home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / other / irc / config < prev    next >
Encoding:
Text File  |  1996-08-14  |  13.7 KB  |  695 lines

  1. #!/bin/sh
  2. #
  3. # (C) 1993, 1994 By Darren Reed, avalon@coombs.anu.edu.au
  4. # You may distribute this file without changes freely providing this notice
  5. # remains intact.  This file may not be redistributed or made available for
  6. # distribution without the author's prior consent.
  7. #
  8. trap "" 13 14 15
  9. MV=/bin/mv
  10. RM=/bin/rm
  11. SETUP=include/setup.h
  12. #
  13. STDLIBH=undef
  14. STDDEFH=undef
  15. SYSSYSLOGH=undef
  16. MALLOCH=undef
  17. PARAMH=undef
  18. UNISTDH=undef
  19. STRINGH=undef
  20. STRINGSH=undef
  21. NOINDEX=undef
  22. NSTRERROR=undef
  23. NSTRTOKEN=undef
  24. NSTRTOK=undef
  25. NINETADDR=undef
  26. NINETNTOA=undef
  27. NINETNETOF=undef
  28. GETTIMEOFDAY=undef
  29. LRAND48=undef
  30. CCPATH=''
  31. SIGNAL=''
  32. BLOCKING=''
  33. TMP=/tmp/.Configtmp$$.c
  34. EXEC=/tmp/.Configtmp$$
  35. PLATE=/tmp/.ConPlate$$
  36. c=''
  37. n=''
  38. #
  39. 2>/dev/null
  40. if [ "`eval echo -n 'a'`" = "-n a" ] ; then
  41.     c='\c'
  42. else
  43.     n='-n'
  44. fi
  45. #if [ ! -f Makefile.bak ] ; then
  46. #    mv Makefile Makefile.bak
  47. #    cp Makefile.bak Makefile
  48. #    chmod ugo-xw Makefile Makefile.bak
  49. #    chmod u+w Makefile
  50. #fi
  51. echo " "
  52. echo "   Welcome to autoconfigure for the IRC server."
  53. echo "Before running this script and expecting it to work, please fix the"
  54. echo "Makefile in this directory (I can only do so much without your help!)"
  55. echo "and I'll look into it for help and to checkup on your compiler"
  56. echo "preferences, etc"
  57. echo " "
  58. echo "Enter \"none\" at any prompt to effect a null entry."
  59. echo " "
  60. FOO=`egrep "^CC=" Makefile 2>/dev/null | sed -e 's/^[^=]*[     ]*=\(.*\)/\1/'`
  61. while [ -z "$CCPATH" ] ; do
  62.     MYP=`echo "$PATH" | sed -e 's/:/ /g'`
  63.     echo "Which compiler do you use, gcc or cc or...?"
  64.     echo $n "[$FOO] -> $c"
  65.     read cc
  66.     if [ -z "$cc" ] ; then
  67.         cc=$FOO
  68.         CCPATH=$FOO
  69.     elif [ -f $cc ] ; then
  70.         CCPATH=$cc
  71.     else
  72.         for i in $MYP; do
  73.             if [ -f $i/$cc -a -z "$CCPATH" ] ; then
  74.                 CCPATH=$i/$cc
  75.             fi
  76.         done
  77.     fi
  78. done
  79. if [ "$FOO" != "$cc" ] ; then
  80.     MYP=`echo "$CCPATH" | sed -e 's@/@ @g'`
  81.     set $MYP
  82.     if [ $2 ] ; then
  83.         while [ $2 ] ; do
  84.             shift
  85.         done
  86.     fi
  87.     if [ $1 = "gcc" ] ; then
  88.         CCPATH="$CCPATH -traditional"
  89.     fi
  90. fi
  91. echo "Compiler selected: $CCPATH"
  92. echo " "
  93. # Check it out
  94. cat > $TMP <<_EOF_
  95. main() {}
  96. _EOF_
  97. $CCPATH $TMP -o $EXEC >/dev/null 2>&1
  98. if [ ! -f $EXEC ] ; then
  99.         echo "You don't have $CCPATH or it's broken!"
  100.         exit 1
  101. fi
  102. # Fix Makefile
  103. #
  104. #$RM -f $TMP
  105. #sed -e "s@^CC=\(.*\)@CC=$CCPATH@" Makefile > $TMP
  106. #cp $TMP Makefile
  107. #$RM -f $TMP
  108. #
  109. echo "Enter additional flags to give to $CCPATH"
  110. FOO=`egrep "^CFLAGS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=[     ]*\(.*\)/\1/'`
  111. INC=`egrep "^INCLUDEDIR=" Makefile 2>/dev/null | sed -e 's/^[^=]*=\(.*\)/\1/'`
  112. FOO=`echo "$FOO" | sed -e "s@\\$(INCLUDEDIR)@$INC@"`
  113. echo $n "[$FOO] -> $c"
  114. read cc
  115. if [ "$cc" = "none" ] ; then
  116.     cc=''
  117. elif [ -z "$cc" ] ; then
  118.     cc=$FOO
  119. fi
  120. CFLAGS=$cc
  121. # Fix Makefile
  122. #
  123. #$RM -f $TMP
  124. #sed -e "s@^CFLAGS=\(.*\)@CFLAGS=$CFLAGS@" Makefile > $TMP
  125. #cp $TMP Makefile
  126. #$RM -f $TMP
  127. #
  128. echo " "
  129. echo "If you need to use any extra libraries when compiling the server,"
  130. echo "please tell me now (might need to look at the Makefiles) and please"
  131. echo "include all the -l and -L flags (I'm lame)."
  132. LIBS=`egrep "^IRCDLIBS=" Makefile 2>/dev/null | sed -e 's/^[^=]*=\(.*\)/\1/' | tr -d "\012"`
  133. echo $n "[$LIBS] -> $c"
  134. read cc;
  135. if [ "$cc" = "none" ] ; then
  136.     cc=''
  137. elif [ -z "$cc" ] ; then
  138.     cc=$LIBS
  139. fi
  140. LIBS=$cc
  141. # Fix Makefile
  142. #
  143. #$RM -f $TMP
  144. #sed -e "s@^IRCDLIBS=\(.*\)@IRCDLIBS=$LIBS@" Makefile > $TMP
  145. #cp $TMP Makefile
  146. #$RM -f $TMP
  147. #
  148. COMP="$CCPATH $CFLAGS $TMP -o $EXEC $LIBS"
  149. #
  150. #
  151. echo 'Checking out /usr/include'
  152. echo $n "...Looking for /usr/include/stdlib.h...$c"
  153. if [ -r /usr/include/stdlib.h ] ; then
  154.     STDLIBH=define
  155.     echo  'found!'
  156. else
  157.     echo 'not found :('
  158. fi
  159. # gcc has its own stddef.h
  160. FOO=''
  161. if [ ! -z "`echo $CCPATH | grep gcc`" ] ; then
  162.     FOO=`$CCPATH -v 2>&1 | head -1 | \
  163.         sed -e 's/Reading specs from //' -e 's/specs$/include/'`
  164. fi
  165. echo $n "...Looking for stddef.h...$c"
  166. if [ -r $FOO/stddef.h ] ; then
  167.     STDDEFH=define
  168.         echo "found in $FOO!"
  169. elif [ -r /usr/include/stddef.h ] ; then
  170.         STDDEFH=define
  171.     echo  'found!'
  172. else
  173.     echo 'not found :('
  174. fi
  175. echo $n "...Looking for /usr/include/sys/syslog.h...$c"
  176. if [ -r /usr/include/sys/syslog.h ] ; then
  177.     SYSSYSLOGH=define
  178.     echo  'found!'
  179. else
  180.     echo 'not found :('
  181. fi
  182. echo $n "...Looking for malloc.h...$c"
  183. if [ -r /usr/include/malloc.h ] ; then
  184.     MALLOCH=malloc.h
  185.     echo  'found!'
  186. elif [ -r /usr/include/sys/malloc.h ] ; then
  187.     MALLOCH=sys/malloc.h
  188.     echo  'found!'
  189. else
  190.     echo 'not found :('
  191.     MALLOCH=undef
  192. fi
  193. echo $n "...Looking for /usr/include/sys/param.h...$c"
  194. if [ -r /usr/include/sys/param.h ] ; then
  195.     PARAMH=define
  196.     echo  'found!'
  197. else
  198.     echo 'not found :('
  199. fi
  200. echo $n "...Looking for /usr/include/unistd.h...$c"
  201. if [ -r /usr/include/unistd.h ] ; then
  202.     UNISTDH=define
  203.     echo  'found!'
  204. else
  205.     echo 'not found :('
  206. fi
  207. echo $n "...Looking for /usr/include/string.h...$c"
  208. if [ -r /usr/include/string.h ] ; then
  209.     STRINGH=define
  210.     echo  'found!'
  211. else
  212.     echo 'not found :('
  213. fi
  214. echo $n "...Looking for /usr/include/strings.h...$c"
  215. if [ -r /usr/include/strings.h ] ; then
  216.     STRINGSH=define
  217.     echo  'found!'
  218. else
  219.     echo 'not found :('
  220. fi
  221. #
  222. # to b or not to b
  223. #
  224. echo " "
  225. echo $n "To be or not to be...$c"
  226. cat > $TMP <<_EOF_
  227. main()
  228. {
  229.     char    a[3], b[3];
  230.     bzero(b,3);
  231.     bcopy(a,b,3);
  232.     (void)bcmp(a,b,3);
  233.     exit(0);
  234. }
  235. _EOF_
  236. $COMP >/dev/null 2>&1
  237. if [ $? -eq 0 ] ; then
  238.     echo "and so it shall be! bcopy/bzero/bcmp are about!"
  239.     BZERO=bzero
  240. else
  241.     echo "and it wasn't.  No bcopy/bzero/bcmp...hmpf"
  242.     BZERO=memset
  243. fi
  244. echo " "
  245. echo $n "Which one, gettimeofday, or lrand48..$c"
  246. cat > $TMP <<_EOF_
  247. #include <stdio.h>
  248. #include <sys/time.h>
  249. main()
  250.  {
  251.    struct timeval tv;
  252.    (void) gettimeofday(&tv, NULL);
  253.  }
  254. _EOF_
  255. $COMP >/dev/null 2>&1
  256. if [ $? -eq 0 ] ; then
  257.     echo "We have a winner! gettimeofday found."
  258.     GETTIMEOFDAY=define
  259. else
  260.     echo "No gettimeofday. Lets try lrand48."
  261. cat > $TMP <<_EOF_
  262. main()
  263. {
  264.    int a;
  265.    a=lrand48();
  266. }
  267. _EOF_
  268.     $COMP >/dev/null 2>&1
  269.     if [ $? -eq 0 ] ; then
  270.          echo "Bingo! lrand48!"
  271.         LRAND48=define
  272.     fi
  273. fi
  274. #
  275. # check for non-blocking fd style available..
  276. #
  277. echo " "
  278. echo 'Checking for POSIX/BSD/SYSV non-blocking stuff'
  279. if [ -f $TMP -o -d $TMP ] ; then
  280.     $RM -f $TMP
  281. fi
  282. cat > $PLATE <<_EOF_
  283. #include <sys/types.h>
  284. #include <sys/socket.h>
  285. #include <fcntl.h>
  286. #include <sys/ioctl.h>
  287. #include <sys/file.h>
  288. #include <signal.h>
  289. alarmed()
  290. {
  291.     exit(1);
  292. }
  293. main()
  294. {
  295.     char b[12], x[32];
  296.     int f, l = sizeof(x);
  297.     f = socket(AF_INET, SOCK_DGRAM, 0);
  298.     if (f >= 0 && !(fcntl(f, F_SETFL, BLOCKING))) {
  299.         signal(SIGALRM, alarmed);
  300.         alarm(3);
  301.         recvfrom(f, b, 12, 0, x, &l);
  302.         alarm(0);
  303.         exit(0);
  304.     }
  305.     exit(1);
  306. }
  307. _EOF_
  308. sed -e 's/BLOCKING/O_NONBLOCK/' $PLATE > $TMP
  309. $COMP >/dev/null 2>&1
  310. if [ 0 -eq $? ] ; then
  311.     $EXEC
  312. fi
  313. if [ 0 -eq $? ] ; then
  314.     BLOCK=O_NONBLOCK
  315. else
  316.     echo 'O_NONBLOCK not present/working in fcntl.h or sys/ioctl.h'
  317.     if [ -f $TMP -o -d $TMP ] ; then
  318.         $RM -f $TMP $EXEC;
  319.     fi
  320.     sed -e 's/BLOCKING/O_NDELAY/' $PLATE > $TMP
  321.     $COMP >/dev/null 2>&1
  322.     if [ 0 -eq $? ] ; then
  323.         $EXEC
  324.     fi
  325.     if [ 0 -eq $? ] ; then
  326.         BLOCK=O_NDELAY
  327.     else
  328.         echo 'O_NDELAY not present/working in fcntl.h or sys/ioctl.h'
  329.         if [ -f $TMP -o -d $TMP ] ; then
  330.             $RM -f $TMP $EXEC;
  331.         fi
  332.         sed -e 's/BLOCKING/FIONBIO/' $PLATE > $TMP
  333.         $COMP >/dev/null 2>&1
  334.         if [ 0 -eq $? ] ; then
  335.             echo 'FIONBIO not found!  No option found!'
  336.             BLOCK=none
  337.         else
  338.             BLOCK=FIONBIO
  339.         fi
  340.     fi
  341. fi
  342. $RM -f $TMP $PLATE $EXEC
  343. echo "Blocking selected: $BLOCK";
  344. #
  345. # reliable signals ?
  346. #
  347. echo 'Looking for reliable signals...'
  348. echo "Hmmm...wonder if you have 'action from POSIX..."
  349. cat > $TMP <<_EOF_
  350. #include <signal.h>
  351.  
  352. main()
  353. {    /* poor replacement for NULL but who cares here ? */
  354.     sigaction(SIGTERM, (struct sigaction *)0L, (struct sigaction *)0L);
  355. }
  356. _EOF_
  357. $COMP >/dev/null 2>&1
  358. if [ $? -eq 0 ] ; then
  359.     echo "Ooooh, you are a lucky one! 'action from POSIX!"
  360.     SIGNAL=posix
  361. else
  362.     $RM -f $EXEC $TMP
  363.     cat > $TMP <<_EOF_
  364. #include <signal.h>
  365. int    calls = 0;
  366. void    handler()
  367. {
  368.     if (calls)
  369.         return;
  370.     calls++;
  371.     kill(getpid(), SIGTERM);
  372.     sleep(1);
  373. }
  374. main()
  375. {
  376.     signal(SIGTERM, handler);
  377.     kill(getpid(), SIGTERM);
  378.     exit (0);
  379. }
  380. _EOF_
  381.     echo $n "Nope, but you have...$c"
  382.     $COMP >/dev/null 2>&1
  383.     $EXEC
  384.     if [ $? -eq 0 ] ; then
  385.         echo 'reliable signals! Cheers BSD!'
  386.         SIGNAL=bsd
  387.     else
  388.         echo "yucky, unreliable SYSV!"
  389.         SIGNAL=sysv
  390.     fi
  391. fi
  392. $RM -f $EXEC $TMP
  393. #
  394. echo 'Now those strings libraries...hmm...which one is it...'
  395. cat > $TMP <<_EOF_
  396. #$STRINGH STRINGH
  397. #$STRINGSH STRINGSH
  398. #ifdef STRINGH
  399. #include <string.h>
  400. #endif
  401. #ifdef STRINGSH
  402. #include <strings.h>
  403. #endif
  404. main()
  405. {
  406.     char *s = index("foo", 'o');
  407.     exit(0);
  408. }
  409. _EOF_
  410. $COMP >/dev/null 2>&1
  411. if [ $? -eq 0 ] ; then
  412.     echo "Cool...you have index()!"
  413. else
  414.     NOINDEX=define
  415.     echo "Grmpf...I guess there is a strchr() out there somewhere..."
  416. fi
  417. $RM -f $EXEC $TMP
  418. #
  419. # getrusage or times ?
  420. #
  421. echo $n "One for debugging, mainly, getrusage(2) or times(2)...$c"
  422. cat > $TMP <<_EOF_
  423. #include <sys/types.h>
  424. #include <sys/time.h>
  425. #include <sys/resource.h>
  426. main()
  427. {
  428.     struct    rusage    rus;
  429.     (void)getrusage(RUSAGE_SELF, &rus);
  430. }
  431. _EOF_
  432. $COMP >/dev/null 2>&1
  433. if [ $? -eq 0 ] ; then
  434.     TIMES=getrusage
  435.     echo "getrusage()"
  436. else
  437.     $RM -f $EXEC $TMP
  438.     cat > $TMP <<_EOF_
  439. #include <sys/types.h>
  440. #include <sys/time.h>
  441. #include <sys/times.h>
  442. main()
  443. {
  444.     struct    tms    tmsbuf;
  445.     (void)times(&tmsbuf);
  446. }
  447. _EOF_
  448.     $COMP >/dev/null 2>&1
  449.     if [ $? -eq 0 ] ; then
  450.         TIMES=times
  451.         echo "times()"
  452.     else
  453.         echo "couldn't get either ?!"
  454.         TIMES=none
  455.     fi
  456. fi
  457. #
  458. # what do we need that isn't here already ?
  459. #
  460. echo "What else do I need that you don't have..."
  461. echo $n "Lets see...$c"
  462. cat > $TMP <<_EOF_
  463. main()
  464. {
  465.     char  *s = strerror(0);
  466.     exit(0);
  467. }
  468. _EOF_
  469. $COMP >/dev/null 2>&1
  470. if [ $? -ne 0 ] ; then
  471.     echo $n " strerror$c"
  472.     NSTRERROR=define
  473. fi
  474. $RM -f $EXEC $TMP
  475. cat > $TMP <<_EOF_
  476. #$STRINGH STRINGH
  477. #$STRINGSH STRINGSH
  478. #ifdef STRINGH
  479. #include <string.h>
  480. #endif
  481. #ifdef STRINGSH
  482. #include <strings.h>
  483. #endif
  484. main()
  485. {
  486.     char  *t = "a", **p = NULL, *s = strtoken(&p, t, ",");
  487.     if (!strcmp(t, s))
  488.         exit(0);
  489.     exit(1);
  490. }
  491. _EOF_
  492. $COMP >/dev/null 2>&1
  493. if [ $? -ne 0 ] ; then
  494.     echo $n " strtoken$c"
  495.     NSTRTOKEN=define
  496. else
  497.     $EXEC
  498.     if [ $? -ne 0 ] ; then
  499.         echo $n " strtoken$c"
  500.         NSTRTOKEN=define
  501.     fi
  502. fi
  503. $RM -f $EXEC $TMP
  504. cat > $TMP <<_EOF_
  505. #$STRINGH STRINGH
  506. #$STRINGSH STRINGSH
  507. #ifdef STRINGH
  508. #include <string.h>
  509. #endif
  510. #ifdef STRINGSH
  511. #include <strings.h>
  512. #endif
  513. main()
  514. {
  515.     char  *t = "a", *s = strtok(t, ",");
  516.     if (!strcmp(t, s))
  517.         exit(0);
  518.     exit(1);
  519. }
  520. _EOF_
  521. $COMP >/dev/null 2>&1
  522. if [ $? -ne 0 ] ; then
  523.     echo $n " strtok$c"
  524.     NSTRTOK=define
  525. else
  526.     $EXEC
  527.     if [ $? -ne 0 ] ; then
  528.         echo $n " strtok$c"
  529.         NSTRTOK=define
  530.     fi
  531. fi
  532. $RM -f $EXEC $TMP
  533. cat > $TMP << _EOF_
  534. #include <sys/types.h>
  535. #include <netinet/in.h>
  536. main()
  537. {
  538.     struct    in_addr in;
  539.     (void)inet_addr("1.2.3.4");
  540. }
  541. _EOF_
  542. $COMP >/dev/null 2>&1
  543. if [ $? -ne 0 ] ; then
  544.     echo $n " inet_addr$c"
  545.     NINETADDR=define
  546. fi
  547. $RM -f $EXEC $TMP
  548. cat > $TMP << _EOF_
  549. #include <sys/types.h>
  550. #include <netinet/in.h>
  551. main()
  552. {
  553.     struct    in_addr    in;
  554.     in.s_addr = 0x12345678;
  555.     (void)inet_ntoa(in);
  556. }
  557. _EOF_
  558. $COMP >/dev/null 2>&1
  559. if [ $? -ne 0 ] ; then
  560.     echo $n " inet_ntoa$c"
  561. fi
  562. $RM -f $EXEC $TMP
  563. cat > $TMP << _EOF_
  564. #include <sys/types.h>
  565. #include <netinet/in.h>
  566. main()
  567. {
  568.     struct    in_addr    in;
  569.     in.s_addr = 0x87654321;
  570.     (void)inet_netof(in);
  571. }
  572. _EOF_
  573. $COMP >/dev/null 2>&1
  574. if [ $? -ne 0 ] ; then
  575.     echo $n " inet_netof$c"
  576.     NINETNETOF=define
  577. fi
  578. $RM -f $EXEC $TMP
  579. echo " "
  580. #
  581. #
  582. #
  583. echo " "
  584. echo "Ok, here's your chance...I think you should use $BLOCK, you want"
  585. echo "which of these ? O_NONBLOCK (POSIX) O_NDELAY (BSD) FIONBIO (SYSV)"
  586. echo $n "[$BLOCK] -> $c"
  587. read cc
  588. if [ "$cc" = "none" ] ; then
  589.     cc=''
  590. elif [ -z "$cc" ] ; then
  591.     cc=$BLOCK
  592. fi
  593. BLOCK=$cc
  594. echo "I found $SIGNAL signals."
  595. if [ "$cc" = "none" ] ; then
  596.     cc=''
  597. elif [ "$SIGNAL" = "posix" ] ; then
  598.     echo "Hmmm...I'm not sure if signal() is reliable or not either..."
  599. fi
  600. echo "You can choose between posix, bsd and sysv.  What'll it be ?"
  601. echo $n "[$SIGNAL] -> $c"
  602. read cc
  603. if [ "$cc" = "none" ] ; then
  604.     cc=''
  605. elif [ -z "$cc" ] ; then
  606.     cc=$SIGNAL
  607. fi
  608. SIGNAL=$cc
  609. if [ "$TIMES" = "none" ] ; then
  610.     echo "I didn't find either getrusage or times earlier...If you do have"
  611.     echo "either of these, please tell me now."
  612. else
  613.     echo "I found $TIMES, out of getrusage and times.  getrusage is"
  614.     echo "more informative.  If you wish to swap your choice, please"
  615.     echo "do so now."
  616. fi
  617. echo $n "[$TIMES] -> $c"
  618. read cc
  619. if [ "$cc" = "none" ] ; then
  620.     cc=''
  621. elif [ -z "$cc" ] ; then
  622.     cc=$TIMES
  623. fi
  624. TIMES=$cc
  625.  
  626. $RM -f $EXEC $TMP $PLATE
  627. $MV -f $SETUP $SETUP.bak 2>/dev/null
  628. cat > $SETUP  <<_EOF_
  629. #ifndef __setup_include__
  630. #define __setup_include__
  631. #$PARAMH    PARAMH
  632. #$UNISTDH    UNISTDH
  633. #$STRINGH    STRINGH
  634. #$STRINGSH    STRINGSH
  635. #$STDLIBH    STDLIBH
  636. #$STDDEFH    STDDEFH
  637. #$SYSSYSLOGH    SYSSYSLOGH
  638. #$NOINDEX    NOINDEX
  639. #$NSTRERROR    NEED_STRERROR
  640. #$NSTRTOKEN    NEED_STRTOKEN
  641. #$NSTRTOK    NEED_STRTOK
  642. #$NINETADDR    NEED_INET_ADDR
  643. #$NINETNTOA    NEED_INET_NTOA
  644. #$NINETNETOF    NEED_INET_NETOF
  645. #$GETTIMEOFDAY    GETTIMEOFDAY
  646. #$LRAND48    LRAND48
  647. _EOF_
  648. if [ "$MALLOCH" = "undef" ] ; then
  649.     echo "#undef    MALLOCH" >> $SETUP
  650. else
  651.     echo "#define    MALLOCH    <$MALLOCH>" >> $SETUP
  652. fi
  653. if [ "$BZERO" = "memset" ] ; then
  654.     cat >> $SETUP <<_EOF_
  655. #define    bzero(a,b)    memset(a,0,b)
  656. #define    bcopy(a,b,c)    memcpy(b,a,c)
  657. #define    bcmp    memcmp
  658. _EOF_
  659. fi
  660. if [ "$BLOCK" = "O_NONBLOCK" ] ; then
  661.     echo "#define    NBLOCK_POSIX" >> $SETUP
  662. elif [ "$BLOCK" = "O_NDELAY" ] ; then
  663.     echo "#define    NBLOCK_BSD" >> $SETUP
  664. else
  665.     echo "#define    NBLOCK_SYSV" >> $SETUP
  666. fi
  667. if [ "$SIGNAL" = "posix" ] ; then
  668.     echo "#define    POSIX_SIGNALS" >> $SETUP
  669. elif [ "$SIGNAL" = "bsd" ] ; then
  670.     echo "#define    BSD_RELIABLE_SIGNALS" >> $SETUP
  671. else
  672.     echo "#define    SYSV_UNRELIABLE_SIGNALS" >> $SETUP
  673. fi
  674. if [ "$TIMES" = "times" ] ; then
  675.     echo "#define    TIMES_2" >> $SETUP
  676.     echo "#undef    GETRUSAGE_2" >> $SETUP
  677. elif [ "$TIMES" = "getrusage" ] ; then
  678.     echo "#undef    TIMES_2" >> $SETUP
  679.     echo "#define    GETRUSAGE_2" >> $SETUP
  680. else
  681.     echo "#undef    TIMES_2" >> $SETUP
  682.     echo "#undef    GETRUSAGE_2" >> $SETUP
  683. fi
  684. echo "#endif" >> $SETUP
  685. touch include/config.h
  686. echo " "
  687. echo "If you would like to issue any shell commands before proceeding, do so"
  688. echo "now.  My findings are in include/setup.h if you wish to change them."
  689. echo $n "--> $c"
  690. read cc
  691. if [ ! -z "$cc" ] ; then
  692.     $cc
  693. fi
  694. exit 0
  695.