home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume26 / xinetd21 / part26 < prev    next >
Encoding:
Text File  |  1993-06-26  |  19.0 KB  |  731 lines

  1. Newsgroups: comp.sources.unix
  2. From: panos@cs.colorado.edu (Panos Tsirigotis)
  3. Subject: v26i270: xinetd-2.1.1 - inetd replacement with access control and logging, Part26/31
  4. Sender: unix-sources-moderator@gw.home.vix.com
  5. Approved: vixie@gw.home.vix.com
  6.  
  7. Submitted-By: panos@cs.colorado.edu (Panos Tsirigotis)
  8. Posting-Number: Volume 26, Issue 270
  9. Archive-Name: xinetd-2.1.1/part26
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 26 (of 31)."
  18. # Contents:  compile-src
  19. # Wrapped by panos@mystique on Mon Jun 21 14:51:28 1993
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f 'compile-src' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'compile-src'\"
  23. else
  24. echo shar: Extracting \"'compile-src'\" \(16974 characters\)
  25. sed "s/^X//" >'compile-src' <<'END_OF_FILE'
  26. X#!/bin/sh
  27. X
  28. X#
  29. X# (c) Copyright 1992, 1993 by Panagiotis Tsirigotis
  30. X#
  31. X
  32. X#
  33. X# $Id: compile-src,v 6.8 1993/06/17 16:56:30 panos Exp $
  34. X#
  35. X
  36. Xscript_name=`basename $0`
  37. X
  38. Xif test "$script_name" != "$0" -a "./$script_name" != "$0" ; then
  39. X   echo This script must be executed from the top level directory 
  40. X   exit 1
  41. Xfi
  42. X
  43. X#
  44. X# The order with which the libraries are listed is important.
  45. X# It is also a problem; to understand why consider this:
  46. X#        Library A depends (uses some functions from) library B
  47. X#        Then, B must be compiled and installed before A so that
  48. X#        A can find B's include files at the standard place.
  49. X#        But when linking the program with A and B, if B precedes A
  50. X#        then none of B's code will be included since nobody has yet
  51. X#        tried to use it (since has not been encountered yet).
  52. X#
  53. X# Our solution is to list the libraries in the order they are compiled
  54. X# and while compiling them also generate the reverse list which is the
  55. X# order they have to be linked.
  56. X#
  57. Xmandatory_libs="sio misc pset xlog str"
  58. Xoptional_libs="pq timer"
  59. X
  60. Xcatch_sigs="2 15"
  61. Xinc=/usr/include
  62. X
  63. X#
  64. X# The value of ccopt is used for setting the DEBUG makefile variable.
  65. X# Therefore, it can be used to either enable debugging support (i.e. -g),
  66. X# profiling support (i.e. -pg), or optimization support (i.e. -O)
  67. X# The default is optimization.
  68. X#
  69. Xccopt=-O
  70. X
  71. Xwhile test $# -gt 0
  72. Xdo
  73. X    option=$1 ; shift
  74. X    case $option in
  75. X        -libc)
  76. X                if test $# -eq 0 ; then
  77. X                    echo "Argument missing. Exiting..."
  78. X                    exit 1
  79. X                fi
  80. X                libc=$1
  81. X                shift
  82. X                if test ! -r $libc ; then
  83. X                    echo "File is not readable: $libc"
  84. X                    exit 1
  85. X                fi
  86. X                ;;
  87. X
  88. X        -signals)
  89. X                if test $# -eq 0 ; then
  90. X                    echo "Argument missing. Exiting..."
  91. X                    exit 1
  92. X                fi
  93. X                signal_handling=$1
  94. X                shift
  95. X                ;;
  96. X
  97. X        -ccopt)
  98. X                if test $# -eq 0 ; then
  99. X                    echo "Argument missing. Exiting..."
  100. X                    exit 1
  101. X                fi
  102. X                ccopt=$1
  103. X                shift
  104. X                ;;
  105. X
  106. X        -os)
  107. X                if test $# -eq 0 ; then
  108. X                    echo "Argument missing. Exiting..."
  109. X                    exit 1
  110. X                fi
  111. X                osversion=$1 ;
  112. X                shift
  113. X                ;;
  114. X        
  115. X        -auto)
  116. X                autoconfig=yes
  117. X                ;;
  118. X
  119. X        -sf|-cf)
  120. X                if test $# -eq 0 ; then
  121. X                    echo "Missing argument to $option. Exiting..."
  122. X                    exit 1
  123. X                fi
  124. X                    
  125. X                if test "$option" = "-sf" ; then
  126. X                    v=yes
  127. X                else
  128. X                    v=no
  129. X                fi
  130. X
  131. X                specified_flags=yes
  132. X                flag=$1
  133. X                shift
  134. X
  135. X                #
  136. X                # The first 2 lines are for xinetd.
  137. X                # The 3rd line has to do with the man pages (xinetd and libraries)
  138. X                # The rest of the lines are for the libraries
  139. X                #
  140. X                case "$flag" in
  141. X                    old_wait|no_rpc|no_termios|no_posix_types)    eval $flag=$v ;;
  142. X                    no_siglist)                                                eval $flag=$v ;;
  143. X                    has_SB)                                                    eval $flag=$v ;;
  144. X                    old_dir|no_ftw|no_timers|no_syslog)                eval $flag=$v ;;
  145. X                    has_mmap|has_memops|has_bcopy)                  eval $flag=$v ;;
  146. X                    has_isatty|has_bsdtty|has_sysvtty)              eval $flag=$v ;;
  147. X                    has_onexit|has_atexit)                          eval $flag=$v ;;
  148. X                    *)    echo "Bad flag name: $flag. Exiting..." ; exit 1
  149. X                esac
  150. X                ;;
  151. X
  152. X        -custom)
  153. X                custom=yes
  154. X                ;;
  155. X
  156. X        -verbose)
  157. X                verbose=yes
  158. X                ;;
  159. X        #
  160. X        # THIS IS THE SCRIPT DOCUMENTATION
  161. X        #
  162. X        -help)
  163. X            echo "Usage: $script_name [options]"
  164. X            echo "Options:"
  165. X            echo "   -libc pathname : specifies the location of the C library"
  166. X            echo "   -signals type  : type of signal handling"
  167. X            echo "   -os osname     : specifies the OS name and version"
  168. X            echo "   -auto          : automatic configuration"
  169. X            echo "   -verbose       : display info about configuration"
  170. X            echo "   -custom        : there is a custom xinetd configuration file"
  171. X            echo "   -ccopt option  : option should be either -g for debugging"
  172. X            echo "                    or -O for optimization"
  173. X            echo "Possible arguments to -signals:"
  174. X            echo "         posix, bsd, simple"
  175. X            echo "Possible arguments to -os:"
  176. X            echo "        sunos4, ultrix4"
  177. X            echo "The -sf and -cf options set or clear flags that specify"
  178. X            echo "what facilities are available from the operating system"
  179. X            echo "Only one flag can be specified per -sf/-cf but these options"
  180. X            echo "can be used multiple times."
  181. X            echo "Available flags:"
  182. X         echo "   no_timers      : BSD-type timers are not available"
  183. X         echo "   no_rpc         : system does not support RPC"
  184. X         echo "   no_termios     : termios(3) is not available"
  185. X         echo "   no_siglist     : sys_siglist(3) is not available"
  186. X         echo "   no_ftw         : ftw(3) is not available"
  187. X         echo "   no_syslog      : syslog(3) is not available"
  188. X         echo "   no_posix_types : POSIX types are not available"
  189. X         echo "   has_isatty     : isatty(3) is available"
  190. X         echo "   has_bsdtty     : system has BSD-type tty interface"
  191. X         echo "   has_sysvtty    : system has SysV-type tty interface"
  192. X         echo "   has_mmap       : mmap(2) is available"
  193. X         echo "   has_memops     : memops(3) functions are available"
  194. X         echo "   has_bcopy      : bcopy(3) is available"
  195. X         echo "   has_onexit     : onexit(3) is available"
  196. X         echo "   has_atexit     : atexit(3) is available"
  197. X         echo "   old_wait       : wait(2) expects a 'union wait' argument"
  198. X         echo "   old_dir        : old directory(3) package"
  199. X         echo "   has_SB         : system supports .SB in man pages"
  200. X         echo
  201. X            echo "You can use the -os option to specify an operating system"
  202. X            echo "and then you can use -sf/-cf for further mods."
  203. X            exit 2
  204. X            ;;
  205. X
  206. X        *) echo "Bad argument: $1. Exiting..." ; exit 1
  207. X    esac
  208. Xdone
  209. X
  210. Xif test "$autoconfig" -a "$osversion" ; then
  211. X    echo "Only one of -auto, -os can be specified"
  212. X    exit 1
  213. Xfi
  214. X
  215. Xif test ! "$osversion" -a ! "$autoconfig" ; then
  216. X    echo "I need to know the operating system you are using and the version."
  217. X    echo "I know about"
  218. X    echo "   SunOS 4.x (sunos4)"
  219. X    echo "   Ultrix 4.x (ultrix4)"
  220. X    echo "If your OS is among these, use the name in the parentheses, otherwise"
  221. X    echo "just hit <return> and I will try to figure out how to properly"
  222. X    echo -n "configure xinetd for your system --> "
  223. X    read osversion
  224. Xfi
  225. X
  226. X#
  227. X# This if statement checks if we have a known osversion.
  228. X# If we don't, we set the autoconfig flag.
  229. X#
  230. Xif test "$osversion" ; then
  231. X    case $osversion in
  232. X        sunos4|ultrix4)
  233. X            autoconfig= 
  234. X            signal_handling=bsd
  235. X            ;;
  236. X        *) echo "I don't know anything about this OS. Exiting..." ; exit 1
  237. X    esac
  238. Xelse
  239. X    autoconfig=yes
  240. Xfi
  241. X
  242. X#
  243. X# Get namelist of C library
  244. X#
  245. Xif test "$autoconfig" ; then
  246. X    echo "Obtaining name list of C library"
  247. X
  248. X    if test ! "$libc" ; then
  249. X        if test -r /lib/libc.a ; then
  250. X            libc=/lib/libc.a
  251. X        else
  252. X            if test -r /usr/lib/libc.a ; then
  253. X                libc=/usr/lib/libc.a
  254. X            else
  255. X                echo -n "Please give me the pathname of the C library -> "
  256. X                read libc
  257. X                if test ! "$libc" -o ! -r "$libc" ; then
  258. X                    echo "Bad pathname. Exiting..."
  259. X                    exit 1
  260. X                fi
  261. X            fi
  262. X        fi
  263. X    fi
  264. X    nmfile=/tmp/libc.nm.$$
  265. X    nm $libc > $nmfile 2>/dev/null
  266. X    if test $? -ne 0 ; then
  267. X        if test ! -s $nmfile ; then
  268. X            echo "Couldn't get the namelist of C library. Exiting..."
  269. X            rm -f $nmfile
  270. X            exit 1
  271. X        else        # name list file is not empty
  272. X            echo "WARNING: The 'nm' command returned a non-zero exit status"
  273. X            echo "WARNING: so the namelist obtained from the C library may be incomplete"
  274. X            echo "Continuing with auto-configuration"
  275. X        fi
  276. X    fi
  277. Xfi
  278. X
  279. Xif test "$specified_flags" -o "$autoconfig" ; then
  280. X    lib_defs=
  281. X    xinetd_defs=
  282. X
  283. X    #
  284. X    # Determine supported signal handing
  285. X    #
  286. X    if test "$autoconfig" -a ! "$signal_handling" ; then
  287. X        if test "$verbose" ; then echo "Looking for sigaction" ; fi
  288. X        found=`grep sigaction $nmfile | grep T`
  289. X        if test "$found" ; then
  290. X            signal_handling=posix
  291. X        else
  292. X            if test "$verbose" ; then echo "Looking for sigvec" ; fi
  293. X            found=`grep sigvec $nmfile | grep T`
  294. X            if test "$found" ; then 
  295. X                signal_handling=bsd
  296. X            else
  297. X                signal_handling=simple
  298. X            fi
  299. X        fi
  300. X    fi
  301. X
  302. X    case "$signal_handling" in
  303. X        posix)    v= ;;
  304. X        bsd)        v="-DNO_POSIX_SIGS" ;;
  305. X        simple)    v="-DNO_POSIX_SIGS -DNO_SIGVEC" ;;
  306. X    esac
  307. X    xinetd_defs="$xinetd_defs $v"
  308. X
  309. X    #
  310. X    # Check for setitimer(2)
  311. X    #
  312. X    case "$no_timers" in
  313. X        yes)    v=-DNO_TIMERS ;;
  314. X        no)    v= ;;
  315. X        *)
  316. X                if test "$autoconfig" ; then
  317. X                    if test "$verbose" ; then echo "Looking for setitimer" ; fi
  318. X                    found=`grep setitimer $nmfile | grep T`
  319. X                    if test ! "$found" ; then v=-DNO_TIMERS ; else v= ; fi
  320. X                else
  321. X                    v=
  322. X                fi
  323. X    esac
  324. X    xinetd_defs="$xinetd_defs $v"
  325. X
  326. X    #
  327. X    # Check for sys_siglist
  328. X    #
  329. X    case "$no_siglist" in
  330. X        yes)    v=-DNO_SIGLIST ;;
  331. X        no)    v= ;;
  332. X        *)
  333. X                if test "$autoconfig" ; then
  334. X                    if test "$verbose" ; then echo "Looking for sys_siglist" ; fi
  335. X                    found=`grep sys_siglist $nmfile | grep D`
  336. X                    if test ! "$found" ; then v=-DNO_SIGLIST ; else v= ; fi
  337. X                else
  338. X                    v=
  339. X                fi
  340. X    esac
  341. X    xinetd_defs="$xinetd_defs $v"
  342. X
  343. X    #
  344. X    # Check for RPC
  345. X    #
  346. X    case "$no_rpc" in
  347. X        yes)    v=-DNO_RPC ;;
  348. X        no)    v= ;;
  349. X        *)
  350. X                if test "$autoconfig" ; then
  351. X                    if test "$verbose" ; then echo "Looking for RPC" ; fi
  352. X                    found=`grep rpcent $inc/netdb.h`
  353. X                    if test ! "$found" ; then v=-DNO_RPC ; else v= ; fi
  354. X                else
  355. X                    v=
  356. X                fi
  357. X    esac
  358. X    xinetd_defs="$xinetd_defs $v"
  359. X
  360. X    #
  361. X    # Check if this system supports the old wait
  362. X    #
  363. X    case "$old_wait" in
  364. X        yes)    v=-DOLD_WAIT ;;
  365. X        no)    v= ;;
  366. X        *)
  367. X            if test "$autoconfig" ; then
  368. X                if test "$verbose" ; then echo "Looking for WEXITSTATUS" ; fi
  369. X                found=`grep WEXITSTATUS $inc/sys/wait.h`
  370. X                if test ! "$found" ; then v=-DOLD_WAIT ; else v= ; fi
  371. X            else
  372. X                v=
  373. X            fi
  374. X    esac
  375. X    xinetd_defs="$xinetd_defs $v"
  376. X
  377. X    #
  378. X    # Check for pid_t
  379. X    # 
  380. X    case "$no_posix_types" in
  381. X        yes)    v=-DNO_POSIX_TYPES ;;
  382. X        no)    v= ;;
  383. X        *)
  384. X            if test "$autoconfig" ; then
  385. X                if test "$verbose" ; then echo "Looking for pid_t" ; fi
  386. X                found=`cd $inc/sys ; grep pid_t *.h | grep typedef`
  387. X                if test ! "$found" ; then v=-DNO_POSIX_TYPES ; else v= ; fi
  388. X            else
  389. X                v=
  390. X            fi
  391. X    esac
  392. X    xinetd_defs="$xinetd_defs $v"
  393. X
  394. X    #
  395. X    # Check for termios
  396. X    #
  397. X    case "$no_termios" in
  398. X        yes)    v=-DNO_TERMIOS ;;
  399. X        no)    v= ;;
  400. X        *)
  401. X            if test "$autoconfig" ; then
  402. X                if test -r $inc/sys/termios.h -o -r $inc/termios.h ; then
  403. X                    v=
  404. X                else
  405. X                    v=-DNO_TERMIOS
  406. X                fi
  407. X            else
  408. X                v=
  409. X            fi
  410. X    esac
  411. X    xinetd_defs="$xinetd_defs $v"
  412. X
  413. X    #
  414. X    # Check for new directory types
  415. X    #
  416. X    case "$old_dir" in
  417. X        yes)    v=-DOLD_DIR ;;
  418. X        no)    v= ;;
  419. X        *)
  420. X                if test "$autoconfig" ; then
  421. X                    if test -r $inc/dirent.h ; then
  422. X                        v=
  423. X                    else
  424. X                        v=-DOLD_DIR
  425. X                    fi
  426. X                else
  427. X                    v=
  428. X                fi
  429. X    esac
  430. X    lib_defs="$lib_defs $v"
  431. X
  432. X    #
  433. X    # Check for ftw(3)
  434. X    #
  435. X    case "$no_ftw" in
  436. X        yes)    v=-D__FTWX_NO_FTW ;;
  437. X        no)    v= ;;
  438. X        *)
  439. X                if test "$autoconfig" ; then
  440. X                    if test -r $inc/ftw.h ; then 
  441. X                        v=
  442. X                    else
  443. X                        v=-D__FTWX_NO_FTW
  444. X                    fi
  445. X                else
  446. X                    v=
  447. X                fi
  448. X    esac
  449. X    lib_defs="$lib_defs $v"
  450. X
  451. X    #
  452. X    # Check for syslog(3)
  453. X    #
  454. X    case "$no_syslog" in
  455. X        yes)    v=-DNO_SYSLOG ;;
  456. X        no)    v= ;;
  457. X        *)
  458. X                if test "$autoconfig" ; then
  459. X                    if test "$verbose" ; then echo "Looking for syslog" ; fi
  460. X                    found=`grep syslog $nmfile | grep T`
  461. X                    if test ! "$found" ; then v=-DNO_SYSLOG ; else v= ; fi
  462. X                else
  463. X                    v=
  464. X                fi
  465. X    esac
  466. X    lib_defs="$lib_defs $v"
  467. X
  468. X    #
  469. X    # Check for mmap. Since it is not required, we do not try to find
  470. X    # if the system supports it.
  471. X    #
  472. X    case "$has_mmap" in
  473. X        yes)  v=-DHAS_MMAP ;;
  474. X        *)    v= ;;
  475. X    esac
  476. X    lib_defs="$lib_defs $v"
  477. X
  478. X   case "$has_onexit" in
  479. X      yes)  v=-DHAS_ONEXIT ;;
  480. X      no)   v= ;;
  481. X      *)
  482. X            if test "$autoconfig" ; then
  483. X               if test "$verbose" ; then echo "Looking for on_exit" ; fi
  484. X               found=`grep on_exit $nmfile | grep T`
  485. X               if test "$found" ; then v=-DHAS_ONEXIT ; else v= ; fi
  486. X            else
  487. X               v=
  488. X            fi
  489. X   esac
  490. X   lib_defs="$lib_defs $v"
  491. X
  492. X   case "$has_atexit" in
  493. X      yes)  v=-DHAS_ATEXIT ;;
  494. X      no)   v= ;;
  495. X      *)
  496. X            if test "$autoconfig" ; then
  497. X               if test "$verbose" ; then echo "Looking for atexit" ; fi
  498. X               found=`grep atexit $nmfile | grep T`
  499. X               if test "$found" ; then v=-DHAS_ATEXIT ; else v= ; fi
  500. X            else
  501. X               v=
  502. X            fi
  503. X   esac
  504. X   lib_defs="$lib_defs $v"
  505. X
  506. X   case "$has_memops" in
  507. X      yes)  v=-DHAS_MEMOPS ;;
  508. X      no)   v= ;;
  509. X      *)
  510. X            if test "$autoconfig" ; then
  511. X               if test "$verbose" ; then echo "Looking for memcpy" ; fi
  512. X               found=`grep memcpy $nmfile | grep T`
  513. X               if test "$found" ; then v=-DHAS_MEMOPS ; else v= ; fi
  514. X            else
  515. X               v=
  516. X            fi
  517. X   esac
  518. X   lib_defs="$lib_defs $v"
  519. X
  520. X   case "$has_bcopy" in
  521. X      yes)  v=-DHAS_BCOPY ;;
  522. X      no)   v= ;;
  523. X      *)
  524. X            if test "$autoconfig" ; then
  525. X               if test "$verbose" ; then echo "Looking for bcopy" ; fi
  526. X               found=`grep bcopy $nmfile | grep T`
  527. X               if test "$found" ; then v=-DHAS_BCOPY ; else v= ; fi
  528. X            else
  529. X               v=
  530. X            fi
  531. X   esac
  532. X   lib_defs="$lib_defs $v"
  533. X
  534. X   case "$has_isatty" in
  535. X      yes)  v=-DHAS_ISATTY ;;
  536. X      no)   v= ;;
  537. X      *)
  538. X            if test "$autoconfig" ; then
  539. X               if test "$verbose" ; then echo "Looking for isatty" ; fi
  540. X               found=`grep bcopy $nmfile | grep T`
  541. X               if test "$found" ; then v=-DHAS_ISATTY ; else v= ; fi
  542. X            else
  543. X               v=
  544. X            fi
  545. X   esac
  546. X   #
  547. X   # Since SIO cannot compile without the isatty function, if isatty is not
  548. X   # in the C library, we have to provide our own. For this, we need to know
  549. X   # if the system supports BSD or SysV tty handling.
  550. X   #
  551. X   if test ! "$osversion" -a ! "$v" ; then
  552. X      while test ! "$v"
  553. X      do
  554. X         echo "Is your OS based on System V or on BSD 4.x ? I am really"
  555. X         echo -n "interested in terminal handling. You can say sysv or bsd -->"
  556. X         read ans
  557. X         case $ans in
  558. X            sysv) v=-DHAS_SYSVTTY ;;
  559. X            bsd)  v=-DHAS_BSDTTY ;;
  560. X            *) echo "Please say either 'sysv' or 'bsd'"
  561. X         esac
  562. X      done
  563. X   fi
  564. X   lib_defs="$lib_defs $v"
  565. Xfi
  566. X
  567. Xif test "$autoconfig" ; then
  568. X    rm -f $nmfile
  569. Xfi
  570. X
  571. X#
  572. X# If we know the OS, we can provide the appropriate flags for SIO
  573. X#
  574. Xcase "$osversion" in
  575. X   sunos4) sio_defs="-DHAS_MMAP -DHAS_ONEXIT -DHAS_MEMOPS -DHAS_ISATTY" ;;
  576. X   ultrix4) sio_defs="-DHAS_MEMOPS -DHAS_ATEXIT -DHAS_ISATTY" ;;
  577. X   *) sio_defs="$lib_defs"
  578. Xesac
  579. X
  580. Xcase "$no_timers" in
  581. X    yes) lib_names="$mandatory_libs" ;;
  582. X    *)
  583. X        case "$signal_handling" in
  584. X            posix)    lib_names="$mandatory_libs $optional_libs" ;;
  585. X            bsd)        lib_names="$mandatory_libs $optional_libs"
  586. X                        lib_defs="$lib_defs -DNO_POSIX_SIGS"
  587. X                        ;;
  588. X            *)            lib_names="$mandatory_libs"
  589. X        esac
  590. Xesac
  591. X
  592. XPWD=`pwd`
  593. X
  594. Xincdir=$PWD/libs/include
  595. Xmandir=$PWD/libs/man
  596. Xlibdir=$PWD/libs/lib
  597. X
  598. X#
  599. X# Only Suns undestand .SB in man pages, so if we are not dealing with
  600. X# a Sun we replace .SB with .B
  601. X#
  602. Xif test "$osversion" = "sunos4" ; then
  603. X    modify_manpages=
  604. Xelse
  605. X    case "$has_SB" in
  606. X        yes) modify_manpages= ;;
  607. X        no)  modify_manpages=yes ;;
  608. X        *)
  609. X        echo -n "Can your machine handle .SB in a man page ? (if you are not sure, say no) -->"
  610. X        read x
  611. X        if test "$x" = "n" -o "$x" = "no" ; then
  612. X            modify_manpages=yes
  613. X        else
  614. X            modify_manpages=
  615. X        fi
  616. X    esac
  617. Xfi
  618. X
  619. Xif test "$modify_manpages" ; then
  620. X    #
  621. X    # We can't take any interrupts while processing the manpages
  622. X    #
  623. X    trap 'interrupt_occured=yes' $catch_sigs
  624. X
  625. X    echo "Replacing .SB in library man pages with .B (if a man page is changed"
  626. X    echo "the original will be kept by appending .orig to its name)"
  627. X    for i in $lib_names
  628. X    do
  629. X        cd $PWD/libs/src/$i
  630. X        for i in *.3
  631. X        do
  632. X            mv $i $i.orig                                            # save the original
  633. X            sed 's/[.]SB/.B/' $i.orig > $i                    # do the replacement
  634. X            cmp -s $i $i.orig                                        # are they the same ?
  635. X            if test $? -eq 0 ; then rm $i.orig ; fi        # if yes, remove the copy
  636. X        done
  637. X        if test "$interrupt_occured" = "yes" ; then
  638. X            echo "Interrupt: quiting"
  639. X            exit 1
  640. X        fi
  641. X    done
  642. X
  643. X    trap $catch_sigs        # no more trapping
  644. Xfi
  645. X
  646. X#
  647. X# Make the libraries
  648. X# Also prepare the value of the LIBS variable in the xinetd Makefile
  649. X#
  650. Xmvars="DEBUG=$ccopt MANDIR=$mandir INCLUDEDIR=$incdir LIBDIR=$libdir"
  651. Xfor i in $lib_names
  652. Xdo
  653. X    libs="-l$i $libs"
  654. X    cd $PWD/libs/src/$i
  655. X    echo Making library: $i
  656. X    #
  657. X    # Remove the archive if it is already there; this is to avoid ld complaints
  658. X    # that the table of contents is out of date.
  659. X    #
  660. X    rm -f lib$i.a
  661. X    if test "$i" = "sio" ; then
  662. X        make $mvars DEFS="$sio_defs" install
  663. X    else
  664. X        make $mvars DEFS="$lib_defs" install
  665. X    fi
  666. X    if test $? -ne 0 ; then
  667. X        echo "Failed to create library: $i"
  668. X        exit 2
  669. X    fi
  670. Xdone
  671. X
  672. X#
  673. X# Now make xinetd
  674. X# We remove the xinetd executable, if there is one, in case the libraries
  675. X# have changed
  676. X#
  677. Xcd $PWD/xinetd
  678. Xrm -f xinetd
  679. Xmvars="DEBUG=$ccopt INCLUDEDIR=-I$incdir LDFLAGS=-L$libdir"
  680. Xif test "$custom" ; then xinetd_defs="$xinetd_defs -DCUSTOMCONF" ; fi
  681. Xmake "DEFS=$xinetd_defs" "LIBS=$libs" $mvars
  682. Xif test $? -ne 0 ; then
  683. X    echo Failed to create xinetd
  684. X    exit 2
  685. Xfi
  686. X
  687. Xif test "$modify_manpages" ; then
  688. X
  689. X    trap 'interrupt_occured=yes' $catch_sigs
  690. X
  691. X    echo "Replacing .SB in xinetd man pages with .B"
  692. X    for i in *.man
  693. X    do
  694. X        mv $i $i.orig
  695. X        sed 's/[.]SB/.B/' $i.orig > $i
  696. X        cmp -s $i $i.orig                                        # are they the same ?
  697. X        if test $? -eq 0 ; then rm $i.orig ; fi        # if yes, remove the copy
  698. X
  699. X        if test "$interrupt_occured" = "yes" ; then
  700. X            echo "Interrupt: quiting"
  701. X            exit 1
  702. X        fi
  703. X    done
  704. X    trap $catch_sigs        # no more trapping
  705. Xfi
  706. X
  707. END_OF_FILE
  708. if test 16974 -ne `wc -c <'compile-src'`; then
  709.     echo shar: \"'compile-src'\" unpacked with wrong size!
  710. fi
  711. chmod +x 'compile-src'
  712. # end of 'compile-src'
  713. fi
  714. echo shar: End of archive 26 \(of 31\).
  715. cp /dev/null ark26isdone
  716. MISSING=""
  717. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 ; do
  718.     if test ! -f ark${I}isdone ; then
  719.     MISSING="${MISSING} ${I}"
  720.     fi
  721. done
  722. if test "${MISSING}" = "" ; then
  723.     echo You have unpacked all 31 archives.
  724.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  725. else
  726.     echo You still need to unpack the following archives:
  727.     echo "        " ${MISSING}
  728. fi
  729. ##  End of shell archive.
  730. exit 0
  731.