summaryrefslogtreecommitdiff
path: root/xpp
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-24 00:55:05 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-24 00:55:05 +0000
commitb7cd98780e3c26d81cbcaea5f80813ed8818624b (patch)
tree1ab4fcf10db2dc645685c29bf315e9d144bb586c /xpp
parent9dfd31d87e38baafe255f7e735c33038d16e78cf (diff)
Make the xpp/utils/Makefile in 1.2 closer to the one in 1.4 .
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2222 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp')
-rw-r--r--xpp/utils/Makefile17
1 files changed, 10 insertions, 7 deletions
diff --git a/xpp/utils/Makefile b/xpp/utils/Makefile
index db93ded..5c21f27 100644
--- a/xpp/utils/Makefile
+++ b/xpp/utils/Makefile
@@ -1,12 +1,10 @@
PEDANTIC = -ansi -pedantic -std=c99
-# TODO: temporarity reverting autoconf-related changes.
-# Those changes are not to be applied to 1.4.
RANLIB = ranlib
INSTALL = install
INSTALL_DATA = install -m 644
-BINDIR = /usr/sbin
+SBINDIR = /usr/sbin
DATADIR = /usr/share/zaptel
MANDIR = /usr/share/man/man8
HOTPLUG_USB_DIR = /etc/hotplug/usb
@@ -19,9 +17,14 @@ XPD_INIT = $(wildcard ../init_card_?_*) ../calibrate_slics
# Variables that should be defined above, but need sane defaults:
# FIXME: Are those values really sane?
HOSTCC ?= $(CC)
-CONFIG_USB ?= y
ZAPTEL_DIR ?= ../..
+ifeq (,$(PBX_LIBUSB))
+# No PBX_LIBUSB? Maybe we compile against zaptel-1.2
+# Let's make a poor man detection of libusb
+PBX_LIBUSB = $(shell if [ -r /usr/include/usb.h ]; then echo 1; else echo 0; fi)
+endif
+
WCTDM=$(ZAPTEL_DIR)/wctdm.c
CFLAGS = -g -Wall $(EXTRA_CFLAGS)
@@ -29,7 +32,7 @@ CFLAGS = -g -Wall $(EXTRA_CFLAGS)
TARGETS = init_fxo_modes print_modes adj_clock
PROG_INSTALL = genzaptelconf adj_clock
MAN_INSTALL = genzaptelconf.8 adj_clock.8
-ifneq (,$(filter y m,$(CONFIG_USB)))
+ifeq (1,$(PBX_LIBUSB))
TARGETS += libhexfile.a fpga_load test_parse
PROG_INSTALL += fpga_load
MAN_INSTALL += fpga_load.8
@@ -38,8 +41,8 @@ endif
all: $(TARGETS)
install: all
- $(INSTALL) -d $(DESTDIR)$(BINDIR)
- $(INSTALL) $(PROG_INSTALL) $(DESTDIR)$(BINDIR)/
+ $(INSTALL) -d $(DESTDIR)$(SBINDIR)
+ $(INSTALL) $(PROG_INSTALL) $(DESTDIR)$(SBINDIR)/
$(INSTALL) -d $(DESTDIR)$(DATADIR)
$(INSTALL_DATA) $(XPD_INIT_DATA) $(DESTDIR)$(DATADIR)/
$(INSTALL) $(XPD_INIT) $(DESTDIR)$(DATADIR)/