home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tcl7.0b1 / configure < prev    next >
Encoding:
Text File  |  1993-06-17  |  14.2 KB  |  652 lines

  1.  
  2. #!/bin/sh
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf.
  5. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  6.  
  7. # This program is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 2, or (at your option)
  10. # any later version.
  11.  
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. # GNU General Public License for more details.
  16.  
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program; if not, write to the Free Software
  19. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  
  21. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  22. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
  23. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  24. # --with-PACKAGE unless this script has special code to handle it.
  25.  
  26.  
  27. for arg
  28. do
  29.   # Handle --exec-prefix with a space before the argument.
  30.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  31.   # Handle --host with a space before the argument.
  32.   elif test x$next_host = xyes; then next_host=
  33.   # Handle --prefix with a space before the argument.
  34.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  35.   # Handle --srcdir with a space before the argument.
  36.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  37.   else
  38.     case $arg in
  39.      # For backward compatibility, also recognize exact --exec_prefix.
  40.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  41.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  42.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  43.     next_exec_prefix=yes ;;
  44.  
  45.      -gas | --gas | --ga | --g) ;;
  46.  
  47.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  48.      -host | --host | --hos | --ho | --h)
  49.     next_host=yes ;;
  50.  
  51.      -nfp | --nfp | --nf) ;;
  52.  
  53.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  54.         no_create=1 ;;
  55.  
  56.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  57.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  59.     next_prefix=yes ;;
  60.  
  61.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  62.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  63.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  64.     next_srcdir=yes ;;
  65.  
  66.      -with-* | --with-*)
  67.        package=`echo $arg|sed 's/-*with-//'`
  68.        # Delete all the valid chars; see if any are left.
  69.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  70.          echo "configure: $package: invalid package name" >&2; exit 1
  71.        fi
  72.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  73.  
  74.      *) ;;
  75.     esac
  76.   fi
  77. done
  78.  
  79. trap 'rm -f conftest* core; exit 1' 1 3 15
  80.  
  81. rm -f conftest*
  82. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  83.  
  84. # A filename unique to this package, relative to the directory that
  85. # configure is in, which we can look for to find out if srcdir is correct.
  86. unique_file=tcl.h
  87.  
  88. # Find the source files, if location was not specified.
  89. if test -z "$srcdir"; then
  90.   srcdirdefaulted=yes
  91.   # Try the directory containing this script, then `..'.
  92.   prog=$0
  93.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  94.   test "X$confdir" = "X$prog" && confdir=.
  95.   srcdir=$confdir
  96.   if test ! -r $srcdir/$unique_file; then
  97.     srcdir=..
  98.   fi
  99. fi
  100. if test ! -r $srcdir/$unique_file; then
  101.   if test x$srcdirdefaulted = xyes; then
  102.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  103.   else
  104.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  105.   fi
  106.   exit 1
  107. fi
  108. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  109. # But we can't avoid them for `..', to make subdirectories work.
  110. case $srcdir in
  111.   .|/*|~*) ;;
  112.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  113. esac
  114.  
  115. # Make sure to not get the incompatible SysV /etc/install and
  116. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  117. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  118. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  119. if test -z "$INSTALL"; then
  120.   echo checking for install
  121.   saveifs="$IFS"; IFS="${IFS}:"
  122.   for dir in $PATH; do
  123.     test -z "$dir" && dir=.
  124.     case $dir in
  125.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  126.     *)
  127.       if test -f $dir/install; then
  128.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  129.       : # AIX
  130.     else
  131.       INSTALL="$dir/install -c"
  132.       INSTALL_PROGRAM='$(INSTALL)'
  133.       INSTALL_DATA='$(INSTALL) -m 644'
  134.       break
  135.     fi
  136.       fi
  137.       ;;
  138.     esac
  139.   done
  140.   IFS="$saveifs"
  141. fi
  142. INSTALL=${INSTALL-cp}
  143. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  144. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  145.  
  146. if test -z "$RANLIB"; then
  147.   echo checking for ranlib
  148.   saveifs="$IFS"; IFS="${IFS}:"
  149.   for dir in $PATH; do
  150.     test -z "$dir" && dir=.
  151.     if test -f $dir/ranlib; then
  152.       RANLIB="ranlib"
  153.       break
  154.     fi
  155.   done
  156.   IFS="$saveifs"
  157. fi
  158. test -z "$RANLIB" && RANLIB="@:"
  159.  
  160.  
  161.  
  162. for func in getcwd opendir strerror strstr strtod
  163. do
  164. echo checking for ${func}
  165. cat > conftest.c <<EOF
  166.  
  167. main() { exit(0); } 
  168. t() { 
  169. /* Override any gcc2 internal prototype to avoid an error.  */
  170. extern char ${func}(); ${func}(); }
  171. EOF
  172. if eval $compile; then
  173.   :
  174. else
  175.   LIBOBJS="$LIBOBJS ${func}.o"
  176. fi
  177. rm -f conftest*
  178.  
  179. done
  180.  
  181. for func in strtol strtoul tmpnam waitpid
  182. do
  183. echo checking for ${func}
  184. cat > conftest.c <<EOF
  185.  
  186. main() { exit(0); } 
  187. t() { 
  188. /* Override any gcc2 internal prototype to avoid an error.  */
  189. extern char ${func}(); ${func}(); }
  190. EOF
  191. if eval $compile; then
  192.   :
  193. else
  194.   LIBOBJS="$LIBOBJS ${func}.o"
  195. fi
  196. rm -f conftest*
  197.  
  198. done
  199.  
  200. echo checking for gettimeofday
  201. cat > conftest.c <<EOF
  202. #include <stdio.h>
  203. main() { exit(0); } 
  204. t() { 
  205. #ifdef __stub_gettimeofday
  206. choke me
  207. #else
  208. /* Override any gcc2 internal prototype to avoid an error.  */
  209. extern char gettimeofday(); gettimeofday();
  210. #endif
  211.  }
  212. EOF
  213. if eval $compile; then
  214.   :
  215. else
  216.   DEFS="$DEFS -DNO_GETTOD=1"
  217. fi
  218. rm -f conftest*
  219. #endif
  220.  
  221. echo checking for getwd
  222. cat > conftest.c <<EOF
  223. #include <stdio.h>
  224. main() { exit(0); } 
  225. t() { 
  226. #ifdef __stub_getwd
  227. choke me
  228. #else
  229. /* Override any gcc2 internal prototype to avoid an error.  */
  230. extern char getwd(); getwd();
  231. #endif
  232.  }
  233. EOF
  234. if eval $compile; then
  235.   :
  236. else
  237.   DEFS="$DEFS -DNO_GETWD=1"
  238. fi
  239. rm -f conftest*
  240. #endif
  241.  
  242. echo checking for wait3
  243. cat > conftest.c <<EOF
  244. #include <stdio.h>
  245. main() { exit(0); } 
  246. t() { 
  247. #ifdef __stub_wait3
  248. choke me
  249. #else
  250. /* Override any gcc2 internal prototype to avoid an error.  */
  251. extern char wait3(); wait3();
  252. #endif
  253.  }
  254. EOF
  255. if eval $compile; then
  256.   :
  257. else
  258.   DEFS="$DEFS -DNO_WAIT3=1"
  259. fi
  260. rm -f conftest*
  261. #endif
  262.  
  263.  
  264.  
  265.  
  266. echo checking for unistd.h
  267. echo checking how to run the C preprocessor
  268. if test -z "$CPP"; then
  269.   CPP='${CC-cc} -E'
  270.   cat > conftest.c <<EOF
  271. #include <stdio.h>
  272. EOF
  273. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  274. if test -z "$err"; then
  275.   :
  276. else
  277.   CPP=/lib/cpp
  278. fi
  279. rm -f conftest*
  280. fi
  281.  
  282. cat > conftest.c <<EOF
  283. #include <unistd.h>
  284. EOF
  285. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  286. if test -z "$err"; then
  287.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  288. fi
  289. rm -f conftest*
  290.  
  291. echo checking for dirent.h
  292. cat > conftest.c <<EOF
  293. #include <sys/types.h>
  294. #include <dirent.h>
  295. main() { exit(0); } 
  296. t() { 
  297. DIR *d;
  298. struct dirent *entryPtr;
  299. char *p;
  300. d = opendir("foobar");
  301. entryPtr = readdir(d);
  302. p = entryPtr->d_name;
  303. closedir(d);
  304.  }
  305. EOF
  306. if eval $compile; then
  307.   :
  308. else
  309.   DEFS="$DEFS -DNO_DIRENT_H=1"
  310. fi
  311. rm -f conftest*
  312.  
  313. echo '#include <DEFS="$DEFS -DNO_DIRENT_H=1">' > conftest.c
  314. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  315. if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
  316.   :
  317. fi
  318. rm -f conftest*
  319.  
  320. echo checking for float.h
  321. cat > conftest.c <<EOF
  322. #include <float.h>
  323. EOF
  324. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  325. if test -z "$err"; then
  326.   :
  327. else
  328.   DEFS="$DEFS -DNO_FLOAT_H=1"
  329. fi
  330. rm -f conftest*
  331.  
  332. echo checking for limits.h
  333. cat > conftest.c <<EOF
  334. #include <limits.h>
  335. EOF
  336. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  337. if test -z "$err"; then
  338.   :
  339. else
  340.   DEFS="$DEFS -DNO_LIMITS_H=1"
  341. fi
  342. rm -f conftest*
  343.  
  344. echo checking for stdlib.h
  345. cat > conftest.c <<EOF
  346. #include <stdlib.h>
  347. EOF
  348. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  349. if test -z "$err"; then
  350.   :
  351. else
  352.   DEFS="$DEFS -DNO_STDLIB_H=1"
  353. fi
  354. rm -f conftest*
  355.  
  356. echo '#include <stdlib.h>' > conftest.c
  357. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  358. if egrep "strtol" conftest.out >/dev/null 2>&1; then
  359.   :
  360. else 
  361.   DEFS="$DEFS -DNO_STDLIB_H=1"
  362. fi
  363. rm -f conftest*
  364.  
  365. echo '#include <stdlib.h>' > conftest.c
  366. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  367. if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  368.   :
  369. else 
  370.   DEFS="$DEFS -DNO_STDLIB_H=1"
  371. fi
  372. rm -f conftest*
  373.  
  374. echo '#include <stdlib.h>' > conftest.c
  375. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  376. if egrep "strtod" conftest.out >/dev/null 2>&1; then
  377.   :
  378. else 
  379.   DEFS="$DEFS -DNO_STDLIB_H=1"
  380. fi
  381. rm -f conftest*
  382.  
  383. echo checking for string.h
  384. cat > conftest.c <<EOF
  385. #include <string.h>
  386. EOF
  387. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  388. if test -z "$err"; then
  389.   :
  390. else
  391.   DEFS="$DEFS -DNO_STRING_H=1"
  392. fi
  393. rm -f conftest*
  394.  
  395. echo '#include <string.h>' > conftest.c
  396. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  397. if egrep "strstr" conftest.out >/dev/null 2>&1; then
  398.   :
  399. else 
  400.   DEFS="$DEFS -DNO_STRING_H=1"
  401. fi
  402. rm -f conftest*
  403.  
  404. echo '#include <string.h>' > conftest.c
  405. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  406. if egrep "strerror" conftest.out >/dev/null 2>&1; then
  407.   :
  408. else 
  409.   DEFS="$DEFS -DNO_STRING_H=1"
  410. fi
  411. rm -f conftest*
  412.  
  413. echo checking for sys/time.h
  414. cat > conftest.c <<EOF
  415. #include <sys/time.h>
  416. EOF
  417. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  418. if test -z "$err"; then
  419.   :
  420. else
  421.   DEFS="$DEFS -DNO_SYS_TIME_H=1"
  422. fi
  423. rm -f conftest*
  424.  
  425. echo checking for sys/wait.h
  426. cat > conftest.c <<EOF
  427. #include <sys/wait.h>
  428. EOF
  429. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  430. if test -z "$err"; then
  431.   :
  432. else
  433.   DEFS="$DEFS -DNO_SYS_WAIT_H=1"
  434. fi
  435. rm -f conftest*
  436.  
  437.  
  438.  
  439. cat > conftest.c <<EOF
  440.  
  441. extern int strstr();
  442. int main()
  443. {
  444.     exit(strstr("\0test", "test") ? 1 : 0);
  445. }
  446.  
  447. EOF
  448. eval $compile
  449. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  450.   :
  451. else
  452.   LIBOBJS="$LIBOBJS strstr.o"
  453. fi
  454. rm -f conftest*
  455.  
  456.  
  457. cat > conftest.c <<EOF
  458.  
  459. extern int strtoul();
  460. int main()
  461. {
  462.     char *string = "0";
  463.     char *term;
  464.     int value;
  465.     value = strtoul(string, &term, 0);
  466.     if ((value != 0) || (term != (string+1))) {
  467.         exit(1);
  468.     }
  469.     exit(0);
  470. }
  471. EOF
  472. eval $compile
  473. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  474.   :
  475. else
  476.   LIBOBJS="$LIBOBJS strtoul.o"
  477. fi
  478. rm -f conftest*
  479.  
  480.  
  481. echo checking for pid_t in sys/types.h
  482. echo '#include <sys/types.h>' > conftest.c
  483. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  484. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  485.   :
  486. else 
  487.   DEFS="$DEFS -Dpid_t=int"
  488. fi
  489. rm -f conftest*
  490.  
  491. echo checking for uid_t in sys/types.h
  492. echo '#include <sys/types.h>' > conftest.c
  493. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  494. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  495.   :
  496. else 
  497.   DEFS="$DEFS -Duid_t=int" DEFS="$DEFS -Dgid_t=int"
  498. fi
  499. rm -f conftest*
  500.  
  501.  
  502.  
  503. echo checking for opendir
  504. cat > conftest.c <<EOF
  505. #include <stdio.h>
  506. main() { exit(0); } 
  507. t() { 
  508. #ifdef __stub_opendir
  509. choke me
  510. #else
  511. /* Override any gcc2 internal prototype to avoid an error.  */
  512. extern char opendir(); opendir();
  513. #endif
  514.  }
  515. EOF
  516. if eval $compile; then
  517.   :
  518. else
  519.   DEFS="$DEFS -DUSE_DIRENT2_H=1"
  520. fi
  521. rm -f conftest*
  522. #endif
  523.  
  524.  
  525.  
  526. echo checking for sys_errlist
  527. cat > conftest.c <<EOF
  528.  
  529. main() { exit(0); } 
  530. t() { 
  531. extern char *sys_errlist[];
  532. extern int sys_nerr;
  533. sys_errlist[sys_nerr-1][0] = 0;
  534.  }
  535. EOF
  536. if eval $compile; then
  537.   :
  538. else
  539.   DEFS="$DEFS -DNO_SYS_ERRLIST=1"
  540. fi
  541. rm -f conftest*
  542.  
  543.  
  544.  
  545. echo checking for union wait
  546. cat > conftest.c <<EOF
  547. #include <sys/types.h> 
  548. #include <sys/wait.h>
  549. main() { exit(0); } 
  550. t() { 
  551. union wait x;
  552. WIFEXITED(x);        /* Generates compiler error if WIFEXITED
  553.              * uses an int. */
  554.  }
  555. EOF
  556. if eval $compile; then
  557.   :
  558. else
  559.   DEFS="$DEFS -DNO_UNION_WAIT=1"
  560. fi
  561. rm -f conftest*
  562.  
  563.  
  564.  
  565. newDefs=""
  566. for i in $DEFS; do
  567.     if test -z "$newDefs"; then
  568.         newDefs=$i
  569.     elif echo $newDefs | fgrep -v -e $i >/dev/null 2>&1; then
  570.         newDefs="$newDefs $i"
  571.     fi
  572. done
  573. DEFS=$newDefs
  574.  
  575. if test -n "$prefix"; then
  576.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  577.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  578. fi
  579. if test -n "$exec_prefix"; then
  580.   prsub="$prsub
  581. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  582. exec_prefix\\1=\\2$exec_prefix%"
  583. fi
  584.  
  585. trap 'rm -f config.status; exit 1' 1 3 15
  586. echo creating config.status
  587. rm -f config.status
  588. cat > config.status <<EOF
  589. #!/bin/sh
  590. # Generated automatically by configure.
  591. # Run this file to recreate the current configuration.
  592. # This directory was configured as follows,
  593. # on host `(hostname || uname -n) 2>/dev/null`:
  594. #
  595. # $0 $*
  596.  
  597. for arg
  598. do
  599.   case "\$arg" in
  600.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  601.     exec /bin/sh $0 $* ;;
  602.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  603.   esac
  604. done
  605.  
  606. trap 'rm -f Makefile; exit 1' 1 3 15
  607. INSTALL='$INSTALL'
  608. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  609. INSTALL_DATA='$INSTALL_DATA'
  610. RANLIB='$RANLIB'
  611. LIBOBJS='$LIBOBJS'
  612. CPP='$CPP'
  613. LIBS='$LIBS'
  614. srcdir='$srcdir'
  615. DEFS='$DEFS'
  616. prefix='$prefix'
  617. exec_prefix='$exec_prefix'
  618. prsub='$prsub'
  619. EOF
  620. cat >> config.status <<\EOF
  621.  
  622. top_srcdir=$srcdir
  623. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  624.   srcdir=$top_srcdir
  625.   # Remove last slash and all that follows it.  Not all systems have dirname.
  626.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  627.   if test "$dir" != "$file"; then
  628.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  629.     test ! -d $dir && mkdir $dir
  630.   fi
  631.   echo creating $file
  632.   rm -f $file
  633.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  634.   sed -e "
  635. $prsub
  636. s%@INSTALL@%$INSTALL%g
  637. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  638. s%@INSTALL_DATA@%$INSTALL_DATA%g
  639. s%@RANLIB@%$RANLIB%g
  640. s%@LIBOBJS@%$LIBOBJS%g
  641. s%@CPP@%$CPP%g
  642. s%@LIBS@%$LIBS%g
  643. s%@srcdir@%$srcdir%g
  644. s%@DEFS@%$DEFS%
  645. " $top_srcdir/${file}.in >> $file
  646. fi; done
  647.  
  648. EOF
  649. chmod +x config.status
  650. test -n "$no_create" || ./config.status
  651.  
  652.