configure 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  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. # 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-PACKAGE] [TARGET]
  18. # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
  19. # --with-PACKAGE unless this script has special code to handle it.
  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. # For backward compatibility, also recognize exact --exec_prefix.
  33. -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  34. exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  35. -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  36. next_exec_prefix=yes ;;
  37. -gas | --gas | --ga | --g) ;;
  38. -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  39. -host | --host | --hos | --ho | --h)
  40. next_host=yes ;;
  41. -nfp | --nfp | --nf) ;;
  42. -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  43. no_create=1 ;;
  44. -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  45. prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  46. -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  47. next_prefix=yes ;;
  48. -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  49. srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  50. -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  51. next_srcdir=yes ;;
  52. -with-* | --with-*)
  53. package=`echo $arg|sed 's/-*with-//'`
  54. # Delete all the valid chars; see if any are left.
  55. if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
  56. echo "configure: $package: invalid package name" >&2; exit 1
  57. fi
  58. eval "with_`echo $package|sed s/-/_/g`=1" ;;
  59. -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  60. verbose=yes ;;
  61. *) ;;
  62. esac
  63. fi
  64. done
  65. trap 'rm -f conftest* core; exit 1' 1 3 15
  66. rm -f conftest*
  67. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  68. # A filename unique to this package, relative to the directory that
  69. # configure is in, which we can look for to find out if srcdir is correct.
  70. unique_file=reduce.c
  71. # Find the source files, if location was not specified.
  72. if test -z "$srcdir"; then
  73. srcdirdefaulted=yes
  74. # Try the directory containing this script, then `..'.
  75. prog=$0
  76. confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  77. test "X$confdir" = "X$prog" && confdir=.
  78. srcdir=$confdir
  79. if test ! -r $srcdir/$unique_file; then
  80. srcdir=..
  81. 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 \`${confdir}' 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. if test -z "$CC"; then
  98. echo checking for gcc
  99. saveifs="$IFS"; IFS="${IFS}:"
  100. for dir in $PATH; do
  101. test -z "$dir" && dir=.
  102. if test -f $dir/gcc; then
  103. CC="gcc"
  104. break
  105. fi
  106. done
  107. IFS="$saveifs"
  108. fi
  109. test -z "$CC" && CC="cc"
  110. # Find out if we are using GNU C, under whatever name.
  111. cat > conftest.c <<EOF
  112. #ifdef __GNUC__
  113. yes
  114. #endif
  115. EOF
  116. ${CC-cc} -E conftest.c > conftest.out 2>&1
  117. if egrep yes conftest.out >/dev/null 2>&1; then
  118. GCC=1 # For later tests.
  119. fi
  120. rm -f conftest*
  121. echo checking how to run the C preprocessor
  122. if test -z "$CPP"; then
  123. CPP='${CC-cc} -E'
  124. cat > conftest.c <<EOF
  125. #include <stdio.h>
  126. EOF
  127. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  128. if test -z "$err"; then
  129. :
  130. else
  131. CPP=/lib/cpp
  132. fi
  133. rm -f conftest*
  134. fi
  135. # Make sure to not get the incompatible SysV /etc/install and
  136. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  137. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  138. # or the AFS install, which mishandles nonexistent args. (Sigh.)
  139. if test -z "$INSTALL"; then
  140. echo checking for install
  141. saveifs="$IFS"; IFS="${IFS}:"
  142. for dir in $PATH; do
  143. test -z "$dir" && dir=.
  144. case $dir in
  145. /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
  146. *)
  147. if test -f $dir/installbsd; then
  148. INSTALL="$dir/installbsd -c" # OSF1
  149. INSTALL_PROGRAM='$(INSTALL)'
  150. INSTALL_DATA='$(INSTALL) -m 644'
  151. break
  152. fi
  153. if test -f $dir/install; then
  154. if grep dspmsg $dir/install >/dev/null 2>&1; then
  155. : # AIX
  156. else
  157. INSTALL="$dir/install -c"
  158. INSTALL_PROGRAM='$(INSTALL)'
  159. INSTALL_DATA='$(INSTALL) -m 644'
  160. break
  161. fi
  162. fi
  163. ;;
  164. esac
  165. done
  166. IFS="$saveifs"
  167. fi
  168. INSTALL=${INSTALL-cp}
  169. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  170. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  171. echo checking for minix/config.h
  172. cat > conftest.c <<EOF
  173. #include <minix/config.h>
  174. EOF
  175. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  176. if test -z "$err"; then
  177. MINIX=1
  178. fi
  179. rm -f conftest*
  180. # The Minix shell can't assign to the same variable on the same line!
  181. if test -n "$MINIX"; then
  182. {
  183. test -n "$verbose" && \
  184. echo ' defining' _POSIX_SOURCE
  185. DEFS="$DEFS -D_POSIX_SOURCE=1"
  186. }
  187. {
  188. test -n "$verbose" && \
  189. echo ' defining' _POSIX_1_SOURCE to be '2'
  190. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  191. }
  192. {
  193. test -n "$verbose" && \
  194. echo ' defining' _MINIX
  195. DEFS="$DEFS -D_MINIX=1"
  196. }
  197. fi
  198. echo checking for POSIXized ISC
  199. if test -d /etc/conf/kconfig.d &&
  200. grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  201. then
  202. ISC=1 # If later tests want to check for ISC.
  203. {
  204. test -n "$verbose" && \
  205. echo ' defining' _POSIX_SOURCE
  206. DEFS="$DEFS -D_POSIX_SOURCE=1"
  207. }
  208. if test -n "$GCC"; then
  209. CC="$CC -posix"
  210. else
  211. CC="$CC -Xp"
  212. fi
  213. fi
  214. prog='/* Ultrix mips cc rejects this. */
  215. typedef int charset[2]; const charset x;
  216. /* SunOS 4.1.1 cc rejects this. */
  217. char const *const *ccp;
  218. char **p;
  219. /* AIX XL C 1.02.0.0 rejects this.
  220. It does not let you subtract one const X* pointer from another in an arm
  221. of an if-expression whose if-part is not a constant expression */
  222. const char *g = "string";
  223. p = &g + (g ? g-g : 0);
  224. /* HPUX 7.0 cc rejects these. */
  225. ++ccp;
  226. p = (char**) ccp;
  227. ccp = (char const *const *) p;
  228. { /* SCO 3.2v4 cc rejects this. */
  229. char *t;
  230. char const *s = 0 ? (char *) 0 : (char const *) 0;
  231. *t++ = 0;
  232. }
  233. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
  234. int x[] = {25,17};
  235. const int *foo = &x[0];
  236. ++foo;
  237. }
  238. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  239. typedef const int *iptr;
  240. iptr p = 0;
  241. ++p;
  242. }
  243. { /* AIX XL C 1.02.0.0 rejects this saying
  244. "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  245. struct s { int j; const int *ap[3]; };
  246. struct s *b; b->j = 5;
  247. }'
  248. echo checking for working const
  249. cat > conftest.c <<EOF
  250. int main() { exit(0); }
  251. int t() { $prog }
  252. EOF
  253. if eval $compile; then
  254. :
  255. else
  256. {
  257. test -n "$verbose" && \
  258. echo ' defining' const to be 'empty'
  259. DEFS="$DEFS -Dconst="
  260. }
  261. fi
  262. rm -f conftest*
  263. echo checking for ANSI C header files
  264. cat > conftest.c <<EOF
  265. #include <stdlib.h>
  266. #include <stdarg.h>
  267. #include <string.h>
  268. #include <float.h>
  269. EOF
  270. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  271. if test -z "$err"; then
  272. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  273. echo '#include <string.h>' > conftest.c
  274. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  275. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  276. # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  277. cat > conftest.c <<EOF
  278. #include <ctype.h>
  279. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  280. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  281. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  282. int main () { int i; for (i = 0; i < 256; i++)
  283. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  284. exit (0); }
  285. EOF
  286. eval $compile
  287. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  288. {
  289. test -n "$verbose" && \
  290. echo ' defining' STDC_HEADERS
  291. DEFS="$DEFS -DSTDC_HEADERS=1"
  292. }
  293. fi
  294. rm -f conftest*
  295. fi
  296. rm -f conftest*
  297. fi
  298. rm -f conftest*
  299. for hdr in string.h stdlib.h memory.h
  300. do
  301. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  302. echo checking for ${hdr}
  303. cat > conftest.c <<EOF
  304. #include <${hdr}>
  305. EOF
  306. err=`eval "($CPP $DEFS conftest.c >/dev/null) 2>&1"`
  307. if test -z "$err"; then
  308. {
  309. test -n "$verbose" && \
  310. echo ' defining' ${trhdr}
  311. DEFS="$DEFS -D${trhdr}=1"
  312. }
  313. fi
  314. rm -f conftest*
  315. done
  316. for func in strerror
  317. do
  318. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  319. echo checking for ${func}
  320. cat > conftest.c <<EOF
  321. #include <stdio.h>
  322. int main() { exit(0); }
  323. int t() {
  324. #ifdef __stub_${func}
  325. choke me
  326. #else
  327. /* Override any gcc2 internal prototype to avoid an error. */
  328. extern char ${func}(); ${func}();
  329. #endif
  330. }
  331. EOF
  332. if eval $compile; then
  333. {
  334. test -n "$verbose" && \
  335. echo ' defining' ${trfunc}
  336. DEFS="$DEFS -D${trfunc}=1"
  337. }
  338. fi
  339. rm -f conftest*
  340. #endif
  341. done
  342. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  343. # for constant arguments. Useless!
  344. echo checking for working alloca.h
  345. cat > conftest.c <<EOF
  346. #include <alloca.h>
  347. int main() { exit(0); }
  348. int t() { char *p = alloca(2 * sizeof(int)); }
  349. EOF
  350. if eval $compile; then
  351. {
  352. test -n "$verbose" && \
  353. echo ' defining' HAVE_ALLOCA_H
  354. DEFS="$DEFS -DHAVE_ALLOCA_H=1"
  355. }
  356. fi
  357. rm -f conftest*
  358. decl="#ifdef __GNUC__
  359. #define alloca __builtin_alloca
  360. #else
  361. #if HAVE_ALLOCA_H
  362. #include <alloca.h>
  363. #else
  364. #ifdef _AIX
  365. #pragma alloca
  366. #else
  367. char *alloca ();
  368. #endif
  369. #endif
  370. #endif
  371. "
  372. echo checking for alloca
  373. cat > conftest.c <<EOF
  374. $decl
  375. int main() { exit(0); }
  376. int t() { char *p = (char *) alloca(1); }
  377. EOF
  378. if eval $compile; then
  379. :
  380. else
  381. alloca_missing=1
  382. fi
  383. rm -f conftest*
  384. if test -n "$alloca_missing"; then
  385. # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  386. # that cause trouble. Some versions do not even contain alloca or
  387. # contain a buggy version. If you still want to use their alloca,
  388. # use ar to extract alloca.o from them instead of compiling alloca.c.
  389. ALLOCA=alloca.o
  390. echo 'checking stack direction for C alloca'
  391. echo checking whether cross-compiling
  392. # If we cannot run a trivial program, we must be cross compiling.
  393. cat > conftest.c <<EOF
  394. main(){exit(0);}
  395. EOF
  396. eval $compile
  397. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  398. :
  399. else
  400. cross_compiling=1
  401. fi
  402. rm -f conftest*
  403. if test -n "$cross_compiling"
  404. then
  405. {
  406. test -n "$verbose" && \
  407. echo ' defining' STACK_DIRECTION to be '0'
  408. DEFS="$DEFS -DSTACK_DIRECTION=0"
  409. }
  410. else
  411. cat > conftest.c <<EOF
  412. find_stack_direction ()
  413. {
  414. static char *addr = 0;
  415. auto char dummy;
  416. if (addr == 0)
  417. {
  418. addr = &dummy;
  419. find_stack_direction ();
  420. }
  421. else
  422. return (&dummy > addr) ? 1 : -1;
  423. }
  424. main ()
  425. {
  426. exit (find_stack_direction() < 0);
  427. }
  428. EOF
  429. eval $compile
  430. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  431. {
  432. test -n "$verbose" && \
  433. echo ' defining' STACK_DIRECTION to be '1'
  434. DEFS="$DEFS -DSTACK_DIRECTION=1"
  435. }
  436. else
  437. {
  438. test -n "$verbose" && \
  439. echo ' defining' STACK_DIRECTION to be '-1'
  440. DEFS="$DEFS -DSTACK_DIRECTION=-1"
  441. }
  442. fi
  443. fi
  444. rm -f conftest*
  445. fi
  446. if test -n "$prefix"; then
  447. test -z "$exec_prefix" && exec_prefix='${prefix}'
  448. prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
  449. fi
  450. if test -n "$exec_prefix"; then
  451. prsub="$prsub
  452. s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
  453. exec_prefix\\1=\\2$exec_prefix%"
  454. fi
  455. trap 'rm -f config.status; exit 1' 1 3 15
  456. echo creating config.status
  457. rm -f config.status
  458. cat > config.status <<EOF
  459. #!/bin/sh
  460. # Generated automatically by configure.
  461. # Run this file to recreate the current configuration.
  462. # This directory was configured as follows,
  463. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  464. #
  465. # $0 $*
  466. for arg
  467. do
  468. case "\$arg" in
  469. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  470. exec /bin/sh $0 $* ;;
  471. *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  472. esac
  473. done
  474. trap 'rm -f Makefile; exit 1' 1 3 15
  475. CC='$CC'
  476. CPP='$CPP'
  477. INSTALL='$INSTALL'
  478. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  479. INSTALL_DATA='$INSTALL_DATA'
  480. ALLOCA='$ALLOCA'
  481. LIBS='$LIBS'
  482. srcdir='$srcdir'
  483. DEFS='$DEFS'
  484. prefix='$prefix'
  485. exec_prefix='$exec_prefix'
  486. prsub='$prsub'
  487. EOF
  488. cat >> config.status <<\EOF
  489. top_srcdir=$srcdir
  490. for file in .. Makefile; do if [ "x$file" != "x.." ]; then
  491. srcdir=$top_srcdir
  492. # Remove last slash and all that follows it. Not all systems have dirname.
  493. dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  494. if test "$dir" != "$file"; then
  495. test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  496. test ! -d $dir && mkdir $dir
  497. fi
  498. echo creating $file
  499. rm -f $file
  500. echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  501. sed -e "
  502. $prsub
  503. s%@CC@%$CC%g
  504. s%@CPP@%$CPP%g
  505. s%@INSTALL@%$INSTALL%g
  506. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  507. s%@INSTALL_DATA@%$INSTALL_DATA%g
  508. s%@ALLOCA@%$ALLOCA%g
  509. s%@LIBS@%$LIBS%g
  510. s%@srcdir@%$srcdir%g
  511. s%@DEFS@%$DEFS%
  512. " $top_srcdir/${file}.in >> $file
  513. fi; done
  514. exit 0
  515. EOF
  516. chmod +x config.status
  517. test -n "$no_create" || ./config.status