home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 1 / FFMCD01.bin / useful / dist / gnu / gdbm / gdbm-1.6-amiga / configure < prev    next >
Encoding:
Text File  |  1993-07-15  |  9.9 KB  |  373 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 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-PACKAGE] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  23. # --with-PACKAGE unless this script has special code to handle it.
  24.  
  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.      # For backward compatibility, also recognize exact --exec_prefix.
  39.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  40.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  41.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  42.     next_exec_prefix=yes ;;
  43.  
  44.      -gas | --gas | --ga | --g) ;;
  45.  
  46.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  47.      -host | --host | --hos | --ho | --h)
  48.     next_host=yes ;;
  49.  
  50.      -nfp | --nfp | --nf) ;;
  51.  
  52.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  53.         no_create=1 ;;
  54.  
  55.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  56.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  57.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  58.     next_prefix=yes ;;
  59.  
  60.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  61.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  62.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  63.     next_srcdir=yes ;;
  64.  
  65.      -with-* | --with-*)
  66.        package=`echo $arg|sed 's/-*with-//'`
  67.        # Delete all the valid chars; see if any are left.
  68.        if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  69.          echo "configure: $package: invalid package name" >&2; exit 1
  70.        fi
  71.        eval "with_`echo $package|sed s/-/_/g`=1" ;;
  72.  
  73.      *) ;;
  74.     esac
  75.   fi
  76. done
  77.  
  78. trap 'rm -f conftest* core; exit 1' 1 3 15
  79.  
  80. rm -f conftest*
  81. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  82.  
  83. # A filename unique to this package, relative to the directory that
  84. # configure is in, which we can look for to find out if srcdir is correct.
  85. unique_file=gdbmdefs.h
  86.  
  87. # Find the source files, if location was not specified.
  88. if test -z "$srcdir"; then
  89.   srcdirdefaulted=yes
  90.   # Try the directory containing this script, then `..'.
  91.   prog=$0
  92.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  93.   test "X$confdir" = "X$prog" && confdir=.
  94.   srcdir=$confdir
  95.   if test ! -r $srcdir/$unique_file; then
  96.     srcdir=..
  97.   fi
  98. fi
  99. if test ! -r $srcdir/$unique_file; then
  100.   if test x$srcdirdefaulted = xyes; then
  101.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  102.   else
  103.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  104.   fi
  105.   exit 1
  106. fi
  107. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  108. # But we can't avoid them for `..', to make subdirectories work.
  109. case $srcdir in
  110.   .|/*|~*) ;;
  111.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  112. esac
  113.  
  114. PROGS="libgdbm.a testgdbm testdbm testndbm tndbm tdbm conv2gdbm"
  115. if test -z "$CC"; then
  116.   echo checking for gcc
  117.   saveifs="$IFS"; IFS="${IFS}:"
  118.   for dir in $PATH; do
  119.     test -z "$dir" && dir=.
  120.     if test -f $dir/gcc; then
  121.       CC="gcc"
  122.       break
  123.     fi
  124.   done
  125.   IFS="$saveifs"
  126. fi
  127. test -z "$CC" && CC="cc"
  128.  
  129. # Find out if we are using GNU C, under whatever name.
  130. cat > conftest.c <<EOF
  131. #ifdef __GNUC__
  132.   yes
  133. #endif
  134. EOF
  135. ${CC-cc} -E conftest.c > conftest.out 2>&1
  136. if egrep yes conftest.out >/dev/null 2>&1; then
  137.   GCC=1 # For later tests.
  138. fi
  139. rm -f conftest*
  140.  
  141. echo checking how to run the C preprocessor
  142. if test -z "$CPP"; then
  143.   CPP='${CC-cc} -E'
  144.   cat > conftest.c <<EOF
  145. #include <stdio.h>
  146. EOF
  147. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  148. if test -z "$err"; then
  149.   :
  150. else
  151.   CPP=/lib/cpp
  152. fi
  153. rm -f conftest*
  154. fi
  155.  
  156. # Make sure to not get the incompatible SysV /etc/install and
  157. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  158. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  159. # or the AFS install, which mishandles nonexistent args.  (Sigh.)
  160. if test -z "$INSTALL"; then
  161.   echo checking for install
  162.   saveifs="$IFS"; IFS="${IFS}:"
  163.   for dir in $PATH; do
  164.     test -z "$dir" && dir=.
  165.     case $dir in
  166.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  167.     *)
  168.       if test -f $dir/install; then
  169.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  170.       : # AIX
  171.     else
  172.       INSTALL="$dir/install -c"
  173.       INSTALL_PROGRAM='$(INSTALL)'
  174.       INSTALL_DATA='$(INSTALL) -m 644'
  175.       break
  176.     fi
  177.       fi
  178.       ;;
  179.     esac
  180.   done
  181.   IFS="$saveifs"
  182. fi
  183. INSTALL=${INSTALL-cp}
  184. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  185. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  186.  
  187. echo checking for unistd.h
  188. cat > conftest.c <<EOF
  189. #include <unistd.h>
  190. EOF
  191. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  192. if test -z "$err"; then
  193.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  194. fi
  195. rm -f conftest*
  196.  
  197. for hdr in string.h sys/file.h
  198. do
  199. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  200. echo checking for ${hdr}
  201. cat > conftest.c <<EOF
  202. #include <${hdr}>
  203. EOF
  204. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  205. if test -z "$err"; then
  206.   DEFS="$DEFS -D${trhdr}=1"
  207. fi
  208. rm -f conftest*
  209. done
  210.  
  211. for func in rename ftruncate flock bcopy fsync xmalloc
  212. do
  213. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  214. echo checking for ${func}
  215. cat > conftest.c <<EOF
  216. #include <stdio.h>
  217. main() { exit(0); } 
  218. t() { 
  219. #ifdef __stub_${func}
  220. choke me
  221. #else
  222. /* Override any gcc2 internal prototype to avoid an error.  */
  223. extern char ${func}(); ${func}();
  224. #endif
  225.  }
  226. EOF
  227. if eval $compile; then
  228.   DEFS="$DEFS -D${trfunc}=1"
  229. fi
  230. rm -f conftest*
  231. #endif
  232. done
  233.  
  234. echo checking for st_blksize in struct stat
  235. cat > conftest.c <<EOF
  236. #include <sys/types.h>
  237. #include <sys/stat.h>
  238. main() { exit(0); } 
  239. t() { struct stat s; s.st_blksize; }
  240. EOF
  241. if eval $compile; then
  242.   DEFS="$DEFS -DHAVE_ST_BLKSIZE=1"
  243. fi
  244. rm -f conftest*
  245.  
  246. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  247. # for constant arguments.  Useless!
  248. echo checking for working alloca.h
  249. cat > conftest.c <<EOF
  250. #include <alloca.h>
  251. main() { exit(0); } 
  252. t() { char *p = alloca(2 * sizeof(int)); }
  253. EOF
  254. if eval $compile; then
  255.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  256. fi
  257. rm -f conftest*
  258.  
  259. decl="#ifdef __GNUC__
  260. #define alloca __builtin_alloca
  261. #else
  262. #if HAVE_ALLOCA_H
  263. #include <alloca.h>
  264. #else
  265. #ifdef _AIX
  266.  #pragma alloca
  267. #else
  268. char *alloca ();
  269. #endif
  270. #endif
  271. #endif
  272. "
  273. echo checking for alloca
  274. cat > conftest.c <<EOF
  275. $decl
  276. main() { exit(0); } 
  277. t() { char *p = (char *) alloca(1); }
  278. EOF
  279. if eval $compile; then
  280.   :
  281. else
  282.   alloca_missing=1
  283. fi
  284. rm -f conftest*
  285.  
  286. if test -n "$alloca_missing"; then
  287.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  288.   # that cause trouble.  Some versions do not even contain alloca or
  289.   # contain a buggy version.  If you still want to use their alloca,
  290.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  291.   ALLOCA=alloca.o
  292. fi
  293.  
  294. if test -n "$prefix"; then
  295.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  296.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  297. fi
  298. if test -n "$exec_prefix"; then
  299.   prsub="$prsub
  300. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  301. exec_prefix\\1=\\2$exec_prefix%"
  302. fi
  303.  
  304. trap 'rm -f config.status; exit 1' 1 3 15
  305. echo creating config.status
  306. rm -f config.status
  307. cat > config.status <<EOF
  308. #!/bin/sh
  309. # Generated automatically by configure.
  310. # Run this file to recreate the current configuration.
  311. # This directory was configured as follows,
  312. # on host `(hostname || uname -n) 2>/dev/null`:
  313. #
  314. # $0 $*
  315.  
  316. for arg
  317. do
  318.   case "\$arg" in
  319.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  320.     exec /bin/sh $0 $* ;;
  321.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  322.   esac
  323. done
  324.  
  325. trap 'rm -f Makefile; exit 1' 1 3 15
  326. PROGS='$PROGS'
  327. CC='$CC'
  328. CPP='$CPP'
  329. INSTALL='$INSTALL'
  330. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  331. INSTALL_DATA='$INSTALL_DATA'
  332. ALLOCA='$ALLOCA'
  333. LIBS='$LIBS'
  334. srcdir='$srcdir'
  335. DEFS='$DEFS'
  336. prefix='$prefix'
  337. exec_prefix='$exec_prefix'
  338. prsub='$prsub'
  339. EOF
  340. cat >> config.status <<\EOF
  341.  
  342. top_srcdir=$srcdir
  343. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  344.   srcdir=$top_srcdir
  345.   # Remove last slash and all that follows it.  Not all systems have dirname.
  346.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  347.   if test "$dir" != "$file"; then
  348.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  349.     test ! -d $dir && mkdir $dir
  350.   fi
  351.   echo creating $file
  352.   rm -f $file
  353.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  354.   sed -e "
  355. $prsub
  356. s%@PROGS@%$PROGS%g
  357. s%@CC@%$CC%g
  358. s%@CPP@%$CPP%g
  359. s%@INSTALL@%$INSTALL%g
  360. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  361. s%@INSTALL_DATA@%$INSTALL_DATA%g
  362. s%@ALLOCA@%$ALLOCA%g
  363. s%@LIBS@%$LIBS%g
  364. s%@srcdir@%$srcdir%g
  365. s%@DEFS@%$DEFS%
  366. " $top_srcdir/${file}.in >> $file
  367. fi; done
  368.  
  369. EOF
  370. chmod +x config.status
  371. test -n "$no_create" || ./config.status
  372.  
  373.