home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #1 / MONSTER.ISO / prog / gen / regex011.taz / regex011 / regex-0.11 / configure < prev    next >
Encoding:
Text File  |  1992-09-16  |  10.0 KB  |  406 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=regex.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes; srcdir=.
  81.   if test ! -r $unique_file; then srcdir=..; fi
  82. fi
  83. if test ! -r $srcdir/$unique_file; then
  84.   if test x$srcdirdefaulted = xyes; then
  85.     echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  86.   else
  87.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  88.   fi
  89.   exit 1
  90. fi
  91. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  92. # But we can't avoid them for `..', to make subdirectories work.
  93. case $srcdir in
  94.   .|/*|~*) ;;
  95.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  96. esac
  97.  
  98.  
  99. if test -z "$CC"; then
  100.   echo checking for gcc
  101.   saveifs="$IFS"; IFS="${IFS}:"
  102.   for dir in $PATH; do
  103.     test -z "$dir" && dir=.
  104.     if test -f $dir/gcc; then
  105.       CC="gcc"
  106.       break
  107.     fi
  108.   done
  109.   IFS="$saveifs"
  110. fi
  111. test -z "$CC" && CC="cc"
  112.  
  113. # Find out if we are using GNU C, under whatever name.
  114. cat <<EOF > conftest.c
  115. #ifdef __GNUC__
  116.   yes
  117. #endif
  118. EOF
  119. ${CC-cc} -E conftest.c > conftest.out 2>&1
  120. if egrep yes conftest.out >/dev/null 2>&1; then
  121.   GCC=1 # For later tests.
  122.   CC="$CC -O"
  123. fi
  124. rm -f conftest*
  125.  
  126. # Make sure to not get the incompatible SysV /etc/install and
  127. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  128. # or the SunOS /usr/etc/install directory.
  129. if test -z "$INSTALL"; then
  130.   echo checking for install
  131.   saveifs="$IFS"; IFS="${IFS}:"
  132.   for dir in $PATH; do
  133.     test -z "$dir" && dir=.
  134.     case $dir in
  135.     /etc|/usr/sbin|/usr/etc) ;;
  136.     *)
  137.       if test -f $dir/install; then
  138.     INSTALL="$dir/install -c"
  139.     INSTALL_PROGRAM='$(INSTALL)'
  140.     INSTALL_DATA='$(INSTALL) -m 644'
  141.     break
  142.       fi
  143.       ;;
  144.     esac
  145.   done
  146.   IFS="$saveifs"
  147. fi
  148. INSTALL=${INSTALL-cp}
  149. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  150. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  151.  
  152.  
  153. echo checking for AIX
  154. echo checking how to run the C preprocessor
  155. if test -z "$CPP"; then
  156.   CPP='${CC-cc} -E'
  157.   cat <<EOF > conftest.c
  158.  
  159. #include <stdio.h>
  160. EOF
  161. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  162. if test -z "$err"; then
  163.   :
  164. else
  165.   CPP=/lib/cpp
  166. fi
  167. rm -f conftest*
  168. fi
  169.  
  170. cat <<EOF > conftest.c
  171.  
  172. #ifdef _AIX
  173.   yes
  174. #endif
  175.  
  176. EOF
  177. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  178. if egrep "yes" conftest.out >/dev/null 2>&1; then
  179.   DEFS="$DEFS -D_ALL_SOURCE=1"
  180. fi
  181. rm -f conftest*
  182.  
  183.  
  184. echo checking for DYNIX/ptx libseq
  185. cat <<EOF > conftest.c
  186.  
  187. #if defined(_SEQUENT_)
  188.   yes
  189. #endif
  190.  
  191. EOF
  192. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  193. if egrep "yes" conftest.out >/dev/null 2>&1; then
  194.   SEQUENT=1
  195. fi
  196. rm -f conftest*
  197.  
  198. test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
  199.   LIBS="$LIBS -lseq"
  200.  
  201. echo checking for POSIXized ISC
  202. if test -d /etc/conf/kconfig.d &&
  203.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  204. then
  205.   ISC=1 # If later tests want to check for ISC.
  206.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  207.   if test -n "$GCC"; then
  208.     CC="$CC -posix"
  209.   else
  210.     CC="$CC -Xp"
  211.   fi
  212. fi
  213.  
  214. echo checking for minix/config.h
  215. cat <<EOF > conftest.c
  216.  
  217. #include <minix/config.h>
  218. EOF
  219. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  220. if test -z "$err"; then
  221.   MINIX=1
  222. fi
  223. rm -f conftest*
  224.  
  225. # The Minix shell can't assign to the same variable on the same line!
  226. if test -n "$MINIX"; then
  227.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  228.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  229.   DEFS="$DEFS -D_MINIX=1"
  230. fi
  231.  
  232.  
  233. echo checking for ANSI C header files
  234. cat <<EOF > conftest.c
  235.  
  236. #include <stdlib.h>
  237. #include <stdarg.h>
  238. #include <string.h>
  239. #include <limits.h>
  240. EOF
  241. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  242. if test -z "$err"; then
  243.   DEFS="$DEFS -DSTDC_HEADERS=1"
  244. fi
  245. rm -f conftest*
  246.  
  247. echo checking for BSD string and memory functions
  248. echo "#include <strings.h>
  249. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  250. if eval $compile; then
  251.   :
  252. else
  253.   DEFS="$DEFS -DUSG=1"
  254. fi
  255. rm -f conftest*
  256.  
  257.  
  258. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  259. # for constant arguments.  Useless!
  260. echo checking for working alloca.h
  261. echo "#include <alloca.h>
  262. main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
  263. if eval $compile; then
  264.   DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  265. fi
  266. rm -f conftest*
  267.  
  268. decl="#ifdef __GNUC__
  269. #define alloca __builtin_alloca
  270. #else
  271. #if HAVE_ALLOCA_H
  272. #include <alloca.h>
  273. #else
  274. #ifdef _AIX
  275.  #pragma alloca
  276. #else
  277. char *alloca ();
  278. #endif
  279. #endif
  280. #endif
  281. "
  282. echo checking for alloca
  283. echo "$decl
  284. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  285. if eval $compile; then
  286.   :
  287. else
  288.   alloca_missing=1
  289. fi
  290. rm -f conftest*
  291.  
  292. if test -n "$alloca_missing"; then
  293.   SAVELIBS="$LIBS"
  294.   # Maybe alloca is in a different library.
  295.   #if test -f /usr/ucblib/libucb.a; then
  296.     # Avoid the broken BSD compatibility library as much as possible.
  297.     #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  298.   #el
  299.   if test -f /lib/libPW.a; then
  300.     LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  301.   fi
  302.   if test -n "$trylib"; then
  303.     alloca_missing=
  304.     echo checking for alloca in $trylib
  305. echo "$decl
  306. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  307. if eval $compile; then
  308.   :
  309. else
  310.   alloca_missing=1
  311. fi
  312. rm -f conftest*
  313.  
  314.   fi
  315.   if test -n "$alloca_missing"; then
  316.     LIBS="$SAVELIBS" ALLOCA=alloca.o
  317.   fi
  318. fi
  319.  
  320.  
  321. if test -z "$prefix"
  322. then
  323.   echo checking for gcc to derive installation directory prefix
  324.   saveifs="$IFS"; IFS="$IFS:"
  325.   for dir in $PATH; do
  326.     test -z "$dir" && dir=.
  327.     if test $dir != . && test -f $dir/gcc; then
  328.       # Not all systems have dirname.
  329.       prefix=`echo $dir|sed 's,/[^/][^/]*$,,'`
  330.       break
  331.     fi
  332.   done
  333.   IFS="$saveifs"
  334. fi
  335.  
  336.  
  337. if test -n "$prefix"; then
  338.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  339.   prsub="s,^prefix[     ]*=.*$,prefix = $prefix,"
  340. fi
  341. if test -n "$exec_prefix"; then
  342.   prsub="$prsub
  343. s,^exec_prefix[     ]*=.*$,exec_prefix = $exec_prefix,"
  344. fi
  345.  
  346. trap 'rm -f config.status; exit 1' 1 3 15
  347. echo creating config.status
  348. rm -f config.status
  349. cat <<EOF > config.status
  350. #!/bin/sh
  351. # Generated automatically by configure.
  352. # Run this file to recreate the current configuration.
  353. # This directory was configured as follows:
  354. # $0 $*
  355.  
  356. case "\$1" in
  357.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  358.   exec /bin/sh $0 $* ;;
  359. esac
  360.  
  361. trap 'rm -f Makefile doc/Makefile test/Makefile; exit 1' 1 3 15
  362. CC='$CC'
  363. INSTALL='$INSTALL'
  364. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  365. INSTALL_DATA='$INSTALL_DATA'
  366. CPP='$CPP'
  367. ALLOCA='$ALLOCA'
  368. LIBS='$LIBS'
  369. srcdir='$srcdir'
  370. DEFS='$DEFS'
  371. prefix='$prefix'
  372. exec_prefix='$exec_prefix'
  373. prsub='$prsub'
  374. EOF
  375. cat <<\EOF >> config.status
  376.  
  377. top_srcdir=$srcdir
  378. for file in Makefile doc/Makefile test/Makefile; do
  379.   srcdir=$top_srcdir
  380.   # Remove last slash and all that follows it.  Not all systems have dirname.
  381.   dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  382.   if test "$dir" != "$file"; then
  383.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  384.     test ! -d $dir && mkdir $dir
  385.   fi
  386.   echo creating $file
  387.   rm -f $file
  388.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  389.   sed -e "
  390. $prsub
  391. s,@CC@,$CC,g
  392. s,@INSTALL@,$INSTALL,g
  393. s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
  394. s,@INSTALL_DATA@,$INSTALL_DATA,g
  395. s,@CPP@,$CPP,g
  396. s,@ALLOCA@,$ALLOCA,g
  397. s,@LIBS@,$LIBS,g
  398. s,@srcdir@,$srcdir,g
  399. s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
  400. done
  401.  
  402. EOF
  403. chmod +x config.status
  404. test -n "$no_create" || ./config.status
  405.  
  406.