[dahdi-commits] dahdi/tools.git branch "review-automake" created.

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Tue May 19 04:58:22 CDT 2015


branch "review-automake" has been created
        at  b375bb80b8db1c7d4a9eba07f97fd80199347746 (commit)

- Log -----------------------------------------------------------------
commit b375bb80b8db1c7d4a9eba07f97fd80199347746
Author: Tzafrir Cohen <tzafrir.cohen at xorcom.com>
Date:   Tue May 19 20:52:22 2015 +0300

    Update README
    
    Reflect recent changes as well as soem long-due fixes.

diff --git a/README b/README
index 2fadf61..d0f4461 100644
--- a/README
+++ b/README
@@ -15,8 +15,6 @@ dahdi-linux before building dahdi-tools.
 Build System
 ~~~~~~~~~~~~
 GCC and friends. Generally you will need to install the package gcc.
-There may be cases where you will need a specific version of gcc to build
-kernel modules.
 
 
 Extra Libraries
@@ -24,9 +22,11 @@ Extra Libraries
 Some libraries are needed for extra utilities that are provided with
 DAHDI.
 
-- libusb is needed for building fpga_load, needed for firmware loading of
-  the Xorcom Astribank.
+- libusb is needed for building astribank_hexload, needed for firmware
+  loading of the Xorcom Astribank.
 - libnewt is needed to build the optional but useful utility dahdi_tool.
+- libpcap is needed for building dahdi_pcap.
+- pppd is needed to build the dahdi pppd plugin.
 
 
 Installation
@@ -36,8 +36,8 @@ Note: If using `sudo` to build/install, you may need to add /sbin to your PATH.
 ./configure
 make
 make install
-# To install init scripts and config files:
-#make config
+# To install some extra configuration files:
+#make install-config
 ----------------------------------
 
 
@@ -49,18 +49,11 @@ There are some make targets that are provided to build or install just
 parts of DAHDI:
 
 . Build targets:
-  - make: Build DAHDI user-space programs and libraries. partial
-    targets of it:
-    * make 'utilname': builds 'utilname' alone (e.g: `make dahdi_diag`)
-    * make utils: Build just the programs.
-    * make libs: Build libtonezone.
-    * make tests: Build testing binaries.
+  - make: Build DAHDI user-space programs and libraries.
+  - make docs: Generate some extra documentation files.
 . Install targets:
-  - make install: Install everything. Sub-targets of it:
-    * make install-utils: Installs most things.
-    * make install-libs: Installs libtonezone.
-  - make config: install configuration files (overriding existing ones).
-  - make install-test: Install testing binaries.
+  - make install: Install everything
+  - make install-config: install configuration files
 
 
 Installation to a Subtree
@@ -76,8 +69,8 @@ This can be useful for any partial install target from the list above.
 
 Options For ./configure
 ^^^^^^^^^^^^^^^^^^^^^^^
-The configure script executes various tests and based on them generates
-makeopts. You can pass it --with options and variable settings, for
+The configure script executes various tests and the build will depend on
+their result. You can pass it --with options and variable settings, for
 instance:
 
   ./configure --without-ncurses CC="gcc-4.10"
@@ -117,6 +110,29 @@ The configuration file of the dahdi init.d script is
 /etc/dahdi/init.conf . That file is used to override defaults that are 
 set at the beginning of the init.d script.
 
+/etc/dahdi/assigned-spans.conf
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Assigns span number and initial channel number for spans in each device.
+Just like system.conf it may be generated with dahdi_genconf:
+
+  dahdi_span_assignments auto
+  dahdi_genconf
+
+It may also be edited manually to allow reserving span and channel
+numbers for specific devices.
+
+/etc/dahdi/span-types.conf
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Theoretically, this file is similar to assigned-spans.conf. It allows
+setting the type (E1/T1) of a "PRI" span. This cannot be configured
+anywhere else: it needs to be done before the span is assigned as it
+changes the number of channels the span has.
+
+In practice most systems don't mix E1 and T1 and thus this file will
+typically have at most a single wild-card line setting all cards to be
+either E1 or T1.
+
+
 Reference Configuration
 ~~~~~~~~~~~~~~~~~~~~~~~
 Sample system.conf

commit 0090086bce5ad8506b9460522efc3438d7a131ae
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 17:19:47 2015 +0000

    automake: handle "make dist"
    
    * "make distcheck" still fails
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/Makefile.am b/Makefile.am
index f3acd16..c238b08 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,12 +17,19 @@ CFLAGS	+= \
 	#-Wformat=2
 endif
 
-SUBDIRS	= xpp doc
+SUBDIRS	= xpp doc hotplug
 
 if PPPD
 SUBDIRS	+= ppp
 endif
 
+noinst_HEADERS	= \
+	bittest.h	\
+	dahdi_tools_version.h	\
+	fxotune.h	\
+	wavformat.h	\
+	#
+
 sbin_PROGRAMS	= \
 	dahdi_test \
 	dahdi_maint \
@@ -40,7 +47,7 @@ noinst_PROGRAMS	= \
 	dahdi_diag \
 	timertest
 
-sbin_SCRIPTS	= \
+dist_sbin_SCRIPTS	= \
 	dahdi_span_assignments \
 	dahdi_waitfor_span_assignments \
 	dahdi_span_types
@@ -89,6 +96,9 @@ endif
 dahdi_cfg_LDFLAGS	= -lm -lpthread
 dahdi_cfg_LDADD		= libtonezone.la
 
+udevrulesdir	= @udevrulesdir@
+udevrules_DATA	= dahdi.rules
+
 all-local:
 	$(LEGACY_MAKE)  all
 
@@ -100,10 +110,59 @@ install-exec-hook:
 	@echo "Compatibility symlinks (should be removed in the future)"
 	ln -s libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
 
-dist:
-	$(LEGACY_MAKE) dist
-
-docs config:
+bashcompdir	= $(sysconfdir)/bash_completion.d
+
+install-data-hook:
+	mkdir -p $(DESTDIR)$(bashcompdir)
+	install -m 644 $(srcdir)/dahdi-bash-completion $(DESTDIR)$(bashcompdir)/dahdi
+
+# Handle these files specially -- install them only with 'install-config'
+special_config_files	= \
+	init.conf.sample	\
+	blacklist.sample	\
+	modprobe.conf.sample	\
+	#
+
+install-config:
+	mkdir -p $(DESTDIR)$(dahdiconfdir)
+	mkdir -p $(DESTDIR)$(sysconfdir)/modprobe.d
+	install -m644 xpp/genconf_parameters $(DESTDIR)$(dahdiconfdir)/genconf_parameters
+	install -m644 init.conf.sample $(DESTDIR)$(dahdiconfdir)/init.conf
+	install -m644 blacklist.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi-blacklist.conf
+	install -m644 modprobe.conf.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi.conf
+	$(LEGACY_MAKE) config
+
+dahdiconfdir	= @sysconfdir@/dahdi
+dahdiconf_DATA	= \
+	system.conf.sample	\
+	assigned-spans.conf.sample	\
+	span-types.conf.sample	\
+	modules.sample	\
+	#
+
+build_scripts	= \
+	build_tools/dahdi_svn_tarball	\
+	build_tools/dahdi_sysfs_copy	\
+	build_tools/dump_sys_state	\
+	build_tools/make_firmware_object.in	\
+	build_tools/make_tree	\
+	build_tools/make_version	\
+	build_tools/test_kernel_git	\
+	build_tools/uninstall-modules	\
+	#
+
+.version:
+	if ./build_tools/make_version . dahdi/tools > $@.tmp; then \
+		mv "$@.tmp" "$@"; \
+	fi
+
+uninstall-hook:
+	$(RM) $(DESTDIR)$(sysconfdir)/dahdi/span-types.conf.sample
+	$(RM) $(DESTDIR)$(sysconfdir)/dahdi/assigned-spans.conf.sample
+	$(RM) $(DESTDIR)$(sysconfdir)/dahdi/system.conf
+	$(RM) $(DESTDIR)$(bashcompdir)/dahdi
+
+docs:
 	$(LEGACY_MAKE)  $@
 
 DISTCLEANFILES	= makeopts config.log config.status .*.d
@@ -116,4 +175,22 @@ MAINTAINERCLEANFILES	= \
 		m4/lt~obsolete.m4 \
 		#
 
+EXTRA_DIST	= \
+	.version	\
+	LICENSE	\
+	LICENSE.LGPL	\
+	UPGRADE.txt	\
+	bootstrap.sh	\
+	Makefile.legacy	\
+	dahdi.init	\
+	dahdi.xml	\
+	dahdi_pcap.c	\
+	ifup-hdlc	\
+	dahdi-bash-completion	\
+	$(special_config_files)	\
+	$(dahdiconf_DATA)	\
+	$(udevrules_DATA)	\
+	$(build_scripts)	\
+	#
+
 .PHONY: docs config
diff --git a/Makefile.legacy b/Makefile.legacy
index a097648..8bd58ae 100644
--- a/Makefile.legacy
+++ b/Makefile.legacy
@@ -46,42 +46,15 @@ ifneq (,$(INITRD_DIR))
   COPY_INITD	:= install -D dahdi.init $(INIT_TARGET)
 endif
 
-RCCONF_FILE	= /etc/dahdi/init.conf
-MODULES_FILE	= /etc/dahdi/modules
-GENCONF_FILE	= /etc/dahdi/genconf_parameters
-MODPROBE_FILE	= /etc/modprobe.d/dahdi.conf
-BLACKLIST_FILE	= /etc/modprobe.d/dahdi.blacklist.conf
-BASH_COMP_DIR	= /etc/bash_completion.d
-BASH_COMP_FILE	= $(BASH_COMP_DIR)/dahdi
-
 NETSCR_DIR	:= $(firstword $(wildcard $(DESTDIR)/etc/sysconfig/network-scripts ))
 ifneq (,$(NETSCR_DIR))
   NETSCR_TARGET	:= $(NETSCR_DIR)/ifup-hdlc
   COPY_NETSCR	:= install -D ifup-hdlc $(NETSCR_TARGET)
 endif
 
-TOOLSVERSION=$(shell build_tools/make_version . dahdi/tools)
-
 # sbindir, libdir, includedir and mandir are defined in makeopts
 # (from configure).
 LIB_DIR:=$(libdir)
-DATA_DIR:=${datadir}/dahdi
-CONFIG_DIR:=$(sysconfdir)/dahdi
-CONFIG_FILE:=$(CONFIG_DIR)/system.conf
-UDEVRULES_DIR:=$(sysconfdir)/udev/rules.d
-
-
-ASSIGNED_DATA_SCRIPTS:=\
-	dahdi_handle_device	\
-	dahdi_span_config	\
-	dahdi_auto_assign_compat	\
-	span_config.d/10-dahdi-cfg	\
-	span_config.d/20-fxotune	\
-	span_config.d/50-asterisk	\
-	handle_device.d/10-span-types	\
-	handle_device.d/20-span-assignments
-
-ASSIGNED_CONF:=assigned-spans.conf.sample span-types.conf.sample
 
 # All the man pages. Not just installed ones:
 GROFF_PAGES	:= $(wildcard doc/*.8 xpp/*.8)
@@ -131,18 +104,7 @@ install: all install-programs
 	@echo "###"
 	@echo "###################################################"
 
-install-programs: install-utils install-libs
-
-install-utils:
-ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
-	$(INSTALL) -d $(DESTDIR)$(CONFIG_DIR)
-	$(INSTALL) -m 644 system.conf.sample $(DESTDIR)$(CONFIG_FILE)
-endif
-	install -d $(DESTDIR)$(DATA_DIR)
-	tar cf - -C hotplug $(ASSIGNED_DATA_SCRIPTS) | tar xf - -C $(DESTDIR)$(DATA_DIR)/
-	install -m 644 $(ASSIGNED_CONF) $(DESTDIR)/$(CONFIG_DIR)/
-	install -d $(DESTDIR)$(BASH_COMP_DIR)
-	install -m 644 dahdi-bash-completion $(DESTDIR)$(BASH_COMP_FILE)
+install-programs: install-libs
 
 install-libs:
 ifneq (no,$(USE_SELINUX))
@@ -155,23 +117,6 @@ config:
 ifneq (,$(COPY_INITD))
 	$(COPY_INITD)
 endif
-ifeq (,$(wildcard $(DESTDIR)$(RCCONF_FILE)))
-	$(INSTALL) -D -m 644 init.conf.sample $(DESTDIR)$(RCCONF_FILE)
-endif
-ifeq (,$(wildcard $(DESTDIR)$(MODULES_FILE)))
-	$(INSTALL) -D -m 644 modules.sample $(DESTDIR)$(MODULES_FILE)
-endif
-ifeq (,$(wildcard $(DESTDIR)$(GENCONF_FILE)))
-	$(INSTALL) -D -m 644 xpp/genconf_parameters $(DESTDIR)$(GENCONF_FILE)
-endif
-ifeq (,$(wildcard $(DESTDIR)$(MODPROBE_FILE)))
-	$(INSTALL) -D -m 644 modprobe.conf.sample $(DESTDIR)$(MODPROBE_FILE)
-endif
-ifeq (,$(wildcard $(DESTDIR)$(BLACKLIST_FILE)))
-	$(INSTALL) -D -m 644 blacklist.sample $(DESTDIR)$(BLACKLIST_FILE)
-endif
-	$(INSTALL) -d $(DESTDIR)$(UDEVRULES_DIR)
-	$(INSTALL) -D -m 644 dahdi.rules $(DESTDIR)$(UDEVRULES_DIR)/
 ifneq (,$(COPY_NETSCR))
 	$(COPY_NETSCR)
 endif
@@ -192,18 +137,11 @@ endif
 		echo "DAHDI start. "; \
 	fi
 
-dist:
-	@./build_tools/make_dist "dahdi-tools" "$(TOOLSVERSION)"
-
 clean:
 	rm -f *.o tzdriver
 	rm -f core
 	rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
 
-.PHONY: clean all install devel data config install-programs install-libs dist
+.PHONY: clean all install devel data config install-programs install-libs
 
 FORCE:
-
-ifneq ($(wildcard .*.d),)
-   include .*.d
-endif
diff --git a/build_tools/make_dist b/build_tools/make_dist
deleted file mode 100755
index 9a2ba07..0000000
--- a/build_tools/make_dist
+++ /dev/null
@@ -1,55 +0,0 @@
-#! /bin/sh
-
-if [ "$#" -ne 2 ]; then
-	echo >&2 "Usage: $0 <package> <version>"
-	exit 1
-fi
-package="$1"
-version="$2"
-tarball_prefix="$package-$version"
-echo "I: Making dist tarball for $tarball_prefix"
-tarball_name="$tarball_prefix.tar.gz"
-
-tmp_work_dir=".tmp"
-tmp_version_dir="$tmp_work_dir/$tarball_prefix"
-
-if [ "$DESTDIR" != '' ]; then
-	destdir="$DESTDIR/"
-fi
-output="$destdir$tarball_name"
-
-mkdir -p "$tmp_version_dir"
-git archive --format tar HEAD | tar xf - -C "$tmp_version_dir"
-echo "$version" > "$tmp_version_dir/.version"
-extra_dist='
-	autoconfig.h.in
-	configure
-	doc/Makefile
-	ppp/Makefile
-	Makefile
-	xpp/Makefile
-	xpp/oct612x/Makefile
-	xpp/perl_modules/Makefile
-	doc/Makefile.in
-	ppp/Makefile.in
-	Makefile.in
-	xpp/Makefile.in
-	xpp/oct612x/Makefile.in
-	xpp/perl_modules/Makefile.in
-	auxdir/compile
-	auxdir/config.guess
-	auxdir/config.sub
-	auxdir/depcomp
-	auxdir/install-sh
-	auxdir/ltmain.sh
-	auxdir/missing
-	m4/libtool.m4
-	m4/ltoptions.m4
-	m4/ltsugar.m4
-	m4/ltversion.m4
-	m4/lt~obsolete.m4
-	'
-find $extra_dist | cpio -pudmv "$tmp_version_dir"
-tar czf "$output" -C "$tmp_work_dir" "$tarball_prefix"
-rm -rf "$tmp_work_dir"
-echo "I: tarball is ready: '$output'"
diff --git a/configure.ac b/configure.ac
index ed62107..59e691d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -269,6 +269,7 @@ AC_CONFIG_FILES([
 	version.c
 	Makefile
 	doc/Makefile
+	hotplug/Makefile
 	ppp/Makefile
 	xpp/Makefile
 	xpp/oct612x/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8518b4a..a2b180c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -15,3 +15,5 @@ noinst_MANS	= \
 	fxstest.8 \
 	patgen.8 \
 	pattest.8
+
+EXTRA_DIST	= $(man_MANS) $(noinst_MANS)
diff --git a/hotplug/Makefile.am b/hotplug/Makefile.am
new file mode 100644
index 0000000..ae2b496
--- /dev/null
+++ b/hotplug/Makefile.am
@@ -0,0 +1,11 @@
+
+nobase_dist_pkgdata_SCRIPTS	= \
+	dahdi_handle_device	\
+	dahdi_span_config	\
+	dahdi_auto_assign_compat	\
+	span_config.d/10-dahdi-cfg	\
+	span_config.d/20-fxotune	\
+	span_config.d/50-asterisk	\
+	handle_device.d/10-span-types	\
+	handle_device.d/20-span-assignments	\
+	#
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index fca3930..7a9eb58 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -52,8 +52,7 @@ perl_mans	= $(perl_scripts:%=%.8)
 
 endif
 
-pkgdatadir	= @datadir@/dahdi
-pkgdata_SCRIPTS	= xpp_fxloader astribank_hook waitfor_xpds
+dist_pkgdata_SCRIPTS	= xpp_fxloader astribank_hook waitfor_xpds
 udevrulesdir	= @udevrulesdir@
 udevrules_DATA	= xpp.rules
 
@@ -65,42 +64,79 @@ if	PBX_USB
 
 SUBDIRS		+= oct612x
 
-noinst_LTLIBRARIES	= libastribank.la libecholoader.la
+noinst_LTLIBRARIES	= libastribank.la libecholoader.la libhexfile.la
+
 libastribank_la_SOURCES	= \
-		xtalk/xusb.c \
-		xtalk/xlist.c \
-		xtalk/debug.c \
-		xtalk/xtalk.c \
-		mpptalk.c \
-		astribank_usb.c
+		astribank_usb.c	\
+		astribank_usb.h	\
+		mpptalk.c	\
+		mpptalk.h	\
+		mpp.h	\
+		mpptalk_defs.h	\
+		xtalk/debug.c	\
+		xtalk/debug.h	\
+		xtalk/xlist.c	\
+		xtalk/xlist.h	\
+		xtalk/xtalk.c	\
+		xtalk/xtalk.h	\
+		xtalk/xtalk_defs.h	\
+		xtalk/xusb.c	\
+		xtalk/xusb.h	\
+		#
+
 libastribank_la_CFLAGS		= $(GLOBAL_CFLAGS)
 
 if USE_OCTASIC
 libecholoader_la_SOURCES	= \
 		parse_span_specs.c \
-		echo_loader.c
+		parse_span_specs.h	\
+		echo_loader.c	\
+		echo_loader.h	\
+		#
+
 libecholoader_la_CFLAGS		= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
 endif
 
+libhexfile_la_SOURCES	= \
+		hexfile.c	\
+		hexfile.h	\
+		#
+
 sbin_PROGRAMS	= \
 		astribank_tool \
 		astribank_hexload \
 		astribank_allow \
 		astribank_is_starting
 
-check_PROGRAMS	= test_parse
+check_PROGRAMS		= test_parse
+test_parse_LDADD	= libhexfile.la
 
 astribank_tool_SOURCES		= astribank_tool.c
 astribank_tool_CFLAGS		= $(GLOBAL_CFLAGS)
 astribank_tool_LDFLAGS		= $(USB_LIB)
 astribank_tool_LDADD		= libastribank.la
 
-astribank_hexload_SOURCES	= astribank_hexload.c hexfile.c pic_loader.c
+astribank_hexload_SOURCES	= \
+			astribank_hexload.c	\
+			pic_loader.c	\
+			pic_loader.h	\
+			#
+
 astribank_hexload_CFLAGS	= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
 astribank_hexload_LDFLAGS	= $(USB_LIB)
-astribank_hexload_LDADD		= libastribank.la libecholoader.la oct612x/liboctasic.la
+astribank_hexload_LDADD		= \
+		libhexfile.la	\
+		libastribank.la	\
+		libecholoader.la	\
+		oct612x/liboctasic.la	\
+		#
+
+astribank_allow_SOURCES		= \
+			astribank_allow.c	\
+			astribank_license.c	\
+			astribank_license.h	\
+			#
 
-astribank_allow_SOURCES		= astribank_allow.c astribank_license.c
 astribank_allow_CFLAGS		= $(GLOBAL_CFLAGS)
 astribank_allow_LDFLAGS		= $(USB_LIB)
 astribank_allow_LDADD		= libastribank.la
@@ -113,3 +149,18 @@ man_pages	= \
 
 man_MANS	+= $(man_pages)
 endif
+
+EXTRA_DIST	= \
+	$(man_pages)	\
+	$(udevrules_DATA)	\
+	README.Astribank	\
+	astribank_upgrade	\
+	dahdi.cgi	\
+	dahdi_drivers	\
+	genconf_parameters	\
+	twinstar_hook	\
+	twinstar_setup	\
+	xpp_modprobe	\
+	xpp_timing	\
+	#
+
diff --git a/xpp/oct612x/Makefile.am b/xpp/oct612x/Makefile.am
index 72f62fa..534e39c 100644
--- a/xpp/oct612x/Makefile.am
+++ b/xpp/oct612x/Makefile.am
@@ -30,6 +30,87 @@ liboctasic_la_SOURCES	= \
 	apilib/largmath/octapi_largmath.c \
 	apilib/llman/octapi_llman.c
 
+noinst_HEADERS	= \
+		apilib/bt/octapi_bt0_private.h	\
+		apilib/llman/octapi_llman_private.h	\
+		include/apilib/octapi_bt0.h	\
+		include/apilib/octapi_largmath.h	\
+		include/apilib/octapi_llman.h	\
+		include/digium_unused.h	\
+		include/oct6100api/oct6100_adpcm_chan_inst.h	\
+		include/oct6100api/oct6100_adpcm_chan_pub.h	\
+		include/oct6100api/oct6100_api.h	\
+		include/oct6100api/oct6100_api_inst.h	\
+		include/oct6100api/oct6100_apimi.h	\
+		include/oct6100api/oct6100_apiud.h	\
+		include/oct6100api/oct6100_channel_inst.h	\
+		include/oct6100api/oct6100_channel_pub.h	\
+		include/oct6100api/oct6100_chip_open_inst.h	\
+		include/oct6100api/oct6100_chip_open_pub.h	\
+		include/oct6100api/oct6100_chip_stats_inst.h	\
+		include/oct6100api/oct6100_chip_stats_pub.h	\
+		include/oct6100api/oct6100_conf_bridge_inst.h	\
+		include/oct6100api/oct6100_conf_bridge_pub.h	\
+		include/oct6100api/oct6100_debug_inst.h	\
+		include/oct6100api/oct6100_debug_pub.h	\
+		include/oct6100api/oct6100_defines.h	\
+		include/oct6100api/oct6100_errors.h	\
+		include/oct6100api/oct6100_events_inst.h	\
+		include/oct6100api/oct6100_events_pub.h	\
+		include/oct6100api/oct6100_interrupts_inst.h	\
+		include/oct6100api/oct6100_interrupts_pub.h	\
+		include/oct6100api/oct6100_mixer_inst.h	\
+		include/oct6100api/oct6100_mixer_pub.h	\
+		include/oct6100api/oct6100_phasing_tsst_inst.h	\
+		include/oct6100api/oct6100_phasing_tsst_pub.h	\
+		include/oct6100api/oct6100_playout_buf_inst.h	\
+		include/oct6100api/oct6100_playout_buf_pub.h	\
+		include/oct6100api/oct6100_remote_debug_inst.h	\
+		include/oct6100api/oct6100_remote_debug_pub.h	\
+		include/oct6100api/oct6100_tlv_inst.h	\
+		include/oct6100api/oct6100_tone_detection_inst.h	\
+		include/oct6100api/oct6100_tone_detection_pub.h	\
+		include/oct6100api/oct6100_tsi_cnct_inst.h	\
+		include/oct6100api/oct6100_tsi_cnct_pub.h	\
+		include/oct6100api/oct6100_tsst_inst.h	\
+		include/octdef.h	\
+		include/octmac.h	\
+		include/octosdependant.h	\
+		include/octrpc/oct6100_rpc_protocol.h	\
+		include/octrpc/rpc_protocol.h	\
+		include/octtype.h	\
+		include/octtypevx.h	\
+		include/octtypewin.h	\
+		#
+
 liboctasic_la_CFLAGS	= \
 	$(OCTASIC_DEFINES) \
 	$(OCTASIC_CFLAGS)
+
+
+EXTRA_DIST	= \
+		get_discards	\
+		octasic-helper	\
+		octdeviceapi/oct6100api/oct6100_adpcm_chan_priv.h	\
+		octdeviceapi/oct6100api/oct6100_api/oct6100_user.c	\
+		octdeviceapi/oct6100api/oct6100_apimi/oct6100_mask_interrupts.c	\
+		octdeviceapi/oct6100api/oct6100_channel_priv.h	\
+		octdeviceapi/oct6100api/oct6100_chip_open_priv.h	\
+		octdeviceapi/oct6100api/oct6100_chip_stats_priv.h	\
+		octdeviceapi/oct6100api/oct6100_conf_bridge_priv.h	\
+		octdeviceapi/oct6100api/oct6100_debug_priv.h	\
+		octdeviceapi/oct6100api/oct6100_events_priv.h	\
+		octdeviceapi/oct6100api/oct6100_interrupts_priv.h	\
+		octdeviceapi/oct6100api/oct6100_memory_priv.h	\
+		octdeviceapi/oct6100api/oct6100_miscellaneous_priv.h	\
+		octdeviceapi/oct6100api/oct6100_mixer_priv.h	\
+		octdeviceapi/oct6100api/oct6100_phasing_tsst_priv.h	\
+		octdeviceapi/oct6100api/oct6100_playout_buf_priv.h	\
+		octdeviceapi/oct6100api/oct6100_remote_debug_priv.h	\
+		octdeviceapi/oct6100api/oct6100_tlv_priv.h	\
+		octdeviceapi/oct6100api/oct6100_tone_detection_priv.h	\
+		octdeviceapi/oct6100api/oct6100_tsi_cnct_priv.h	\
+		octdeviceapi/oct6100api/oct6100_tsst_priv.h	\
+		octdeviceapi/oct6100api/oct6100_version.h	\
+		test.c	\
+		#
diff --git a/xpp/perl_modules/Makefile.am b/xpp/perl_modules/Makefile.am
index b9a0520..3239e1b 100644
--- a/xpp/perl_modules/Makefile.am
+++ b/xpp/perl_modules/Makefile.am
@@ -22,3 +22,5 @@ nobase_perllib_DATA	= \
 	Dahdi/Config/Gen.pm \
 	Dahdi/Hardware/USB.pm \
 	Dahdi/Hardware/PCI.pm
+
+EXTRA_DIST	= $(nobase_perllib_DATA)

commit f21b592f68bd919c87e737ba8a44afb71b0a44c3
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 18:59:33 2015 +0000

    automake: migrate dahdi_pcap from Makefile.legacy
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/Makefile.am b/Makefile.am
index 07b7614..f3acd16 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,11 @@ pkginclude_HEADERS	= tonezone.h
 libtonezone_la_CFLAGS	= $(CFLAGS) -I$(srcdir) -DBUILDING_TONEZONE
 libtonezone_la_LDFLAGS	= -version-info "$(LTZ_CURRENT):$(LTZ_REVISION):$(LTZ_AGE)"
 
+if PBX_PCAP
+noinst_PROGRAMS		+= dahdi_pcap
+dahdi_pcap_LDADD	= -lpcap
+endif
+
 patlooptest_LDADD	= libtonezone.la -lm
 fxstest_LDADD		= libtonezone.la -lm
 fxotune_LDADD		= -lm
diff --git a/Makefile.legacy b/Makefile.legacy
index 997f269..a097648 100644
--- a/Makefile.legacy
+++ b/Makefile.legacy
@@ -91,10 +91,6 @@ GENERATED_DOCS	:= $(GROFF_HTML) README.html README.Astribank.html
 
 all:
 
-dahdi_pcap:
-	$(CC) $(CFLAGS) dahdi_pcap.c -lpcap -o $@ $<
-	
-
 tonezones.txt: zonedata.c
 	perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \
 		print (($$1 eq "country")? "* $$2\t":"$$2\n");' $<  \
@@ -203,7 +199,6 @@ clean:
 	rm -f *.o tzdriver
 	rm -f core
 	rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
-	rm -f dahdi_pcap
 
 .PHONY: clean all install devel data config install-programs install-libs dist
 
diff --git a/configure.ac b/configure.ac
index 359f493..ed62107 100644
--- a/configure.ac
+++ b/configure.ac
@@ -121,14 +121,22 @@ AC_SUBST(DAHDI_DECLARATION_AFTER_STATEMENT)
 AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
 AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
 AST_EXT_LIB_SETUP([USB], [usb], [usb])
+AST_EXT_LIB_SETUP([PCAP], [pcap], [pcap])
 
 AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
 DAHDI23_DIR="${DAHDI_DIR}"
 AST_C_DEFINE_CHECK([DAHDI23], [DAHDI_CONFIG_NTTE], [dahdi/user.h])
 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
 AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h])
+AST_EXT_LIB_CHECK([PCAP], [pcap], [pcap_compile], [pcap.h])
+
+saved_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $DAHDI_INCLUDE"
+AC_CHECK_DECL([DAHDI_TXMIRROR], [DAHDI_TXMIRROR=1], [DAHDI_TXMIRROR=0], [#include <dahdi/user.h>])
+CPPFLAGS="$saved_CPPFLAGS"
 
 AM_CONDITIONAL([PBX_NEWT], [test "$PBX_NEWT" = "1"])
+AM_CONDITIONAL([PBX_PCAP], [test "$PBX_PCAP" = "1" -a "$DAHDI_TXMIRROR" = "1"])
 
 AC_CHECK_FUNCS([semtimedop])
 

commit d63812bd7356711e51aeefd6fbf5d97a4082faa6
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Sun Dec 21 09:21:57 2014 -0500

    automake: migrated "--enable-dev-mode"
    
    * Fix small compile warnings (which are now errors):
      - hdlcgen.c
      - hdlcstress.c (remove return value which isn't checked)
      - patlooptest.c
    
    * Also added dev-mode to xpp with relevant compile fixes.
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/Makefile.am b/Makefile.am
index 571653d..07b7614 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,17 @@ LEGACY_MAKE	= \
 		top_srcdir=$(top_srcdir) \
 		srcdir=$(srcdir)
 
-CFLAGS	= -g -Wall $(DAHDI_INCLUDE)
+CFLAGS	= -g -Wall -O2 $(DAHDI_INCLUDE)
+if DAHDI_DEVMODE
+CFLAGS	+= \
+	-Werror \
+	-Wunused \
+	-Wundef \
+	$(DAHDI_DECLARATION_AFTER_STATEMENT) \
+	-Wmissing-format-attribute \
+	-Wformat-security \
+	#-Wformat=2
+endif
 
 SUBDIRS	= xpp doc
 
diff --git a/Makefile.legacy b/Makefile.legacy
index 7bbd412..997f269 100644
--- a/Makefile.legacy
+++ b/Makefile.legacy
@@ -14,8 +14,6 @@ ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
  endif
 endif
 
-OPTFLAGS=-O2
-CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
 ifneq (,$(findstring ppc,$(UNAME_M)))
 CFLAGS+=-fsigned-char
 endif
@@ -23,10 +21,6 @@ ifneq (,$(findstring x86_64,$(UNAME_M)))
 CFLAGS+=-m64
 endif
 
-ifeq ($(DAHDI_DEVMODE),yes)
-  CFLAGS+=-Werror -Wunused -Wundef $(DAHDI_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
-endif
-
 ROOT_PREFIX=
 
 # extra cflags to build dependencies. Recursively expanded.
diff --git a/configure.ac b/configure.ac
index f476105..359f493 100644
--- a/configure.ac
+++ b/configure.ac
@@ -106,6 +106,7 @@ AC_ARG_ENABLE(dev-mode,
 	      *) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode)  ;;
 	esac])
 AC_SUBST(DAHDI_DEVMODE)
+AM_CONDITIONAL([DAHDI_DEVMODE], [test "$DAHDI_DEVMODE" = 'yes'])
 
 AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
 if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
diff --git a/hdlcgen.c b/hdlcgen.c
index 29811bb..3915925 100644
--- a/hdlcgen.c
+++ b/hdlcgen.c
@@ -40,7 +40,7 @@
 #define RANDOM "/dev/urandom"			/* Not genuinely random */
 /* #define RANDOM "/dev/random" */		/* Quite genuinely random */
 
-int myread(int fd, char *buf, int len)
+int myread(int fd, unsigned char *buf, int len)
 {
 	int sofar;
 	int res;
diff --git a/hdlcstress.c b/hdlcstress.c
index 6704f1f..a0cbde9 100644
--- a/hdlcstress.c
+++ b/hdlcstress.c
@@ -107,13 +107,12 @@ static struct fasthdlc_state fs;
 
 void send_packet(unsigned char *buf, int len)
 {
-	int res;
 	int x;
 	unsigned char outbuf[BLOCK_SIZE];
 	int pos=0;
 	unsigned int fcs = PPP_INITFCS;
 	if (hdlcmode)
-		res = write(fd, buf, len + 2);
+		write(fd, buf, len + 2);
 	else {
 		for (x=0;x<len;x++) {
 			if (fasthdlc_tx_load(&fs, buf[x]))
diff --git a/patlooptest.c b/patlooptest.c
index 7563bfe..2c23a15 100644
--- a/patlooptest.c
+++ b/patlooptest.c
@@ -168,6 +168,7 @@ int main(int argc, char *argv[])
 	int opt;
 	int oldstyle_cmdline = 1;
 	unsigned int event_count = 0;
+	time_t start_time = 0;
 
 	/* Parse the command line arguments */
 	while((opt = getopt(argc, argv, "b:s:t:r:v?h")) != -1) {
@@ -218,8 +219,6 @@ int main(int argc, char *argv[])
 	if (oldstyle_cmdline && argc > optind +1) {
 		timeout = strtoul(argv[optind+1], NULL, 10);
 	}
-	
-	time_t start_time = 0;
 
 	fd = channel_open(device, &bs);
 	if (fd < 0)
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index f83fc43..fca3930 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -3,10 +3,21 @@ all-local: $(perl_checks)
 
 SUBDIRS		=
 
+
 # FIXME: try to improve code, so we can use $(PEDANTIC)
 #PEDANTIC	= -ansi -pedantic -std=c99
 GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk $(PEDANTIC)
 
+if DAHDI_DEVMODE
+GLOBAL_CFLAGS	+= \
+	-Werror \
+	-Wunused \
+	-Wundef \
+	-Wmissing-format-attribute \
+	-Wformat-security \
+	-Wformat=2
+endif
+
 if PERL
 SUBDIRS		+= perl_modules
 
diff --git a/xpp/astribank_hexload.c b/xpp/astribank_hexload.c
index 643fe57..ffc158a 100644
--- a/xpp/astribank_hexload.c
+++ b/xpp/astribank_hexload.c
@@ -84,7 +84,12 @@ int handle_hexline(struct astribank_device *astribank, struct hexline *hexline)
 	return 0;
 }
 
-void print_parse_errors(int level, const char *msg, ...)
+
+#ifdef	__GNUC__
+static void print_parse_errors(int level, const char *msg, ...) __attribute__((format(printf,2,3)));
+#endif
+
+static void print_parse_errors(int level, const char *msg, ...)
 {
 	va_list ap;
 
diff --git a/xpp/hexfile.h b/xpp/hexfile.h
index 27c71e7..33ff50d 100644
--- a/xpp/hexfile.h
+++ b/xpp/hexfile.h
@@ -72,7 +72,11 @@ struct hexdata {
 
 __BEGIN_DECLS
 
-typedef void (*parse_hexfile_report_func_t)(int level, const char *msg, ...);
+typedef void (*parse_hexfile_report_func_t)(int level, const char *msg, ...)
+#ifdef	__GNUC__
+	__attribute__((format(printf,2,3)));
+#endif
+	;
 
 parse_hexfile_report_func_t parse_hexfile_set_reporting(parse_hexfile_report_func_t rf);
 void free_hexdata(struct hexdata *hexdata);

commit bf9500ab32eb2f17e3e0f8f93b31d50acb434798
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Sun Dec 21 15:10:31 2014 -0500

    automake: migrate tools from Makefile.legacy
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/Makefile.am b/Makefile.am
index ef38b0a..571653d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,12 +5,75 @@ LEGACY_MAKE	= \
 		top_srcdir=$(top_srcdir) \
 		srcdir=$(srcdir)
 
+CFLAGS	= -g -Wall $(DAHDI_INCLUDE)
+
 SUBDIRS	= xpp doc
 
 if PPPD
 SUBDIRS	+= ppp
 endif
 
+sbin_PROGRAMS	= \
+	dahdi_test \
+	dahdi_maint \
+	dahdi_monitor \
+	dahdi_cfg \
+	dahdi_speed \
+	dahdi_scan \
+	fxotune
+
+noinst_PROGRAMS	= \
+	fxstest \
+	patgen \
+	pattest \
+	patlooptest \
+	dahdi_diag \
+	timertest
+
+sbin_SCRIPTS	= \
+	dahdi_span_assignments \
+	dahdi_waitfor_span_assignments \
+	dahdi_span_types
+
+if PBX_HDLC
+sbin_PROGRAMS	+= sethdlc
+noinst_PROGRAMS += hdlcstress hdlctest hdlcgen hdlcverify
+endif
+
+# Libtool versioning for libtonezone:
+# Bump when interface changes
+LTZ_CURRENT	= 2
+# Bump if interface change is backward compatible
+LTZ_AGE		= 0
+# Bump if only implementation change
+LTZ_REVISION	= 0
+
+lib_LTLIBRARIES		= libtonezone.la
+
+libtonezone_la_SOURCES	= \
+	zonedata.c \
+	tonezone.c \
+	version.c
+pkginclude_HEADERS	= tonezone.h
+libtonezone_la_CFLAGS	= $(CFLAGS) -I$(srcdir) -DBUILDING_TONEZONE
+libtonezone_la_LDFLAGS	= -version-info "$(LTZ_CURRENT):$(LTZ_REVISION):$(LTZ_AGE)"
+
+patlooptest_LDADD	= libtonezone.la -lm
+fxstest_LDADD		= libtonezone.la -lm
+fxotune_LDADD		= -lm
+dahdi_speed_CFLAGS	= -O2
+
+dahdi_maint_SOURCES	= dahdi_maint.c version.c
+
+if PBX_NEWT
+sbin_PROGRAMS		+= dahdi_tool
+dahdi_tool_CFLAGS	= $(CFLAGS) $(NEWT_INCLUDE)
+dahdi_tool_LDADD	= $(NEWT_LIB)
+endif
+
+dahdi_cfg_LDFLAGS	= -lm -lpthread
+dahdi_cfg_LDADD		= libtonezone.la
+
 all-local:
 	$(LEGACY_MAKE)  all
 
@@ -19,6 +82,8 @@ clean-local:
 
 install-exec-hook:
 	$(LEGACY_MAKE) install
+	@echo "Compatibility symlinks (should be removed in the future)"
+	ln -s libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
 
 dist:
 	$(LEGACY_MAKE) dist
diff --git a/Makefile.legacy b/Makefile.legacy
index b8b5070..7bbd412 100644
--- a/Makefile.legacy
+++ b/Makefile.legacy
@@ -5,10 +5,10 @@
 #
 #
 
-ifeq ($(strip $(foreach var,clean distclean dist-clean,$(findstring $(var),$(MAKECMDGOALS)))),)
+ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
 endif
 
-ifeq ($(strip $(foreach var,clean distclean dist-clean,$(findstring $(var),$(MAKECMDGOALS)))),)
+ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
  ifneq ($(wildcard makeopts),)
   include makeopts
  endif
@@ -68,39 +68,15 @@ endif
 
 TOOLSVERSION=$(shell build_tools/make_version . dahdi/tools)
 
-LTZ_A:=libtonezone.a
-LTZ_A_OBJS:=zonedata.o tonezone.o version.o
-LTZ_SO:=libtonezone.so
-LTZ_SO_OBJS:=zonedata.lo tonezone.lo version.o
-LTZ_SO_MAJOR_VER:=2
-LTZ_SO_MINOR_VER:=0
-
 # sbindir, libdir, includedir and mandir are defined in makeopts
 # (from configure).
-BIN_DIR:=$(sbindir)
 LIB_DIR:=$(libdir)
-INC_DIR:=$(includedir)/dahdi
 DATA_DIR:=${datadir}/dahdi
 CONFIG_DIR:=$(sysconfdir)/dahdi
 CONFIG_FILE:=$(CONFIG_DIR)/system.conf
 UDEVRULES_DIR:=$(sysconfdir)/udev/rules.d
 
-# Utilities we build with a standard build procedure:
-UTILS		= dahdi_tool dahdi_test dahdi_monitor dahdi_speed sethdlc dahdi_cfg \
-		  fxstest fxotune dahdi_diag dahdi_scan
-
-# some tests:
-UTILS		+= patgen pattest patlooptest hdlcstress hdlctest hdlcgen \
-		   hdlcverify timertest dahdi_maint
 
-
-BINS:=fxotune dahdi_cfg dahdi_monitor dahdi_speed dahdi_test dahdi_scan dahdi_maint
-ifeq	(1,$(PBX_NEWT))
-	BINS	+= dahdi_tool
-endif
-ifeq	(1,$(PBX_HDLC))
-	BINS	+= sethdlc
-endif
 ASSIGNED_DATA_SCRIPTS:=\
 	dahdi_handle_device	\
 	dahdi_span_config	\
@@ -111,64 +87,20 @@ ASSIGNED_DATA_SCRIPTS:=\
 	handle_device.d/10-span-types	\
 	handle_device.d/20-span-assignments
 
-ASSIGNED_UTILS:=dahdi_span_assignments dahdi_span_types \
-	dahdi_waitfor_span_assignments
 ASSIGNED_CONF:=assigned-spans.conf.sample span-types.conf.sample
 
-TEST_BINS:=patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest dahdi_maint
 # All the man pages. Not just installed ones:
 GROFF_PAGES	:= $(wildcard doc/*.8 xpp/*.8)
 GROFF_HTML	:= $(GROFF_PAGES:%=%.html)
 
 GENERATED_DOCS	:= $(GROFF_HTML) README.html README.Astribank.html
 
-all: prereq programs
-
-libs: $(LTZ_SO) $(LTZ_A)
-
-programs: libs utils
-
-utils: $(BINS)
-
-tests: $(TEST_BINS)
-
-$(UTILS): %: %.o
-
-$(UTILS): version.o
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
-
-%.lo: %.c
-	$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
-
-%: %.o
-	$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
-
-prereq: config.status
+all:
 
-dahdi_tool: CFLAGS+=$(NEWT_INCLUDE)
-dahdi_tool: LIBS+=$(NEWT_LIB)
-
-dahdi_speed: CFLAGS+=-O0
-
-$(LTZ_A): $(LTZ_A_OBJS)
-	ar rcs $@ $^
-	ranlib $@
-
-$(LTZ_SO): $(LTZ_SO_OBJS)
-	$(CC) $(CFLAGS) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ -lm
-
-dahdi_cfg: $(LTZ_A)
-dahdi_cfg: LIBS+=-lm -lpthread
 dahdi_pcap:
 	$(CC) $(CFLAGS) dahdi_pcap.c -lpcap -o $@ $<
 	
 
-fxstest: $(LTZ_SO)
-fxstest: LIBS+=-lm
-fxotune: LIBS+=-lm
-
 tonezones.txt: zonedata.c
 	perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \
 		print (($$1 eq "country")? "* $$2\t":"$$2\n");' $<  \
@@ -211,58 +143,23 @@ install: all install-programs
 
 install-programs: install-utils install-libs
 
-install-utils: utils
-ifneq (,$(BINS))
-	install -d $(DESTDIR)$(BIN_DIR)
-	install  $(BINS) $(DESTDIR)$(BIN_DIR)/
-endif
+install-utils:
 ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
 	$(INSTALL) -d $(DESTDIR)$(CONFIG_DIR)
 	$(INSTALL) -m 644 system.conf.sample $(DESTDIR)$(CONFIG_FILE)
 endif
 	install -d $(DESTDIR)$(DATA_DIR)
 	tar cf - -C hotplug $(ASSIGNED_DATA_SCRIPTS) | tar xf - -C $(DESTDIR)$(DATA_DIR)/
-	install $(ASSIGNED_UTILS) $(DESTDIR)/$(BIN_DIR)/
 	install -m 644 $(ASSIGNED_CONF) $(DESTDIR)/$(CONFIG_DIR)/
 	install -d $(DESTDIR)$(BASH_COMP_DIR)
 	install -m 644 dahdi-bash-completion $(DESTDIR)$(BASH_COMP_FILE)
 
-install-libs: libs
-	$(INSTALL) -d -m 755 $(DESTDIR)/$(LIB_DIR)
-	$(INSTALL) -m 755 $(LTZ_A) $(DESTDIR)$(LIB_DIR)/
-	$(INSTALL) -m 755 $(LTZ_SO) $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
-ifeq (,$(DESTDIR))
-	if [ `id -u` = 0 ]; then \
-		/sbin/ldconfig || : ;\
-	fi
-endif
-	rm -f $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
-	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
-		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER)
-	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
-		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
-	# Overwrite the 1.0 links out there.  dahdi-tools 2.0.0 installed
-	# 1.0 links but dahdi-tools changed them to 2.0 in order to explicitly
-	# break applications linked with zaptel.  But, this also meant that
-	# applications linked with libtonezone.so.1.0 broke when dahdi-tools
-	# 2.1.0 was installed.
-	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
-		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).1.0
-	$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
-		$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).1
+install-libs:
 ifneq (no,$(USE_SELINUX))
   ifeq (,$(DESTDIR))
 	/sbin/restorecon -v $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
   endif
 endif
-	$(INSTALL) -d -m 755 $(DESTDIR)/$(INC_DIR)
-	$(INSTALL) -m 644 tonezone.h $(DESTDIR)$(INC_DIR)/
-
-install-tests: tests
-ifneq (,$(TEST_BINS))
-	install -d $(DESTDIR)$(BIN_DIR)
-	install  $(TEST_BINS) $(DESTDIR)$(BIN_DIR)/
-endif
 
 config:
 ifneq (,$(COPY_INITD))
@@ -309,32 +206,12 @@ dist:
 	@./build_tools/make_dist "dahdi-tools" "$(TOOLSVERSION)"
 
 clean:
-	rm -f $(BINS) $(TEST_BINS)
-	rm -f *.o dahdi_cfg tzdriver sethdlc
-	rm -f $(LTZ_SO) $(LTZ_A) *.lo
-	rm -f libtonezone*
-	rm -f fxotune
+	rm -f *.o tzdriver
 	rm -f core
-	rm -f dahdi_cfg-shared fxstest
 	rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
 	rm -f dahdi_pcap
 
-distclean: dist-clean
-
-dist-clean: clean
-	rm -f makeopts
-	rm -f config.log config.status
-	rm -f .*.d
-
-config.status: configure
-	@CFLAGS="" ./configure
-	@echo "****"
-	@echo "**** The configure script was just executed, so 'make' needs to be"
-	@echo "**** restarted."
-	@echo "****"
-	@exit 1
-
-.PHONY: distclean dist-clean clean all install programs tests devel data config install-programs install-libs prereq dist
+.PHONY: clean all install devel data config install-programs install-libs dist
 
 FORCE:
 
diff --git a/configure.ac b/configure.ac
index 6ed7c64..f476105 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,6 +127,8 @@ AST_C_DEFINE_CHECK([DAHDI23], [DAHDI_CONFIG_NTTE], [dahdi/user.h])
 AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
 AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h])
 
+AM_CONDITIONAL([PBX_NEWT], [test "$PBX_NEWT" = "1"])
+
 AC_CHECK_FUNCS([semtimedop])
 
 PBX_HDLC=0
@@ -166,6 +168,7 @@ if test "x${PBX_HDLC}" != "x1"; then
 fi
 
 AC_SUBST(PBX_HDLC)
+AM_CONDITIONAL([PBX_HDLC], [test "$PBX_HDLC" = "1"])
 
 AC_ARG_WITH(selinux,
 	[AS_HELP_STRING([--with-selinux],

commit 703db3bcc3be9ecb1590d88b5b0dc3035f0b2e62
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Sun Dec 21 09:52:38 2014 -0500

    automake: handle doc/ man-pages
    
    * Install via doc/Makefile.am
    * Remove relevant code from Makefile.legacy
    * For now, leave the conversion to HTML in Makefile.legacy
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/Makefile.am b/Makefile.am
index fe4e28f..ef38b0a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ LEGACY_MAKE	= \
 		top_srcdir=$(top_srcdir) \
 		srcdir=$(srcdir)
 
-SUBDIRS	= xpp
+SUBDIRS	= xpp doc
 
 if PPPD
 SUBDIRS	+= ppp
diff --git a/Makefile.legacy b/Makefile.legacy
index 98303c5..b8b5070 100644
--- a/Makefile.legacy
+++ b/Makefile.legacy
@@ -80,7 +80,6 @@ LTZ_SO_MINOR_VER:=0
 BIN_DIR:=$(sbindir)
 LIB_DIR:=$(libdir)
 INC_DIR:=$(includedir)/dahdi
-MAN_DIR:=$(mandir)/man8
 DATA_DIR:=${datadir}/dahdi
 CONFIG_DIR:=$(sysconfdir)/dahdi
 CONFIG_FILE:=$(CONFIG_DIR)/system.conf
@@ -116,10 +115,6 @@ ASSIGNED_UTILS:=dahdi_span_assignments dahdi_span_types \
 	dahdi_waitfor_span_assignments
 ASSIGNED_CONF:=assigned-spans.conf.sample span-types.conf.sample
 
-MAN_PAGES:= \
-	$(wildcard $(BINS:%=doc/%.8)) \
-	$(wildcard $(ASSIGNED_UTILS:%=doc/%.8))
-
 TEST_BINS:=patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest dahdi_maint
 # All the man pages. Not just installed ones:
 GROFF_PAGES	:= $(wildcard doc/*.8 xpp/*.8)
@@ -220,8 +215,6 @@ install-utils: utils
 ifneq (,$(BINS))
 	install -d $(DESTDIR)$(BIN_DIR)
 	install  $(BINS) $(DESTDIR)$(BIN_DIR)/
-	install -d $(DESTDIR)$(MAN_DIR)
-	install -m 644 $(MAN_PAGES) $(DESTDIR)$(MAN_DIR)/
 endif
 ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
 	$(INSTALL) -d $(DESTDIR)$(CONFIG_DIR)
diff --git a/build_tools/make_dist b/build_tools/make_dist
index e1e580c..9a2ba07 100755
--- a/build_tools/make_dist
+++ b/build_tools/make_dist
@@ -24,11 +24,13 @@ echo "$version" > "$tmp_version_dir/.version"
 extra_dist='
 	autoconfig.h.in
 	configure
+	doc/Makefile
 	ppp/Makefile
 	Makefile
 	xpp/Makefile
 	xpp/oct612x/Makefile
 	xpp/perl_modules/Makefile
+	doc/Makefile.in
 	ppp/Makefile.in
 	Makefile.in
 	xpp/Makefile.in
diff --git a/configure.ac b/configure.ac
index 796410b..6ed7c64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -256,6 +256,7 @@ AC_CONFIG_FILES([
 	makeopts
 	version.c
 	Makefile
+	doc/Makefile
 	ppp/Makefile
 	xpp/Makefile
 	xpp/oct612x/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..8518b4a
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,17 @@
+man_MANS	= \
+	dahdi_cfg.8 \
+	dahdi_maint.8 \
+	dahdi_monitor.8 \
+	dahdi_scan.8 \
+	dahdi_span_assignments.8 \
+	dahdi_span_types.8 \
+	dahdi_test.8 \
+	dahdi_tool.8 \
+	dahdi_waitfor_span_assignments.8 \
+	fxotune.8
+
+noinst_MANS	= \
+	dahdi_diag.8 \
+	fxstest.8 \
+	patgen.8 \
+	pattest.8

commit b5b32a438fbffb7b5cf06463f295cb4123da83dc
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 16:23:12 2015 +0000

    automake: xpp: remove xpp/Makefile.legacy
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index 1645a78..f83fc43 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -1,25 +1,11 @@
 
-LEGACY_MAKE	= \
-	 $(MAKE) -f $(srcdir)/Makefile.legacy \
-		top_srcdir=$(top_srcdir) \
-		srcdir=$(srcdir)
-
 all-local: $(perl_checks)
-	$(LEGACY_MAKE)  all
-
-clean-local:
-	$(LEGACY_MAKE)  clean
-
-install-exec-hook:
-	$(LEGACY_MAKE)  install
-
-# Cannot allow this yet
-distclean:
-maintainer-clean:
 
 SUBDIRS		=
 
-GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk
+# FIXME: try to improve code, so we can use $(PEDANTIC)
+#PEDANTIC	= -ansi -pedantic -std=c99
+GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk $(PEDANTIC)
 
 if PERL
 SUBDIRS		+= perl_modules
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
deleted file mode 100644
index 2095c25..0000000
--- a/xpp/Makefile.legacy
+++ /dev/null
@@ -1,22 +0,0 @@
-PEDANTIC	= -ansi -pedantic -std=c99
-
-#
-# Ugly hack to find kernel directories before/after the split
-# to kernel/user-space.
-#
-# These variables should be passed to us. But until then...
-#
-DAHDI_TOOLSDIR	?= ..
-DAHDI_KERNELDIR	=
-
--include $(DAHDI_TOOLSDIR)/makeopts
-
-# Variables that should be defined above, but need sane defaults:
-# FIXME: Are those values really sane?
-HOSTCC		?= $(CC)
-
-all:
-
-install: all
-
-clean:

commit 4cc7df1089128cc7f6b727c92526156c94208c8a
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 15:49:08 2015 +0000

    automake: xpp: handle /usr/share/dahdi
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index 3dacac2..1645a78 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -55,6 +55,8 @@ perl_mans	= $(perl_scripts:%=%.8)
 
 endif
 
+pkgdatadir	= @datadir@/dahdi
+pkgdata_SCRIPTS	= xpp_fxloader astribank_hook waitfor_xpds
 udevrulesdir	= @udevrulesdir@
 udevrules_DATA	= xpp.rules
 
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
index 3dc3f89..2095c25 100644
--- a/xpp/Makefile.legacy
+++ b/xpp/Makefile.legacy
@@ -1,8 +1,5 @@
 PEDANTIC	= -ansi -pedantic -std=c99
 
-INSTALL		= install
-INSTALL_DATA	= install -m 644
-
 #
 # Ugly hack to find kernel directories before/after the split
 # to kernel/user-space.
@@ -14,18 +11,6 @@ DAHDI_KERNELDIR	=
 
 -include $(DAHDI_TOOLSDIR)/makeopts
 
-INSTALL_DATA	= $(INSTALL) -m 644
-
-# In 1.4 those are provided by autoconf through makeopts
-prefix		?= /usr
-datadir		?= $(prefix)/share
-sysconfdir	?= $(prefix)/etc
-INSTALL		?= install
-
-INSTALL_DATA	= $(INSTALL) -m 644
-
-DATADIR		= $(datadir)/dahdi
-
 # Variables that should be defined above, but need sane defaults:
 # FIXME: Are those values really sane?
 HOSTCC		?= $(CC)
@@ -33,8 +18,5 @@ HOSTCC		?= $(CC)
 all:
 
 install: all
-	$(INSTALL) -d $(DESTDIR)$(DATADIR)
-	$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
-	$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
 
 clean:

commit ac6f437317c4ebe86e2a52666cd809718ccbd19c
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 15:42:38 2015 +0000

    automake: xpp: handle udev rules
    
    * Set udev installation directory to $sysconfdir/udev/rules.d
    * Add definitions to xpp/Makefile.am and remove them from xpp/Makefile.legacy
    * TODO: add "--with-udev-rulesdir=" for packagers (/lib/udev/rules.d)
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/configure.ac b/configure.ac
index 1557888..796410b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,8 @@ if test ${localstatedir} = '${prefix}/var'; then
      localstatedir=/var
 fi
 
+AC_SUBST([udevrulesdir], '${sysconfdir}/udev/rules.d')
+
 # specify output header file
 AC_CONFIG_HEADER(autoconfig.h)
 
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index 7d060d5..3dacac2 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -55,6 +55,9 @@ perl_mans	= $(perl_scripts:%=%.8)
 
 endif
 
+udevrulesdir	= @udevrulesdir@
+udevrules_DATA	= xpp.rules
+
 dist_sbin_SCRIPTS	= $(perl_scripts)
 man_MANS		= $(perl_mans)
 CLEANFILES		= $(perl_checks) $(perl_mans)
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
index 3d49b09..3dc3f89 100644
--- a/xpp/Makefile.legacy
+++ b/xpp/Makefile.legacy
@@ -20,7 +20,6 @@ INSTALL_DATA	= $(INSTALL) -m 644
 prefix		?= /usr
 datadir		?= $(prefix)/share
 sysconfdir	?= $(prefix)/etc
-udevrulesdir	?= $(sysconfdir)/udev/rules.d
 INSTALL		?= install
 
 INSTALL_DATA	= $(INSTALL) -m 644
@@ -37,7 +36,5 @@ install: all
 	$(INSTALL) -d $(DESTDIR)$(DATADIR)
 	$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
 	$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
-	$(INSTALL) -d $(DESTDIR)$(udevrulesdir)
-	$(INSTALL_DATA) xpp.rules $(DESTDIR)$(udevrulesdir)/
 
 clean:

commit b054abb7e98b33f8a4f7ac83d364799fe253611a
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Mon May 18 15:25:03 2015 +0000

    automake: xpp: man-pages and perl-scripts
    
    * Now man-pages and perl-script are handled by xpp/Makefile.am
    * Removed from xpp/Makefile.legacy
    * Detect perl and set perllibdir in configure.ac
    * Handle modules in their own xpp/perl_modules/Makefile.am
    * Enclose perl-related stuff in conditional
    * Updates for "make dist"
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/.gitignore b/.gitignore
index 1249c51..87d854e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@ timertest
 tonezone.lo
 tonezones.txt
 version.c
+xpp/*.check
 xpp/.depend
 xpp/.octasic.depend
 xpp/.perlcheck
diff --git a/build_tools/make_dist b/build_tools/make_dist
index 8261c24..e1e580c 100755
--- a/build_tools/make_dist
+++ b/build_tools/make_dist
@@ -28,10 +28,12 @@ extra_dist='
 	Makefile
 	xpp/Makefile
 	xpp/oct612x/Makefile
+	xpp/perl_modules/Makefile
 	ppp/Makefile.in
 	Makefile.in
 	xpp/Makefile.in
 	xpp/oct612x/Makefile.in
+	xpp/perl_modules/Makefile.in
 	auxdir/compile
 	auxdir/config.guess
 	auxdir/config.sub
diff --git a/configure.ac b/configure.ac
index cc935dd..1557888 100644
--- a/configure.ac
+++ b/configure.ac
@@ -86,6 +86,16 @@ AC_SUBST(DOWNLOAD)
 
 AC_LANG(C)
 
+AC_PATH_PROG([PERL], [perl])
+if test "$PERL" = ''; then
+	      AC_MSG_ERROR(perl is mandatory)
+fi
+AC_MSG_CHECKING(for perl libdir)
+eval `"$PERL" -V:sitelib`
+AC_SUBST([perllibdir], [`echo "$sitelib"`])
+AC_MSG_RESULT([$perllibdir])
+AM_CONDITIONAL([PERL], [test "$perllibdir" != ''])
+
 AC_ARG_ENABLE(dev-mode,
 	[  --enable-dev-mode    Turn on developer mode],
 	[case "${enableval}" in
@@ -247,6 +257,7 @@ AC_CONFIG_FILES([
 	ppp/Makefile
 	xpp/Makefile
 	xpp/oct612x/Makefile
+	xpp/perl_modules/Makefile
 	])
 AC_OUTPUT
 
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index c456fad..7d060d5 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -4,7 +4,7 @@ LEGACY_MAKE	= \
 		top_srcdir=$(top_srcdir) \
 		srcdir=$(srcdir)
 
-all-local:
+all-local: $(perl_checks)
 	$(LEGACY_MAKE)  all
 
 clean-local:
@@ -21,6 +21,44 @@ SUBDIRS		=
 
 GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk
 
+if PERL
+SUBDIRS		+= perl_modules
+
+%.8: %
+	@if file "$^" | cut -d: -f2 | grep -q perl; then \
+		if pod2man --section 8 $^ > $@; then \
+			echo "  GEN      $@"; \
+		else \
+			rm -f "$@"; \
+		fi \
+	fi
+
+%.check: %
+	@echo "  CHECK    $^"; \
+	if ! perl -I./perl_modules -c $^ 2>/dev/null; then \
+		perl -I./perl_modules -c $^; \
+	fi
+	@touch $@
+
+perl_scripts	=	\
+		dahdi_registration	\
+		xpp_sync	\
+		lsdahdi		\
+		xpp_blink	\
+		dahdi_genconf	\
+		dahdi_hardware	\
+		twinstar	\
+		#
+
+perl_checks	= $(perl_scripts:%=%.check)
+perl_mans	= $(perl_scripts:%=%.8)
+
+endif
+
+dist_sbin_SCRIPTS	= $(perl_scripts)
+man_MANS		= $(perl_mans)
+CLEANFILES		= $(perl_checks) $(perl_mans)
+
 if	PBX_USB
 
 SUBDIRS		+= oct612x
@@ -65,9 +103,11 @@ astribank_allow_CFLAGS		= $(GLOBAL_CFLAGS)
 astribank_allow_LDFLAGS		= $(USB_LIB)
 astribank_allow_LDADD		= libastribank.la
 
-man_MANS	= \
+man_pages	= \
 		astribank_tool.8 \
 		astribank_hexload.8 \
 		astribank_allow.8 \
 		astribank_is_starting.8
+
+man_MANS	+= $(man_pages)
 endif
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
index 9f37f0b..3d49b09 100644
--- a/xpp/Makefile.legacy
+++ b/xpp/Makefile.legacy
@@ -19,75 +19,25 @@ INSTALL_DATA	= $(INSTALL) -m 644
 # In 1.4 those are provided by autoconf through makeopts
 prefix		?= /usr
 datadir		?= $(prefix)/share
-mandir		?= $(datadir)/man
 sysconfdir	?= $(prefix)/etc
 udevrulesdir	?= $(sysconfdir)/udev/rules.d
 INSTALL		?= install
 
 INSTALL_DATA	= $(INSTALL) -m 644
 
-SBINDIR		= $(prefix)/sbin
 DATADIR		= $(datadir)/dahdi
-MANDIR		= $(mandir)/man8
-PERLLIBDIR	:= $(shell eval `perl -V:sitelib`; echo "$$sitelib")
-PERL_DIRS	:= $(shell cd perl_modules; find * -name '[A-Z]*' -type d| xargs)
-PERL_MODS_PAT	:= *.pm $(PERL_DIRS:%=%/*.pm)
-PERL_MODS	:= $(shell cd perl_modules; echo $(PERL_MODS_PAT))
 
 # Variables that should be defined above, but need sane defaults:
 # FIXME: Are those values really sane?
 HOSTCC		?= $(CC)
 
-%.8: %
-	pod2man --section 8 $^ > $@ || $(RM) $@
-PERL_SCRIPTS	=	\
-		dahdi_registration	\
-		xpp_sync	\
-		lsdahdi		\
-		xpp_blink	\
-		dahdi_genconf	\
-		dahdi_hardware	\
-		twinstar	\
-		#
-
-PERL_MANS	= $(PERL_SCRIPTS:%=%.8)
-
-TARGETS	= .perlcheck
-
-ifneq	(,$(PERLLIBDIR))
-PROG_INSTALL	+= $(PERL_SCRIPTS)
-TARGETS		+= $(PERL_MANS)
-endif
-
-all: $(TARGETS)
-
-docs: $(PERL_MANS)
+all:
 
 install: all
-	$(INSTALL) -d $(DESTDIR)$(SBINDIR)
-	$(INSTALL) $(PROG_INSTALL) $(DESTDIR)$(SBINDIR)/
 	$(INSTALL) -d $(DESTDIR)$(DATADIR)
 	$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
 	$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
 	$(INSTALL) -d $(DESTDIR)$(udevrulesdir)
 	$(INSTALL_DATA) xpp.rules $(DESTDIR)$(udevrulesdir)/
-	$(INSTALL) -d $(DESTDIR)$(MANDIR)
-	$(INSTALL_DATA) $(PERL_MANS) $(DESTDIR)$(MANDIR)/
-ifneq	(,$(PERLLIBDIR))
-	$(INSTALL) -d $(DESTDIR)$(PERLLIBDIR)
-	for i in $(PERL_DIRS); \
-	do \
-		$(INSTALL) -d "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
-	done
-	for i in $(PERL_MODS); \
-	do \
-		$(INSTALL_DATA) "perl_modules/$$i" "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
-	done
-endif
-
-.perlcheck: $(PERL_SCRIPTS)
-	for i in $^; do perl -I./perl_modules -c $$i || exit 1; done
-	touch $@
 
 clean:
-	$(RM) $(TARGETS)
diff --git a/xpp/perl_modules/Makefile.am b/xpp/perl_modules/Makefile.am
new file mode 100644
index 0000000..b9a0520
--- /dev/null
+++ b/xpp/perl_modules/Makefile.am
@@ -0,0 +1,24 @@
+nobase_perllib_DATA	= \
+	Dahdi.pm \
+	Dahdi/Hardware.pm \
+	Dahdi/Xpp/Line.pm \
+	Dahdi/Xpp/Xbus.pm \
+	Dahdi/Xpp/Xpd.pm \
+	Dahdi/Xpp/Mpp.pm \
+	Dahdi/Span.pm \
+	Dahdi/Utils.pm \
+	Dahdi/Chans.pm \
+	Dahdi/Xpp.pm \
+	Dahdi/Config/Params.pm \
+	Dahdi/Config/Gen/Xpporder.pm \
+	Dahdi/Config/Gen/Spantypes.pm \
+	Dahdi/Config/Gen/Modules.pm \
+	Dahdi/Config/Gen/Users.pm \
+	Dahdi/Config/Gen/Freepbxdb.pm \
+	Dahdi/Config/Gen/Unicall.pm \
+	Dahdi/Config/Gen/Chandahdi.pm \
+	Dahdi/Config/Gen/Assignedspans.pm \
+	Dahdi/Config/Gen/System.pm \
+	Dahdi/Config/Gen.pm \
+	Dahdi/Hardware/USB.pm \
+	Dahdi/Hardware/PCI.pm

commit ee83afa669944c9354d578af53c1861d1a6bae17
Author: Oron Peled <oron.peled at xorcom.com>
Date:   Sun Dec 21 09:13:58 2014 -0500

    automake: handle xpp/ compilation via Makefile.am:
    
    * Added xpp/oct612x/Makefile.am:
      - Compile octasic sources into a convenience library (static, not installed)
      - Set OCTASIC_CFLAGS in configure.ac, as they are used in two
        Makefile.am's
      - Added relevant Makefile.in and Makefile into build_tools/make_dist
    
    * In xpp/Makefile.am:
      - Have USE_OCTASIC conditional (currently configure.ac always set it to true)
    
    * Added PBX_USB automake conditional, so we only build our tools if
      configure'd for libusb.
    
    * Create two convenience libraries (libastribank and libecholoader)
      Statically link them into our tools.
    
    * Handle man-pages for the tools.
    
    * Remove all new functionality from xpp/Makefile.legacy -- it now
      contains:
      - All perl related tools and man-pages
      - Other misc stuff (udev files, etc.)
    
    Signed-off-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

diff --git a/build_tools/make_dist b/build_tools/make_dist
index 26af271..8261c24 100755
--- a/build_tools/make_dist
+++ b/build_tools/make_dist
@@ -27,6 +27,7 @@ extra_dist='
 	ppp/Makefile
 	Makefile
 	xpp/Makefile
+	xpp/oct612x/Makefile
 	ppp/Makefile.in
 	Makefile.in
 	xpp/Makefile.in
diff --git a/configure.ac b/configure.ac
index 0baec5b..cc935dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,6 +230,14 @@ fi
 
 AC_SUBST(PPPD_VERSION)
 
+AM_CONDITIONAL([PBX_USB], [test "$PBX_USB" = "1"])
+
+# Taken from octasic-helper
+AC_SUBST([USE_OCTASIC], [yes])
+AM_CONDITIONAL([USE_OCTASIC], [test "$USE_OCTASIC" = 'yes'])
+octasic_dir='$(top_srcdir)/xpp/oct612x'
+AC_SUBST([OCTASIC_CFLAGS], ["-I$octasic_dir/include -I$octasic_dir/octdeviceapi -I$octasic_dir/octdeviceapi/oct6100api"])
+
 AC_SUBST([TOOLSVERSION], m4_esyscmd([build_tools/make_version . dahdi/tools]))
 
 AC_CONFIG_FILES([
@@ -238,6 +246,7 @@ AC_CONFIG_FILES([
 	Makefile
 	ppp/Makefile
 	xpp/Makefile
+	xpp/oct612x/Makefile
 	])
 AC_OUTPUT
 
diff --git a/xpp/Makefile.am b/xpp/Makefile.am
index 22344f0..c456fad 100644
--- a/xpp/Makefile.am
+++ b/xpp/Makefile.am
@@ -16,3 +16,58 @@ install-exec-hook:
 # Cannot allow this yet
 distclean:
 maintainer-clean:
+
+SUBDIRS		=
+
+GLOBAL_CFLAGS	= -I$(srcdir) -I$(srcdir)/xtalk
+
+if	PBX_USB
+
+SUBDIRS		+= oct612x
+
+noinst_LTLIBRARIES	= libastribank.la libecholoader.la
+libastribank_la_SOURCES	= \
+		xtalk/xusb.c \
+		xtalk/xlist.c \
+		xtalk/debug.c \
+		xtalk/xtalk.c \
+		mpptalk.c \
+		astribank_usb.c
+libastribank_la_CFLAGS		= $(GLOBAL_CFLAGS)
+
+if USE_OCTASIC
+libecholoader_la_SOURCES	= \
+		parse_span_specs.c \
+		echo_loader.c
+libecholoader_la_CFLAGS		= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
+endif
+
+sbin_PROGRAMS	= \
+		astribank_tool \
+		astribank_hexload \
+		astribank_allow \
+		astribank_is_starting
+
+check_PROGRAMS	= test_parse
+
+astribank_tool_SOURCES		= astribank_tool.c
+astribank_tool_CFLAGS		= $(GLOBAL_CFLAGS)
+astribank_tool_LDFLAGS		= $(USB_LIB)
+astribank_tool_LDADD		= libastribank.la
+
+astribank_hexload_SOURCES	= astribank_hexload.c hexfile.c pic_loader.c
+astribank_hexload_CFLAGS	= $(GLOBAL_CFLAGS) $(OCTASIC_CFLAGS)
+astribank_hexload_LDFLAGS	= $(USB_LIB)
+astribank_hexload_LDADD		= libastribank.la libecholoader.la oct612x/liboctasic.la
+
+astribank_allow_SOURCES		= astribank_allow.c astribank_license.c
+astribank_allow_CFLAGS		= $(GLOBAL_CFLAGS)
+astribank_allow_LDFLAGS		= $(USB_LIB)
+astribank_allow_LDADD		= libastribank.la
+
+man_MANS	= \
+		astribank_tool.8 \
+		astribank_hexload.8 \
+		astribank_allow.8 \
+		astribank_is_starting.8
+endif
diff --git a/xpp/Makefile.legacy b/xpp/Makefile.legacy
index 8584dcc..9f37f0b 100644
--- a/xpp/Makefile.legacy
+++ b/xpp/Makefile.legacy
@@ -38,25 +38,6 @@ PERL_MODS	:= $(shell cd perl_modules; echo $(PERL_MODS_PAT))
 # FIXME: Are those values really sane?
 HOSTCC		?= $(CC)
 
-USE_OCTASIC	:= yes
-OCTASIC_DIR	:= oct612x
-
-ifneq (no,$(USE_OCTASIC))
... 10823 lines suppressed ...


-- 
dahdi/tools.git



More information about the dahdi-commits mailing list