--- zaptel-1.0.7/Makefile.orig 2005-03-20 23:08:04.803610656 +0000 +++ zaptel-1.0.7/Makefile 2005-03-20 23:10:24.390390240 +0000 @@ -13,13 +13,13 @@ # (assuming He's running Linux -- which we all know He must). # HOSTCC=gcc -KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi) +KINCLUDES=/usr/src/linux/include -CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER +CFLAGS+=-I. -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi) CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi) LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE -KFLAGS+=-I/usr/src/linux-2.4/include -O6 +KFLAGS+=-I/usr/src/linux/include -O6 KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net \ -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/net KFLAGS+=$(shell if [ -f $(KINCLUDES)/linux/modversions.h ] ; then echo "-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h" ; fi) @@ -39,7 +39,7 @@ CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\" BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi) -MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi) +MODCONF=$(INSTALL_PREFIX)/etc/modules.d/zaptel ifeq (${BUILDVER},linux24) #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4 @@ -54,7 +54,7 @@ TZOBJS=zonedata.lo tonezone.lo LIBTONEZONE=libtonezone.so.1.0 MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \ - ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp # ztdummy + ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp ztdummy #MODULES+=wcfxsusb MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done ) @@ -255,7 +255,7 @@ @echo "**** If you are running udev, read README.udev" endif -install: all devices $(LIBTONEZONE) +install: devices $(LIBTONEZONE) install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg if [ -f sethdlc-new ]; then \ install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \ @@ -281,43 +281,21 @@ fi install -D -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE) - if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE); fi install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so ) - [ `id -u` = 0 ] && /sbin/ldconfig || : - if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi - cat $(MODCONF).bak | grep -v "alias char-major-250" | \ - grep -v "post-install torisa /sbin/ztcfg" | \ - grep -v "post-install wcfxsusb /sbin/ztcfg" | \ - grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true + if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi if ! grep "options torisa" $(MODCONF); then \ echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \ fi if ! grep "alias char-major-196" $(MODCONF); then \ echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \ fi - - for x in $(MODULES); do \ - if ! grep "post-install $$x" $(MODCONF); then \ - if ! grep "install $$x " $(MODCONF); then \ - if [ "$$x" != "zaptel" ] ; then \ - if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \ - else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \ - fi; \ - fi; \ - fi; \ - fi; \ - done if ! grep "alias wctdm" $(MODCONF); then \ echo "alias wctdm wcfxs" >> $(MODCONF); \ fi \ - if [ -d /etc/modutils ]; then \ - /sbin/update-modules ; \ - fi - [ `id -u` = 0 ] && /sbin/depmod -a || : [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE) config: