home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / time14.zip / time-1.4 / configure < prev    next >
Text File  |  1992-10-22  |  12KB  |  488 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=time.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes
  81.   # Try the directory containing this script, then `..'.
  82.   prog=$0
  83.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  84.   test "X$confdir" = "X$prog" && confdir=.
  85.   srcdir=$confdir
  86.   if test ! -r $srcdir/$unique_file; then
  87.     srcdir=..
  88.   fi
  89. fi
  90. if test ! -r $srcdir/$unique_file; then
  91.   if test x$srcdirdefaulted = xyes; then
  92.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  93.   else
  94.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  95.   fi
  96.   exit 1
  97. fi
  98. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  99. # But we can't avoid them for `..', to make subdirectories work.
  100. case $srcdir in
  101.   .|/*|~*) ;;
  102.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  103. esac
  104.  
  105. if test -z "$CC"; then
  106.   echo checking for gcc
  107.   saveifs="$IFS"; IFS="${IFS}:"
  108.   for dir in $PATH; do
  109.     test -z "$dir" && dir=.
  110.     if test -f $dir/gcc; then
  111.       CC="gcc"
  112.       break
  113.     fi
  114.   done
  115.   IFS="$saveifs"
  116. fi
  117. test -z "$CC" && CC="cc"
  118.  
  119. # Find out if we are using GNU C, under whatever name.
  120. cat <<EOF > conftest.c
  121. #ifdef __GNUC__
  122.   yes
  123. #endif
  124. EOF
  125. ${CC-cc} -E conftest.c > conftest.out 2>&1
  126. if egrep yes conftest.out >/dev/null 2>&1; then
  127.   GCC=1 # For later tests.
  128.   CC="$CC -O"
  129. fi
  130. rm -f conftest*
  131.  
  132. echo checking how to run the C preprocessor
  133. if test -z "$CPP"; then
  134.   CPP='${CC-cc} -E'
  135.   cat <<EOF > conftest.c
  136.  
  137. #include <stdio.h>
  138. EOF
  139. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  140. if test -z "$err"; then
  141.   :
  142. else
  143.   CPP=/lib/cpp
  144. fi
  145. rm -f conftest*
  146. fi
  147.  
  148. # Make sure to not get the incompatible SysV /etc/install and
  149. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  150. # or the SunOS /usr/etc/install directory, or the AIX /bin/install.
  151. if test -z "$INSTALL"; then
  152.   echo checking for install
  153.   saveifs="$IFS"; IFS="${IFS}:"
  154.   for dir in $PATH; do
  155.     test -z "$dir" && dir=.
  156.     case $dir in
  157.     /etc|/usr/sbin|/usr/etc) ;;
  158.     *)
  159.       if test -f $dir/install; then
  160.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  161.       : # AIX
  162.     else
  163.       INSTALL="$dir/install -c"
  164.       INSTALL_PROGRAM='$(INSTALL)'
  165.       INSTALL_DATA='$(INSTALL) -m 644'
  166.       break
  167.     fi
  168.       fi
  169.       ;;
  170.     esac
  171.   done
  172.   IFS="$saveifs"
  173. fi
  174. INSTALL=${INSTALL-cp}
  175. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  176. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  177.  
  178. echo checking for minix/config.h
  179. cat <<EOF > conftest.c
  180.  
  181. #include <minix/config.h>
  182. EOF
  183. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  184. if test -z "$err"; then
  185.   MINIX=1
  186. fi
  187. rm -f conftest*
  188.  
  189. # The Minix shell can't assign to the same variable on the same line!
  190. if test -n "$MINIX"; then
  191.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  192.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  193.   DEFS="$DEFS -D_MINIX=1"
  194. fi
  195.  
  196. echo checking for POSIXized ISC
  197. if test -d /etc/conf/kconfig.d &&
  198.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  199. then
  200.   ISC=1 # If later tests want to check for ISC.
  201.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  202.   if test -n "$GCC"; then
  203.     CC="$CC -posix"
  204.   else
  205.     CC="$CC -Xp"
  206.   fi
  207. fi
  208.  
  209. echo checking return type of signal handlers
  210. echo '#include <signal.h>' > conftest.c
  211. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  212. if egrep "(void|sighandler_t).*signal" conftest.out >/dev/null 2>&1; then
  213.   :
  214. else 
  215.   DEFS="$DEFS -DRETSIGTYPE=int"
  216. fi
  217. rm -f conftest*
  218.  
  219.  
  220. echo checking for ANSI C header files
  221. cat <<EOF > conftest.c
  222.  
  223. #include <stdlib.h>
  224. #include <stdarg.h>
  225. #include <string.h>
  226. #include <float.h>
  227. #include <limits.h>
  228. EOF
  229. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  230. if test -z "$err"; then
  231.   DEFS="$DEFS -DSTDC_HEADERS=1"
  232. fi
  233. rm -f conftest*
  234.  
  235. echo checking for BSD string and memory functions
  236. echo "#include <strings.h>
  237. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  238. if eval $compile; then
  239.   :
  240. else
  241.   DEFS="$DEFS -DUSG=1"
  242. fi
  243. rm -f conftest*
  244.  
  245. echo checking for unistd.h
  246. cat <<EOF > conftest.c
  247.  
  248. #include <unistd.h>
  249. EOF
  250. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  251. if test -z "$err"; then
  252.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  253. fi
  254. rm -f conftest*
  255.  
  256. echo checking for sys/time.h
  257. cat <<EOF > conftest.c
  258.  
  259. #include <sys/time.h>
  260. EOF
  261. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  262. if test -z "$err"; then
  263.   DEFS="$DEFS -DHAVE_SYS_TIME_H=1"
  264. fi
  265. rm -f conftest*
  266.  
  267. echo checking for sys/resource.h
  268. cat <<EOF > conftest.c
  269.  
  270. #include <sys/resource.h>
  271. EOF
  272. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  273. if test -z "$err"; then
  274.   DEFS="$DEFS -DHAVE_SYS_RESOURCE_H=1"
  275. fi
  276. rm -f conftest*
  277.  
  278. echo checking for getpagesize
  279. echo "#include <sys/param.h>
  280. main() { exit(0); } t() { getpagesize(); }" > conftest.c
  281. if eval $compile; then
  282.   DEFS="$DEFS -DHAVE_GETPAGESIZE=1"
  283. fi
  284. rm -f conftest*
  285.  
  286. for func in strerror
  287. do
  288. trfrom='[a-z]' trto='[A-Z]'
  289. echo checking for ${func}
  290. echo "
  291. main() { exit(0); } t() { 
  292. /* Override any gcc2 internal prototype to avoid an error.  */
  293. extern char ${func}(); ${func}(); }" > conftest.c
  294. if eval $compile; then
  295.   DEFS="$DEFS -DHAVE_`echo $func|tr "$trfrom" "$trto"`=1"
  296. fi
  297. rm -f conftest*
  298. done
  299.  
  300. echo checking for wait3 that fills in rusage
  301. cat <<EOF > conftest.c
  302. #include <sys/types.h>
  303. #include <sys/time.h>
  304. #include <sys/resource.h>
  305. #include <stdio.h>
  306. /* HP-UX has wait3 but does not fill in rusage.  */
  307. main() {
  308.   struct rusage r;
  309.   int i;
  310.   r.ru_nvcsw = 0;
  311.   switch (fork()) {
  312.   case 0: /* Child.  */
  313.     sleep(1); /* Give up the CPU.  */
  314.     _exit(0);
  315.   case -1: _exit(0); /* What can we do?  */
  316.   default: /* Parent.  */
  317.     wait3(&i, 0, &r);
  318.     exit(r.ru_nvcsw == 0);
  319.   }
  320. }
  321. EOF
  322. eval $compile
  323. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  324.   DEFS="$DEFS -DHAVE_WAIT3=1"
  325. fi
  326. rm -f conftest*
  327. case "$DEFS" in
  328.   *HAVE_WAIT3*) ;;
  329.   *) LIBOBJS="$LIBOBJS wait3.o" ;;
  330. esac
  331.  
  332. echo checking for vprintf
  333. echo "
  334. main() { exit(0); } t() { vprintf(); }" > conftest.c
  335. if eval $compile; then
  336.   DEFS="$DEFS -DHAVE_VPRINTF=1"
  337. else
  338.   vprintf_missing=1
  339. fi
  340. rm -f conftest*
  341.  
  342. if test -n "$vprintf_missing"; then
  343. echo checking for _doprnt
  344. echo "
  345. main() { exit(0); } t() { _doprnt(); }" > conftest.c
  346. if eval $compile; then
  347.   DEFS="$DEFS -DHAVE_DOPRNT=1"
  348. fi
  349. rm -f conftest*
  350.  
  351. fi
  352.  
  353. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  354. # for constant arguments.  Useless!
  355. echo checking for working alloca.h
  356. echo "#include <alloca.h>
  357. main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
  358. if eval $compile; then
  359.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  360. fi
  361. rm -f conftest*
  362.  
  363. decl="#ifdef __GNUC__
  364. #define alloca __builtin_alloca
  365. #else
  366. #if HAVE_ALLOCA_H
  367. #include <alloca.h>
  368. #else
  369. #ifdef _AIX
  370.  #pragma alloca
  371. #else
  372. char *alloca ();
  373. #endif
  374. #endif
  375. #endif
  376. "
  377. echo checking for alloca
  378. echo "$decl
  379. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  380. if eval $compile; then
  381.   :
  382. else
  383.   alloca_missing=1
  384. fi
  385. rm -f conftest*
  386.  
  387. if test -n "$alloca_missing"; then
  388.   SAVELIBS="$LIBS"
  389.   # Maybe alloca is in a different library.
  390.   #if test -f /usr/ucblib/libucb.a; then
  391.     # Avoid the broken BSD compatibility library as much as possible.
  392.     #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  393.   #el
  394.   if test -f /lib/libPW.a; then
  395.     LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  396.   fi
  397.   if test -n "$trylib"; then
  398.     alloca_missing=
  399.     echo checking for alloca in $trylib
  400. echo "$decl
  401. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  402. if eval $compile; then
  403.   :
  404. else
  405.   alloca_missing=1
  406. fi
  407. rm -f conftest*
  408.  
  409.   fi
  410.   if test -n "$alloca_missing"; then
  411.     LIBS="$SAVELIBS" ALLOCA=alloca.o
  412.   fi
  413. fi
  414.  
  415. if test -n "$prefix"; then
  416.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  417.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  418. fi
  419. if test -n "$exec_prefix"; then
  420.   prsub="$prsub
  421. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  422. fi
  423.  
  424. trap 'rm -f config.status; exit 1' 1 3 15
  425. echo creating config.status
  426. rm -f config.status
  427. cat <<EOF > config.status
  428. #!/bin/sh
  429. # Generated automatically by configure.
  430. # Run this file to recreate the current configuration.
  431. # This directory was configured as follows,
  432. # on host `(hostname || uname -n) 2>/dev/null`:
  433. #
  434. # $0 $*
  435.  
  436. case "\$1" in
  437.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  438.   exec /bin/sh $0 $* ;;
  439. esac
  440.  
  441. trap 'rm -f Makefile; exit 1' 1 3 15
  442. CC='$CC'
  443. CPP='$CPP'
  444. INSTALL='$INSTALL'
  445. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  446. INSTALL_DATA='$INSTALL_DATA'
  447. LIBOBJS='$LIBOBJS'
  448. ALLOCA='$ALLOCA'
  449. LIBS='$LIBS'
  450. srcdir='$srcdir'
  451. DEFS='$DEFS'
  452. prefix='$prefix'
  453. exec_prefix='$exec_prefix'
  454. prsub='$prsub'
  455. EOF
  456. cat <<\EOF >> config.status
  457.  
  458. top_srcdir=$srcdir
  459. for file in Makefile; do
  460.   srcdir=$top_srcdir
  461.   # Remove last slash and all that follows it.  Not all systems have dirname.
  462.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  463.   if test "$dir" != "$file"; then
  464.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  465.     test ! -d $dir && mkdir $dir
  466.   fi
  467.   echo creating $file
  468.   rm -f $file
  469.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  470.   sed -e "
  471. $prsub
  472. s%@CC@%$CC%g
  473. s%@CPP@%$CPP%g
  474. s%@INSTALL@%$INSTALL%g
  475. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  476. s%@INSTALL_DATA@%$INSTALL_DATA%g
  477. s%@LIBOBJS@%$LIBOBJS%g
  478. s%@ALLOCA@%$ALLOCA%g
  479. s%@LIBS@%$LIBS%g
  480. s%@srcdir@%$srcdir%g
  481. s%@DEFS@%$DEFS%" $top_srcdir/${file}.in >> $file
  482. done
  483.  
  484. EOF
  485. chmod +x config.status
  486. test -n "$no_create" || ./config.status
  487.  
  488.