--- zaptel-1.0.9.2/Makefile.orig 2005-09-15 04:16:23.000000000 +0200 +++ zaptel-1.0.9.2/Makefile 2005-09-15 04:16:56.000000000 +0200 @@ -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) @@ -38,8 +38,8 @@ CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf 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) +BUILDVER?=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; 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 @@ -58,7 +58,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 ) @@ -71,7 +71,7 @@ PRIMARY=torisa #PRIMARY=wcfxo PWD=$(shell pwd) -KERNEL_SOURCE?=/lib/modules/`uname -r`/build +KERNEL_SOURCE?=/usr/src/linux all: $(BUILDVER) $(LIBTONEZONE) @@ -198,7 +198,6 @@ $(LIBTONEZONE): $(TZOBJS) $(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS) - [ `id -u` = 0 ] && /sbin/ldconfig || : ln -sf libtonezone.so.1 libtonezone.so ztcfg.c: ztcfg.h @@ -262,7 +261,7 @@ @echo "**** If you are running udev, read README.udev" endif -install: all devices +install: devices install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg if [ -f sethdlc-new ]; then \ install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \ @@ -286,45 +285,24 @@ fi; \ 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 "alias wcfxs" | \ - grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true + if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi + /sbin/ldconfig -n $(INSTALL_PREFIX)/usr/lib 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 ! grep "alias wct2xxp" $(MODCONF); then \ echo "alias wct2xxp wct4xxp" >> $(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: