CONFIGUR.E 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  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. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  17. # [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  18. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  19. trap 'rm -f conftest* core; exit 1' 1 3 15
  20. for arg
  21. do
  22. # Handle --exec_prefix with a space before the argument.
  23. if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  24. # Handle --host with a space before the argument.
  25. elif test x$next_host = xyes; then next_host=
  26. # Handle --prefix with a space before the argument.
  27. elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  28. # Handle --srcdir with a space before the argument.
  29. elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  30. else
  31. case $arg in
  32. -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  33. exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  34. -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  35. next_exec_prefix=yes ;;
  36. -gas | --gas | --ga | --g) ;;
  37. -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  38. -host | --host | --hos | --ho | --h)
  39. next_host=yes ;;
  40. -nfp | --nfp | --nf) ;;
  41. -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  42. no_create=1 ;;
  43. -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  44. prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  45. -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  46. next_prefix=yes ;;
  47. -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  48. srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  49. -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  50. next_srcdir=yes ;;
  51. -with-* | --with-*) ;;
  52. *) ;;
  53. esac
  54. fi
  55. done
  56. rm -f conftest*
  57. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  58. # A filename unique to this package, relative to the directory that
  59. # configure is in, which we can look for to find out if srcdir is correct.
  60. unique_file=reduce.c
  61. # Find the source files, if location was not specified.
  62. if test -z "$srcdir"; then
  63. srcdirdefaulted=yes
  64. # Try the directory containing this script, then `..'.
  65. prog=$0
  66. confdir=`echo $prog|sed 's,/[^/][^/]*$,,'`
  67. test "X$confdir" = "X$prog" && confdir=.
  68. srcdir=$confdir
  69. if test ! -r $srcdir/$unique_file; then
  70. srcdir=..
  71. fi
  72. fi
  73. if test ! -r $srcdir/$unique_file; then
  74. if test x$srcdirdefaulted = xyes; then
  75. echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  76. else
  77. echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  78. fi
  79. exit 1
  80. fi
  81. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  82. # But we can't avoid them for `..', to make subdirectories work.
  83. case $srcdir in
  84. .|/*|~*) ;;
  85. *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  86. esac
  87. if test -z "$CC"; then
  88. echo checking for gcc
  89. saveifs="$IFS"; IFS="${IFS}:"
  90. for dir in $PATH; do
  91. test -z "$dir" && dir=.
  92. if test -f $dir/gcc; then
  93. CC="gcc"
  94. break
  95. fi
  96. done
  97. IFS="$saveifs"
  98. fi
  99. test -z "$CC" && CC="cc"
  100. # Find out if we are using GNU C, under whatever name.
  101. cat <<EOF > conftest.c
  102. #ifdef __GNUC__
  103. yes
  104. #endif
  105. EOF
  106. ${CC-cc} -E conftest.c > conftest.out 2>&1
  107. if egrep yes conftest.out >/dev/null 2>&1; then
  108. GCC=1 # For later tests.
  109. CC="$CC -O"
  110. fi
  111. rm -f conftest*
  112. echo checking how to run the C preprocessor
  113. if test -z "$CPP"; then
  114. CPP='${CC-cc} -E'
  115. cat <<EOF > conftest.c
  116. #include <stdio.h>
  117. EOF
  118. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  119. if test -z "$err"; then
  120. :
  121. else
  122. CPP=/lib/cpp
  123. fi
  124. rm -f conftest*
  125. fi
  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. echo checking for minix/config.h
  152. cat <<EOF > conftest.c
  153. #include <minix/config.h>
  154. EOF
  155. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  156. if test -z "$err"; then
  157. MINIX=1
  158. fi
  159. rm -f conftest*
  160. # The Minix shell can't assign to the same variable on the same line!
  161. if test -n "$MINIX"; then
  162. DEFS="$DEFS -D_POSIX_SOURCE=1"
  163. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  164. DEFS="$DEFS -D_MINIX=1"
  165. fi
  166. echo checking for POSIXized ISC
  167. if test -d /etc/conf/kconfig.d &&
  168. grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  169. then
  170. ISC=1 # If later tests want to check for ISC.
  171. DEFS="$DEFS -D_POSIX_SOURCE=1"
  172. if test -n "$GCC"; then
  173. CC="$CC -posix"
  174. else
  175. CC="$CC -Xp"
  176. fi
  177. fi
  178. echo checking for ANSI C header files
  179. cat <<EOF > conftest.c
  180. #include <stdlib.h>
  181. #include <stdarg.h>
  182. #include <string.h>
  183. #include <float.h>
  184. #include <limits.h>
  185. EOF
  186. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  187. if test -z "$err"; then
  188. DEFS="$DEFS -DSTDC_HEADERS=1"
  189. fi
  190. rm -f conftest*
  191. echo checking for BSD string and memory functions
  192. echo "#include <strings.h>
  193. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  194. if eval $compile; then
  195. :
  196. else
  197. DEFS="$DEFS -DUSG=1"
  198. fi
  199. rm -f conftest*
  200. for func in strerror
  201. do
  202. trfrom='[a-z]' trto='[A-Z]'
  203. echo checking for ${func}
  204. echo "
  205. main() { exit(0); } t() {
  206. /* Override any gcc2 internal prototype to avoid an error. */
  207. extern char ${func}(); ${func}(); }" > conftest.c
  208. if eval $compile; then
  209. DEFS="$DEFS -DHAVE_`echo $func|tr "$trfrom" "$trto"`=1"
  210. fi
  211. rm -f conftest*
  212. done
  213. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  214. # for constant arguments. Useless!
  215. echo checking for working alloca.h
  216. echo "#include <alloca.h>
  217. main() { exit(0); } t() { char *p = alloca(2 * sizeof(int)); }" > conftest.c
  218. if eval $compile; then
  219. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  220. fi
  221. rm -f conftest*
  222. decl="#ifdef __GNUC__
  223. #define alloca __builtin_alloca
  224. #else
  225. #if HAVE_ALLOCA_H
  226. #include <alloca.h>
  227. #else
  228. #ifdef _AIX
  229. #pragma alloca
  230. #else
  231. char *alloca ();
  232. #endif
  233. #endif
  234. #endif
  235. "
  236. echo checking for alloca
  237. echo "$decl
  238. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  239. if eval $compile; then
  240. :
  241. else
  242. alloca_missing=1
  243. fi
  244. rm -f conftest*
  245. if test -n "$alloca_missing"; then
  246. SAVELIBS="$LIBS"
  247. # Maybe alloca is in a different library.
  248. #if test -f /usr/ucblib/libucb.a; then
  249. # Avoid the broken BSD compatibility library as much as possible.
  250. #LIBS="$LIBS -L/usr/ucblib -lc -lucb" trylib=-lucb # SVR4
  251. #el
  252. if test -f /lib/libPW.a; then
  253. LIBS="$LIBS -lPW" trylib=-lPW # SVR2 and SVR3
  254. fi
  255. if test -n "$trylib"; then
  256. alloca_missing=
  257. echo checking for alloca in $trylib
  258. echo "$decl
  259. main() { exit(0); } t() { char *p = (char *) alloca(1); }" > conftest.c
  260. if eval $compile; then
  261. :
  262. else
  263. alloca_missing=1
  264. fi
  265. rm -f conftest*
  266. fi
  267. if test -n "$alloca_missing"; then
  268. LIBS="$SAVELIBS" ALLOCA=alloca.o
  269. fi
  270. fi
  271. if test -n "$prefix"; then
  272. test -z "$exec_prefix" && exec_prefix='$(prefix)'
  273. prsub="s,^prefix[ ]*=.*$,prefix = $prefix,"
  274. fi
  275. if test -n "$exec_prefix"; then
  276. prsub="$prsub
  277. s,^exec_prefix[ ]*=.*$,exec_prefix = $exec_prefix,"
  278. fi
  279. trap 'rm -f config.status; exit 1' 1 3 15
  280. echo creating config.status
  281. rm -f config.status
  282. cat <<EOF > config.status
  283. #!/bin/sh
  284. # Generated automatically by configure.
  285. # Run this file to recreate the current configuration.
  286. # This directory was configured as follows,
  287. # on host `(hostname || uname -n) 2>/dev/null`:
  288. #
  289. # $0 $*
  290. case "\$1" in
  291. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  292. exec /bin/sh $0 $* ;;
  293. esac
  294. trap 'rm -f Makefile; exit 1' 1 3 15
  295. CC='$CC'
  296. CPP='$CPP'
  297. INSTALL='$INSTALL'
  298. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  299. INSTALL_DATA='$INSTALL_DATA'
  300. ALLOCA='$ALLOCA'
  301. LIBS='$LIBS'
  302. srcdir='$srcdir'
  303. DEFS='$DEFS'
  304. prefix='$prefix'
  305. exec_prefix='$exec_prefix'
  306. prsub='$prsub'
  307. EOF
  308. cat <<\EOF >> config.status
  309. top_srcdir=$srcdir
  310. for file in Makefile; do
  311. srcdir=$top_srcdir
  312. # Remove last slash and all that follows it. Not all systems have dirname.
  313. dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  314. if test "$dir" != "$file"; then
  315. test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  316. test ! -d $dir && mkdir $dir
  317. fi
  318. echo creating $file
  319. rm -f $file
  320. echo "# Generated automatically from `basename $file`.in by configure." > $file
  321. sed -e "
  322. $prsub
  323. s,@CC@,$CC,g
  324. s,@CPP@,$CPP,g
  325. s,@INSTALL@,$INSTALL,g
  326. s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
  327. s,@INSTALL_DATA@,$INSTALL_DATA,g
  328. s,@ALLOCA@,$ALLOCA,g
  329. s,@LIBS@,$LIBS,g
  330. s,@srcdir@,$srcdir,g
  331. s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
  332. done
  333. EOF
  334. chmod +x config.status
  335. test -n "$no_create" || ./config.status