home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / misc / 3931 < prev    next >
Encoding:
Text File  |  1992-09-11  |  57.1 KB  |  2,206 lines

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: wht@n4hgf.mt-park.ga.us (Warren Tucker)
  4. Subject:  v32i039:  ecu - ECU Asynchronous Communications v3.20, Part04/40
  5. Message-ID: <1992Sep11.192317.6420@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: 05cbcc207ba3a515c581f6323a5ffb00
  8. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  9. Organization: Sterling Software
  10. References: <csm-v32i036=ecu.141245@sparky.IMD.Sterling.COM>
  11. Date: Fri, 11 Sep 1992 19:23:17 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 2191
  14.  
  15. Submitted-by: wht@n4hgf.mt-park.ga.us (Warren Tucker)
  16. Posting-number: Volume 32, Issue 39
  17. Archive-name: ecu/part04
  18. Environment: SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses
  19. Supersedes: ecu: Volume 21, Issue 53-89
  20.  
  21. ---- Cut Here and feed the following to sh ----
  22. #!/bin/sh
  23. # this is ecu320.04 (part 4 of ecu320)
  24. # do not concatenate these parts, unpack them in order with /bin/sh
  25. # file Make.src continued
  26. #
  27. if test ! -r _shar_seq_.tmp; then
  28.     echo 'Please unpack part 1 first!'
  29.     exit 1
  30. fi
  31. (read Scheck
  32.  if test "$Scheck" != 4; then
  33.     echo Please unpack part "$Scheck" next!
  34.     exit 1
  35.  else
  36.     exit 0
  37.  fi
  38. ) < _shar_seq_.tmp || exit 1
  39. if test ! -f _shar_wnt_.tmp; then
  40.     echo 'x - still skipping Make.src'
  41. else
  42. echo 'x - continuing file Make.src'
  43. sed 's/^X//' << 'SHAR_EOF' >> 'Make.src' &&
  44. X    cd help; $(MAKE) -$(MAKEFLAGS) install
  45. X    @if [ ! -f $(HDBLIBDIR)/Devices ]; then \
  46. X        cp models/*.mi $(ECULIBDIR); \
  47. X        echo "==> edit $(ECULIBDIR)/*.mi for your tty lines per ecu.man"; \
  48. X    fi
  49. X    @echo '\012'Installation complete.  Follow the yellow brick road.
  50. X
  51. Xshar.fls: Makefile
  52. X    csh -c 'ls $(SHARFLS) | sort > shar.fls'
  53. X
  54. X# for shar 3.461
  55. Xshar: shar.fls
  56. X    csh -c 'shar -F -c -s "wht@n4hgf.Mt-Park.GA.US" -a \
  57. X    -E 'SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses' \
  58. X-n$(ECUSHARNAME) -L57 -o/tmp/$(ECUSHARNAME) $(SHARFLS)' 
  59. X    cd doc;make
  60. X    shar -F -c -s "wht@n4hgf.Mt-Park.GA.US" -a \
  61. X    -E 'SCO,XENIX,ISC,SUNOS,SYSVR4,HDB,Curses' \
  62. X-n$(MANSHARNAME) -L57 -o/tmp/$(MANSHARNAME) doc/ecu.man doc/proc.man
  63. X
  64. Xcpio: shar.fls
  65. X    @echo Making /tmp/$(ECUSHARNAME)cpio.Z
  66. X    cd doc;make
  67. X    rm -f /tmp/ecu.cpio.fls
  68. X    cat shar.fls > /tmp/ecu.cpio.fls
  69. X    echo doc/ecu.man >> /tmp/ecu.cpio.fls
  70. X    echo doc/proc.man >> /tmp/ecu.cpio.fls
  71. X    sed -e 's:^:ecu/:' < /tmp/ecu.cpio.fls > cpio.fls
  72. X    rm -f /tmp/ecu.cpio.fls
  73. X    cd ..;cat ecu/cpio.fls | sort -y | cpio -oc | \
  74. X         compress > /tmp/$(ECUSHARNAME)cpio.Z
  75. X    zcat /tmp/$(ECUSHARNAME)cpio.Z | cpio -itv | head
  76. X
  77. X# tools for making ecu
  78. Xafterlint: afterlint.c
  79. X    cc -O afterlint.c -o $@
  80. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $@; fi
  81. X    strip $@
  82. X
  83. Xmkoldproto: mkoldproto.l
  84. X    lex mkoldproto.l
  85. X    cc -O lex.yy.c -ll -o $@
  86. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $@; fi
  87. X    strip $@
  88. X    rm lex.yy.?
  89. X
  90. X# lint is outdated old biddy, but is worth consulting once per millineum
  91. X# hack LINT_ARGS into your config.local file
  92. Xlint.out: Makefile $(SRC)
  93. X    lint $(LINT_ARGS) $(SRC) > lint.out
  94. X
  95. Xneat:
  96. X    rm -f core tags cscope.out makedate.c makedate.o
  97. X    rm -f *~ *# *.orig *.rej make.log a.out
  98. X    rm -f */*~ */*# */*.orig */*.rej
  99. X    rm -f makedirs kbdtest kbdtest3
  100. X    rm -f bperr/bperr shar.fls cpio.fls /tmp/ecu.cpio.fls
  101. X    rm -f .make.* depend.tmp eddep.tmp Makefile.new *.bak *.BAK
  102. X    cd help; $(MAKE) -$(MAKEFLAGS) neat
  103. X    cd z; $(MAKE) -$(MAKEFLAGS) neat
  104. X    cd sea; $(MAKE) -$(MAKEFLAGS) neat
  105. X    if [ $(USE_ECUUNGETTY) = yes ]; then \
  106. X        cd ecuungetty; $(MAKE) -$(MAKEFLAGS) neat; \
  107. X    fi
  108. X
  109. Xclean: neat
  110. X    rm -f $(OBJ) makedirs.o
  111. X    rm -f config kbdtest kbdtest3 makedirs afterlint mkoldproto
  112. X    cd help; $(MAKE) -$(MAKEFLAGS) clean
  113. X    cd z; $(MAKE) -$(MAKEFLAGS) clean
  114. X    cd sea; $(MAKE) -$(MAKEFLAGS) clean
  115. X    if [ $(USE_ECUUNGETTY) = yes ]; then \
  116. X        cd ecuungetty; $(MAKE) -$(MAKEFLAGS) clean; \
  117. X    fi
  118. X    -if [ -f gendial/Makefile ]; then \
  119. X        cd gendial; $(MAKE) -$(MAKEFLAGS) clean; \
  120. X    fi
  121. X    -if [ -f timetest/Makefile ]; then \
  122. X        cd timetest; $(MAKE) -$(MAKEFLAGS) clean; \
  123. X    fi
  124. X
  125. Xclobber: clean
  126. X    rm -f $(PROGRAM) $(PROGRAM)~
  127. X    rm -f kbdtest3.out
  128. X    cd help; $(MAKE) -$(MAKEFLAGS) clobber
  129. X    cd z; $(MAKE) -$(MAKEFLAGS) clobber
  130. X    cd sea; $(MAKE) -$(MAKEFLAGS) clobber
  131. X    if [ $(USE_ECUUNGETTY) = yes ]; then \
  132. X        cd ecuungetty; $(MAKE) -$(MAKEFLAGS) clobber; \
  133. X    fi
  134. X
  135. X#regenerate .o:.h dependencies automatically
  136. Xdepend:
  137. X    rm -f depend.tmp
  138. X    if test '$(SRC)' ;\
  139. X    then (grep '^#include' $(SRC) \
  140. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  141. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  142. X        -e 's?\(.*\)\.c?\1.o?'\
  143. X     >> depend.tmp) ;\
  144. X    fi
  145. X
  146. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  147. X    echo '.+1,$$d' >>eddep.tmp
  148. X    echo 'r depend.tmp' >> eddep.tmp
  149. X    echo 'w' >> eddep.tmp
  150. X    cp Makefile Makefile.new
  151. X    ed Makefile.new < eddep.tmp
  152. X    rm eddep.tmp depend.tmp
  153. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  154. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  155. X    echo '# see make depend above'>>Makefile.new
  156. X    mv Makefile Makefile.bak
  157. X    mv Makefile.new Makefile
  158. X    cd help; $(MAKE) -$(MAKEFLAGS) depend
  159. X    cd z; $(MAKE) -$(MAKEFLAGS) depend
  160. X    cd sea; $(MAKE) -$(MAKEFLAGS) depend
  161. X    if [ $(USE_ECUUNGETTY) = yes ]; then \
  162. X        cd ecuungetty; $(MAKE) -$(MAKEFLAGS) depend; \
  163. X    fi
  164. X
  165. X# DO NOT DELETE THIS LINE
  166. X# DEPENDENCIES MUST END AT END OF FILE
  167. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  168. X# see make depend above
  169. SHAR_EOF
  170. echo 'File Make.src is complete' &&
  171. chmod 0644 Make.src ||
  172. echo 'restore of Make.src failed'
  173. Wc_c="`wc -c < 'Make.src'`"
  174. test 9934 -eq "$Wc_c" ||
  175.     echo 'Make.src: original size 9934, current size' "$Wc_c"
  176. rm -f _shar_wnt_.tmp
  177. fi
  178. # ============= ecufriend/Make.src ==============
  179. if test ! -d 'ecufriend'; then
  180.     echo 'x - creating directory ecufriend'
  181.     mkdir 'ecufriend'
  182. fi
  183. if test -f 'ecufriend/Make.src' -a X"$1" != X"-c"; then
  184.     echo 'x - skipping ecufriend/Make.src (File already exists)'
  185.     rm -f _shar_wnt_.tmp
  186. else
  187. > _shar_wnt_.tmp
  188. echo 'x - extracting ecufriend/Make.src (Text)'
  189. sed 's/^X//' << 'SHAR_EOF' > 'ecufriend/Make.src' &&
  190. X#----------------------------------------------------------------
  191. X# Makefile for sample ecufriend
  192. X# wht@n4hgf.Mt-Park.GA.US
  193. X#----------------------------------------------------------------
  194. X#+:EDITS:*/
  195. X#:09-10-1992-13:58-wht@n4hgf-ECU release 3.20
  196. X#:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA
  197. X#:08-26-1991-05:59-wht@n4hgf2-default target was .o not executable
  198. X#:07-25-1991-12:56-wht@n4hgf-ECU release 3.10
  199. X#:04-21-1991-12:05-wht@n4hgf-convert to Make.src
  200. X
  201. XSHELL = /bin/sh
  202. XPROGRAM = ecufriend
  203. X
  204. X.SUFFIXES:
  205. X.SUFFIXES: .c .o .h
  206. X
  207. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  208. X
  209. XOBJ = $(PROGRAM).o
  210. X
  211. Xall: $(PROGRAM)
  212. X
  213. X$(PROGRAM): $(OBJ)
  214. X    $(BINTIME) $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
  215. X
  216. X$(OBJ): Makefile
  217. X$(OBJ): ../ecushm.h
  218. X
  219. Xclean:
  220. X    rm -f $(OBJ) core Makefile.bak tags cscope.out
  221. X
  222. Xclobber: clean
  223. X    rm -f $(PROGRAM)
  224. X
  225. SHAR_EOF
  226. chmod 0644 ecufriend/Make.src ||
  227. echo 'restore of ecufriend/Make.src failed'
  228. Wc_c="`wc -c < 'ecufriend/Make.src'`"
  229. test 810 -eq "$Wc_c" ||
  230.     echo 'ecufriend/Make.src: original size 810, current size' "$Wc_c"
  231. rm -f _shar_wnt_.tmp
  232. fi
  233. # ============= ecuungetty/Make.src ==============
  234. if test ! -d 'ecuungetty'; then
  235.     echo 'x - creating directory ecuungetty'
  236.     mkdir 'ecuungetty'
  237. fi
  238. if test -f 'ecuungetty/Make.src' -a X"$1" != X"-c"; then
  239.     echo 'x - skipping ecuungetty/Make.src (File already exists)'
  240.     rm -f _shar_wnt_.tmp
  241. else
  242. > _shar_wnt_.tmp
  243. echo 'x - extracting ecuungetty/Make.src (Text)'
  244. sed 's/^X//' << 'SHAR_EOF' > 'ecuungetty/Make.src' &&
  245. X#+---------------------------------------------------------------
  246. X# Makefile for ecuungetty
  247. X# wht@n4hgf.Mt-Park.GA.US
  248. X#
  249. X# must be root to run make install
  250. X#----------------------------------------------------------------
  251. X#+:EDITS:*/
  252. X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  253. X#:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA
  254. X#:02-10-1992-05:47-wht@n4hgf-mcs avail on some systems when non-COFF produced
  255. X#:07-25-1991-12:57-wht@n4hgf-ECU release 3.10
  256. X#:04-21-1991-12:05-wht@n4hgf-convert to Make.src
  257. X
  258. XSHELL = /bin/sh
  259. XPROGRAM = ecuungetty
  260. XINSTALLABLE = $(ECULIBDIR)/$(PROGRAM)
  261. X
  262. X.SUFFIXES:
  263. X.SUFFIXES: .c .o .h
  264. X
  265. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  266. X
  267. XSRC = \
  268. X    ecuungetty.c
  269. X
  270. XOBJ = \
  271. X    ../ecuuclc.o\
  272. X    ../ecuLCK.o\
  273. X    ../utmpstat.o\
  274. X    ../bamboozle.o\
  275. X    ../ttynaming.o\
  276. X    ecuungetty.o
  277. X
  278. Xall: $(PROGRAM)
  279. X
  280. X$(PROGRAM): $(OBJ)
  281. X    $(BINTIME) $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
  282. X
  283. X$(OBJ): Makefile
  284. X
  285. Xinstall: $(PROGRAM)
  286. X    ../makedirs -m 755 $(ECULIBDIR)
  287. X    rm -f $(INSTALLABLE)
  288. X    if [ -f $(INSTALLABLE) ]; then mv $(INSTALLABLE) $(INSTALLABLE)~; fi
  289. X    cp $(PROGRAM) $(INSTALLABLE)
  290. X    strip $(INSTALLABLE)
  291. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $(INSTALLABLE); fi
  292. X    chown root $(INSTALLABLE)
  293. X    chgrp bin $(INSTALLABLE)
  294. X    chmod 4711 $(INSTALLABLE)
  295. X
  296. Xneat:
  297. X    rm -f .make.* depend.tmp eddep.tmp Makefile.new *.bak *.BAK
  298. X    rm -f core tags cscope.out
  299. X    -rm -f *~ *# *.orig *.rej make.log a.out
  300. X
  301. Xclean: neat
  302. X    rm -f $(PROGRAM).o
  303. X
  304. Xclobber: clean
  305. X    rm -f $(PROGRAM)
  306. X
  307. X../bamboozle.o: ../bamboozle.c
  308. X    cd ..;make bamboozle.o
  309. X
  310. X../utmpstat.o: ../utmpstat.c
  311. X    cd ..;make utmpstat.o
  312. X
  313. X../ecuuclc.o: ../ecuuclc.c
  314. X    cd ..;make ecuuclc.o
  315. X
  316. X../ecuLCK.o: ../ecuLCK.c
  317. X    cd ..;make ecuLCK.o
  318. X
  319. X../ttynaming.o: ../ttynaming.c
  320. X    cd ..;make ttynaming.o
  321. X
  322. X#regenerate .o:.h dependencies automatically
  323. Xdepend:
  324. X    rm -f depend.tmp
  325. X    if test '$(SRC)' ;\
  326. X    then (grep '^#include' $(SRC) \
  327. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  328. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  329. X        -e 's?\(.*\)\.c?\1.o?'\
  330. X     >> depend.tmp) ;\
  331. X    fi
  332. X
  333. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  334. X    echo '.+1,$$d' >>eddep.tmp
  335. X    echo 'r depend.tmp' >> eddep.tmp
  336. X    echo 'w' >> eddep.tmp
  337. X    cp Makefile Makefile.new
  338. X    ed Makefile.new < eddep.tmp
  339. X    rm eddep.tmp depend.tmp
  340. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  341. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  342. X    echo '# see make depend above'>>Makefile.new
  343. X    mv Makefile Makefile.bak
  344. X    mv Makefile.new Makefile
  345. X
  346. X# DO NOT DELETE THIS LINE
  347. X# DEPENDENCIES MUST END AT END OF FILE
  348. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  349. X# see make depend above
  350. SHAR_EOF
  351. chmod 0644 ecuungetty/Make.src ||
  352. echo 'restore of ecuungetty/Make.src failed'
  353. Wc_c="`wc -c < 'ecuungetty/Make.src'`"
  354. test 2527 -eq "$Wc_c" ||
  355.     echo 'ecuungetty/Make.src: original size 2527, current size' "$Wc_c"
  356. rm -f _shar_wnt_.tmp
  357. fi
  358. # ============= gendial/Make.src ==============
  359. if test ! -d 'gendial'; then
  360.     echo 'x - creating directory gendial'
  361.     mkdir 'gendial'
  362. fi
  363. if test -f 'gendial/Make.src' -a X"$1" != X"-c"; then
  364.     echo 'x - skipping gendial/Make.src (File already exists)'
  365.     rm -f _shar_wnt_.tmp
  366. else
  367. > _shar_wnt_.tmp
  368. echo 'x - extracting gendial/Make.src (Text)'
  369. sed 's/^X//' << 'SHAR_EOF' > 'gendial/Make.src' &&
  370. X#+-------------------------------------------------------------------
  371. X# ECU generic dialer makefile
  372. X# wht@n4hgf.Mt-Park.GA.US
  373. X#
  374. X# you must be root to run this
  375. X# edit PROGRAMS to choose the dialers you want
  376. X#--------------------------------------------------------------------
  377. X#+:EDITS:*/
  378. X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  379. X#:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA
  380. X#:07-27-1992-05:04-wht@n4hgf-fix COMMON_OBJ misdeclaration
  381. X#:07-17-1992-18:26-wht@n4hgf-use ../nap.o
  382. X#:05-11-1992-17:03-wht@gyro-add dialgT3000
  383. X#:01-26-1992-15:31-wht@n4hgf-gendial 1.2 for ecu 3.20- better hangup
  384. X#:07-25-1991-12:58-wht@n4hgf-ECU release 3.10
  385. X#:04-21-1991-12:05-wht@n4hgf-convert to Make.src
  386. X
  387. XPROGRAMS = \
  388. X    dialgHA24 
  389. X#    dialgHA24 \
  390. X#    dialgMC9624 \
  391. X#    dialgMPAD \
  392. X#    dialgT2500 \
  393. X#    dialgT3000 \
  394. X#    dialgTBPlus \
  395. X#    dialgUSR24
  396. X
  397. XSHELL = /bin/sh
  398. X
  399. XCFLAGS_EXTRA = -DHDB_UUCP
  400. X
  401. X.SUFFIXES:
  402. X.SUFFIXES: .c .o .h
  403. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  404. X
  405. XSRC = \
  406. X    dceHA24.c \
  407. X    dceMC9624.c \
  408. X    dceMPAD.c \
  409. X    dceT2500.c \
  410. X    dceT3000.c \
  411. X    dceTBPlus.c \
  412. X    dceUSR24.c \
  413. X    gendial.c
  414. X
  415. XCOMMON_OBJ = \
  416. X    ../nap.o \
  417. X    gendial.o
  418. X
  419. Xall:    $(PROGRAMS)
  420. X
  421. XdialgMC9624: $(COMMON_OBJ) dceMC9624.o
  422. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceMC9624.o $(LIBS) -o $@
  423. X
  424. XdceTBPlus.o: tbit.sync.h
  425. XdialgTBPlus: $(COMMON_OBJ) dceTBPlus.o
  426. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceTBPlus.o $(LIBS) -o $@
  427. X
  428. XdceT2500.o: tbit.sync.h
  429. XdialgT2500: $(COMMON_OBJ) dceT2500.o
  430. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceT2500.o $(LIBS) -o $@
  431. X
  432. XdceT3000.o: tbit.sync.h
  433. XdialgT3000: $(COMMON_OBJ) dceT3000.o
  434. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceT3000.o $(LIBS) -o $@
  435. X
  436. XdialgHA24: $(COMMON_OBJ) dceHA24.o
  437. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceHA24.o $(LIBS) -o $@
  438. X
  439. XdialgUSR24: $(COMMON_OBJ) dceUSR24.o
  440. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceUSR24.o $(LIBS) -o $@
  441. X
  442. XdialgMPAD: $(COMMON_OBJ) dceMPAD.o
  443. X    $(BINTIME) $(CC) $(LDFLAGS) $(COMMON_OBJ) dceMPAD.o $(LIBS) -o $@
  444. X
  445. X../nap.o:
  446. X    cd ..;make nap.o
  447. X
  448. Xinstall: $(PROGRAMS)
  449. X    -chmod +x ./install_dialer
  450. X    ./install_dialer $(HDBLIBDIR) $(PROGRAMS)
  451. X
  452. Xneat:
  453. X    rm -f .make.* *.tmp Makefile.new *.bak *.BAK
  454. X    rm -f core tags cscope.out
  455. X
  456. Xclean: neat
  457. X    rm -f *.o
  458. X
  459. Xclobber: clean
  460. X    rm -f dialg*
  461. X
  462. X#regenerate .o:.h dependencies automatically
  463. Xdepend:
  464. X    rm -f depend.tmp
  465. X    if test '$(SRC)' ;\
  466. X    then (grep '^#include' $(SRC) \
  467. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  468. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  469. X        -e 's?\(.*\)\.c?\1.o?'\
  470. X     >> depend.tmp) ;\
  471. X    fi
  472. X
  473. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  474. X    echo '.+1,$$d' >>eddep.tmp
  475. X    echo 'r depend.tmp' >> eddep.tmp
  476. X    echo 'w' >> eddep.tmp
  477. X    cp Makefile Makefile.new
  478. X    ed Makefile.new < eddep.tmp
  479. X    rm eddep.tmp depend.tmp
  480. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  481. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  482. X    echo '# see make depend above'>>Makefile.new
  483. X    mv Makefile Makefile.bak
  484. X    mv Makefile.new Makefile
  485. X
  486. X# DO NOT DELETE THIS LINE
  487. X# see make depend above
  488. SHAR_EOF
  489. chmod 0644 gendial/Make.src ||
  490. echo 'restore of gendial/Make.src failed'
  491. Wc_c="`wc -c < 'gendial/Make.src'`"
  492. test 2943 -eq "$Wc_c" ||
  493.     echo 'gendial/Make.src: original size 2943, current size' "$Wc_c"
  494. rm -f _shar_wnt_.tmp
  495. fi
  496. # ============= help/Make.src ==============
  497. if test ! -d 'help'; then
  498.     echo 'x - creating directory help'
  499.     mkdir 'help'
  500. fi
  501. if test -f 'help/Make.src' -a X"$1" != X"-c"; then
  502.     echo 'x - skipping help/Make.src (File already exists)'
  503.     rm -f _shar_wnt_.tmp
  504. else
  505. > _shar_wnt_.tmp
  506. echo 'x - extracting help/Make.src (Text)'
  507. sed 's/^X//' << 'SHAR_EOF' > 'help/Make.src' &&
  508. X#  CHK=0xFF6D
  509. X#+---------------------------------------------------------------
  510. X# Makefile for helpgen (ecu help system)
  511. X#----------------------------------------------------------------
  512. X#+:EDITS:*/
  513. X#:09-10-1992-13:59-wht@n4hgf-ECU release 3.20
  514. X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  515. X#:07-25-1991-12:58-wht@n4hgf-ECU release 3.10
  516. X#:04-21-1991-13:31-wht@n4hgf-convert to Make.src
  517. X
  518. XSHELL = /bin/sh
  519. XPROGRAM = helpgen
  520. X
  521. X.SUFFIXES:
  522. X.SUFFIXES: .c .o .h .src .data
  523. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  524. X
  525. XSRC    = \
  526. X    $(PROGRAM).c\
  527. X    util.c
  528. X
  529. XOBJ    = \
  530. X    $(PROGRAM).o\
  531. X    util.o
  532. X
  533. Xall: $(PROGRAM) ecuhelp.data # ecuhelp.doc
  534. X
  535. X$(PROGRAM): $(OBJ)
  536. X    $(BINTIME) $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $(PROGRAM) 
  537. X
  538. X$(OBJ): Makefile
  539. X
  540. Xecuhelp.data: ecuhelp.src $(PROGRAM)
  541. X    ./$(PROGRAM) -b
  542. X
  543. Xecuhelp.doc: ecuhelp.src $(PROGRAM)
  544. X    ./$(PROGRAM) -d
  545. X
  546. X$(PROGRAM).fls: Makefile
  547. X    ls $(SRC) >$(PROGRAM).fls
  548. X
  549. Xinstall: $(PROGRAM) ecuhelp.data # ecuhelp.doc
  550. X    ../makedirs -m 755 $(ECULIBDIR)
  551. X    rm -f  $(ECULIBDIR)/ecuhelp.data
  552. X    cp ecuhelp.data $(ECULIBDIR)/ecuhelp.data
  553. X    chown bin $(ECULIBDIR)/ecuhelp.data
  554. X    chgrp bin $(ECULIBDIR)/ecuhelp.data
  555. X    chmod 644 $(ECULIBDIR)/ecuhelp.data
  556. X
  557. Xneat:
  558. X    rm -f .make.* depend.tmp eddep.tmp Makefile.new *.bak *.BAK
  559. X    rm -f core tags cscope.out
  560. X    -rm -f *~ *# *.orig *.rej make.log a.out
  561. X
  562. Xclean: neat
  563. X    rm -f $(OBJ)
  564. X
  565. Xclobber: clean
  566. X    rm -f $(PROGRAM) ecuhelp.data ecuhelp.doc
  567. X
  568. X#MSC -Zg is broken and even my kludge mechanism can't make this one
  569. X#anymore.  Decommitted until some future day.
  570. X#protos: $(PROGRAM).fls
  571. X#    echo > protos.h
  572. X#    csh ../zgcc $(PROGRAM).fls protos.h ..
  573. X
  574. X#
  575. X# MAKE DEPEND: regenerate .c:.h, .ol:.c, .ol:.asm dependencies automatically
  576. X#
  577. Xdepend:
  578. X    rm -f depend.tmp
  579. X    if test '$(SRC)' ;\
  580. X    then (grep '^#include' $(SRC) \
  581. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  582. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  583. X        -e 's?\(.*\)\.c?\1.o?'\
  584. X     >> depend.tmp) ;\
  585. X    fi
  586. X
  587. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  588. X    echo '.+1,$$d' >>eddep.tmp
  589. X    echo 'r depend.tmp' >> eddep.tmp
  590. X    echo 'w' >> eddep.tmp
  591. X    cp Makefile Makefile.new
  592. X    ed Makefile.new < eddep.tmp
  593. X    rm eddep.tmp depend.tmp
  594. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  595. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  596. X    echo '# see make depend above'>>Makefile.new
  597. X    mv Makefile Makefile.bak
  598. X    mv Makefile.new Makefile
  599. X
  600. X# DO NOT DELETE THIS LINE
  601. X# DEPENDENCIES MUST END AT END OF FILE
  602. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  603. X# see make depend above
  604. SHAR_EOF
  605. chmod 0644 help/Make.src ||
  606. echo 'restore of help/Make.src failed'
  607. Wc_c="`wc -c < 'help/Make.src'`"
  608. test 2437 -eq "$Wc_c" ||
  609.     echo 'help/Make.src: original size 2437, current size' "$Wc_c"
  610. rm -f _shar_wnt_.tmp
  611. fi
  612. # ============= sea/Make.src ==============
  613. if test ! -d 'sea'; then
  614.     echo 'x - creating directory sea'
  615.     mkdir 'sea'
  616. fi
  617. if test -f 'sea/Make.src' -a X"$1" != X"-c"; then
  618.     echo 'x - skipping sea/Make.src (File already exists)'
  619.     rm -f _shar_wnt_.tmp
  620. else
  621. > _shar_wnt_.tmp
  622. echo 'x - extracting sea/Make.src (Text)'
  623. sed 's/^X//' << 'SHAR_EOF' > 'sea/Make.src' &&
  624. X#  CHK=0x8F7A
  625. X#+----------------------------------------------------------
  626. X# Makefile for ecusea
  627. X# wht@n4hgf.Mt-Park.GA.US
  628. X#-----------------------------------------------------------
  629. X#+:EDITS:*/
  630. X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
  631. X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  632. X#:08-21-1992-15:04-wht@n4hgf-executable goes to lib dir
  633. X#:07-17-1992-18:26-wht@n4hgf-use ../nap.o
  634. X#:02-10-1992-05:47-wht@n4hgf-mcs avail on some systems when non-COFF produced
  635. X#:07-25-1991-12:59-wht@n4hgf-ECU release 3.10
  636. X#:04-21-1991-12:05-wht@n4hgf-convert to Make.src
  637. X
  638. XSHELL = /bin/sh
  639. XPROGRAM = ecusea
  640. XINSTALLABLE = $(ECULIBDIR)/$(PROGRAM)
  641. X
  642. X.SUFFIXES:
  643. X.SUFFIXES: .c .o .h
  644. X
  645. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  646. X
  647. XSRC = \
  648. X    ecusea.c\
  649. X    scurses.c
  650. X
  651. XOBJ = \
  652. X    ecusea.o\
  653. X    scurses.o\
  654. X    ../nap.o
  655. X
  656. Xall: $(PROGRAM)
  657. X
  658. X$(PROGRAM): $(OBJ) Makefile
  659. X    $(BINTIME) $(CC) -o $@ $(LDFLAGS) $(OBJ) $(LIBS)
  660. X
  661. X$(OBJ): Makefile
  662. X
  663. X../nap.o:
  664. X    cd ..;make nap.o
  665. X
  666. X../makedirs:
  667. X    cd ..;make makedirs
  668. X
  669. Xinstall: ../makedirs $(PROGRAM)
  670. X    ../makedirs -m 755 $(ECULIBDIR)
  671. X    rm -f $(INSTALLABLE) $(INSTALLABLE)~
  672. X    if [ -f $(INSTALLABLE) ]; then mv $(INSTALLABLE) $(INSTALLABLE)~; fi
  673. X    cp $(PROGRAM) $(INSTALLABLE)
  674. X    strip $(INSTALLABLE)
  675. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $(INSTALLABLE); fi
  676. X    chown bin $(INSTALLABLE)
  677. X    chgrp bin $(INSTALLABLE)
  678. X    chmod 711 $(INSTALLABLE)
  679. X
  680. Xneat:
  681. X    rm -f .make.* depend.tmp eddep.tmp Makefile.new *.bak *.BAK
  682. X    rm -f core tags cscope.out
  683. X    -rm -f *~ *# *.orig *.rej make.log a.out
  684. X
  685. Xclean: neat
  686. X    rm -f $(OBJ)
  687. X
  688. Xclobber: clean
  689. X    rm -f $(PROGRAM)
  690. X
  691. X$(PROGRAM).fls: Makefile
  692. X    ls $(SRC) >$(PROGRAM).fls
  693. X
  694. Xprotos: $(PROGRAM).fls
  695. X    echo > protos.h
  696. X    csh ../zgcc $(PROGRAM).fls protos.h .. -DSIGTYPE=$(SIGTYPE)
  697. X
  698. X#regenerate .o:.h dependencies automatically
  699. Xdepend:
  700. X    rm -f depend.tmp
  701. X    if test '$(SRC)' ;\
  702. X    then (grep '^#include' $(SRC) \
  703. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  704. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  705. X        -e 's?\(.*\)\.c?\1.o?'\
  706. X     >> depend.tmp) ;\
  707. X    fi
  708. X
  709. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  710. X    echo '.+1,$$d' >>eddep.tmp
  711. X    echo 'r depend.tmp' >> eddep.tmp
  712. X    echo 'w' >> eddep.tmp
  713. X    cp Makefile Makefile.new
  714. X    ed Makefile.new < eddep.tmp
  715. X    rm eddep.tmp depend.tmp
  716. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  717. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  718. X    echo '# see make depend above'>>Makefile.new
  719. X    mv Makefile Makefile.bak
  720. X    mv Makefile.new Makefile
  721. X
  722. X# DO NOT DELETE THIS LINE
  723. X
  724. SHAR_EOF
  725. chmod 0644 sea/Make.src ||
  726. echo 'restore of sea/Make.src failed'
  727. Wc_c="`wc -c < 'sea/Make.src'`"
  728. test 2416 -eq "$Wc_c" ||
  729.     echo 'sea/Make.src: original size 2416, current size' "$Wc_c"
  730. rm -f _shar_wnt_.tmp
  731. fi
  732. # ============= z/Make.src ==============
  733. if test ! -d 'z'; then
  734.     echo 'x - creating directory z'
  735.     mkdir 'z'
  736. fi
  737. if test -f 'z/Make.src' -a X"$1" != X"-c"; then
  738.     echo 'x - skipping z/Make.src (File already exists)'
  739.     rm -f _shar_wnt_.tmp
  740. else
  741. > _shar_wnt_.tmp
  742. echo 'x - extracting z/Make.src (Text)'
  743. sed 's/^X//' << 'SHAR_EOF' > 'z/Make.src' &&
  744. X#  CHK=0xC8A5
  745. X#+-------------------------------------------------------------------
  746. X# Makefile for ecurz/ecusz (ecu file transfer)
  747. X# wht@n4hgf.Mt-Park.GA.US
  748. X#--------------------------------------------------------------------
  749. X#+:EDITS:*/
  750. X#:09-10-1992-14:00-wht@n4hgf-ECU release 3.20
  751. X#:08-22-1992-15:39-wht@n4hgf-ECU release 3.20 BETA
  752. X#:08-21-1992-15:04-wht@n4hgf-executables goes to lib dir
  753. X#:07-17-1992-18:26-wht@n4hgf-use ../nap.o
  754. X#:02-10-1992-05:47-wht@n4hgf-mcs avail on some systems when non-COFF produced
  755. X#:08-06-1991-15:28-wht@n4hgf-neat used wrong rm args
  756. X#:07-25-1991-12:59-wht@n4hgf-ECU release 3.10
  757. X#:04-21-1991-12:05-wht@n4hgf-convert to Make.src
  758. X
  759. XSHELL = /bin/sh
  760. XINSTALLED_SZ = $(ECULIBDIR)/ecusz
  761. XINSTALLED_RZ = $(ECULIBDIR)/ecurz
  762. X
  763. X.SUFFIXES:
  764. X.SUFFIXES: .c .o .h
  765. X
  766. X.c.o:;    $(BINTIME) $(CC) -c $(CFLAGS) $*.c 
  767. XCFLAGS_EXTRA = -DMD -DREADCHECK -DLOG_XFER
  768. X
  769. X
  770. XCOM_SRC = \
  771. X    zcommon.c\
  772. X    zmodem.c\
  773. X    zcurses.c\
  774. X    baudtest.c\
  775. X    zdebug.c
  776. X
  777. XCOM_OBJ = \
  778. X    zcommon.o\
  779. X    zmodem.o\
  780. X    zcurses.o\
  781. X    baudtest.o\
  782. X    ../logevent.o\
  783. X    ../nap.o
  784. X
  785. Xall: ecusz ecurz
  786. X
  787. Xecusz: ecusz.o $(COM_OBJ)
  788. X    echo 'char *makedate="@(#)ecusz '`date` $(SYSTEM)'";'  >ecuszmake.c
  789. X    $(CC) -c $(CFLAGS) ecuszmake.c ; rm ecuszmake.c
  790. X    $(BINTIME) $(CC) -o $@ $(LDFLAGS) ecusz.o ecuszmake.o $(COM_OBJ) $(LIBS)
  791. X    rm -f ecuszmake.o
  792. X
  793. Xecurz: ecurz.o $(COM_OBJ)
  794. X    echo 'char *makedate="@(#)ecurz '`date` $(SYSTEM)'";'  >ecurzmake.c
  795. X    $(CC) -c $(CFLAGS) ecurzmake.c ; rm ecurzmake.c
  796. X    $(BINTIME) $(CC) -o $@ $(LDFLAGS) ecurz.o ecurzmake.o $(COM_OBJ) $(LIBS) 
  797. X    rm -f ecurzmake.o
  798. X
  799. Xecusz.o ecurz.o $(COM_OBJ): Makefile
  800. X
  801. X../makedirs:
  802. X    cd ..;make makedirs
  803. X
  804. Xinstall: ../makedirs ecusz ecurz
  805. X    ../makedirs -m 755 $(ECULIBDIR)
  806. X    rm -f $(INSTALLED_SZ) $(INSTALLED_SZ)~
  807. X    if [ -f $(INSTALLED_SZ) ]; then mv $(INSTALLED_SZ) $(INSTALLED_SZ)~; fi
  808. X    cp ecusz $(INSTALLED_SZ)
  809. X    strip $(INSTALLED_SZ)
  810. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $(INSTALLED_SZ); fi
  811. X    chown bin $(INSTALLED_SZ)
  812. X    chgrp bin $(INSTALLED_SZ)
  813. X    chmod 711 $(INSTALLED_SZ)
  814. X    rm -f $(INSTALLED_RZ) $(INSTALLED_RZ)~
  815. X    if [ -f $(INSTALLED_RZ) ]; then mv $(INSTALLED_RZ) $(INSTALLED_RZ)~; fi
  816. X    cp ecurz $(INSTALLED_RZ)
  817. X    strip $(INSTALLED_RZ)
  818. X    -if [ -x /usr/bin/mcs ]; then /usr/bin/mcs -d $(INSTALLED_RZ); fi
  819. X    chown bin $(INSTALLED_RZ)
  820. X    chgrp bin $(INSTALLED_RZ)
  821. X    chmod 711 $(INSTALLED_RZ)
  822. X
  823. Xneat:
  824. X    rm -f .make.* depend.tmp eddep.tmp Makefile.new *.bak *.BAK
  825. X    rm -f core tags cscope.out
  826. X    rm -f ecuszmake.c ecuszmake.o ecurzmake.c ecurzmake.o
  827. X    -rm -f *~ *# *.orig *.rej make.log a.out
  828. X
  829. Xclean: neat
  830. X    rm -f *.o
  831. X
  832. Xclobber: clean
  833. X    rm -f ecusz ecurz
  834. X
  835. Xcomsrc.fls: Makefile
  836. X    ls $(COM_SRC) > comsrc.fls
  837. X
  838. Xprotos: comsrc.fls
  839. X    echo ' ' > protos.h
  840. X    csh ../zgcc comsrc.fls protos.h ..
  841. X
  842. X../logevent.o:
  843. X    cd ..;make logevent.o
  844. X
  845. X../nap.o:
  846. X    cd ..;make nap.o
  847. X
  848. X#
  849. X# MAKE DEPEND: regenerate .c:.h, .ol:.c, .ol:.asm dependencies automatically
  850. X#
  851. Xdepend:
  852. X    rm -f depend.tmp
  853. X    if test '$(COM_SRC)' ;\
  854. X    then (grep '^#include' $(COM_SRC) \
  855. X    | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  856. X        -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  857. X        -e 's?\(.*\)\.c?\1.o?'\
  858. X     >> depend.tmp) ;\
  859. X    fi
  860. X
  861. X    echo '/^# DO NOT DELETE THIS LINE' >eddep.tmp
  862. X    echo '.+1,$$d' >>eddep.tmp
  863. X    echo 'r depend.tmp' >> eddep.tmp
  864. X    echo 'w' >> eddep.tmp
  865. X    cp Makefile Makefile.new
  866. X    ed Makefile.new < eddep.tmp
  867. X    rm eddep.tmp depend.tmp
  868. X    echo '# DEPENDENCIES MUST END AT END OF FILE' >>Makefile.new
  869. X    echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  870. X    echo '# see make depend above'>>Makefile.new
  871. X    mv Makefile Makefile.bak
  872. X    mv Makefile.new Makefile
  873. X
  874. X# DO NOT DELETE THIS LINE
  875. X# DEPENDENCIES MUST END AT END OF FILE
  876. X# IF YOU PUT STUFF HERE IT WILL GO AWAY
  877. X# see make depend above
  878. SHAR_EOF
  879. chmod 0644 z/Make.src ||
  880. echo 'restore of z/Make.src failed'
  881. Wc_c="`wc -c < 'z/Make.src'`"
  882. test 3601 -eq "$Wc_c" ||
  883.     echo 'z/Make.src: original size 3601, current size' "$Wc_c"
  884. rm -f _shar_wnt_.tmp
  885. fi
  886. # ============= afterlint.c ==============
  887. if test -f 'afterlint.c' -a X"$1" != X"-c"; then
  888.     echo 'x - skipping afterlint.c (File already exists)'
  889.     rm -f _shar_wnt_.tmp
  890. else
  891. > _shar_wnt_.tmp
  892. echo 'x - extracting afterlint.c (Text)'
  893. sed 's/^X//' << 'SHAR_EOF' > 'afterlint.c' &&
  894. X/* CHK=0xC2C5 */
  895. Xchar *rev = "1.20";
  896. X/*+-------------------------------------------------------------------------
  897. X    afterlint.c -- process MSC -Zg output (for *some* MSC versions)
  898. X
  899. XThis works for ecu but maybe not other code collections;
  900. Xreturning a typedefed but unnamed structure (or pointer)
  901. Xwill, for instance, produce bad output.
  902. X
  903. XUse with zgcc.
  904. X--------------------------------------------------------------------------*/
  905. X/*+:EDITS:*/
  906. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  907. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  908. X/*:01-21-1992-03:03-wht@n4hgf-better handling of commented items with UNNAMED */
  909. X/*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  910. X/*:01-09-1991-22:31-wht@n4hgf-ISC port */
  911. X/*:11-18-1990-21:15-wht@n4hgf-clobber 'extern  ' in prototypes */
  912. X/*:07-13-1988-19:50-wht-creation */
  913. X
  914. X# include <stdio.h>
  915. X# include <sys/types.h>
  916. X
  917. X#ifdef BSD
  918. X# include <sys/time.h>
  919. X#define strchr index
  920. X#define strrchr rindex
  921. Xchar *index();
  922. Xchar *rindex();
  923. X/*************************/
  924. X#else    /* assuming SYSV */
  925. X/*************************/
  926. X# include <time.h>
  927. Xchar *strchr();
  928. Xchar *strrchr();
  929. X#endif    /* system dependencies */
  930. X
  931. X
  932. Xstruct tm *localtime();
  933. X
  934. X/*+-------------------------------------------------------------------------
  935. X    emit_editnote(fp)
  936. X--------------------------------------------------------------------------*/
  937. Xvoid
  938. Xemit_editnote(fp)
  939. XFILE    *fp;
  940. X{
  941. X    struct tm *ltime;
  942. X    long cur_time;
  943. X
  944. X    time(&cur_time);
  945. X    ltime = localtime(&cur_time);
  946. X
  947. X    fputs("/*+:EDITS:*/\n",fp);
  948. X    fprintf(fp,"/*:%02d-%02d-%04d-%02d:%02d-afterlint %s-creation */\n",
  949. X        ltime->tm_mon+1,ltime->tm_mday,ltime->tm_year + 1900,
  950. X        ltime->tm_hour,ltime->tm_min,rev);
  951. X
  952. X}    /* end of emit_editnote */
  953. X
  954. X/*+-------------------------------------------------------------------------
  955. X    instr(str1,str2) - is str2 contained in str1?
  956. X
  957. Xreturn 1 if so, else 0
  958. X--------------------------------------------------------------------------*/
  959. Xint
  960. Xinstr(str1,str2)
  961. Xregister char *str1;    /* the (target) string to search */
  962. Xregister char *str2;    /* the (comparand) string to search for */
  963. X{
  964. Xregister int lstr2 = strlen(str2);
  965. X
  966. X    if(lstr2 > strlen(str1))
  967. X        return(0);
  968. X    while(*str1)
  969. X    {
  970. X        if(*str1 == *str2)
  971. X        {
  972. X            if(!strncmp(str1,str2,lstr2))
  973. X                return(1);
  974. X        }
  975. X        ++str1;
  976. X    }
  977. X    return(0);
  978. X
  979. X}    /* end of instr */
  980. X
  981. X/*+-------------------------------------------------------------------------
  982. X    main(argc,argv,envp)
  983. X--------------------------------------------------------------------------*/
  984. Xmain(argc,argv,envp)
  985. Xint argc;
  986. Xchar **argv;
  987. Xchar **envp;
  988. X{
  989. X    register char *cptr;
  990. X    register FILE *fpin;
  991. X    register FILE *fpout;
  992. X    char buf[256];
  993. X    char *basename;
  994. X
  995. X    if(argc < 2)
  996. X    {
  997. X        fprintf(stderr,"usage: afterlint <infile> [<outfile>]\n");
  998. X        fprintf(stderr,"if outfile not supplied, output is to stdout\n");
  999. X        exit(1);
  1000. X    }
  1001. X
  1002. X    if(!(fpin = fopen(argv[1],"r")))
  1003. X    {
  1004. X        perror(argv[1]);
  1005. X        exit(1);
  1006. X    }
  1007. X
  1008. X    if(argc > 2)
  1009. X    {
  1010. X        if(!(fpout = fopen(argv[2],"w")))
  1011. X        {
  1012. X            perror(argv[2]);
  1013. X            exit(1);
  1014. X        }
  1015. X        basename = argv[2];
  1016. X    }
  1017. X    else
  1018. X        fpout = stdout;
  1019. X
  1020. X    fprintf(fpout,
  1021. X        "/*+-----------------------------------------------------------------------\n");
  1022. X    if(argc > 2)
  1023. X        fprintf(fpout,"\t%s\n",basename);
  1024. X    else
  1025. X        fprintf(fpout,"\tfunction declarations\n",basename);
  1026. X    fprintf(fpout,
  1027. X        "------------------------------------------------------------------------*/\n");
  1028. X
  1029. X    emit_editnote(fpout);
  1030. X    fprintf(fpout,"\n");
  1031. X    fprintf(fpout,"#ifndef BUILDING_PROTOTYPES\n");
  1032. X    fprintf(fpout,"\n/* the following should catch only SCO MSC */\n");
  1033. X    fprintf(fpout,
  1034. X        "#if defined(M_SYSV) && !defined(__GNUC__) && !defined(GNUC)\n\n");
  1035. X
  1036. X    while(fgets(buf,sizeof(buf),fpin))
  1037. X    {
  1038. X        cptr = buf;
  1039. X        if(instr(buf,"UNNAMED"))
  1040. X        {
  1041. X            cptr += 3;
  1042. X            if(strchr(cptr,'('))
  1043. X            {
  1044. X                while(*cptr != '(')
  1045. X                    fputc(*cptr++,fpout);
  1046. X                fputs("(); /* no proto (struct UNNAMED param) */\n",fpout);
  1047. X            }
  1048. X            continue;
  1049. X        }
  1050. X        if(!strncmp(buf,"/*global*/  ",12))
  1051. X            cptr += 12;
  1052. X        else if(!strncmp(buf,"extern  ",8))
  1053. X            cptr += 8;
  1054. X        else if(!strncmp(buf,"static  ",8))
  1055. X            cptr += 8;
  1056. X        fputs(cptr,fpout);
  1057. X    }
  1058. X
  1059. X    fprintf(fpout,"\n#else\t\t/* compiler doesn't know prototyping */\n\n");
  1060. X
  1061. X    fclose(fpin);
  1062. X    fpin = fopen(argv[1],"r");
  1063. X
  1064. X    while(fgets(buf,sizeof(buf),fpin))
  1065. X    {
  1066. X        cptr = buf;
  1067. X        if(instr(buf,"UNNAMED"))
  1068. X            cptr += 3;
  1069. X        else if(!strncmp(buf,"/*global*/  ",12))
  1070. X            cptr += 12;
  1071. X        else if(!strncmp(buf,"extern  ",8))
  1072. X            cptr += 8;
  1073. X        else if(!strncmp(buf,"static  ",8))
  1074. X            cptr += 8;
  1075. X        if(strchr(cptr,'('))
  1076. X        {
  1077. X            while(*cptr != '(')
  1078. X                fputc(*cptr++,fpout);
  1079. X            fputs("();\n",fpout);
  1080. X        }
  1081. X    }
  1082. X
  1083. X    fprintf(fpout,"\n#endif /* MSC considerations */\n");
  1084. X    fprintf(fpout,"#endif /* BUILDING_PROTOTYPES */\n");
  1085. X    fprintf(fpout,"\n/* end of %s */\n",
  1086. X        (argc > 2) ? basename : "function declarations");
  1087. X
  1088. X    fclose(fpin);
  1089. X    fclose(fpout);
  1090. X    exit(0);
  1091. X}    /* end of main */
  1092. X
  1093. X/* vi: set tabstop=4 shiftwidth=4: */
  1094. SHAR_EOF
  1095. chmod 0644 afterlint.c ||
  1096. echo 'restore of afterlint.c failed'
  1097. Wc_c="`wc -c < 'afterlint.c'`"
  1098. test 4839 -eq "$Wc_c" ||
  1099.     echo 'afterlint.c: original size 4839, current size' "$Wc_c"
  1100. rm -f _shar_wnt_.tmp
  1101. fi
  1102. # ============= bamboozle.c ==============
  1103. if test -f 'bamboozle.c' -a X"$1" != X"-c"; then
  1104.     echo 'x - skipping bamboozle.c (File already exists)'
  1105.     rm -f _shar_wnt_.tmp
  1106. else
  1107. > _shar_wnt_.tmp
  1108. echo 'x - extracting bamboozle.c (Text)'
  1109. sed 's/^X//' << 'SHAR_EOF' > 'bamboozle.c' &&
  1110. X/*+-------------------------------------------------------------------------
  1111. X    bamboozle.c - ecu/ecuungetty protection scheme
  1112. X    wht@n4hgf.Mt-Park.GA.US
  1113. X--------------------------------------------------------------------------*/
  1114. X/*+:EDITS:*/
  1115. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  1116. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  1117. X/*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  1118. X/*:01-09-1991-22:31-wht@n4hgf-ISC port */
  1119. X/*:01-09-1991-21:05-wht@n4hgf-no prototype for crypt if not __STDC__ */
  1120. X/*:08-14-1990-20:39-wht@n4hgf-ecu3.00-flush old edit history */
  1121. X
  1122. X#if __STDC__
  1123. Xchar *crypt(char *,char *);
  1124. X#else
  1125. Xchar *crypt();
  1126. X#endif
  1127. X
  1128. X
  1129. X/*+-------------------------------------------------------------------------
  1130. X    bamboozle(pid) - build encrypted string based on 'pid'
  1131. X
  1132. XIf crypt not used, do something pretty basic  (probably enough)
  1133. XIf you are paranoid, don't use _ANY_ of these algorithms exactly
  1134. X--------------------------------------------------------------------------*/
  1135. Xchar *
  1136. Xbamboozle(pid)
  1137. Xint pid;
  1138. X{
  1139. X#if defined(CRYPT)
  1140. Xchar pidstr[16];
  1141. Xchar *cptr;
  1142. X
  1143. X    sprintf(pidstr,"z%08d",pid);
  1144. X    pidstr[0] = 'G';    /* fool strings searchers */
  1145. X    cptr = crypt(pidstr,"ba");
  1146. X    return(cptr);
  1147. X#else                /* probably enough */
  1148. Xstatic char pidstr[16];
  1149. X    sprintf(pidstr,"b%09da",(int)(((long)pid * 4) / 5));
  1150. X    return(pidstr);
  1151. X#endif
  1152. X
  1153. X#ifdef VARIANT_1    /* very paranoid */
  1154. Xchar pidstr[16];
  1155. Xchar *cptr;
  1156. X    sprintf(pidstr,"z%08d",pid);
  1157. X    pidstr[0] = 0xFF;    /* fool strings searchers */
  1158. X    cptr = crypt(pidstr,pidstr);
  1159. X    return(cptr);
  1160. X#endif
  1161. X#ifdef VARIANT_2    /* not paranoid at all */
  1162. Xchar pidstr[16];
  1163. X    sprintf(pidstr,"z%08d",pid - 2);
  1164. X#endif
  1165. X#ifdef VARIANT_3    /* invite trouble :-) */
  1166. X    return("I_am_easy");
  1167. X#endif
  1168. X
  1169. X}    /* end of bamboozle */
  1170. X
  1171. X
  1172. X/* vi: set tabstop=4 shiftwidth=4: */
  1173. X/* end of bamboozle.c */
  1174. SHAR_EOF
  1175. chmod 0644 bamboozle.c ||
  1176. echo 'restore of bamboozle.c failed'
  1177. Wc_c="`wc -c < 'bamboozle.c'`"
  1178. test 1780 -eq "$Wc_c" ||
  1179.     echo 'bamboozle.c: original size 1780, current size' "$Wc_c"
  1180. rm -f _shar_wnt_.tmp
  1181. fi
  1182. # ============= cmdtbl.c ==============
  1183. if test -f 'cmdtbl.c' -a X"$1" != X"-c"; then
  1184.     echo 'x - skipping cmdtbl.c (File already exists)'
  1185.     rm -f _shar_wnt_.tmp
  1186. else
  1187. > _shar_wnt_.tmp
  1188. echo 'x - extracting cmdtbl.c (Text)'
  1189. sed 's/^X//' << 'SHAR_EOF' > 'cmdtbl.c' &&
  1190. X/*+-------------------------------------------------------------------------
  1191. X    cmdtbl.c - interactive/procedure command table data
  1192. X    wht@n4hgf.Mt-Park.GA.US
  1193. X
  1194. XThis module merely declares the public instance of the ecu command
  1195. Xtable.  DECLARE_P_CMD performs magic in ecucmd.h
  1196. X--------------------------------------------------------------------------*/
  1197. X/*+:EDITS:*/
  1198. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  1199. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  1200. X/*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  1201. X/*:03-25-1991-11:40-wht@n4hgf-get termio.h for ecucmd.h conditonal compile */
  1202. X/*:08-14-1990-20:39-wht@n4hgf-ecu3.00-flush old edit history */
  1203. X
  1204. X#define DECLARE_P_CMD
  1205. X#include "ecu.h"
  1206. X#include "ecucmd.h"
  1207. X
  1208. X/* vi: set tabstop=4 shiftwidth=4: */
  1209. X/* end of cmdtbl.c */
  1210. SHAR_EOF
  1211. chmod 0644 cmdtbl.c ||
  1212. echo 'restore of cmdtbl.c failed'
  1213. Wc_c="`wc -c < 'cmdtbl.c'`"
  1214. test 780 -eq "$Wc_c" ||
  1215.     echo 'cmdtbl.c: original size 780, current size' "$Wc_c"
  1216. rm -f _shar_wnt_.tmp
  1217. fi
  1218. # ============= config.c ==============
  1219. if test -f 'config.c' -a X"$1" != X"-c"; then
  1220.     echo 'x - skipping config.c (File already exists)'
  1221.     rm -f _shar_wnt_.tmp
  1222. else
  1223. > _shar_wnt_.tmp
  1224. echo 'x - extracting config.c (Text)'
  1225. sed 's/^X//' << 'SHAR_EOF' > 'config.c' &&
  1226. X/* CHK=0xD40E */
  1227. Xchar *rev = "3.20";
  1228. X/* #define FORCE_DASH_G */
  1229. X
  1230. X/*+-------------------------------------------------------------------------
  1231. X    config.c - Makefile configuration program for ECU
  1232. X    wht@n4hgf.Mt-Park.GA.US
  1233. X
  1234. XThis must be compiled with the *NATIVE* cc or else you must fake all
  1235. Xof the predefines the native compiler supplies.  The Configure
  1236. Xscript can pass stuff in CFLAGS to tickle config a bit.
  1237. X
  1238. XThere are a few tricks in here for SCO multi-target development
  1239. Xsystem.  If you compile this on a UNIX system, but specify the
  1240. Xtarget for a XENIX system, you get the cc -xenix switch.  You
  1241. Xalso get -Dconst= to avoid banging into some problems with the
  1242. XXENIX stuff in the header files.
  1243. X
  1244. XTo paraphrase Henry Spencer:
  1245. X"Those who do not understand imake are doomed to reinvent it - poorly."
  1246. XIf this gets much more complicated, I'll make some imake rules.
  1247. XVery soon, most of the systems ECU gets used on will have imake already.
  1248. XWe cannot assume that yet.
  1249. X
  1250. X  Defined functions:
  1251. X    gen_cc_cflags()
  1252. X    gen_gcc_cflags()
  1253. X    gen_isc_ldflags()
  1254. X    gen_sco_ldflags()
  1255. X    gen_sun_ldflags()
  1256. X    gen_svr4_ldflags()
  1257. X    generate_config(mdir)
  1258. X    goodbye(sig)
  1259. X    main(argc,argv)
  1260. X    tgetc()
  1261. X    tgetopt(prompt,choices,deflt)
  1262. X    tgets(buf)
  1263. X    tputstrs(strs)
  1264. X    tputstrsfp(strs)
  1265. X    type (or the 'nearest equivalent')
  1266. X
  1267. X--------------------------------------------------------------------------*/
  1268. X/*+:EDITS:*/
  1269. X/*:09-10-1992-13:58-wht@n4hgf-ECU release 3.20 */
  1270. X/*:09-10-1992-04:39-wht@n4hgf-admonition about SunOS IPC config */
  1271. X/*:08-22-1992-15:38-wht@n4hgf-ECU release 3.20 BETA */
  1272. X/*:08-21-1992-13:46-wht@n4hgf-don't configure ecuungetty if not used on a sys */
  1273. X/*:08-11-1992-06:04-wht@n4hgf-FORCE_DASH_G and 3.2v4 LNG353 warnings */
  1274. X/*:07-12-1992-07:17-wht@n4hgf-3.2v4 has a fully functional nap and select */
  1275. X/*:07-02-1992-20:41-wht@n4hgf-rework for more options + 3.2v4 PID_T */
  1276. X/*:06-18-1992-11:19-root@n4hgf-SCO 3.2v4 gcc CFLAG additions */
  1277. X/*:04-23-1992-14:04-wht@n4hgf-had XENIX curses lib paths wrong */
  1278. X/*:04-19-1992-21:55-wht@n4hgf-pressing return or enter gets tgeopt default */
  1279. X/*:04-19-1992-21:43-wht@n4hgf-add default for tgetopt */
  1280. X/*:04-19-1992-02:55-wht@n4hgf-add ESIX SVR4 config */
  1281. X/*:04-17-1992-20:08-wht@n4hgf-add tty, baud and parity questions */
  1282. X/*:03-20-1992-03:08-wht@n4hgf-correct XENIX tcap/tlib test thanks to tbetz */
  1283. X/*:03-01-1992-13:36-wht@n4hgf-add -Wswitch to gcc compiles */
  1284. X/*:02-06-1992-15:23-wht@n4hgf-depressing ... SCO keeps chging their minds */
  1285. X/*:10-17-1991-14:51-wht@n4hgf-add can_pipe code */
  1286. X/*:09-03-1991-12:53-wht@n4hgf2-iron out sun gcc options */
  1287. X/*:09-01-1991-16:32-wht@n4hgf2-show package and config versions */
  1288. X/*:09-01-1991-15:59-wht@n4hgf2-generalize HDB Devices, etc. files location */
  1289. X/*:08-28-1991-14:07-wht@n4hgf2-SVR4 cleanup by aega84!lh */
  1290. X/*:08-25-1991-14:39-wht@n4hgf-SVR4 port thanks to aega84!lh */
  1291. X/*:08-23-1991-01:37-wht@n4hgf-sun port */
  1292. X/*:07-25-1991-12:55-wht@n4hgf-ECU release 3.10 */
  1293. X/*:07-12-1991-14:02-wht@n4hgf-GCC140 update */
  1294. X/*:05-02-1991-02:46-wht@n4hgf-take out M_TERMCAP in favor of ecucurses.h */
  1295. X/*:04-28-1991-03:44-wht@n4hgf-add -Dconst= for X286 under UNIX */
  1296. X/*:04-20-1991-17:26-wht@n4hgf-creation */
  1297. X
  1298. X#include <stdio.h>
  1299. X#include <ctype.h>
  1300. X#include <string.h>
  1301. X#include <termio.h>
  1302. X#include "ecu_types.h"
  1303. X#include "ecu_stat.h"
  1304. X#include "patchlevel.h"
  1305. X
  1306. X#define S_SCO        0
  1307. X#define S_ISC        1
  1308. X#define S_SUN        2
  1309. X#define S_ISCSVR4    3
  1310. X#define S_ESIXSVR4    4
  1311. X
  1312. X#define X_X286        0
  1313. X#define X_X386        1
  1314. X#define X_UNIX        2
  1315. X#define X_32v4        3
  1316. X
  1317. X#define C_CC        0
  1318. X#define C_GCC        1
  1319. X
  1320. Xstruct termio tty0;
  1321. Xstruct termio tty1;
  1322. X#define setty(arg) ioctl(0,TCSETAW,(arg) ? (char *)&tty1 : (char *)&tty0)
  1323. X
  1324. Xchar *makedirs[] = {
  1325. X    ".",
  1326. X    "./ecufriend",
  1327. X    "./ecuungetty",
  1328. X    "./gendial",
  1329. X    "./help",
  1330. X    "./sea",
  1331. X    "./z",
  1332. X    (char *)0
  1333. X};
  1334. X
  1335. Xchar *strs_intro1[] = {
  1336. X    "\n",
  1337. X    ".-------------------.\n",
  1338. X    "| ECU configuration |\n",
  1339. X    "`-------------------'\n",
  1340. X    (char *)0
  1341. X};
  1342. Xchar *strs_intro2[] = {
  1343. X#ifdef WHT
  1344. X    "WHT features enabled.  ",
  1345. X#endif
  1346. X#if defined(FORCE_DASH_G)
  1347. X    "-g compilation will be forced.",
  1348. X#endif
  1349. X    "\n",
  1350. X    "\n",
  1351. X    "Please answer these questions so that I can configure ECU.\n",
  1352. X    "There are two types of answers, single character and string.\n",
  1353. X    "Single character questions have the choices in () followed by a ?\n",
  1354. X    "String questions are followed by a :\n",
  1355. X    "Default answers appearing in [] are guesses.  If you wish to use\n",
  1356. X    "the default answer for a question, just press CR\n",
  1357. X    "\n",
  1358. X    "Abort (DEL, ^C, etc.) now if you do not wish to continue\n",
  1359. X    (char *)0
  1360. X};
  1361. X
  1362. Xchar *strs_lng353[] = {
  1363. X    "\n",
  1364. X    "I see you have installed LNG353 for the development system.\n",
  1365. X    "This fixed many things but introduced a new warning I cannot readily do\n",
  1366. X    "anything about.  Expect loads of \"warning C4200: previous declarator\n",
  1367. X    "is not compatible with default argument promotion\" messages.\n",
  1368. X    "They reflect little more than ECU isn't compliant with the latest\n",
  1369. X    "ANSI throathold tightening.\n",
  1370. X    (char *)0
  1371. X};
  1372. X
  1373. Xchar *strs_nolng353[] = {
  1374. X    "\n",
  1375. X    "You MUST use the 3.2v4 (or ODT 2.0) development system and you ought to\n",
  1376. X    "LNG353 installed.  If you have only an older DS, rerun ./config and\n",
  1377. X    "specify 'u'.  No promises. (This message may be obsolete after 1992).\n",
  1378. X    (char *)0
  1379. X};
  1380. X
  1381. Xchar *strs_mkdep[] = {
  1382. X    "\n",
  1383. X    "You are ready to make the program. It make take a while (now is a good\n",
  1384. X    "time to Read The Fine Manual).\n",
  1385. X    "\n",
  1386. X    "You MAY wish to make depend first.  It is not necessary to do this\n",
  1387. X    "until you make source modifications or apply patches.\n",
  1388. X    (char *)0
  1389. X};
  1390. X
  1391. Xchar *sco_cc_opts[] = {
  1392. X    "\t-M2let128 -LARGE \\\n",            /* XENIX/286 */
  1393. X    "\t-M3e \\\n",                        /* XENIX/386 */
  1394. X    "\t-M3e \\\n",                        /* UNIX/386 3.2.0-3.2v2*/
  1395. X    "\t-M3e \\\n"                        /* UNIX/386 3.2v4 */
  1396. X};
  1397. X
  1398. Xchar *sco_cc_optim[] = {
  1399. X#ifdef FORCE_DASH_G
  1400. X    "\t-Ot \\\n",                        /* XENIX/286 */
  1401. X    "\t-Oct -CSON \\\n",                /* XENIX/386 */
  1402. X    "\t-g \\\n",                        /* UNIX/386 3.2.0-3.2v2 */
  1403. X    "\t-g \\\n"                            /* UNIX/386 3.2v4 */
  1404. X#else
  1405. X    "\t-Ot \\\n",                        /* XENIX/286 */
  1406. X    "\t-Oct -CSON \\\n",                /* XENIX/386 */
  1407. X    "\t-Oct -CSON \\\n",                /* UNIX/386 3.2.0-3.2v2 */
  1408. X    "\t-Oct -CSON \\\n"                    /* UNIX/386 3.2v4 */
  1409. X#endif
  1410. X};
  1411. X
  1412. Xchar *sco_sigtype[] = {
  1413. X    "int",            /* XENIX/286 */
  1414. X    "void",            /* XENIX/386 */
  1415. X    "void",            /* UNIX/386 3.2.0-3.2v2 */
  1416. X    "void"            /* UNIX/386 32v4 */
  1417. X};
  1418. X
  1419. Xchar *pid_type = "\t-DPID_T=int \\\n";
  1420. X
  1421. X/*
  1422. X * GCC CFLAGS
  1423. X */
  1424. Xchar *gcc_opts[] = {
  1425. X#ifdef PEDANTIC
  1426. X    "\t-pedantic -ansi -O \\\n",        /* UH OH: see ecu README */
  1427. X#else
  1428. X    "\t-traditional -O \\\n",
  1429. X#endif
  1430. X#if defined(WHT) || defined(FORCE_DASH_G)
  1431. X    "\t-g \\\n",
  1432. X#endif
  1433. X    "\t-fstrength-reduce -fpcc-struct-return -fwritable-strings \\\n",
  1434. X    "\t-finline-functions -fforce-mem -fforce-addr \\\n",
  1435. X    "\t-W -Wunused -Wpointer-arith -Wcast-qual -Wshadow -Wcomment -Wswitch\\\n",
  1436. X    (char *)0
  1437. X};
  1438. X
  1439. Xchar *i86_gcc_opts[] = {
  1440. X#if 0
  1441. X    "\t-fcall-used-bx \\\n",
  1442. X#endif
  1443. X    (char *)0
  1444. X};
  1445. X
  1446. Xchar *sco_gcc_opts[] = {
  1447. X    /*
  1448. X     * XENIX/286
  1449. X     */
  1450. X    "\t........what-goes-here?......... \\\n",
  1451. X
  1452. X    /*
  1453. X     * XENIX/386
  1454. X     */
  1455. X    "\t-DM_XENIX -DM_SYSV -DM_SYS5 -DM_I386 \\\n\
  1456. X\t-DM_BITFIELDS -DM_COFF -DM_I386 -DM_I86 -DM_I86SM \\\n\
  1457. X\t-DM_INTERNAT -DM_SDATA -DM_STEXT -DM_SYS3 \\\n\
  1458. X\t-DM_SYSIII -DM_WORDSWAP -Di386\\\n",
  1459. X
  1460. X    /*
  1461. X     * UNIX/386 3.20..3.2v2
  1462. X     */
  1463. X    "\t-DM_BITFIELDS -DM_COFF -DM_I386 -DM_I86 -DM_I86SM \\\n\
  1464. X\t-DM_INTERNAT -DM_SDATA -DM_STEXT -DM_SYS3 -DM_SYS5 \\\n\
  1465. X\t-DM_SYSIII -DM_SYSV -DM_UNIX -DM_WORDSWAP -DM_XENIX -Dunix -Di386\\\n",
  1466. X
  1467. X    /*
  1468. X     * UNIX/386 3.2v4
  1469. X     */
  1470. X"\t-D_NO_PROTOTYPE -D_SVID -D_KR \\\n\
  1471. X\t-DM_BITFIELDS -DM_COFF -DM_I386 -DM_I86 -DM_I86SM \\\n\
  1472. X\t-DM_INTERNAT -DM_SDATA -DM_STEXT -DM_SYS3 -DM_SYS5 \\\n\
  1473. X\t-DM_SYSIII -DM_SYSV -DM_UNIX -DM_WORDSWAP -DM_XENIX -Dunix -Di386\\\n",
  1474. X};
  1475. X
  1476. X
  1477. Xchar *isc_cc_opts  = "\t-O -DISC -DISC22 -DSYSV \\\n";
  1478. Xchar *isc_gcc_opts = "\t-DISC -DISC22 -DSYSV -Di386\\\n";
  1479. Xchar *isc_sigtype = "void";
  1480. X
  1481. Xchar *sun_cc_opts  = "\t-O \\\n";
  1482. Xchar *sun_gcc_opts  = "\t-O -Dsun=1 \\\n"; /* ansi gets __sun__ only */
  1483. Xchar *sun_sigtype = "void";
  1484. X
  1485. Xchar *svr4_cc_opts  = "\t-O -DSVR4 -DSYSV \\\n";
  1486. Xchar *svr4_gcc_opts = "\t-DSVR4 -DSYSV \\\n";
  1487. Xchar *svr4_sigtype = "void";
  1488. X
  1489. X/*
  1490. X * LIBS
  1491. X */
  1492. Xchar *_sco_libs[] = {
  1493. X    "-ltcap -ltermlib -lx",
  1494. X    "-ltcap -ltermlib -lx",
  1495. X    "-ltcap -ltermlib -lmalloc -lc_s -lc -lx",
  1496. X    "-ltcap -ltermlib -lmalloc -lc_s -lc -lx"
  1497. X};
  1498. Xchar *_sco2_libs[] = {
  1499. X    "-ltcap -ltermcap -lx",
  1500. X    "-ltcap -ltermcap -lx",
  1501. X    "-ltcap -ltermcap -lmalloc -lc_s -lc -lx",
  1502. X    "-ltcap -ltermcap -lmalloc -lc_s -lc -lx"
  1503. X};
  1504. Xchar **sco_libs = _sco_libs;
  1505. X
  1506. Xchar *isc_libs = "-lcurses -linet -lx -lmalloc";
  1507. X
  1508. Xchar *sun_libs = "-lcurses -ltermcap";
  1509. X
  1510. Xchar *svr4_libs = "-lcurses -lx -lmalloc";
  1511. X
  1512. Xchar *sco_system[] = {
  1513. X    "XENIX/286",
  1514. X    "XENIX/386",
  1515. X    "UNIX/386",
  1516. X    "UNIX/386 3.2v4"
  1517. X};
  1518. X
  1519. Xchar *malloc_3x = "\t-DMALLOC_3X \\\n";
  1520. X
  1521. Xchar *tty = "tty1a";
  1522. Xchar *baud = "9600";
  1523. Xint parity = 0;
  1524. Xchar *bindir = "/usr/local/bin";
  1525. Xchar *libdir = "/usr/local/lib/ecu";
  1526. Xchar *symbolic = "";
  1527. Xchar *use_ecuungetty = "yes";
  1528. X
  1529. Xint sys = -1;
  1530. Xint compiler = -1;
  1531. Xint have_gcc_140 = 0;
  1532. Xint sco_type = -1;
  1533. Xint debug = 0;
  1534. Xint can_pipe = 0;
  1535. X
  1536. XFILE *fpmake;
  1537. X
  1538. Xvoid
  1539. Xgoodbye(sig)
  1540. Xint sig;
  1541. X{
  1542. X    setty(0);
  1543. X    printf("\n");
  1544. X    exit(sig);
  1545. X}
  1546. X
  1547. Xvoid
  1548. Xtputstrs(strs)
  1549. Xchar **strs;
  1550. X{
  1551. X    while(*strs)
  1552. X        fputs(*strs++,stdout);
  1553. X}
  1554. X
  1555. Xvoid
  1556. Xtputstrsfp(strs)
  1557. Xchar **strs;
  1558. X{
  1559. X    while(*strs)
  1560. X        fputs(*strs++,fpmake);
  1561. X}
  1562. X
  1563. Xchar
  1564. Xtgetc()
  1565. X{
  1566. Xchar rtn;
  1567. X
  1568. X    setty(1);
  1569. X    read(0,&rtn,1);
  1570. X    rtn &= 0x7F;
  1571. X    setty(0);
  1572. X    if(rtn != 0x0A)
  1573. X        printf("\n",rtn);
  1574. X    return(rtn);
  1575. X}
  1576. X
  1577. Xvoid
  1578. Xtgets(buf)
  1579. Xchar *buf;
  1580. X{
  1581. X    if(!gets(buf))
  1582. X        goodbye(1);
  1583. X}
  1584. X
  1585. Xchar
  1586. Xtgetopt(prompt,choices,deflt)
  1587. Xchar *prompt;
  1588. Xchar *choices;
  1589. Xchar deflt;
  1590. X{
  1591. X    char rtn = 0;
  1592. X    char response;
  1593. X    char *cptr;
  1594. X
  1595. X    printf("\n%s (",prompt);
  1596. X    while(!rtn)
  1597. X    {
  1598. X        cptr = choices;
  1599. X        while(*cptr)
  1600. X        {
  1601. X            if(cptr - choices)
  1602. X                putchar(',');
  1603. X            if(*cptr == deflt)
  1604. X                putchar('[');
  1605. X            putchar(*cptr);
  1606. X            if(*cptr == deflt)
  1607. X                putchar(']');
  1608. X            cptr++;
  1609. X        }
  1610. X        printf(")? ");
  1611. X        response = tgetc();
  1612. X        if(strchr(choices,response))
  1613. X            rtn = response;
  1614. X        else if((response == 0x0D) || (response == 0x0A))
  1615. X            rtn = deflt;
  1616. X        else
  1617. X            printf("Please answer with one of (");
  1618. X    }
  1619. X    return(rtn);
  1620. X}
  1621. X
  1622. Xvoid
  1623. Xgen_cc_cflags()
  1624. X{
  1625. X
  1626. X    fputs("CFLAGS = \\\n",fpmake);
  1627. X    switch(sys)
  1628. X    {
  1629. X        case S_SCO:
  1630. X#ifdef M_UNIX
  1631. X            fputs("\t-nointl \\\n",fpmake);
  1632. X            if((sco_type != X_UNIX) && (sco_type != X_32v4))
  1633. X                fputs("\t-xenix -Dconst= \\\n",fpmake);
  1634. X#endif
  1635. X            fputs("\t-DLINT_ARGS \\\n",fpmake);
  1636. X            fputs(sco_cc_optim[sco_type],fpmake);
  1637. X            fputs(sco_cc_opts[sco_type],fpmake);
  1638. X            if((sco_type == X_UNIX) || (sco_type == X_32v4))
  1639. X                fputs(malloc_3x,fpmake);
  1640. X            fputs("\t-DUSE_ECUUNGETTY \\\n",fpmake);
  1641. X            if(sco_type == X_32v4)
  1642. X                fputs("\t-DWORKING_SELECT -DSCO32v4 \\\n",fpmake);
  1643. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1644. X            fputs("\t-DLOCK_DIR_NAME='\"/usr/spool/uucp\"' \\\n",fpmake);
  1645. X            break;
  1646. X        case S_ISC:
  1647. X            fputs(isc_cc_opts,fpmake);
  1648. X            fputs(malloc_3x,fpmake);
  1649. X            fputs("\t-DUSE_ECUUNGETTY \\\n",fpmake);
  1650. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1651. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1652. X            fputs("\t-DLOCK_DIR_NAME='\"/usr/spool/locks\"' \\\n",fpmake);
  1653. X            break;
  1654. X        case S_SUN:
  1655. X            fputs(sun_cc_opts,fpmake);
  1656. X            fputs(malloc_3x,fpmake);
  1657. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1658. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1659. X            fputs("\t-DLOCK_DIR_NAME='\"/var/spool/locks\"' \\\n",fpmake);
  1660. X            break;
  1661. X        case S_ISCSVR4:
  1662. X        case S_ESIXSVR4:
  1663. X            fputs(svr4_cc_opts,fpmake);
  1664. X            if(sys == S_ISCSVR4)
  1665. X                fputs("\t-DISCSVR4 \\\n",fpmake);
  1666. X            else
  1667. X                fputs("\t-DESIXSVR4 \\\n",fpmake);
  1668. X            fputs(malloc_3x,fpmake);
  1669. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1670. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1671. X            fputs("\t-DLOCK_DIR_NAME='\"/var/spool/locks\"' \\\n",fpmake);
  1672. X            break;
  1673. X    }
  1674. X    fprintf(fpmake,"\t-DDEFAULT_TTY='\"/dev/%s\"' \\\n",tty);
  1675. X    fprintf(fpmake,"\t-DDEFAULT_BAUD_RATE=%s \\\n",baud);
  1676. X    fprintf(fpmake,"\t-DDEFAULT_PARITY=\"'%c'\" \\\n",parity);
  1677. X    fputs("\t-DHDBLIBDIR='\"$(HDBLIBDIR)\"' \\\n",fpmake);
  1678. X    fputs("\t-DECULIBDIR='\"$(ECULIBDIR)\"' -DECUUNGETTY_CHOWN \\\n",fpmake);
  1679. X    fputs(pid_type,fpmake);
  1680. X    fputs(
  1681. X"\t$(SYMBOLIC) $(CFLAGS_EXTRA) $(CC_CFLAGS_EXTRA) $(LOCAL_CFLAGS)\n\n",fpmake);
  1682. X}
  1683. X
  1684. Xvoid
  1685. Xgen_gcc_cflags()
  1686. X{
  1687. X    fputs("CFLAGS = \\\n",fpmake);
  1688. X    tputstrsfp(gcc_opts);
  1689. X    if(can_pipe)
  1690. X        fputs("\t-pipe \\\n",fpmake);
  1691. X    switch(sys)
  1692. X    {
  1693. X        case S_SCO:
  1694. X            fputs(sco_gcc_opts[sco_type],fpmake);
  1695. X            tputstrsfp(i86_gcc_opts);
  1696. X            if((sco_type == X_UNIX) || (sco_type == X_32v4))
  1697. X                fputs(malloc_3x,fpmake);
  1698. X            fputs("\t-DUSE_ECUUNGETTY \\\n",fpmake);
  1699. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1700. X            if(sco_type == X_32v4)
  1701. X                fputs("\t-DWORKING_SELECT -DSCO32v4 \\\n",fpmake);
  1702. X            fputs("\t-DLOCK_DIR_NAME='\"/usr/spool/uucp\"' \\\n",fpmake);
  1703. X            break;
  1704. X        case S_ISC:
  1705. X            fputs(isc_gcc_opts,fpmake);
  1706. X            tputstrsfp(i86_gcc_opts);
  1707. X            fputs(malloc_3x,fpmake);
  1708. X            fputs("\t-DUSE_ECUUNGETTY \\\n",fpmake);
  1709. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1710. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1711. X            fputs("\t-DLOCK_DIR_NAME='\"/usr/spool/locks\"' \\\n",fpmake);
  1712. X            break;
  1713. X        case S_SUN:
  1714. X            fputs(sun_gcc_opts,fpmake);
  1715. X            fputs(malloc_3x,fpmake);
  1716. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1717. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1718. X            fputs("\t-DLOCK_DIR_NAME='\"/var/spool/locks\"' \\\n",fpmake);
  1719. X            break;
  1720. X        case S_ISCSVR4:
  1721. X        case S_ESIXSVR4:
  1722. X            fputs(svr4_gcc_opts,fpmake);
  1723. X#if defined(i386)
  1724. X            tputstrsfp(i86_gcc_opts);
  1725. X#endif
  1726. X            if(sys == S_ISCSVR4)
  1727. X                fputs("\t-DISCSVR4 \\\n",fpmake);
  1728. X            else
  1729. X                fputs("\t-DESIXSVR4 \\\n",fpmake);
  1730. X            fputs(malloc_3x,fpmake);
  1731. X            fputs("\t-DWORKING_SELECT \\\n",fpmake);
  1732. X            fputs("\t-DSIGTYPE=$(SIGTYPE) \\\n",fpmake);
  1733. X            fputs("\t-DLOCK_DIR_NAME='\"/var/spool/locks\"' \\\n",fpmake);
  1734. X            break;
  1735. X    }
  1736. X    if(have_gcc_140)
  1737. X        fputs("\t-DGCC140 \\\n",fpmake);
  1738. X    fprintf(fpmake,"\t-DDEFAULT_TTY='\"/dev/%s\"' \\\n",tty);
  1739. X    fprintf(fpmake,"\t-DDEFAULT_BAUD_RATE=%s \\\n",baud);
  1740. X    fprintf(fpmake,"\t-DDEFAULT_PARITY=\"'%c'\" \\\n",parity);
  1741. X    fputs("\t-DHDBLIBDIR='\"$(HDBLIBDIR)\"' \\\n",fpmake);
  1742. X    fputs("\t-DECULIBDIR='\"$(ECULIBDIR)\"' -DECUUNGETTY_CHOWN \\\n",fpmake);
  1743. X    fputs(pid_type,fpmake);
  1744. X    fputs(
  1745. X"\t$(SYMBOLIC) $(CFLAGS_EXTRA) $(GCC_CFLAGS_EXTRA) $(LOCAL_CFLAGS)\n\n",fpmake);
  1746. X}
  1747. X
  1748. Xvoid
  1749. Xgen_sco_ldflags()
  1750. X{
  1751. X    fputs("LDFLAGS = \\\n",fpmake);
  1752. X#if defined(WHT) || defined(FORCE_DASH_G)
  1753. X    fputs("\t-g \\\n",fpmake);
  1754. X#endif
  1755. X    if(compiler == C_CC)
  1756. X    {
  1757. X#ifdef M_UNIX
  1758. X        fputs("\t-nointl \\\n",fpmake);
  1759. X        if((sco_type != X_UNIX) && (sco_type != X_32v4))
  1760. X            fputs("\t-xenix \\\n",fpmake);
  1761. X#endif
  1762. X        fputs(sco_cc_opts[sco_type],fpmake);
  1763. X        if(sco_type == X_X286)
  1764. X            fputs("\t-SEG 512 -F 5000 \\\n",fpmake);
  1765. X    }
  1766. X    fputs("\t$(SYMBOLIC) $(LDFLAGS_EXTRA)\n\n",fpmake);
  1767. X
  1768. X    fprintf(fpmake,"LIBS = %s\n\n",sco_libs[sco_type]);
  1769. X}
  1770. X
  1771. Xvoid
  1772. Xgen_isc_ldflags()
  1773. X{
  1774. X    fputs("LDFLAGS = \\\n",fpmake);
  1775. X    fputs("\t$(SYMBOLIC) $(LDFLAGS_EXTRA)\n\n",fpmake);
  1776. X
  1777. X    fprintf(fpmake,"LIBS = %s\n\n",isc_libs);
  1778. X}
  1779. X
  1780. Xvoid
  1781. Xgen_sun_ldflags()
  1782. X{
  1783. X    fputs("LDFLAGS = \\\n",fpmake);
  1784. X    fputs("\t$(SYMBOLIC) $(LDFLAGS_EXTRA)\n\n",fpmake);
  1785. X
  1786. X    fprintf(fpmake,"LIBS = %s\n\n",sun_libs);
  1787. X}
  1788. X
  1789. Xvoid
  1790. Xgen_svr4_ldflags()
  1791. X{
  1792. X    fputs("LDFLAGS = \\\n",fpmake);
  1793. X    fputs("\t$(SYMBOLIC) $(LDFLAGS_EXTRA)\n\n",fpmake);
  1794. X
  1795. X    fprintf(fpmake,"LIBS = %s\n\n",svr4_libs);
  1796. X}
  1797. X
  1798. Xvoid
  1799. Xgenerate_config(mdir)
  1800. Xchar *mdir;
  1801. X{
  1802. X    char mksrc[128];
  1803. X    char mkfl[128];
  1804. X    char s128[128];
  1805. X    FILE *fpsrc;
  1806. X    FILE *local = fopen("config.local","r");
  1807. X    static int reported_config_local = 0;
  1808. X
  1809. X    sprintf(mksrc,"%s/Make.src",mdir);
  1810. X    sprintf(mkfl,"%s/Makefile",mdir);
  1811. X
  1812. X    printf("Configuring %s from %s\n",mkfl,mksrc);
  1813. X
  1814. X    if(!(fpsrc = fopen(mksrc,"r")))
  1815. X    {
  1816. X        perror(mksrc);
  1817. X        return;
  1818. X    }
  1819. X
  1820. X    if(debug)
  1821. X        fpmake = stdout;
  1822. X    else
  1823. X    {
  1824. X        if(!(fpmake = fopen(mkfl,"w")))
  1825. X        {
  1826. X            perror(mkfl);
  1827. X            fclose(fpsrc);
  1828. X            if(local)
  1829. X                fclose(local);
  1830. X            return;
  1831. X        }
  1832. X    }
  1833. X
  1834. X    fprintf(fpmake,"#---- configured by Configure revision %s for ECU 3.%02d\n",
  1835. X        rev,PATCHLEVEL);
  1836. X    fprintf(fpmake,"#---- edit %s and rerun Configure to produce this file\n\n",
  1837. X        mksrc);
  1838. X
  1839. X    if(local)
  1840. X    {
  1841. X        fprintf(fpmake,"# config.local inclusions\n");
  1842. X        fprintf(fpmake,"# -----------------------\n");
  1843. X        if(!reported_config_local)
  1844. X            fputs("found config.local:\n",stdout);
  1845. X        while(fgets(s128,sizeof(s128),local))
  1846. X        {
  1847. X            if(!reported_config_local)
  1848. X                fputs(s128,stdout);
  1849. X            fputs(s128,fpmake);
  1850. X        }
  1851. X        if(!reported_config_local)
  1852. X            fputs("\n",stdout);
  1853. X        reported_config_local = 1;
  1854. X        fclose(local);
  1855. X        fprintf(fpmake,"# -----------------------\n");
  1856. X        fputs("\n",fpmake);
  1857. X    }
  1858. X
  1859. X    switch(sys)
  1860. X    {
  1861. X        case S_SCO:
  1862. X            fprintf(fpmake,"SIGTYPE = %s\n\n",sco_sigtype[sco_type]);
  1863. X            break;
  1864. X        case S_ISC:
  1865. X            fprintf(fpmake,"SIGTYPE = %s\n\n",isc_sigtype);
  1866. X            break;
  1867. X        case S_SUN:
  1868. X            fprintf(fpmake,"SIGTYPE = %s\n\n",sun_sigtype);
  1869. X            break;
  1870. X        case S_ISCSVR4:
  1871. X        case S_ESIXSVR4:
  1872. X            fprintf(fpmake,"SIGTYPE = %s\n\n",svr4_sigtype);
  1873. X            break;
  1874. X    }
  1875. X
  1876. X    switch(compiler)
  1877. X    {
  1878. X        case C_CC:
  1879. X            fputs("CC = cc\n",fpmake);
  1880. X            gen_cc_cflags();
  1881. X            break;
  1882. X        case C_GCC:
  1883. X            fputs("CC = gcc\n",fpmake);
  1884. X            gen_gcc_cflags();
  1885. X            break;
  1886. X    }
  1887. X
  1888. X    switch(sys)
  1889. X    {
  1890. X        case S_SCO:
  1891. X            gen_sco_ldflags();
  1892. X            break;
  1893. X        case S_ISC:
  1894. X            gen_isc_ldflags();
  1895. X            break;
  1896. X        case S_SUN:
  1897. X            gen_sun_ldflags();
  1898. X            break;
  1899. X        case S_ISCSVR4:
  1900. X        case S_ESIXSVR4:
  1901. X            gen_svr4_ldflags();
  1902. X            break;
  1903. X    }
  1904. X
  1905. X    fprintf(fpmake,"LBIN = %s\n",bindir);
  1906. X    fprintf(fpmake,"ECULIBDIR = %s\n",libdir);
  1907. X    /*
  1908. X     * we need this info in Makefiles, so it is put here rather
  1909. X     * than ecu.h; must also have this passed thru in CFLAGS
  1910. X     */
  1911. X    switch(sys)
  1912. X    {
  1913. X        case S_SCO:
  1914. X            fprintf(fpmake,"SYSTEM = %s\n",sco_system[sco_type]);
  1915. X            fputs("HDBLIBDIR = /usr/lib/uucp\n",fpmake);
  1916. X            use_ecuungetty = "yes";
  1917. X            break;
  1918. X        case S_ISC:
  1919. X            fputs("SYSTEM = ISC-SVR3\n",fpmake);
  1920. X            fputs("HDBLIBDIR = /usr/lib/uucp\n",fpmake);
  1921. X            use_ecuungetty = "yes";
  1922. X            break;
  1923. X        case S_SUN:
  1924. X            fputs("SYSTEM = SunOS-4.1\n",fpmake);
  1925. X            fputs("HDBLIBDIR = /etc/uucp\n",fpmake);
  1926. X            use_ecuungetty = "no";
  1927. X            break;
  1928. X        case S_ISCSVR4:
  1929. X        case S_ESIXSVR4:
  1930. X            if(sys == S_ISCSVR4)
  1931. X                fputs("SYSTEM = ISC-SVR4\n",fpmake);
  1932. X            else
  1933. X                fputs("SYSTEM = ESIX-SVR4\n",fpmake);
  1934. X            fputs("HDBLIBDIR = /etc/uucp\n",fpmake);
  1935. X            use_ecuungetty = "no";
  1936. X            break;
  1937. X    }
  1938. X
  1939. X
  1940. X    fprintf(fpmake,"USE_ECUUNGETTY = %s\n",use_ecuungetty);
  1941. X#if !defined(WHT)
  1942. X    fputs("#",fpmake);
  1943. X#endif
  1944. X    fputs("BINTIME = /bin/time\n",fpmake);
  1945. X
  1946. X    fprintf(fpmake,"\n#---- end of configured make variables\n");
  1947. X
  1948. X    while(!debug && fgets(s128,sizeof(s128),fpsrc))
  1949. X        fputs(s128,fpmake);
  1950. X
  1951. X    fclose(fpsrc);
  1952. X    if(!debug)
  1953. X        fclose(fpmake);
  1954. X
  1955. X}
  1956. X
  1957. Xmain(argc,argv)
  1958. Xint argc;
  1959. Xchar **argv;
  1960. X{
  1961. X    int itmp;
  1962. X    int getopt_libdir = 0;
  1963. X    int getopt_bindir = 0;
  1964. X    int getopt_tty = 0;
  1965. X    int getopt_baud = 0;
  1966. X    int getopt_parity = 0;
  1967. X    int have_lng353 = 0;
  1968. X    char s128[128];
  1969. X    char **makedir;
  1970. X    char *tlib;
  1971. X    char *tcap;
  1972. X    struct stat fst;
  1973. X    extern int optind;
  1974. X    extern char *optarg;
  1975. X
  1976. X    setbuf(stdin,NULL);
  1977. X    setbuf(stdout,NULL);
  1978. X
  1979. X    while((itmp = getopt(argc,argv,"dsiS234ugcT:B:P:b:l:")) != -1)
  1980. X    {
  1981. X        switch(itmp)
  1982. X        {
  1983. X            case 'd': debug = 1; break;
  1984. X
  1985. X            case 's': sys = S_SCO; break;
  1986. X            case 'i': sys = S_ISC; break;
  1987. X            case 'S': sys = S_SUN; break;
  1988. X            case 'I': sys = S_ISCSVR4; break;
  1989. X            case 'E': sys = S_ESIXSVR4; break;
  1990. X
  1991. X            case '2': sco_type = X_X286; break;
  1992. X            case '3': sco_type = X_X386; break;
  1993. X            case 'u':
  1994. X                sco_type = X_UNIX;
  1995. X                break;
  1996. X            case 'v':
  1997. X                sco_type = X_32v4;
  1998. X                pid_type = "\t-DPID_T=short \\\n";
  1999. X                have_lng353 = !stat("/etc/perms/ccsls",&fst);
  2000. X                break;
  2001. X
  2002. X            case 'g': compiler = C_GCC; break;
  2003. X            case 'c': compiler = C_CC; break;
  2004. X
  2005. X            case 'T':
  2006. X                tty = optarg;
  2007. X                getopt_tty = 1;
  2008. X                break;
  2009. X
  2010. X            case 'B':
  2011. X                baud = optarg;
  2012. X                getopt_baud = 1;
  2013. X                break;
  2014. X
  2015. X            case 'P':
  2016. X                parity = *optarg;
  2017. X                if(isupper(parity))
  2018. X                    parity = tolower(parity);
  2019. X                getopt_parity = 1;
  2020. X                break;
  2021. X
  2022. X            case 'b':
  2023. X                bindir = optarg;
  2024. X                getopt_bindir = 1;
  2025. X                break;
  2026. X
  2027. X            case 'l':
  2028. X                libdir = optarg;
  2029. X                getopt_libdir = 1;
  2030. X                break;
  2031. X        }
  2032. X    }
  2033. X
  2034. X    /*
  2035. X     * set up raw/cooked tty setty() macro
  2036. X     */
  2037. X    ioctl(0,TCGETA,&tty0);
  2038. X    tty1 = tty0;
  2039. X    tty1.c_lflag &= ~(ICANON);
  2040. X    tty1.c_cc[VMIN] = 1;
  2041. X    tty1.c_cc[VTIME] = 0;
  2042. X
  2043. X    for(itmp = 1; itmp < 32; itmp++)
  2044. X        signal(itmp,goodbye);
  2045. X
  2046. X    if(!debug)
  2047. X    {
  2048. X        tputstrs(strs_intro1);
  2049. X        printf("ECU 3.%02d, config version %s\n",PATCHLEVEL,rev);
  2050. X        tputstrs(strs_intro2);
  2051. X    }
  2052. X
  2053. X    /*
  2054. X     * try to make a stab at default
  2055. X     * two vendor compilers have thoughtfully provided a reliable built-in
  2056. X     * default to ISC if not one of those two
  2057. X     */
  2058. X    itmp = 'i';
  2059. X#ifdef M_SYSV
  2060. X    itmp = 's';
  2061. X#endif
  2062. X#ifdef sun
  2063. X    itmp = 'S';
  2064. X#endif
  2065. X
  2066. X    if(sys < 0)
  2067. X    {
  2068. X        switch(tgetopt("\
  2069. XChoose your system type (or the 'nearest equivalent') \n\
  2070. X                s  SCO,\n\
  2071. X                i  ISC,\n\
  2072. X                S  SunOS 4.1,\n\
  2073. X                I  ISC SVR4 or\n\
  2074. X                E  ESIX SVR4 system\n\
  2075. X",
  2076. X            "siSIE",itmp))
  2077. X        {
  2078. X            case 's':  
  2079. X                sys = S_SCO; 
  2080. X                tty = "tty1a";
  2081. X                break;
  2082. X            case 'i':  
  2083. X                sys = S_ISC; 
  2084. X                tty = "acu00";
  2085. X                break;
  2086. X            case 'S':  
  2087. X                sys = S_SUN; 
  2088. X                tty = "ttya";
  2089. X                printf(
  2090. X"You need System V IPC configured in your kernel. I didn't check for it.\n");
  2091. X                break;
  2092. X            case 'I':  
  2093. X                sys = S_ISCSVR4; 
  2094. X                tty = "tty00";
  2095. X                break;
  2096. X            case 'E':  
  2097. X                sys = S_ESIXSVR4; 
  2098. X                tty = "tty00";
  2099. X                break;
  2100. X        }
  2101. X    }
  2102. X
  2103. X    if((sys == S_SCO) && (sco_type < 0))
  2104. X    {
  2105. X        switch(tgetopt("\
  2106. XChoose between 2  XENIX/286,\n\
  2107. X               3  XENIX/386,\n\
  2108. X               u  ODT 1.0.x, ODT 1.1, UNIX 3.20-3.2v2 or\n\
  2109. X               v  ODT 2.0, UNIX 3.2v4\n\
  2110. X(The choice between 'u' and 'v' is for the Development System you have.\n\
  2111. XUsing the 3.2v2DS with 3.2v4OS will \"work\" but erratic behavior is most\n\
  2112. Xcertain to occur (e.g., long filenames will confuse the 3.2v2 library).\n\
  2113. X ","23uv",
  2114. X#ifdef M_UNIX
  2115. X'u'
  2116. X#else
  2117. X#ifdef M_I286
  2118. X'2'
  2119. X#else
  2120. X#ifdef M_I286
  2121. X'3'
  2122. X#else
  2123. X#ifdef sun
  2124. X'S'
  2125. X#else
  2126. X'i'
  2127. X#endif
  2128. X#endif
  2129. X#endif
  2130. X#endif
  2131. X    ))
  2132. X        {
  2133. X            case '2':  
  2134. X                sco_type = X_X286; 
  2135. X                tlib = "/lib/Llibtermlib.a";
  2136. X                tcap = "/lib/Llibtermcap.a";
  2137. X                break;
  2138. X            case '3':  
  2139. X                sco_type = X_X386; 
  2140. X                tlib = "/lib/386/Slibtermlib.a";
  2141. X                tcap = "/lib/386/Slibtermcap.a";
  2142. X                break;
  2143. X            case 'u':  
  2144. X                sco_type = X_UNIX; 
  2145. X                tlib = "/usr/lib/libtermlib.a";
  2146. X                tcap = "/usr/lib/libtermcap.a";
  2147. X#ifdef S_IFLNK /* 3.2v2 DS with 3.2v4 OS */
  2148. X                fputs("OK, we will try to make for 3.2v4 with a 3.2v2 DS\n",
  2149. X                    stdout);
  2150. X#endif
  2151. X                break;
  2152. X            case 'v':  
  2153. X                sco_type = X_32v4; 
  2154. X                pid_type = "\t-DPID_T=short\\\n";
  2155. X                tlib = "/usr/lib/libtermlib.a";
  2156. X                tcap = "/usr/lib/libtermcap.a";
  2157. X                have_lng353 = !stat("/etc/perms/ccsls",&fst);
  2158. X                break;
  2159. X        }
  2160. X
  2161. X        /*
  2162. X         * Some of the following may have minor flaws making it
  2163. X         * open to political nitpicking (this is 1992 :-!), but
  2164. X         * here is truth:
  2165. X         *
  2166. X         * With the advent of terminfo curses in XENIX 2.?.?,
  2167. X         * SCO until 3.2v2 had a question at install time asking what
  2168. X         * kind of curses installation you want.  It was somebody's
  2169. X         * bright idea to settle the differences between XENIX V7/BSD
  2170. X         * -lcurses+-ltermcap curses vs. the System V -lcurses terminfo
  2171. X         * method.  Well, bright people go on to other things and
  2172. X         * continutity gets lost.  The hard link driven, logical ld time
  2173. X         * -lcurses = (XENIX/BSD/V7) ? -ltcap : -ltinfo
  2174. X         * -ltermlib = (XENIX/BSD/V7) ? -ltermcap : -ltinfo
  2175. X         * stuff appears to have disappeared in 3.2v2.  I hope it is not
  2176. X         * too late to get it back into 3.2v4, but the degenerate 3.2v2
  2177. X         * case adds yet another variation on the "ever-improved-but-
  2178. X         * multivariate" SCO development environment.
  2179. X         */
  2180. X        if(!access(tcap,0))
  2181. X            sco_libs = _sco2_libs;
  2182. X        else if(!access(tlib,0))
  2183. X            sco_libs = _sco_libs;
  2184. X        else
  2185. X        {
  2186. X            sleep(1);    /* psychological */
  2187. X            printf("\nI find neither %s nor %s.\n",tcap,tlib);
  2188. X            printf("Do you have curses support installed? I cannot proceed.\n");
  2189. X            goodbye(1);
  2190. X        }
  2191. X
  2192. X    }
  2193. X
  2194. X    if((sys == S_SCO) && (sco_type == X_X286))
  2195. X    {
  2196. X        /* don't know about gcc on 286 systems */
  2197. SHAR_EOF
  2198. true || echo 'restore of config.c failed'
  2199. fi
  2200. echo 'End of ecu320 part 4'
  2201. echo 'File config.c is continued in part 5'
  2202. echo 5 > _shar_seq_.tmp
  2203. exit 0
  2204.  
  2205. exit 0 # Just in case...
  2206.