home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / tcl / tk3.3b1 / configure < prev    next >
Encoding:
Text File  |  1993-07-08  |  8.6 KB  |  316 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=tk.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. echo checking for unistd.h
  161. echo checking how to run the C preprocessor
  162. if test -z "$CPP"; then
  163.   CPP='${CC-cc} -E'
  164.   cat > conftest.c <<EOF
  165. #include <stdio.h>
  166. EOF
  167. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  168. if test -z "$err"; then
  169.   :
  170. else
  171.   CPP=/lib/cpp
  172. fi
  173. rm -f conftest*
  174. fi
  175.  
  176. cat > conftest.c <<EOF
  177. #include <unistd.h>
  178. EOF
  179. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  180. if test -z "$err"; then
  181.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  182. fi
  183. rm -f conftest*
  184.  
  185. for hdr in sys/select.h
  186. do
  187. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  188. echo checking for ${hdr}
  189. cat > conftest.c <<EOF
  190. #include <${hdr}>
  191. EOF
  192. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  193. if test -z "$err"; then
  194.   DEFS="$DEFS -D${trhdr}=1"
  195. fi
  196. rm -f conftest*
  197. done
  198.  
  199. libname=`echo "socket" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  200. LIBS_save="${LIBS}"
  201. LIBS="${LIBS} -l${libname}"
  202. have_lib=""
  203. echo checking for -lsocket
  204. cat > conftest.c <<EOF
  205.  
  206. main() { exit(0); } 
  207. t() { main(); }
  208. EOF
  209. if eval $compile; then
  210.   have_lib="1"
  211. fi
  212. rm -f conftest*
  213. LIBS="${LIBS_save}"
  214. if test -n "${have_lib}"; then
  215.    :; LIBS=$libs -lsocket"
  216. else
  217.    :; 
  218. fi
  219.  
  220. libname=`echo "nsl" | sed 's/lib\([^\.]*\)\.a/\1/;s/-l//'`
  221. LIBS_save="${LIBS}"
  222. LIBS="${LIBS} -l${libname}"
  223. have_lib=""
  224. echo checking for -lnsl
  225. cat > conftest.c <<EOF
  226.  
  227. main() { exit(0); } 
  228. t() { main(); }
  229. EOF
  230. if eval $compile; then
  231.   have_lib="1"
  232. fi
  233. rm -f conftest*
  234. LIBS="${LIBS_save}"
  235. if test -n "${have_lib}"; then
  236.    :; LIBS=$libs -lnsl"
  237. else
  238.    :; 
  239. fi
  240.  
  241. if test -n "$prefix"; then
  242.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  243.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  244. fi
  245. if test -n "$exec_prefix"; then
  246.   prsub="$prsub
  247. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  248. exec_prefix\\1=\\2$exec_prefix%"
  249. fi
  250.  
  251. trap 'rm -f config.status; exit 1' 1 3 15
  252. echo creating config.status
  253. rm -f config.status
  254. cat > config.status <<EOF
  255. #!/bin/sh
  256. # Generated automatically by configure.
  257. # Run this file to recreate the current configuration.
  258. # This directory was configured as follows,
  259. # on host `(hostname || uname -n) 2>/dev/null`:
  260. #
  261. # $0 $*
  262.  
  263. for arg
  264. do
  265.   case "\$arg" in
  266.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  267.     exec /bin/sh $0 $* ;;
  268.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  269.   esac
  270. done
  271.  
  272. trap 'rm -f Makefile; exit 1' 1 3 15
  273. INSTALL='$INSTALL'
  274. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  275. INSTALL_DATA='$INSTALL_DATA'
  276. RANLIB='$RANLIB'
  277. CPP='$CPP'
  278. LIBS='$LIBS'
  279. srcdir='$srcdir'
  280. DEFS='$DEFS'
  281. prefix='$prefix'
  282. exec_prefix='$exec_prefix'
  283. prsub='$prsub'
  284. EOF
  285. cat >> config.status <<\EOF
  286.  
  287. top_srcdir=$srcdir
  288. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  289.   srcdir=$top_srcdir
  290.   # Remove last slash and all that follows it.  Not all systems have dirname.
  291.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  292.   if test "$dir" != "$file"; then
  293.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  294.     test ! -d $dir && mkdir $dir
  295.   fi
  296.   echo creating $file
  297.   rm -f $file
  298.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  299.   sed -e "
  300. $prsub
  301. s%@INSTALL@%$INSTALL%g
  302. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  303. s%@INSTALL_DATA@%$INSTALL_DATA%g
  304. s%@RANLIB@%$RANLIB%g
  305. s%@CPP@%$CPP%g
  306. s%@LIBS@%$LIBS%g
  307. s%@srcdir@%$srcdir%g
  308. s%@DEFS@%$DEFS%
  309. " $top_srcdir/${file}.in >> $file
  310. fi; done
  311.  
  312. EOF
  313. chmod +x config.status
  314. test -n "$no_create" || ./config.status
  315.  
  316.