diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-01 03:32:51 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-01 03:32:51 +0000 |
commit | 4fcfbecfd91eacf8fc7441e3c645e0f72277b650 (patch) | |
tree | d3232dfe5d5d701a5653e470fb2fe2590e0b94eb | |
parent | 9162d9b002869a86d654b2bba58657384650f873 (diff) |
* Maintain the same meaning of DESTDIR and INSTALL_PREFIX as in main
Makefile
* Document ppp support to the best of my knowledge.
* Err clearly if the VERSION was not found.
* Add some basic/broken detection of ppp in autoconf.
Merged revisions 2987 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@2990 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r-- | README | 23 | ||||
-rwxr-xr-x | configure | 47 | ||||
-rw-r--r-- | configure.ac | 34 | ||||
-rw-r--r-- | makeopts.in | 3 | ||||
-rw-r--r-- | ppp/Makefile | 26 |
5 files changed, 117 insertions, 16 deletions
@@ -385,6 +385,26 @@ see an extra '(In use)': 2 XPP_FXS/0/0/1 FXOLS (In use) +[[ppp]] +PPP Support +----------- +Zaptel digital cards can provide data channels through ppp as +point-to-point connections. This requires a plugin to the ppp daemon +that is included in the ppp/ subdirectory. To install it: + +1. Make sure you have the PPP source / headers installed. On Debian: + + apt-get install ppp-dev + +2. Run 'make' on the ppp subdirectory: + + make -C ppp + make -C ppp install + +3. Make sure your kernel has support for both PPP (which is common is + distribution kernels and for HDLC (much less common) - CONFIG_PPP and + CONFIG_HDLC . + What is the license for the zaptel driver? ------------------------------------------ @@ -394,8 +414,7 @@ The GNU GPL is included in the file LICENSE in this directory. If you wish to use the zaptel drivers in an application for which the GPL is not appropriate (e.g. a proprietary embedded system), licenses -under more flexible terms can be readily obtained through Digium, Inc. -at reasonable cost. +under more flexible terms can be readily obtained through Digium, Inc.at reasonable cost. How do I report bugs or contribute? @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.ac Revision: 2107 . +# From configure.ac Revision: 2216 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -686,6 +686,7 @@ PBX_LIBNEWT USB_LIB USB_INCLUDE PBX_LIBUSB +PPPD_VERSION LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1270,6 +1271,7 @@ Optional Packages: --with-ncurses=PATH use ncurses files in PATH --with-newt=PATH use newt files in PATH --with-usb=PATH use libusb files in PATH + --with-ppp=PATH Use ppp support from PATH Some influential environment variables: CC C compiler command @@ -5325,6 +5327,46 @@ fi + +# Check whether --with-ppp was given. +if test "${with_ppp+set}" = set; then + withval=$with_ppp; +else + with_ppp=check + +fi + +set -x +# somebody will fix that +default_ppp_path=/usr + +case "$with_ppp" in + yes|check) ppp_path="$default_ppp_path";; + no) ppp_path='' ;; + *) ppp_path="$with_ppp" ;; +esac + +level_file="$ppp_path/include/pppd/patchlevel.h" +PPP_VERSION= +if test "$ppp_path" != '' && test -r "$level_file"; then + PPPD_VERSION=`awk -F '"' '/VERSION/ { print $$2; }' $level_file` +fi + +case "$with_ppp" in + check|no) :;; + *) + # If we asked explicitly for ppp support + if test "$PPPD_VERSION" = ''; then + # but have not detected it + { { echo "$as_me:$LINENO: error: failed to find pppd/patchlevel.h: no ppp support." >&5 +echo "$as_me: error: failed to find pppd/patchlevel.h: no ppp support." >&2;} + { (exit 1); exit 1; }; } + fi + ;; +esac +set +x + + ac_config_files="$ac_config_files build_tools/menuselect-deps makeopts" cat >confcache <<\_ACEOF @@ -6026,11 +6068,12 @@ PBX_LIBNEWT!$PBX_LIBNEWT$ac_delim USB_LIB!$USB_LIB$ac_delim USB_INCLUDE!$USB_INCLUDE$ac_delim PBX_LIBUSB!$PBX_LIBUSB$ac_delim +PPPD_VERSION!$PPPD_VERSION$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 72; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 140e546..2fe6069 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,40 @@ AST_EXT_LIB([ncurses], [initscr], [curses.h], [NCURSES], [ncurses], []) AST_EXT_LIB([newt], [newtBell], [newt.h], [NEWT], [newt]) AST_EXT_LIB([usb], [usb_init], [usb.h], [USB], [libusb]) +AC_ARG_WITH(ppp, + [AS_HELP_STRING([--with-ppp=PATH],[Use ppp support from PATH])], + [], + [with_ppp=check] + ) +set -x +# somebody will fix that +default_ppp_path=/usr + +case "$with_ppp" in + yes|check) ppp_path="$default_ppp_path";; + no) ppp_path='' ;; + *) ppp_path="$with_ppp" ;; +esac + +level_file="$ppp_path/include/pppd/patchlevel.h" +PPP_VERSION= +if test "$ppp_path" != '' && test -r "$level_file"; then + PPPD_VERSION=`awk -F '"' '/VERSION/ { print $$2; }' $level_file` +fi + +case "$with_ppp" in + check|no) :;; + *) + # If we asked explicitly for ppp support + if test "$PPPD_VERSION" = ''; then + # but have not detected it + AC_MSG_ERROR(failed to find pppd/patchlevel.h: no ppp support.) + fi + ;; +esac +set +x +AC_SUBST(PPPD_VERSION) + AC_CONFIG_FILES([build_tools/menuselect-deps makeopts]) AC_OUTPUT diff --git a/makeopts.in b/makeopts.in index 5022e51..0babc06 100644 --- a/makeopts.in +++ b/makeopts.in @@ -36,6 +36,7 @@ NCURSES_LIB=@NCURSES_LIB@ NCURSES_INCLUDE=@NCURSES_INCLUDE@ PBX_LIBUSB=@PBX_LIBUSB@ -USB_LIB=@NCURSES_LIB@ +USB_LIB=@USB_LIB@ USB_INCLUDE=@USB_INCLUDE@ +PPPD_VERSION=@PPPD_VERSION@ diff --git a/ppp/Makefile b/ppp/Makefile index a068fa2..86b65a6 100644 --- a/ppp/Makefile +++ b/ppp/Makefile @@ -1,25 +1,29 @@ -CC = gcc -COPTS = -O2 -g -CFLAGS = $(COPTS) -I.. -fPIC -LDFLAGS = -shared -INSTALL = install +#COPTS = -O2 -g -DESTDIR = /usr +-include ../makeopts -VERSION := $(shell awk -F '"' '/VERSION/ { print $$2; }' $(DESTDIR)/include/pppd/patchlevel.h) +CFLAGS += $(COPTS) -I.. -fPIC +LDFLAGS += -shared -LIBDIR := $(DESTDIR)/lib/pppd/$(VERSION) +INCLUDE_DIR = $(includedir)/pppd + +LIBDIR = $(libdir)/pppd/$(PPPD_VERSION) PLUGINS := zaptel.so all: $(PLUGINS) %.so: %.c - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ +ifeq (,$(PPPD_VERSION)) + @echo "pppd version not found (in patchlevel.h)." + @echo "Install ppp source/headers and/or ./configure --with-ppp=PATH." + exit 1 +endif + $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) install: $(PLUGINS) - $(INSTALL) -d $(LIBDIR) - $(INSTALL) -m 0644 $? $(LIBDIR) + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 0644 $? $(DESTDIR)$(LIBDIR) clean: rm -f *.o *.so *.a |