home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / t / trmcap11.zip / termcap-1.1 / configure < prev    next >
Text File  |  1992-10-14  |  8KB  |  285 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=termcap.h
  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 BSD string and memory functions
  179. echo "#include <strings.h>
  180. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  181. if eval $compile; then
  182.   :
  183. else
  184.   DEFS="$DEFS -DUSG=1"
  185. fi
  186. rm -f conftest*
  187.  
  188. echo checking for unistd.h
  189. cat <<EOF > conftest.c
  190.  
  191. #include <unistd.h>
  192. EOF
  193. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  194. if test -z "$err"; then
  195.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  196. fi
  197. rm -f conftest*
  198.  
  199. echo checking for ANSI C header files
  200. cat <<EOF > conftest.c
  201.  
  202. #include <stdlib.h>
  203. #include <stdarg.h>
  204. #include <string.h>
  205. #include <float.h>
  206. #include <limits.h>
  207. EOF
  208. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  209. if test -z "$err"; then
  210.   DEFS="$DEFS -DSTDC_HEADERS=1"
  211. fi
  212. rm -f conftest*
  213.  
  214. if test -n "$prefix"; then
  215.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  216.   prsub="s%^prefix[     ]*=.*$%prefix = $prefix%"
  217. fi
  218. if test -n "$exec_prefix"; then
  219.   prsub="$prsub
  220. s%^exec_prefix[     ]*=.*$%exec_prefix = $exec_prefix%"
  221. fi
  222.  
  223. trap 'rm -f config.status; exit 1' 1 3 15
  224. echo creating config.status
  225. rm -f config.status
  226. cat <<EOF > config.status
  227. #!/bin/sh
  228. # Generated automatically by configure.
  229. # Run this file to recreate the current configuration.
  230. # This directory was configured as follows,
  231. # on host `(hostname || uname -n) 2>/dev/null`:
  232. #
  233. # $0 $*
  234.  
  235. case "\$1" in
  236.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  237.   exec /bin/sh $0 $* ;;
  238. esac
  239.  
  240. trap 'rm -f Makefile; exit 1' 1 3 15
  241. PROGS='$PROGS'
  242. CC='$CC'
  243. CPP='$CPP'
  244. INSTALL='$INSTALL'
  245. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  246. INSTALL_DATA='$INSTALL_DATA'
  247. LIBS='$LIBS'
  248. srcdir='$srcdir'
  249. DEFS='$DEFS'
  250. prefix='$prefix'
  251. exec_prefix='$exec_prefix'
  252. prsub='$prsub'
  253. EOF
  254. cat <<\EOF >> config.status
  255.  
  256. top_srcdir=$srcdir
  257. for file in Makefile; do
  258.   srcdir=$top_srcdir
  259.   # Remove last slash and all that follows it.  Not all systems have dirname.
  260.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  261.   if test "$dir" != "$file"; then
  262.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  263.     test ! -d $dir && mkdir $dir
  264.   fi
  265.   echo creating $file
  266.   rm -f $file
  267.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  268.   sed -e "
  269. $prsub
  270. s%@PROGS@%$PROGS%g
  271. s%@CC@%$CC%g
  272. s%@CPP@%$CPP%g
  273. s%@INSTALL@%$INSTALL%g
  274. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  275. s%@INSTALL_DATA@%$INSTALL_DATA%g
  276. s%@LIBS@%$LIBS%g
  277. s%@srcdir@%$srcdir%g
  278. s%@DEFS@%$DEFS%" $top_srcdir/${file}.in >> $file
  279. done
  280.  
  281. EOF
  282. chmod +x config.status
  283. test -n "$no_create" || ./config.status
  284.  
  285.