home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / Shells / zsh / Source / src / config / bz.config.h < prev    next >
Encoding:
Text File  |  1994-04-07  |  10.6 KB  |  421 lines

  1. # --- ${C_BLDDIR}config.h
  2.  
  3. if test -n "$B_config_h"
  4. then
  5.  
  6. F_define=yep
  7. F_using=yep
  8.  
  9. echo
  10. echo Building ${C_BLDDIR}config.h...
  11.  
  12. (exec >${C_BLDDIR}config.h
  13.  
  14. {
  15. echo
  16. echo '    starting features probing...'
  17. echo
  18. } >&2
  19.  
  20. cat <<foo
  21. /* config.h */
  22. /* architecture-customized config.h for $VERSION
  23.  * for architecture "$arch",
  24.  * automagically generated by buildzsh -- do not edit */
  25.  
  26. foo
  27.  
  28. set elfh elf.h ${headerdir}/sys
  29. . bz.walk
  30.  
  31. set resourceh resource.h ${headerdir}/sys
  32. . bz.walk
  33.  
  34. set 'test -n "$elfh" -o -z "$resourceh"' SYSV 1 'pure SYSV'
  35. . bz.ifdef
  36.  
  37. if test -n "$_yea"
  38. then
  39.   PATH=/usr/bin:$PATH
  40.   export PATH
  41.   echo '    forcing /usr/bin early in PATH...' >&2
  42.   if test -n "${elfh}"
  43.   then
  44.     echo '#define SYSVR4'
  45.     echo '    looks like a SYSVR4 system...' >&2
  46.     force_setpgid=1
  47.     force_strftime=1
  48.     if test -n "$SOLARIS"
  49.     then
  50.       echo '#define SOLARIS'
  51.       echo '    looks like a Solaris...' >& 2
  52.     fi
  53.     echo
  54.   fi
  55. fi
  56.  
  57. echo '/* some environments have broken termios, for example ULTRIX */'
  58. set 'test -z "$ULTRIX" -a -z "$APOLLO" -a -z "$BBN" -a -z "$NEXT" -a -f ${headerdir}/termios.h' HAS_TERMIOS 1 'termios'
  59. . bz.ifdef
  60.  
  61. if test -z "$_nay"
  62. then
  63.   test -n "$DGUX" && echo '#define CLOBBERS_TYPEAHEAD 1'
  64. else
  65.  
  66. set 'test -z "$ULTRIX" -a -z "`grep sgttyb ${headerdir}/sys/ioctl.h 2>/dev/null`"' HAS_TERMIO 1 'termio'
  67. . bz.ifdef
  68. echo '    using sgttyb...' >&2
  69.  
  70. if test -z "$ULTRIX" -a -z "$NEXT"
  71. then
  72. cat <<foo
  73. #define TTY_NEEDS_DRAINING 1
  74. #define CLOBBERS_TYPEAHEAD 1
  75.  
  76. foo
  77. fi
  78.  
  79. fi
  80.  
  81. test -n "$IRIX5" && echo '#define IRIX5'
  82.   
  83. set 'test -f ${headerdir}/dirent.h \
  84.           -a -z "$NEXT" -a -z "$ULTRIX"'\
  85.     HAS_DIRENT 1 '<dirent.h>'
  86. . bz.ifdef
  87.  
  88. set 'test -f ${headerdir}/unistd.h' HAS_UNISTD 1 '<unistd.h>'
  89. . bz.ifdef
  90.  
  91. set stdlibh stdlib.h "/usr/include/ansi ${headerdir}"
  92. . bz.walk
  93.  
  94. if test -n "$stdlibh"
  95. then
  96.    set 'grep alloc $stdlibh >/dev/null 2>&1' HAS_STDLIB 1 '<stdlib.h>'
  97.   . bz.ifdef
  98. fi
  99.  
  100. set 'test -f ${headerdir}/string.h' HAS_STRING 1 '<string.h>' '<strings.h>'
  101. . bz.ifdef
  102.  
  103. if test -f ${headerdir}/strings.h -a -n "${NEXT}" -a Z"${NEXT}" != Z3.x
  104. then
  105. cat <<foo
  106. /* BSD compat */
  107. #define strchr    index
  108. #define strrchr    rindex
  109. foo
  110. fi
  111.  
  112. set 'test -f ${headerdir}/memory.h' HAS_MEMORY 1 '<memory.h>'
  113. . bz.ifdef
  114.  
  115. if test -n "$_nay"
  116. then
  117. set 'grep memset ${headerdir}/string.h >/dev/null 2>&1' '' '' 'memcpy(),memset(),memcmp() from <string.h>' 'redefined memcpy(), memset(), memcmp()' '' '' '
  118. #define memcpy(dst, src, n)    bcopy(src, dst, n)
  119. #define memset(dst, ch, n)    do {\
  120.     char *__DST__ = (char *)(dst);\
  121.     int __N__ = (int)(n), __CH__ = (int)(ch);\
  122.     while (__N__--) { __DST__[__N__] = __CH__; } } while(0)
  123. #define memcmp(s1, s2, n)    bcmp(s1, s2, n)'
  124. . bz.ifdef
  125. fi
  126.  
  127. set 'test -f ${headerdir}/locale.h' HAS_LOCALE 1 '<locale.h>'
  128. . bz.ifdef
  129.  
  130. if test -f "${headerdir}/utmpx.h"
  131. then
  132.   _utmp_hs_="${headerdir}/utmpx.h ${headerdir}/utmp.h"
  133. else
  134.   _utmp_hs_="${headerdir}/utmp.h"
  135. fi
  136.  
  137. set utmph "utmpx.h utmp.h" ${headerdir}
  138. . bz.walk
  139.  
  140. set 'test Z$utmph = Z${headerdir}/utmpx.h' HAS_UTMPX 1 '<utmpx.h>' '<utmp.h>'
  141. . bz.ifdef
  142.  
  143. set 'grep ut_host $utmph >/dev/null 2>&1 && ( test Z"$host" != Zmips || test -n "$OSF1" )' UTMP_HOST 1 'host field in utmp'
  144. . bz.ifdef
  145.  
  146. set 'test -f ${headerdir}/time.h && (grep timeval ${headerdir}/time.h >/dev/null 2>&1 || test -n "$SCO" )' HAS_TIME 1 '<time.h>' '<sys/time.h>'
  147. . bz.ifdef
  148.  
  149. set waith wait.h "${headerdir} ${headerdir}/sys"
  150. . bz.walk
  151.  
  152. set 'test Z$waith = Z${headerdir}/wait.h' HAS_WAIT 1 '<wait.h>' '<sys/wait.h>'
  153. . bz.ifdef
  154.  
  155. set 'test -z "$NEXT" && grep "waitpid.*(" $waith >/dev/null 2>&1 || man 2 wait 2>/dev/null | sed "s/_.//g" | grep waitpid >/dev/null' HAS_WAITPID 1 'waitpid()'
  156. . bz.ifdef
  157.  
  158. set 'grep FD_SET ${headerdir}/sys/types.h >/dev/null 2>&1 || test -f ${headerdir}/sys/select.h || test -n "$LINUX"' HAS_SELECT 1 'select()'
  159. . bz.ifdef
  160.  
  161. set 'test -f ${headerdir}/sys/select.h \
  162.      && \
  163.      grep "struct  *fd_set " ${headerdir}/sys/select.h >/dev/null 2>&1' \
  164.      HAS_SYS_SELECT 1 \
  165.      '<sys/select.h>' '' '"struct fd_set" in <sys/select.h>'
  166. . bz.ifdef
  167.  
  168. cat <<foo
  169. /* we can't just test for S_IFIFO or check to see if the mknod worked,
  170.    because the NeXTs sold by a vendor which will remain nameless will
  171.    happily create the FIFO for you, and then panic when you try to do
  172.     something weird with them, because they aren't supported by the OS. */
  173. foo
  174. set 'test -z "$NEXT" -o Z"$NEXT" != Z2.x' HAS_FIFOS 1 'fifos'
  175. . bz.ifdef
  176.  
  177. set 'test -n "$force_strftime" -o -n "$MIPS" -o -n "$AIX" -o -n "$LINUX" || \
  178.      man 3 strftime 2>/dev/null | grep return >/dev/null || \
  179.      man -s 3c strftime 2>/dev/null | grep return >/dev/null' \
  180.     HAS_STRFTIME 1 'strftime()'
  181. . bz.ifdef
  182.  
  183. set 'test -n "$MIPS" -o -n "$AIX" || \
  184.      grep tcsetpgrp ${headerdir}/unistd.h >/dev/null 2>&1 || \
  185.      man tcsetpgrp 2>/dev/null | grep process >/dev/null && test -z "$NEXT"' \
  186.     HAS_TCSETPGRP 1 'tcsetpgrp()'
  187. . bz.ifdef
  188.  
  189. _term_hs_="${headerdir}/termio.h ${headerdir}/sys/termio.h ${headerdir}/termios.h ${headerdir}/sys/termios.h"
  190.  
  191. set 'test -z "$NEXT" -a -n "`grep tcgetattr $_term_hs_ 2>/dev/null`"' \
  192.      HAS_TCCRAP 1 'tcgetattr() and friends'
  193. . bz.ifdef
  194.  
  195. if test -n "$_nay" -a \( -n "$IRIX" -o -n "$MIPS" \)
  196. then
  197. echo '
  198. /* some environments like IRIX have a broken setpgid()
  199.  * setpgrp() might come to rescue */'
  200. fi
  201. set 'test -n "$AIX" -o -n "$LINUX" -o -n "$force_setpgid" || \
  202.      man setpgid 2>/dev/null | grep process >/dev/null && \
  203.      test -z "$IRIX" -a -z "$MIPS" -a -z "$NEXT"' \
  204.      HAS_SETPGID 1 'setpgid()' 'setpgrp()'
  205. . bz.ifdef
  206.  
  207. if test -n "$TITAN"
  208. then
  209. echo '
  210. /* TitanOS has sigrelse(), sighold() and sigset() but it cannot use
  211.  * them simultaneously with -43 */'
  212. fi
  213.  
  214. _signal_hs_="${headerdir}/signal.h ${headerdir}/sys/signal.h ${headerdir}/linux/signal.h"
  215.  
  216. set 'test -z "$HPUX" -a -z "$PYR" -a -z "$MIPS" -a -z "$AIX" -a -z "$TITAN" &&
  217.     (grep SIGRELSE $_signal_hs_ > /dev/null 2>&1 || \
  218.      man sigrelse 2>/dev/null | grep signal >/dev/null)' \
  219.     HAS_SIGRELSE 1 'sigrelse()' 'sigblock()'
  220. . bz.ifdef
  221.  
  222. set 'test -d /../.CONTROL' HAS_RFS 1 RFS
  223. . bz.ifdef
  224.  
  225. cat <<foo
  226. /* the stress is on "a working wait3()" because for example HP-UX has
  227.  * sort of working getrusage() but nothing like wait3() */
  228. foo
  229. set 'test -f $resourceh -a -z "$HPUX" -a -z "$UNICOS" -a -z "$SOLARIS"' HAS_RUSAGE 1 'getrusage() and wait3()'
  230. . bz.ifdef
  231.  
  232. if test Z"$host" = Zhp9000s700
  233. then
  234. echo '    using hp9000s700 rlimit kludge...' >&2
  235. echo '
  236. /* kludge RLIM code for HPUX s700 - These limits are all readable,and
  237.  * some like coredumpsize are settable by users
  238.  */
  239. #define RLIMIT_CPU    0        /* cpu time in milliseconds */
  240. #define RLIMIT_FSIZE    1        /* maximum file size */
  241. #define RLIMIT_DATA    2        /* data size */
  242. #define RLIMIT_STACK    3        /* stack size */
  243. #define RLIMIT_CORE    4        /* core file size */
  244. #define RLIMIT_RSS    5        /* resident set size */
  245.  
  246. #define RLIM_INFINITY    0x7fffffff
  247. '
  248. fi
  249.  
  250. STD_DUMP="cat /etc/passwd"
  251. NIS_DUMP="ypcat passwd.byname"
  252. NI_DUMP="nidump passwd /"
  253. DUMP_USERS="$STD_DUMP"
  254.  
  255. set 'test -f /usr/bin/ypcat && $NIS_DUMP > /dev/null 2>&1' HAS_NIS 1 NIS
  256. . bz.ifdef
  257.  
  258. if test -n "$_yea"
  259. then
  260.   DUMP_USERS="$NIS_DUMP"
  261. else
  262.   test -d /NextApps && $NI_DUMP > /dev/null 2>&1 && DUMP_USERS="$NI_DUMP"
  263. fi
  264.  
  265. lot_user=`$DUMP_USERS | awk '{if(NR>'$LOTSA_USERS'){print;exit 1}}'`
  266. if test -n "$B_query"
  267. then
  268. {
  269.   echo
  270.   echo "Username caching is useful if there are more than $LOTSA_USERS users..."
  271. } >&2
  272. fi
  273. G_verb2_=use
  274. set 'test -n "$lot_user"' CACHE_USERNAMES 1 'username caching'
  275. . bz.ifdef
  276.  
  277. set 'egrep "SIG_DFL|sighandler_t" $_signal_hs_ 2>/dev/null | grep void > /dev/null && test -z "$IRIX" || test -n "$SCO" ' SIGVOID 1 'signal handlers returning void' 'signal handlers returning int'
  278. . bz.ifdef
  279.  
  280. set 'test -n "`grep SIGTSTP $_signal_hs_ 2>/dev/null`"' \
  281.     HAS_AUTORESETHAND 1 'automatically reset signal handlers' \
  282.     'forced reset signal handlers'
  283. . bz.ifdef
  284.  
  285. if test -n "$_yea"
  286. then
  287. set 'test -z "$HPUX" -a -z "$MIPS" -a -z "$IRIX" -a -z "$TITAN" -a -z "$AIX" \
  288.    && (man 2 sigset 2>/dev/null | grep handler >/dev/null )' \
  289.     USE_SIGSET 1 'sigset() to install said signal handlers'
  290. . bz.ifdef
  291. fi
  292.  
  293. {
  294. echo
  295. echo '    finished probing features...'
  296. } >&2
  297.  
  298. cat <<foo
  299. #if defined(SIGVOID) || defined(IRIX5) || defined(SCO)
  300. #define HANDTYPE void
  301. #else
  302. #define HANDTYPE int
  303. #define INTHANDTYPE
  304. #endif
  305.  
  306. /* a string corresponding to the host type */
  307.  
  308. #define HOSTTYPE "$host"
  309.  
  310. /* the default editor for the fc builtin */
  311. #define DEFFCEDIT "vi"
  312. foo
  313. echo
  314.  
  315. if test -n "`egrep 'UTMP_FILE|_PATH_UTMP' $_utmp_hs_ 2>/dev/null`"
  316. then :
  317. else 
  318. set WTMP wtmp "/etc /usr/etc /var/adm /usr/adm" /dev/null
  319. . bz.walk
  320. set UTMP utmp "/etc /usr/etc /var/adm /usr/adm" /dev/null
  321. . bz.walk
  322. cat <<foo
  323. /* the path of wtmp */
  324. #define WTMP_FILE "$WTMP"
  325.  
  326. /* the path of utmp */
  327. #define UTMP_FILE "$UTMP"
  328. foo
  329. fi
  330.  
  331. {
  332.   echo
  333.   echo '    defining installation specifics...'
  334.   echo
  335. } >&2
  336.  
  337. set DEFTMPPREFIX /tmp/zsh 'default prefix for temporary files' '' '"'
  338. . bz.define
  339.  
  340. set GLOBALZSHENV /etc/zshenv \
  341. "the global file to source absolutely first whenever zsh is run;
  342. if undefined, don't source anything" 1 '"'
  343. . bz.define
  344.  
  345. set GLOBALZSHRC /etc/zshrc \
  346. "the global file to source whenever zsh is run;
  347. if undefined, don't source anything" 1 '"'
  348. . bz.define
  349.  
  350. set GLOBALZLOGIN /etc/zlogin \
  351. "the global file to source whenever zsh is run as a login shell;
  352. if undefined, don't source anything" 1 '"'
  353. . bz.define
  354.  
  355. set GLOBALZPROFILE /etc/zprofile \
  356. "the global file to source whenever zsh is run as a login shell,
  357. before zshrc is read; if undefined, don't source anything" 1 '"'
  358. . bz.define
  359.  
  360. F_define=yep
  361.  
  362. if test -n "$B_query"
  363. then
  364. {
  365.   echo
  366.   echo "The following question is about the text printed by zsh"
  367.   echo "when a process is suspended/stopped under job control."
  368. } >&2
  369. fi
  370. G_verb2_=prefer
  371. set true USE_SUSPENDED 1 '"suspended" instead of "stopped"' '"stopped" instead of "suspended"'
  372. . bz.ifdef
  373.  
  374. set DEFAULT_HISTSIZE 30 \
  375. "the default history buffer size in lines"
  376. . bz.define
  377.  
  378. cat <<'foo'
  379. #define _BSD_COMPAT        /* this could be IRIX,  you never know */
  380. #define _BSD_TYPES        /* this could be IRIX5, you never know */
  381. #define _BSD            /* this could be HP-UX, you never know */
  382. #define _BSD_INCLUDES        /* this could be AIX,   you never know */
  383. #define _BBN_POSIX_SUPPORT    /* this could be nX,    you never know */
  384.  
  385. /* if your compiler doesn't like void *,
  386.  * change this to char * and ignore all the warnings. */
  387.  
  388. typedef void * vptr;
  389.  
  390. #define JOB_CONTROL
  391.  
  392. /* define this if you want to use zsh's own allocator */
  393. /* #define USE_ZSH_MALLOC */
  394.  
  395. #ifdef USE_ZSH_MALLOC
  396.  
  397. /* define this if you want the allocator to store information */
  398.  
  399. /* #define MEM_DEBUG */
  400.  
  401. /* define this if you want to get error messages from the allocator */
  402.  
  403. /* #define MEM_WARNING */
  404.  
  405. /* define this if you want free() to be really save */
  406.  
  407. /* #define SECURE_FREE */
  408.  
  409. #endif /* USE_ZSH_MALLOC */
  410.  
  411. /* end of config.h */
  412. foo
  413.  
  414. {
  415.   echo
  416.   echo '    defined installation specifics...'
  417. } >&2
  418.  
  419. )
  420. fi
  421.