[Asterisk-Users] SuSE & Zaptel Compilation errors

digvijay singh ds98127 at hotmail.com
Fri May 14 13:22:20 MST 2004


Hi,
Thanks for giving me a detailed reply on hardware needs steven.
I have been looking at the archives in detail and found a few people have 
had problems with zaptel compilation on suse(kernel-source-2.4.19.SuSE-342 
// gcc 3.2.2 )  ... is shifting to red hat the only viable scenario...would 
be a pain cuz suse comes with sun java desktop system( just bought it !! ) 
... any fixes would be a great help.
I am attaching the error code and makefile again just in case it helps fork 
a solution..I have readline , termcap and other RPM's involved ... have done 
the make oldconfig and make dep in use/src/linux
Thanks
digvijay
Error :
##########
gcc -I/usr/src/linux-2.4/include -O6 -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 -DMODVERSIONS -include 
/usr/src/linux/include/linux/modversions.h  -DSTANDALONE_ZAPATA -c wcusb.c
In file included from wcusb.c:54:
wcusb.h:75: parse error before "urb_t"
wcusb.h:75: warning: no semicolon at end of struct or union
wcusb.h:87: parse error before '}' token
wcusb.h:96: parse error before "urb_t"
wcusb.h:96: warning: no semicolon at end of struct or union
wcusb.h:97: warning: type defaults to `int' in declaration of `isoframe'
wcusb.h:97: warning: data definition has no type or storage class
wcusb.h:99: parse error before '}' token
wcusb.h:108: field `dataread' has incomplete type
wcusb.h:109: field `datawrite' has incomplete type
wcusb.h:114: parse error before "urb_t"
wcusb.h:114: warning: no semicolon at end of struct or union
wcusb.h:115: warning: type defaults to `int' in declaration of `dr'
wcusb.h:115: warning: data definition has no type or storage class
wcusb.h:135: parse error before '}' token
wcusb.c:195: parse error before '*' token
wcusb.c:195: warning: function declaration isn't a prototype
wcusb.c:196: parse error before '*' token
wcusb.c:196: warning: function declaration isn't a prototype
wcusb.c:197: parse error before '*' token
wcusb.c:197: warning: function declaration isn't a prototype
wcusb.c: In function `proslic_read_direct_async':
wcusb.c:202: dereferencing pointer to incomplete type
wcusb.c:203: dereferencing pointer to incomplete type
wcusb.c:204: dereferencing pointer to incomplete type
wcusb.c:205: dereferencing pointer to incomplete type
wcusb.c:206: dereferencing pointer to incomplete type
wcusb.c:207: dereferencing pointer to incomplete type
wcusb.c: In function `proslic_write_direct_async':
wcusb.c:212: dereferencing pointer to incomplete type
wcusb.c:213: dereferencing pointer to incomplete type
wcusb.c:214: dereferencing pointer to incomplete type
wcusb.c:215: dereferencing pointer to incomplete type
wcusb.c:216: dereferencing pointer to incomplete type
wcusb.c:217: dereferencing pointer to incomplete type
wcusb.c: At top level:
wcusb.c:227: parse error before '*' token
wcusb.c:229: warning: function declaration isn't a prototype
wcusb.c: In function `wcusb_async_control':
wcusb.c:230: `urb' undeclared (first use in this function)
wcusb.c:230: (Each undeclared identifier is reported only once
wcusb.c:230: for each function it appears in.)
wcusb.c:231: dereferencing pointer to incomplete type
wcusb.c:235: dereferencing pointer to incomplete type
wcusb.c:238: dereferencing pointer to incomplete type
wcusb.c:241: dereferencing pointer to incomplete type
wcusb.c:244: dereferencing pointer to incomplete type
wcusb.c:247: dereferencing pointer to incomplete type
wcusb.c:249: dereferencing pointer to incomplete type
wcusb.c:249: dereferencing pointer to incomplete type
wcusb.c:250: dereferencing pointer to incomplete type
wcusb.c:253: dereferencing pointer to incomplete type
wcusb.c:254: dereferencing pointer to incomplete type
wcusb.c:254: dereferencing pointer to incomplete type
wcusb.c:255: dereferencing pointer to incomplete type
wcusb.c:258: dereferencing pointer to incomplete type
wcusb.c:261: dereferencing pointer to incomplete type
wcusb.c:261: dereferencing pointer to incomplete type
wcusb.c:263: dereferencing pointer to incomplete type
wcusb.c:264: dereferencing pointer to incomplete type
wcusb.c:264: dereferencing pointer to incomplete type
wcusb.c:265: dereferencing pointer to incomplete type
wcusb.c:267: dereferencing pointer to incomplete type
wcusb.c:271: dereferencing pointer to incomplete type
wcusb.c:272: dereferencing pointer to incomplete type
wcusb.c:275: dereferencing pointer to incomplete type
wcusb.c:276: dereferencing pointer to incomplete type
wcusb.c:280: dereferencing pointer to incomplete type
wcusb.c:300: dereferencing pointer to incomplete type
wcusb.c:303: dereferencing pointer to incomplete type
wcusb.c:304: dereferencing pointer to incomplete type
wcusb.c:308: dereferencing pointer to incomplete type
wcusb.c: At top level:
wcusb.c:319: parse error before '*' token
wcusb.c:321: warning: function declaration isn't a prototype
wcusb.c: In function `keypad_check_done':
wcusb.c:322: `urb' undeclared (first use in this function)
wcusb.c:323: dereferencing pointer to incomplete type
wcusb.c:327: dereferencing pointer to incomplete type
wcusb.c:328: dereferencing pointer to incomplete type
wcusb.c:337: dereferencing pointer to incomplete type
wcusb.c:338: dereferencing pointer to incomplete type
wcusb.c:341: dereferencing pointer to incomplete type
wcusb.c:342: dereferencing pointer to incomplete type
wcusb.c:343: dereferencing pointer to incomplete type
wcusb.c:343: dereferencing pointer to incomplete type
wcusb.c:343: dereferencing pointer to incomplete type
wcusb.c:344: dereferencing pointer to incomplete type
wcusb.c:345: dereferencing pointer to incomplete type
wcusb.c:346: dereferencing pointer to incomplete type
wcusb.c:352: dereferencing pointer to incomplete type
wcusb.c:353: dereferencing pointer to incomplete type
wcusb.c:356: dereferencing pointer to incomplete type
wcusb.c:357: dereferencing pointer to incomplete type
wcusb.c:358: dereferencing pointer to incomplete type
wcusb.c:359: dereferencing pointer to incomplete type
wcusb.c:359: dereferencing pointer to incomplete type
wcusb.c:360: dereferencing pointer to incomplete type
wcusb.c:360: dereferencing pointer to incomplete type
wcusb.c:361: dereferencing pointer to incomplete type
wcusb.c:361: dereferencing pointer to incomplete type
wcusb.c:362: dereferencing pointer to incomplete type
wcusb.c:362: dereferencing pointer to incomplete type
wcusb.c:363: dereferencing pointer to incomplete type
wcusb.c:364: dereferencing pointer to incomplete type
wcusb.c:367: dereferencing pointer to incomplete type
wcusb.c:367: dereferencing pointer to incomplete type
wcusb.c:368: dereferencing pointer to incomplete type
wcusb.c:368: dereferencing pointer to incomplete type
wcusb.c:369: dereferencing pointer to incomplete type
wcusb.c:369: dereferencing pointer to incomplete type
wcusb.c:370: dereferencing pointer to incomplete type
wcusb.c:370: dereferencing pointer to incomplete type
wcusb.c:371: dereferencing pointer to incomplete type
wcusb.c:372: dereferencing pointer to incomplete type
wcusb.c:375: dereferencing pointer to incomplete type
wcusb.c:375: dereferencing pointer to incomplete type
wcusb.c:376: dereferencing pointer to incomplete type
wcusb.c:376: dereferencing pointer to incomplete type
wcusb.c:377: dereferencing pointer to incomplete type
wcusb.c:377: dereferencing pointer to incomplete type
wcusb.c:378: dereferencing pointer to incomplete type
wcusb.c:378: dereferencing pointer to incomplete type
wcusb.c:378: dereferencing pointer to incomplete type
wcusb.c:380: dereferencing pointer to incomplete type
wcusb.c:380: dereferencing pointer to incomplete type
wcusb.c:381: dereferencing pointer to incomplete type
wcusb.c:381: dereferencing pointer to incomplete type
wcusb.c:382: dereferencing pointer to incomplete type
wcusb.c:382: dereferencing pointer to incomplete type
wcusb.c:383: dereferencing pointer to incomplete type
wcusb.c:383: dereferencing pointer to incomplete type
wcusb.c:383: dereferencing pointer to incomplete type
wcusb.c:385: dereferencing pointer to incomplete type
wcusb.c:386: dereferencing pointer to incomplete type
wcusb.c:386: dereferencing pointer to incomplete type
wcusb.c:393: dereferencing pointer to incomplete type
wcusb.c:395: dereferencing pointer to incomplete type
wcusb.c:396: dereferencing pointer to incomplete type
wcusb.c:400: dereferencing pointer to incomplete type
wcusb.c:400: dereferencing pointer to incomplete type
wcusb.c:401: dereferencing pointer to incomplete type
wcusb.c:403: dereferencing pointer to incomplete type
wcusb.c:405: dereferencing pointer to incomplete type
wcusb.c:405: dereferencing pointer to incomplete type
wcusb.c:406: dereferencing pointer to incomplete type
wcusb.c:409: dereferencing pointer to incomplete type
wcusb.c:410: dereferencing pointer to incomplete type
wcusb.c:414: dereferencing pointer to incomplete type
wcusb.c: In function `wcusb_check_interrupt':
wcusb.c:421: dereferencing pointer to incomplete type
wcusb.c: At top level:
wcusb.c:436: parse error before '*' token
wcusb.c:436: warning: function declaration isn't a prototype
wcusb.c: In function `wcusb_async_read':
wcusb.c:451: `urb_t' undeclared (first use in this function)
wcusb.c:451: `urb' undeclared (first use in this function)
wcusb.c:451: dereferencing pointer to incomplete type
wcusb.c:454: dereferencing pointer to incomplete type
wcusb.c:455: dereferencing pointer to incomplete type
wcusb.c:456: dereferencing pointer to incomplete type
wcusb.c:457: dereferencing pointer to incomplete type
wcusb.c:458: dereferencing pointer to incomplete type
wcusb.c:461: dereferencing pointer to incomplete type
wcusb.c:461: dereferencing pointer to incomplete type
wcusb.c:461: dereferencing pointer to incomplete type
wcusb.c:469: dereferencing pointer to incomplete type
wcusb.c:472: dereferencing pointer to incomplete type
wcusb.c:473: dereferencing pointer to incomplete type
wcusb.c: At top level:
wcusb.c:484: parse error before '*' token
wcusb.c:484: warning: function declaration isn't a prototype
wcusb.c: In function `wcusb_async_write':
wcusb.c:499: `urb_t' undeclared (first use in this function)
wcusb.c:499: `urb' undeclared (first use in this function)
wcusb.c:499: dereferencing pointer to incomplete type
wcusb.c:502: dereferencing pointer to incomplete type
wcusb.c:503: dereferencing pointer to incomplete type
wcusb.c:504: dereferencing pointer to incomplete type
wcusb.c:505: dereferencing pointer to incomplete type
wcusb.c:506: dereferencing pointer to incomplete type
wcusb.c:509: dereferencing pointer to incomplete type
wcusb.c:509: dereferencing pointer to incomplete type
wcusb.c:509: dereferencing pointer to incomplete type
wcusb.c:519: dereferencing pointer to incomplete type
wcusb.c:520: dereferencing pointer to incomplete type
wcusb.c: In function `init_hardware':
wcusb.c:787: dereferencing pointer to incomplete type
wcusb.c:789: dereferencing pointer to incomplete type
wcusb.c: In function `set_aux_ctrl':
wcusb.c:841: dereferencing pointer to incomplete type
wcusb.c:842: dereferencing pointer to incomplete type
wcusb.c:844: dereferencing pointer to incomplete type
wcusb.c:845: dereferencing pointer to incomplete type
wcusb.c: In function `wcusb_check_keypad':
wcusb.c:852: dereferencing pointer to incomplete type
wcusb.c:854: dereferencing pointer to incomplete type
wcusb.c:859: dereferencing pointer to incomplete type
wcusb.c:860: dereferencing pointer to incomplete type
wcusb.c:861: dereferencing pointer to incomplete type
wcusb.c:862: dereferencing pointer to incomplete type
wcusb.c:863: dereferencing pointer to incomplete type
wcusb.c:864: dereferencing pointer to incomplete type
wcusb.c: In function `wc_dtmf':
wcusb.c:870: dereferencing pointer to incomplete type
wcusb.c:878: dereferencing pointer to incomplete type
wcusb.c:878: dereferencing pointer to incomplete type
wcusb.c: In function `wcusb_read_complete':
wcusb.c:894: dereferencing pointer to incomplete type
wcusb.c:896: dereferencing pointer to incomplete type
wcusb.c:900: dereferencing pointer to incomplete type
wcusb.c:903: dereferencing pointer to incomplete type
wcusb.c:908: dereferencing pointer to incomplete type
wcusb.c:913: dereferencing pointer to incomplete type
wcusb.c:913: dereferencing pointer to incomplete type
wcusb.c:913: dereferencing pointer to incomplete type
wcusb.c:915: dereferencing pointer to incomplete type
wcusb.c:917: dereferencing pointer to incomplete type
wcusb.c:928: dereferencing pointer to incomplete type
wcusb.c:928: dereferencing pointer to incomplete type
wcusb.c:929: dereferencing pointer to incomplete type
wcusb.c: In function `wcusb_write_complete':
wcusb.c:960: dereferencing pointer to incomplete type
wcusb.c:962: dereferencing pointer to incomplete type
wcusb.c:966: dereferencing pointer to incomplete type
wcusb.c:968: dereferencing pointer to incomplete type
wcusb.c:970: dereferencing pointer to incomplete type
wcusb.c: In function `StopTransmit':
wcusb.c:986: dereferencing pointer to incomplete type
wcusb.c:988: dereferencing pointer to incomplete type
wcusb.c:989: dereferencing pointer to incomplete type
wcusb.c:990: dereferencing pointer to incomplete type
wcusb.c:992: dereferencing pointer to incomplete type
wcusb.c: In function `flip_relays':
wcusb.c:1004: dereferencing pointer to incomplete type
wcusb.c:1007: dereferencing pointer to incomplete type
wcusb.c:1016: dereferencing pointer to incomplete type
wcusb.c:1018: dereferencing pointer to incomplete type
wcusb.c: In function `prepare_transfer_urbs':
wcusb.c:1027: dereferencing pointer to incomplete type
wcusb.c:1029: dereferencing pointer to incomplete type
wcusb.c:1032: dereferencing pointer to incomplete type
wcusb.c:1032: dereferencing pointer to incomplete type
wcusb.c:1033: dereferencing pointer to incomplete type
wcusb.c:1037: dereferencing pointer to incomplete type
wcusb.c:1039: dereferencing pointer to incomplete type
wcusb.c:1040: dereferencing pointer to incomplete type
wcusb.c:1041: dereferencing pointer to incomplete type
wcusb.c:1042: dereferencing pointer to incomplete type
wcusb.c:1043: dereferencing pointer to incomplete type
wcusb.c:1044: dereferencing pointer to incomplete type
wcusb.c:1044: dereferencing pointer to incomplete type
wcusb.c:1045: dereferencing pointer to incomplete type
wcusb.c:1047: dereferencing pointer to incomplete type
wcusb.c:1047: dereferencing pointer to incomplete type
wcusb.c:1048: dereferencing pointer to incomplete type
wcusb.c:1052: dereferencing pointer to incomplete type
wcusb.c:1054: dereferencing pointer to incomplete type
wcusb.c:1055: dereferencing pointer to incomplete type
wcusb.c:1056: dereferencing pointer to incomplete type
wcusb.c:1057: dereferencing pointer to incomplete type
wcusb.c:1058: dereferencing pointer to incomplete type
wcusb.c:1059: dereferencing pointer to incomplete type
wcusb.c:1059: dereferencing pointer to incomplete type
wcusb.c:1060: dereferencing pointer to incomplete type
wcusb.c: In function `begin_transfer':
wcusb.c:1070: dereferencing pointer to incomplete type
wcusb.c:1071: dereferencing pointer to incomplete type
wcusb.c:1077: dereferencing pointer to incomplete type
wcusb.c:1086: dereferencing pointer to incomplete type
wcusb.c: In function `wc_usb_hooksig':
wcusb.c:1102: dereferencing pointer to incomplete type
wcusb.c:1113: dereferencing pointer to incomplete type
wcusb.c:1119: dereferencing pointer to incomplete type
wcusb.c:1119: dereferencing pointer to incomplete type
wcusb.c:1122: dereferencing pointer to incomplete type
wcusb.c:1127: dereferencing pointer to incomplete type
wcusb.c:1127: dereferencing pointer to incomplete type
wcusb.c:1130: dereferencing pointer to incomplete type
wcusb.c:1133: dereferencing pointer to incomplete type
wcusb.c: In function `wc_usb_open':
wcusb.c:1155: dereferencing pointer to incomplete type
wcusb.c:1157: dereferencing pointer to incomplete type
wcusb.c:1159: dereferencing pointer to incomplete type
wcusb.c:1160: dereferencing pointer to incomplete type
wcusb.c:1168: dereferencing pointer to incomplete type
wcusb.c: In function `wc_usb_close':
wcusb.c:1175: dereferencing pointer to incomplete type
wcusb.c:1176: dereferencing pointer to incomplete type
wcusb.c:1176: dereferencing pointer to incomplete type
wcusb.c:1179: dereferencing pointer to incomplete type
wcusb.c:1180: dereferencing pointer to incomplete type
wcusb.c:1181: dereferencing pointer to incomplete type
wcusb.c:1182: dereferencing pointer to incomplete type
wcusb.c: In function `wc_detect_device':
wcusb.c:1197: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1203: sizeof applied to an incomplete type
wcusb.c:1205: dereferencing pointer to incomplete type
wcusb.c:1212: dereferencing pointer to incomplete type
wcusb.c:1217: sizeof applied to an incomplete type
wcusb.c:1219: dereferencing pointer to incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1224: sizeof applied to an incomplete type
wcusb.c:1225: dereferencing pointer to incomplete type
wcusb.c:1226: dereferencing pointer to incomplete type
wcusb.c:1227: dereferencing pointer to incomplete type
wcusb.c:1228: dereferencing pointer to incomplete type
wcusb.c:1231: dereferencing pointer to incomplete type
wcusb.c:1232: dereferencing pointer to incomplete type
wcusb.c: In function `wc_set_zaptel':
wcusb.c:1249: dereferencing pointer to incomplete type
wcusb.c:1250: dereferencing pointer to incomplete type
wcusb.c:1250: dereferencing pointer to incomplete type
wcusb.c:1251: dereferencing pointer to incomplete type
wcusb.c:1253: dereferencing pointer to incomplete type
wcusb.c:1254: dereferencing pointer to incomplete type
wcusb.c:1255: dereferencing pointer to incomplete type
wcusb.c:1256: dereferencing pointer to incomplete type
wcusb.c:1256: dereferencing pointer to incomplete type
wcusb.c:1257: dereferencing pointer to incomplete type
wcusb.c:1258: dereferencing pointer to incomplete type
wcusb.c:1259: dereferencing pointer to incomplete type
wcusb.c:1260: dereferencing pointer to incomplete type
wcusb.c:1263: dereferencing pointer to incomplete type
wcusb.c:1264: dereferencing pointer to incomplete type
wcusb.c:1265: dereferencing pointer to incomplete type
wcusb.c:1266: dereferencing pointer to incomplete type
wcusb.c:1267: dereferencing pointer to incomplete type
wcusb.c:1270: dereferencing pointer to incomplete type
wcusb.c:1272: dereferencing pointer to incomplete type
wcusb.c:1273: dereferencing pointer to incomplete type
wcusb.c: In function `wc_usb_probe':
wcusb.c:1301: dereferencing pointer to incomplete type
wcusb.c:1340: dereferencing pointer to incomplete type
wcusb.c:1350: dereferencing pointer to incomplete type
wcusb.c:1351: dereferencing pointer to incomplete type
wcusb.c:1353: dereferencing pointer to incomplete type
wcusb.c:1356: dereferencing pointer to incomplete type
wcusb.c:1358: dereferencing pointer to incomplete type
wcusb.c:1359: dereferencing pointer to incomplete type
wcusb.c:1370: dereferencing pointer to incomplete type
wcusb.c:1371: dereferencing pointer to incomplete type
wcusb.c: In function `wc_usb_disconnect':
wcusb.c:1396: dereferencing pointer to incomplete type
wcusb.c:1397: dereferencing pointer to incomplete type
wcusb.c:1398: dereferencing pointer to incomplete type
wcusb.c:1399: dereferencing pointer to incomplete type
wcusb.c:1400: dereferencing pointer to incomplete type
wcusb.c:1401: dereferencing pointer to incomplete type
wcusb.c:1405: dereferencing pointer to incomplete type
wcusb.c:1406: dereferencing pointer to incomplete type
wcusb.c:1407: dereferencing pointer to incomplete type
make: *** [wcusb.o] Error 1
############################################
Makefile
############################################
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)

CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
KFLAGS+=-I/usr/src/linux-2.4/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 [ -f $(KINCLUDES)/linux/modversions.h ] && echo 
"-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h")
KFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-msoft-float 
-fsigned-char"; fi)
#
# Features are now configured in zconfig.h
#
#

KFLAGS+=-DSTANDALONE_ZAPATA
CFLAGS+=-DSTANDALONE_ZAPATA

INSTALL_PREFIX=

BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo 
"linux24"; fi)
MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo 
"$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d 
$(INSTALL_PREFIX)/etc/modutils ]; then echo 
"$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f 
$(INSTALL_PREFIX)/etc/modprobe.conf ]; then echo 
"$(INSTALL_PREFIX)/etc/modprobe.conf"; elif [ -f 
$(INSTALL_PREFIX)/etc/modules.conf ]; then echo 
"$(INSTALL_PREFIX)/etc/modules.conf"; else echo 
$(INSTALL_PREFIX)/etc/conf.modules ; fi)

ifeq (${BUILDVER},linux24)
#We only support DEVFS in linux 2.4 kernels, since its considered obsolete 
post 2.4
DEVFS=$(shell ps ax | grep -v grep | grep devfsd)
endif

TZOBJS=zonedata.lo tonezone.lo
LIBTONEZONE=libtonezone.so.1.0
MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \
	ztdynamic ztd-eth wct1xxp wct4xxp # ztdummy
#MODULES+=wcfxsusb

MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done )
MODULESKO=$(shell for x in $(MODULES); do echo "$$x.ko "; done )

ZTTOOL=$(shell if [ -f /usr/include/newt.h ]; then echo zttool; fi)
BINS=ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)

#PRIMARY=wcfxsusb
PRIMARY=torisa
#PRIMARY=wcfxo
PWD=$(shell pwd)

all: $(BUILDVER)

linux24: $(MODULESO) $(BINS)

linux26:
linux26: prereq $(BINS)
	@if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your 
kernel sources first!"; exit 1 ; fi
	make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules

obj-m := $(MODULESO)

#ifneq ($(TOPDIR),)
#include $(TOPDIR)/Rules.make
#endif

MOD_DESTDIR := zaptel

devel: tor2ee

tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify 
timertest

tor2.o: tor2.c tor2-hw.h tor.h tor2fw.h zaptel.h
	$(HOSTCC) $(KFLAGS) -c tor2.c

zaptel.o: zaptel.c zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h 
mec3.h
	$(HOSTCC) $(KFLAGS) -c zaptel.c

torisa.o: torisa.c zaptel.h torisa.h
	$(HOSTCC) $(KFLAGS) -c torisa.c

wcusb.o: wcusb.c wcusb.h zaptel.h
	$(HOSTCC) $(KFLAGS) -c wcusb.c

wcfxsusb.o: wcfxsusb.c wcfxsusb.h zaptel.h
	$(HOSTCC) $(KFLAGS) -c wcfxsusb.c

wcfxo.o: wcfxo.c zaptel.h
	$(HOSTCC) $(KFLAGS) -c wcfxo.c

wct1xxp.o:wct1xxp.c zaptel.h
	$(HOSTCC) $(KFLAGS) -c wct1xxp.c

wct4xxp.o:wct4xxp.c zaptel.h
	$(HOSTCC) $(KFLAGS) -c wct4xxp.c

wcfxs.o:wcfxs.c zaptel.h
	$(HOSTCC) $(KFLAGS) -c wcfxs.c

wcs3200p.o:wcs3200p.c zaptel.h
	$(HOSTCC) $(KFLAGS) -c wcs3200p.c

ztdummy.o:ztdummy.c ztdummy.h
	$(HOSTCC) $(KFLAGS) -c ztdummy.c

ztdynamic.o: ztdynamic.c zaptel.h
	$(HOSTCC) $(KFLAGS)  -c ztdynamic.c

ztd-eth.o: ztd-eth.c zaptel.h
	$(HOSTCC) $(KFLAGS)  -c ztd-eth.c

tor2ee.o: tor2-hw.h

tor2ee: tor2ee.o
	$(CC) $(CFLAGS) -o tor2ee tor2ee.o -lpci

zonedata.lo: zonedata.c
	$(CC) -c $(LCFLAGS) -o zonedata.lo zonedata.c

tonezone.lo: tonezone.c
	$(CC) -c $(LCFLAGS) -o tonezone.lo tonezone.c

torisatool: torisatool.o
	$(CC) -o torisatool torisatool.o

tones.h: gendigits
	./gendigits

tor2fw.h: makefw tormenta2.rbt
	./makefw tormenta2.rbt tor2fw > tor2fw.h

gendigits: gendigits.o
	$(CC) -o gendigits gendigits.o -lm

zaptel.c: tones.h

prereq: tones.h tor2fw.h

zttool.o: zttool.c zaptel.h

ztprovision.o: ztprovision.c zaptel.h

ztmonitor.o: ztmonitor.c zaptel.h

ztspeed.o: ztspeed.c
	$(CC) -c ztspeed.c

zttool: zttool.o
	$(CC) -o zttool zttool.o -lnewt

ztprovision: ztprovision.o
	$(CC) -o ztprovision ztprovision.o -lnewt

ztmonitor: ztmonitor.o
	$(CC) -o ztmonitor ztmonitor.o

ztcat: ztcat.o
	$(CC) -o ztcat ztcat.o -ltonezone

ztspeed: ztspeed.o
	$(CC) -o ztspeed ztspeed.o

sethdlc-new: sethdlc-new.o
	$(CC) -o sethdlc-new sethdlc-new.o

sethdlc-new.o: sethdlc-new.c
	$(CC) -c $(CFLAGS) -I$(KINCLUDES) sethdlc-new.c

libtonezone.a: $(TZOBJS)
	ar rcs libtonezone.a $(TZOBJS)

$(LIBTONEZONE): $(TZOBJS)
	$(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS)
	/sbin/ldconfig -n .
	ln -sf libtonezone.so.1 libtonezone.so

ztcfg.c: ztcfg.h

ztcfg-shared: ztcfg.o $(LIBTONEZONE)
	$(CC) -o ztcfg-shared ztcfg.o -lm -L. -ltonezone

ztcfg: ztcfg.o libtonezone.a
	$(CC) -o ztcfg ztcfg.o -lm -L. libtonezone.a

ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE)
	$(CC) -o ztcfg ztcfg-dude.o mknotch.o complex.o -lm -L. -ltonezone

mknotch.o: mknotch.cc
	$(CC) -c mknotch.cc

complex.o: complex.cc
	$(CC) -c complex.cc

usbfxstest.o: usbfxstest.c
	$(CC) -g -c usbfxstest.c

usbfxstest: usbfxstest.o
	$(CC) -o usbfxstest usbfxstest.o -lzap

fxstest: fxstest.o
	$(CC) -o fxstest fxstest.o -ltonezone

fxsdump: fxsdump.o
	$(CC) -o fxsdump fxsdump.o -lm

devices:
ifeq ($(DEVFS),)
	mkdir -p $(INSTALL_PREFIX)/dev/zap
	rm -f $(INSTALL_PREFIX)/dev/zap/ctl
	rm -f $(INSTALL_PREFIX)/dev/zap/channel
	rm -f $(INSTALL_PREFIX)/dev/zap/pseudo
	rm -f $(INSTALL_PREFIX)/dev/zap/timer
	rm -f $(INSTALL_PREFIX)/dev/zap/253
	rm -f $(INSTALL_PREFIX)/dev/zap/252
	rm -f $(INSTALL_PREFIX)/dev/zap/251
	rm -f $(INSTALL_PREFIX)/dev/zap/250
	mknod $(INSTALL_PREFIX)/dev/zap/ctl c 196 0
	mknod $(INSTALL_PREFIX)/dev/zap/timer c 196 253
	mknod $(INSTALL_PREFIX)/dev/zap/channel c 196 254
	mknod $(INSTALL_PREFIX)/dev/zap/pseudo c 196 255
	N=1; \
	while [ $$N -lt 250 ]; do \
		rm -f $(INSTALL_PREFIX)/dev/zap/$$N; \
		mknod $(INSTALL_PREFIX)/dev/zap/$$N c 196 $$N; \
		N=$$[$$N+1]; \
	done
else
	@echo "**** devfs detected -- not making device nodes"
endif

install:  all devices $(LIBTONEZONE)
	mkdir -p $(INSTALL_PREFIX)/sbin
	install -m 755 ztcfg $(INSTALL_PREFIX)/sbin
	if [ -f sethdlc-new ]; then \
		install -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
	elif [ -f sethdlc ]; then \
		install -m 755 sethdlc $(INSTALL_PREFIX)/sbin ; \
	fi
	if [ -f zttool ]; then install -m 755 zttool $(INSTALL_PREFIX)/sbin; fi
	mkdir -p $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc

	if [ -f zaptel.ko ]; then \
		for x in $(MODULESKO); do \
			install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
		done; \
		if ! [ -f wcfxsusb.ko ]; then \
			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
		fi; \
	else \
		for x in $(MODULESO); do \
			install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
		done; \
		if ! [ -f wcfxsusb.o ]; then \
			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.ko; \
		fi; \
	fi

	mkdir -p $(INSTALL_PREFIX)/usr/lib
	install -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib
	install -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux
	install -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux
	install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
	( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf 
$(LIBTONEZONE) libtonezone.so )
	/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 ! 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 [ -d /etc/modutils ]; then \
		/sbin/update-modules ; \
	fi
	-/sbin/depmod -a
	[ -f $(INSTALL_PREFIX)/etc/zaptel.conf ] || install -m 644 
zaptel.conf.sample $(INSTALL_PREFIX)/etc/zaptel.conf

config:
	if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
		install -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \
		chkconfig --add zaptel; \
	elif [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \
		install -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
	fi
	if [ ! -f /etc/sysconfig/zaptel ]; then \
		install -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
	fi
	if [ -d /etc/sysconfig/network-scripts ]; then \
		install -m 755 ifup-hdlc 
$(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \
	fi

clean:
	rm -f torisatool makefw tor2fw.h
	rm -f zttool
	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
	rm -f $(TZOBJS) $(LIBTONEZONE) *.lo
	rm -f *.ko *.mod.c .*o.cmd
	rm -f gendigits tones.h
	rm -f libtonezone*
	rm -f tor2ee
	rm -f core
############################################

_________________________________________________________________
Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp 
Buy and Sell on MSN Classifieds.




More information about the asterisk-users mailing list