[zaptel-commits] tzafrir: branch 1.2 r2222 - /branches/1.2/xpp/utils/Makefile

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Feb 23 17:55:06 MST 2007


Author: tzafrir
Date: Fri Feb 23 18:55:05 2007
New Revision: 2222

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2222
Log:
Make the xpp/utils/Makefile in 1.2 closer to the one in 1.4 .

Modified:
    branches/1.2/xpp/utils/Makefile

Modified: branches/1.2/xpp/utils/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.2/xpp/utils/Makefile?view=diff&rev=2222&r1=2221&r2=2222
==============================================================================
--- branches/1.2/xpp/utils/Makefile (original)
+++ branches/1.2/xpp/utils/Makefile Fri Feb 23 18:55:05 2007
@@ -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,8 +17,13 @@
 # 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
 
@@ -29,7 +32,7 @@
 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 @@
 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)/



More information about the zaptel-commits mailing list