home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / mesch12a.zip / configure < prev    next >
Text File  |  1994-01-14  |  28KB  |  969 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.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  74.        verbose=yes ;;
  75.  
  76.      *) ;;
  77.     esac
  78.   fi
  79. done
  80.  
  81. trap 'rm -f conftest* core; exit 1' 1 3 15
  82.  
  83. # Needed for some versions of `tr' so that character classes in `[]' work.
  84. if test "${LANG+set}" = "set" ; then
  85.    LANG=C
  86. fi
  87.  
  88. rm -f conftest*
  89. compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  90.  
  91. # A filename unique to this package, relative to the directory that
  92. # configure is in, which we can look for to find out if srcdir is correct.
  93. unique_file=err.c
  94.  
  95. # Find the source files, if location was not specified.
  96. if test -z "$srcdir"; then
  97.   srcdirdefaulted=yes
  98.   # Try the directory containing this script, then `..'.
  99.   prog=$0
  100.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  101.   test "X$confdir" = "X$prog" && confdir=.
  102.   srcdir=$confdir
  103.   if test ! -r $srcdir/$unique_file; then
  104.     srcdir=..
  105.   fi
  106. fi
  107. if test ! -r $srcdir/$unique_file; then
  108.   if test x$srcdirdefaulted = xyes; then
  109.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  110.   else
  111.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  112.   fi
  113.   exit 1
  114. fi
  115. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  116. # But we can't avoid them for `..', to make subdirectories work.
  117. case $srcdir in
  118.   .|/*|~*) ;;
  119.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  120. esac
  121.  
  122.  
  123. PROGS=""
  124. if test -z "$CC"; then
  125.   # Extract the first word of `acc', so it can be a program name with args.
  126.   set dummy acc; word=$2
  127.   echo checking for $word
  128.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  129.   for dir in $PATH; do
  130.     test -z "$dir" && dir=.
  131.     if test -f $dir/$word; then
  132.       CC="acc"
  133.       break
  134.     fi
  135.   done
  136.   IFS="$saveifs"
  137. fi
  138. test -z "$CC" && CC=""""
  139. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  140.  
  141. if test -z "$CC"; then
  142.   # Extract the first word of `cc', so it can be a program name with args.
  143.   set dummy cc; word=$2
  144.   echo checking for $word
  145.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  146.   for dir in $PATH; do
  147.     test -z "$dir" && dir=.
  148.     if test -f $dir/$word; then
  149.       CC="cc"
  150.       break
  151.     fi
  152.   done
  153.   IFS="$saveifs"
  154. fi
  155. test -z "$CC" && CC="gcc"
  156. test -n "$CC" -a -n "$verbose" && echo "    setting CC to $CC"
  157.  
  158. echo checking how to run the C preprocessor
  159. if test -z "$CPP"; then
  160.   CPP='${CC-cc} -E'
  161.   cat > conftest.c <<EOF
  162. #include <stdio.h>
  163. EOF
  164. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  165. if test -z "$err"; then
  166.   :
  167. else
  168.   CPP=/lib/cpp
  169. fi
  170. rm -f conftest*
  171. fi
  172.  
  173. echo checking for AIX
  174. cat > conftest.c <<EOF
  175. #ifdef _AIX
  176.   yes
  177. #endif
  178.  
  179. EOF
  180. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  181. if egrep "yes" conftest.out >/dev/null 2>&1; then
  182.   {
  183. test -n "$verbose" && \
  184. echo '    defining' _ALL_SOURCE
  185. DEFS="$DEFS -D_ALL_SOURCE=1"
  186. SEDDEFS="${SEDDEFS}\${SEDdA}_ALL_SOURCE\${SEDdB}_ALL_SOURCE\${SEDdC}1\${SEDdD}
  187. \${SEDuA}_ALL_SOURCE\${SEDuB}_ALL_SOURCE\${SEDuC}1\${SEDuD}
  188. \${SEDeA}_ALL_SOURCE\${SEDeB}_ALL_SOURCE\${SEDeC}1\${SEDeD}
  189. "
  190. }
  191.  
  192. fi
  193. rm -f conftest*
  194.  
  195.  
  196. echo checking for minix/config.h
  197. cat > conftest.c <<EOF
  198. #include <minix/config.h>
  199. EOF
  200. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  201. if test -z "$err"; then
  202.   MINIX=1
  203. fi
  204. rm -f conftest*
  205.  
  206. # The Minix shell can't assign to the same variable on the same line!
  207. if test -n "$MINIX"; then
  208.   {
  209. test -n "$verbose" && \
  210. echo '    defining' _POSIX_SOURCE
  211. DEFS="$DEFS -D_POSIX_SOURCE=1"
  212. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  213. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  214. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  215. "
  216. }
  217.  
  218.   {
  219. test -n "$verbose" && \
  220. echo '    defining' _POSIX_1_SOURCE to be '2'
  221. DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  222. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_1_SOURCE\${SEDdB}_POSIX_1_SOURCE\${SEDdC}2\${SEDdD}
  223. \${SEDuA}_POSIX_1_SOURCE\${SEDuB}_POSIX_1_SOURCE\${SEDuC}2\${SEDuD}
  224. \${SEDeA}_POSIX_1_SOURCE\${SEDeB}_POSIX_1_SOURCE\${SEDeC}2\${SEDeD}
  225. "
  226. }
  227.  
  228.   {
  229. test -n "$verbose" && \
  230. echo '    defining' _MINIX
  231. DEFS="$DEFS -D_MINIX=1"
  232. SEDDEFS="${SEDDEFS}\${SEDdA}_MINIX\${SEDdB}_MINIX\${SEDdC}1\${SEDdD}
  233. \${SEDuA}_MINIX\${SEDuB}_MINIX\${SEDuC}1\${SEDuD}
  234. \${SEDeA}_MINIX\${SEDeB}_MINIX\${SEDeC}1\${SEDeD}
  235. "
  236. }
  237.  
  238. fi
  239.  
  240. echo checking for POSIXized ISC
  241. if test -d /etc/conf/kconfig.d &&
  242.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  243. then
  244.   ISC=1 # If later tests want to check for ISC.
  245.   {
  246. test -n "$verbose" && \
  247. echo '    defining' _POSIX_SOURCE
  248. DEFS="$DEFS -D_POSIX_SOURCE=1"
  249. SEDDEFS="${SEDDEFS}\${SEDdA}_POSIX_SOURCE\${SEDdB}_POSIX_SOURCE\${SEDdC}1\${SEDdD}
  250. \${SEDuA}_POSIX_SOURCE\${SEDuB}_POSIX_SOURCE\${SEDuC}1\${SEDuD}
  251. \${SEDeA}_POSIX_SOURCE\${SEDeB}_POSIX_SOURCE\${SEDeC}1\${SEDeD}
  252. "
  253. }
  254.  
  255.   if test -n "$GCC"; then
  256.     CC="$CC -posix"
  257.   else
  258.     CC="$CC -Xp"
  259.   fi
  260. fi
  261.  
  262. if test -z "$RANLIB"; then
  263.   # Extract the first word of `ranlib', so it can be a program name with args.
  264.   set dummy ranlib; word=$2
  265.   echo checking for $word
  266.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  267.   for dir in $PATH; do
  268.     test -z "$dir" && dir=.
  269.     if test -f $dir/$word; then
  270.       RANLIB="ranlib"
  271.       break
  272.     fi
  273.   done
  274.   IFS="$saveifs"
  275. fi
  276. test -z "$RANLIB" && RANLIB=":"
  277. test -n "$RANLIB" -a -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  278.  
  279. echo checking whether string.h declares mem functions
  280. echo '#include <string.h>' > conftest.c
  281. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  282. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  283.   :
  284. else
  285.   echo checking for memory.h
  286. cat > conftest.c <<EOF
  287. #include <memory.h>
  288. EOF
  289. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  290. if test -z "$err"; then
  291.   {
  292. test -n "$verbose" && \
  293. echo '    defining' NEED_MEMORY_H
  294. DEFS="$DEFS -DNEED_MEMORY_H=1"
  295. SEDDEFS="${SEDDEFS}\${SEDdA}NEED_MEMORY_H\${SEDdB}NEED_MEMORY_H\${SEDdC}1\${SEDdD}
  296. \${SEDuA}NEED_MEMORY_H\${SEDuB}NEED_MEMORY_H\${SEDuC}1\${SEDuD}
  297. \${SEDeA}NEED_MEMORY_H\${SEDeB}NEED_MEMORY_H\${SEDeC}1\${SEDeD}
  298. "
  299. }
  300.  
  301. fi
  302. rm -f conftest*
  303.  
  304. fi
  305. rm -f conftest*
  306.  
  307.  
  308. echo checking for ANSI C header files
  309. cat > conftest.c <<EOF
  310. #include <stdlib.h>
  311. #include <stdarg.h>
  312. #include <string.h>
  313. #include <float.h>
  314. EOF
  315. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  316. if test -z "$err"; then
  317.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  318. echo '#include <string.h>' > conftest.c
  319. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  320. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  321.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  322. cat > conftest.c <<EOF
  323. #include <ctype.h>
  324. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  325. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  326. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  327. int main () { int i; for (i = 0; i < 256; i++)
  328. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  329. exit (0); }
  330.  
  331. EOF
  332. eval $compile
  333. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  334.   {
  335. test -n "$verbose" && \
  336. echo '    defining' STDC_HEADERS
  337. DEFS="$DEFS -DSTDC_HEADERS=1"
  338. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  339. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  340. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  341. "
  342. }
  343.  
  344. fi
  345. rm -f conftest*
  346. fi
  347. rm -f conftest*
  348.  
  349. fi
  350. rm -f conftest*
  351.  
  352. echo checking for complex.h
  353. cat > conftest.c <<EOF
  354. #include <complex.h>
  355. EOF
  356. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  357. if test -z "$err"; then
  358.   {
  359. test -n "$verbose" && \
  360. echo '    defining' HAVE_COMPLEX_H
  361. DEFS="$DEFS -DHAVE_COMPLEX_H=1"
  362. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_COMPLEX_H\${SEDdB}HAVE_COMPLEX_H\${SEDdC}1\${SEDdD}
  363. \${SEDuA}HAVE_COMPLEX_H\${SEDuB}HAVE_COMPLEX_H\${SEDuC}1\${SEDuD}
  364. \${SEDeA}HAVE_COMPLEX_H\${SEDeB}HAVE_COMPLEX_H\${SEDeC}1\${SEDeD}
  365. "
  366. }
  367.  
  368. fi
  369. rm -f conftest*
  370.  
  371. echo checking for malloc.h
  372. cat > conftest.c <<EOF
  373. #include <malloc.h>
  374. EOF
  375. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  376. if test -z "$err"; then
  377.   {
  378. test -n "$verbose" && \
  379. echo '    defining' HAVE_MALLOC_H
  380. DEFS="$DEFS -DHAVE_MALLOC_H=1"
  381. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_MALLOC_H\${SEDdB}HAVE_MALLOC_H\${SEDdC}1\${SEDdD}
  382. \${SEDuA}HAVE_MALLOC_H\${SEDuB}HAVE_MALLOC_H\${SEDuC}1\${SEDuD}
  383. \${SEDeA}HAVE_MALLOC_H\${SEDeB}HAVE_MALLOC_H\${SEDeC}1\${SEDeD}
  384. "
  385. }
  386.  
  387. fi
  388. rm -f conftest*
  389.  
  390. echo checking for varargs.h
  391. cat > conftest.c <<EOF
  392. #include <varargs.h>
  393. EOF
  394. err=`eval "($CPP \$DEFS conftest.c >/dev/null) 2>&1"`
  395. if test -z "$err"; then
  396.   {
  397. test -n "$verbose" && \
  398. echo '    defining' VARARGS
  399. DEFS="$DEFS -DVARARGS=1"
  400. SEDDEFS="${SEDDEFS}\${SEDdA}VARARGS\${SEDdB}VARARGS\${SEDdC}1\${SEDdD}
  401. \${SEDuA}VARARGS\${SEDuB}VARARGS\${SEDuC}1\${SEDuD}
  402. \${SEDeA}VARARGS\${SEDeB}VARARGS\${SEDeC}1\${SEDeD}
  403. "
  404. }
  405.  
  406. fi
  407. rm -f conftest*
  408.  
  409. {
  410. test -n "$verbose" && \
  411. echo '    defining' NOT_SEGMENTED
  412. DEFS="$DEFS -DNOT_SEGMENTED=1"
  413. SEDDEFS="${SEDDEFS}\${SEDdA}NOT_SEGMENTED\${SEDdB}NOT_SEGMENTED\${SEDdC}1\${SEDdD}
  414. \${SEDuA}NOT_SEGMENTED\${SEDuB}NOT_SEGMENTED\${SEDuC}1\${SEDuD}
  415. \${SEDeA}NOT_SEGMENTED\${SEDeB}NOT_SEGMENTED\${SEDeC}1\${SEDeD}
  416. "
  417. }
  418.  
  419. echo checking for size_t in sys/types.h
  420. echo '#include <sys/types.h>' > conftest.c
  421. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  422. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  423.   :
  424. else
  425.   {
  426. test -n "$verbose" && \
  427. echo '    defining' size_t to be 'unsigned'
  428. DEFS="$DEFS -Dsize_t=unsigned"
  429. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  430. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  431. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  432. "
  433. }
  434.  
  435. fi
  436. rm -f conftest*
  437.  
  438. prog='/* Ultrix mips cc rejects this.  */
  439. typedef int charset[2]; const charset x;
  440. /* SunOS 4.1.1 cc rejects this.  */
  441. char const *const *ccp;
  442. char **p;
  443. /* AIX XL C 1.02.0.0 rejects this.
  444.    It does not let you subtract one const X* pointer from another in an arm
  445.    of an if-expression whose if-part is not a constant expression */
  446. const char *g = "string";
  447. p = &g + (g ? g-g : 0);
  448. /* HPUX 7.0 cc rejects these. */
  449. ++ccp;
  450. p = (char**) ccp;
  451. ccp = (char const *const *) p;
  452. { /* SCO 3.2v4 cc rejects this.  */
  453.   char *t;
  454.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  455.  
  456.   *t++ = 0;
  457. }
  458. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  459.   int x[] = {25,17};
  460.   const int *foo = &x[0];
  461.   ++foo;
  462. }
  463. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  464.   typedef const int *iptr;
  465.   iptr p = 0;
  466.   ++p;
  467. }
  468. { /* AIX XL C 1.02.0.0 rejects this saying
  469.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  470.   struct s { int j; const int *ap[3]; };
  471.   struct s *b; b->j = 5;
  472. }'
  473. echo checking for working const
  474. cat > conftest.c <<EOF
  475.  
  476. int main() { exit(0); }
  477. int t() { $prog }
  478. EOF
  479. if eval $compile; then
  480.   :
  481. else
  482.   {
  483. test -n "$verbose" && \
  484. echo '    defining' const to be 'empty'
  485. DEFS="$DEFS -Dconst="
  486. SEDDEFS="${SEDDEFS}\${SEDdA}const\${SEDdB}const\${SEDdC}\${SEDdD}
  487. \${SEDuA}const\${SEDuB}const\${SEDuC}\${SEDuD}
  488. \${SEDeA}const\${SEDeB}const\${SEDeC}\${SEDeD}
  489. "
  490. }
  491.  
  492. fi
  493. rm -f conftest*
  494.  
  495. echo checking byte ordering
  496. cat > conftest.c <<EOF
  497. main () {
  498.   /* Are we little or big endian?  From Harbison&Steele.  */
  499.   union
  500.   {
  501.     long l;
  502.     char c[sizeof (long)];
  503.   } u;
  504.   u.l = 1;
  505.   exit (u.c[sizeof (long) - 1] == 1);
  506. }
  507. EOF
  508. eval $compile
  509. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  510.   :
  511. else
  512.   {
  513. test -n "$verbose" && \
  514. echo '    defining' WORDS_BIGENDIAN
  515. DEFS="$DEFS -DWORDS_BIGENDIAN=1"
  516. SEDDEFS="${SEDDEFS}\${SEDdA}WORDS_BIGENDIAN\${SEDdB}WORDS_BIGENDIAN\${SEDdC}1\${SEDdD}
  517. \${SEDuA}WORDS_BIGENDIAN\${SEDuB}WORDS_BIGENDIAN\${SEDuC}1\${SEDuD}
  518. \${SEDeA}WORDS_BIGENDIAN\${SEDeB}WORDS_BIGENDIAN\${SEDeC}1\${SEDeD}
  519. "
  520. }
  521.  
  522. fi
  523. rm -f conftest*
  524.  
  525. # check whether --with-complex was given
  526. if test -n "$with_complex"; then
  527.   {
  528. test -n "$verbose" && \
  529. echo '    defining' COMPLEX
  530. DEFS="$DEFS -DCOMPLEX=1"
  531. SEDDEFS="${SEDDEFS}\${SEDdA}COMPLEX\${SEDdB}COMPLEX\${SEDdC}1\${SEDdD}
  532. \${SEDuA}COMPLEX\${SEDuB}COMPLEX\${SEDuC}1\${SEDuD}
  533. \${SEDeA}COMPLEX\${SEDeB}COMPLEX\${SEDeC}1\${SEDeD}
  534. "
  535. }
  536.  
  537. fi
  538.  
  539. # check whether --with-sparse was given
  540. if test -n "$with_sparse"; then
  541.   {
  542. test -n "$verbose" && \
  543. echo '    defining' SPARSE
  544. DEFS="$DEFS -DSPARSE=1"
  545. SEDDEFS="${SEDDEFS}\${SEDdA}SPARSE\${SEDdB}SPARSE\${SEDdC}1\${SEDdD}
  546. \${SEDuA}SPARSE\${SEDuB}SPARSE\${SEDuC}1\${SEDuD}
  547. \${SEDeA}SPARSE\${SEDeB}SPARSE\${SEDeC}1\${SEDeD}
  548. "
  549. }
  550.  
  551. fi
  552.  
  553. # check whether --with-all was given
  554. if test -n "$with_all"; then
  555.   {
  556. test -n "$verbose" && \
  557. echo '    defining' COMPLEX
  558. DEFS="$DEFS -DCOMPLEX=1"
  559. SEDDEFS="${SEDDEFS}\${SEDdA}COMPLEX\${SEDdB}COMPLEX\${SEDdC}1\${SEDdD}
  560. \${SEDuA}COMPLEX\${SEDuB}COMPLEX\${SEDuC}1\${SEDuD}
  561. \${SEDeA}COMPLEX\${SEDeB}COMPLEX\${SEDeC}1\${SEDeD}
  562. "
  563. }
  564.  
  565. fi
  566.  
  567. # check whether --with-all was given
  568. if test -n "$with_all"; then
  569.   {
  570. test -n "$verbose" && \
  571. echo '    defining' SPARSE
  572. DEFS="$DEFS -DSPARSE=1"
  573. SEDDEFS="${SEDDEFS}\${SEDdA}SPARSE\${SEDdB}SPARSE\${SEDdC}1\${SEDdD}
  574. \${SEDuA}SPARSE\${SEDuB}SPARSE\${SEDuC}1\${SEDuD}
  575. \${SEDeA}SPARSE\${SEDeB}SPARSE\${SEDeC}1\${SEDeD}
  576. "
  577. }
  578.  
  579. fi
  580.  
  581. # check whether --with-unroll was given
  582. if test -n "$with_unroll"; then
  583.   {
  584. test -n "$verbose" && \
  585. echo '    defining' VUNROLL
  586. DEFS="$DEFS -DVUNROLL=1"
  587. SEDDEFS="${SEDDEFS}\${SEDdA}VUNROLL\${SEDdB}VUNROLL\${SEDdC}1\${SEDdD}
  588. \${SEDuA}VUNROLL\${SEDuB}VUNROLL\${SEDuC}1\${SEDuD}
  589. \${SEDeA}VUNROLL\${SEDeB}VUNROLL\${SEDeC}1\${SEDeD}
  590. "
  591. }
  592.  
  593. fi
  594.  
  595. # check whether --with-munroll was given
  596. if test -n "$with_munroll"; then
  597.   {
  598. test -n "$verbose" && \
  599. echo '    defining' MUNROLL
  600. DEFS="$DEFS -DMUNROLL=1"
  601. SEDDEFS="${SEDDEFS}\${SEDdA}MUNROLL\${SEDdB}MUNROLL\${SEDdC}1\${SEDdD}
  602. \${SEDuA}MUNROLL\${SEDuB}MUNROLL\${SEDuC}1\${SEDuD}
  603. \${SEDeA}MUNROLL\${SEDeB}MUNROLL\${SEDeC}1\${SEDeD}
  604. "
  605. }
  606.  
  607. fi
  608.  
  609. # check whether --with-segmem was given
  610. if test -n "$with_segmem"; then
  611.   {
  612. test -n "$verbose" && \
  613. echo '    defining' SEGMENTED
  614. DEFS="$DEFS -DSEGMENTED=1"
  615. SEDDEFS="${SEDDEFS}\${SEDdA}SEGMENTED\${SEDdB}SEGMENTED\${SEDdC}1\${SEDdD}
  616. \${SEDuA}SEGMENTED\${SEDuB}SEGMENTED\${SEDuC}1\${SEDuD}
  617. \${SEDeA}SEGMENTED\${SEDeB}SEGMENTED\${SEDeC}1\${SEDeD}
  618. "
  619. }
  620.  
  621. fi
  622.  
  623. # check whether --with-float was given
  624. if test -n "$with_float"; then
  625.   {
  626. test -n "$verbose" && \
  627. echo '    defining' REAL_FLT
  628. DEFS="$DEFS -DREAL_FLT=1"
  629. SEDDEFS="${SEDDEFS}\${SEDdA}REAL_FLT\${SEDdB}REAL_FLT\${SEDdC}1\${SEDdD}
  630. \${SEDuA}REAL_FLT\${SEDuB}REAL_FLT\${SEDuC}1\${SEDuD}
  631. \${SEDeA}REAL_FLT\${SEDeB}REAL_FLT\${SEDeC}1\${SEDeD}
  632. "
  633. }
  634.  
  635. fi
  636.  
  637. # check whether --with-double was given
  638. if test -n "$with_double"; then
  639.   {
  640. test -n "$verbose" && \
  641. echo '    defining' REAL_DBL
  642. DEFS="$DEFS -DREAL_DBL=1"
  643. SEDDEFS="${SEDDEFS}\${SEDdA}REAL_DBL\${SEDdB}REAL_DBL\${SEDdC}1\${SEDdD}
  644. \${SEDuA}REAL_DBL\${SEDuB}REAL_DBL\${SEDuC}1\${SEDuD}
  645. \${SEDeA}REAL_DBL\${SEDeB}REAL_DBL\${SEDeC}1\${SEDeD}
  646. "
  647. }
  648.  
  649. fi
  650.  
  651. LIBS="$LIBS -lm"
  652. echo checking for u_int
  653. cat > conftest.c <<EOF
  654. #include <stdio.h>
  655. #ifdef __STDC__
  656. #include <stdlib.h>
  657. #endif
  658. int main() { exit(0); }
  659. int t() { u_int i; i = 1; }
  660. EOF
  661. if eval $compile; then
  662.   {
  663. test -n "$verbose" && \
  664. echo '    defining' U_INT_DEF
  665. DEFS="$DEFS -DU_INT_DEF=1"
  666. SEDDEFS="${SEDDEFS}\${SEDdA}U_INT_DEF\${SEDdB}U_INT_DEF\${SEDdC}1\${SEDdD}
  667. \${SEDuA}U_INT_DEF\${SEDuB}U_INT_DEF\${SEDuC}1\${SEDuD}
  668. \${SEDeA}U_INT_DEF\${SEDeB}U_INT_DEF\${SEDeC}1\${SEDeD}
  669. "
  670. }
  671.  
  672. fi
  673. rm -f conftest*
  674.  
  675. echo 'computing machine epsilon(s)'
  676. echo $CC -o macheps dmacheps.c
  677. $CC -o macheps dmacheps.c
  678. {
  679. test -n "$verbose" && \
  680. echo '    defining' D_MACHEPS to be '`macheps`'
  681. DEFS="$DEFS -DD_MACHEPS=`macheps`"
  682. SEDDEFS="${SEDDEFS}\${SEDdA}D_MACHEPS\${SEDdB}D_MACHEPS\${SEDdC}`macheps`\${SEDdD}
  683. \${SEDuA}D_MACHEPS\${SEDuB}D_MACHEPS\${SEDuC}`macheps`\${SEDuD}
  684. \${SEDeA}D_MACHEPS\${SEDeB}D_MACHEPS\${SEDeC}`macheps`\${SEDeD}
  685. "
  686. }
  687.  
  688. echo $CC -o macheps fmacheps.c
  689. $CC -o macheps fmacheps.c
  690. {
  691. test -n "$verbose" && \
  692. echo '    defining' F_MACHEPS to be '`macheps`'
  693. DEFS="$DEFS -DF_MACHEPS=`macheps`"
  694. SEDDEFS="${SEDDEFS}\${SEDdA}F_MACHEPS\${SEDdB}F_MACHEPS\${SEDdC}`macheps`\${SEDdD}
  695. \${SEDuA}F_MACHEPS\${SEDuB}F_MACHEPS\${SEDuC}`macheps`\${SEDuD}
  696. \${SEDeA}F_MACHEPS\${SEDeB}F_MACHEPS\${SEDeC}`macheps`\${SEDeD}
  697. "
  698. }
  699.  
  700. echo computing M_MAX_INT
  701. echo $CC -o maxint maxint.c
  702. $CC -o maxint maxint.c
  703. {
  704. test -n "$verbose" && \
  705. echo '    defining' M_MAX_INT to be '`maxint`'
  706. DEFS="$DEFS -DM_MAX_INT=`maxint`"
  707. SEDDEFS="${SEDDEFS}\${SEDdA}M_MAX_INT\${SEDdB}M_MAX_INT\${SEDdC}`maxint`\${SEDdD}
  708. \${SEDuA}M_MAX_INT\${SEDuB}M_MAX_INT\${SEDuC}`maxint`\${SEDuD}
  709. \${SEDeA}M_MAX_INT\${SEDeB}M_MAX_INT\${SEDeC}`maxint`\${SEDeD}
  710. "
  711. }
  712.  
  713. echo checking char '\\0' vs. float zeros
  714. cat > conftest.c <<EOF
  715. main() {
  716.     char    *cp = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
  717.     double    *dp;
  718.     dp = (double *)cp;
  719.     if ( *dp == 0.0 ) printf("yes\n");  }
  720.  
  721. EOF
  722. eval "$CPP \$DEFS conftest.c > conftest.out 2>&1"
  723. if egrep "yes" conftest.out >/dev/null 2>&1; then
  724.   {
  725. test -n "$verbose" && \
  726. echo '    defining' CHAR0ISDBL0
  727. DEFS="$DEFS -DCHAR0ISDBL0=1"
  728. SEDDEFS="${SEDDEFS}\${SEDdA}CHAR0ISDBL0\${SEDdB}CHAR0ISDBL0\${SEDdC}1\${SEDdD}
  729. \${SEDuA}CHAR0ISDBL0\${SEDuB}CHAR0ISDBL0\${SEDuC}1\${SEDuD}
  730. \${SEDeA}CHAR0ISDBL0\${SEDeB}CHAR0ISDBL0\${SEDeC}1\${SEDeD}
  731. "
  732. }
  733.  
  734. fi
  735. rm -f conftest*
  736.  
  737. for func in bcopy bzero
  738. do
  739. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  740. echo checking for ${func}
  741. cat > conftest.c <<EOF
  742. #include <ctype.h>
  743. int main() { exit(0); }
  744. int t() { 
  745. /* The GNU C library defines this for functions which it implements
  746.     to always fail with ENOSYS.  Some functions are actually named
  747.     something starting with __ and the normal name is an alias.  */
  748. #if defined (__stub_${func}) || defined (__stub___${func})
  749. choke me
  750. #else
  751. /* Override any gcc2 internal prototype to avoid an error.  */
  752. extern char ${func}(); ${func}();
  753. #endif
  754.  }
  755. EOF
  756. if eval $compile; then
  757.   {
  758. test -n "$verbose" && \
  759. echo '    defining' ${trfunc}
  760. DEFS="$DEFS -D${trfunc}=1"
  761. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  762. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  763. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  764. "
  765. }
  766.  
  767. fi
  768. rm -f conftest*
  769. done
  770.  
  771. echo checking for function prototypes
  772. cat > conftest.c <<EOF
  773.  
  774. int main() { exit(0); }
  775. int t() { extern int test (int i, double x); }
  776. EOF
  777. if eval $compile; then
  778.   {
  779. test -n "$verbose" && \
  780. echo '    defining' HAVE_PROTOTYPES
  781. DEFS="$DEFS -DHAVE_PROTOTYPES=1"
  782. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_PROTOTYPES\${SEDdB}HAVE_PROTOTYPES\${SEDdC}1\${SEDdD}
  783. \${SEDuA}HAVE_PROTOTYPES\${SEDuB}HAVE_PROTOTYPES\${SEDuC}1\${SEDuD}
  784. \${SEDeA}HAVE_PROTOTYPES\${SEDeB}HAVE_PROTOTYPES\${SEDeC}1\${SEDeD}
  785. "
  786. }
  787.  
  788. fi
  789. rm -f conftest*
  790.  
  791. if test -n "$prefix"; then
  792.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  793.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  794. fi
  795. if test -n "$exec_prefix"; then
  796.   prsub="$prsub
  797. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%\
  798. exec_prefix\\1=\\2$exec_prefix%"
  799. fi
  800. DEFS="`echo \"$DEFS\" | sed 's%[&\\\]%\\\&%g'`"
  801.  
  802. trap 'rm -f config.status; exit 1' 1 3 15
  803. echo creating config.status
  804. rm -f config.status
  805. cat > config.status <<EOF
  806. #!/bin/sh
  807. # Generated automatically by configure.
  808. # Run this file to recreate the current configuration.
  809. # This directory was configured as follows,
  810. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  811. #
  812. # $0 $*
  813.  
  814. for arg
  815. do
  816.   case "\$arg" in
  817.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  818.     exec /bin/sh $0 $* ;;
  819.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  820.   esac
  821. done
  822.  
  823. trap 'rm -f makefile machine.h conftest*; exit 1' 1 3 15
  824. PROGS='$PROGS'
  825. CC='$CC'
  826. CPP='$CPP'
  827. RANLIB='$RANLIB'
  828. LIBS='$LIBS'
  829. srcdir='$srcdir'
  830. prefix='$prefix'
  831. exec_prefix='$exec_prefix'
  832. prsub='$prsub'
  833. EOF
  834. cat >> config.status <<\EOF
  835.  
  836. top_srcdir=$srcdir
  837.  
  838. # Allow make-time overrides of the generated file list.
  839. test -n "$gen_files" || gen_files="makefile"
  840.  
  841. for file in .. $gen_files; do if [ "x$file" != "x.." ]; then
  842.   srcdir=$top_srcdir
  843.   # Remove last slash and all that follows it.  Not all systems have dirname.
  844.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  845.   if test "$dir" != "$file"; then
  846.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  847.     test ! -d $dir && mkdir $dir
  848.   fi
  849.   echo creating $file
  850.   rm -f $file
  851.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  852.   sed -e "
  853. $prsub
  854. s%@PROGS@%$PROGS%g
  855. s%@CC@%$CC%g
  856. s%@CPP@%$CPP%g
  857. s%@RANLIB@%$RANLIB%g
  858. s%@LIBS@%$LIBS%g
  859. s%@srcdir@%$srcdir%g
  860. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  861. fi; done
  862. test -n "$gen_config" || gen_config=machine.h
  863. echo creating $gen_config
  864. # These sed commands are put into SEDDEFS when defining a macro.
  865. # They are broken into pieces to make the sed script easier to manage.
  866. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  867. # is the cpp macro being defined and VALUE is the value it is being given.
  868. # Each defining turns into a single global substitution command.
  869. #
  870. # SEDd sets the value in "#define NAME VALUE" lines.
  871. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  872. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  873. SEDdC='\3'
  874. SEDdD='@g'
  875. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  876. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  877. SEDuB='\([     ]\)@\1#\2define\3'
  878. SEDuC=' '
  879. SEDuD='\4@g'
  880. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  881. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  882. SEDeB='$@\1#\2define\3'
  883. SEDeC=' '
  884. SEDeD='@g'
  885. rm -f conftest.sed
  886. EOF
  887. # Turn off quoting long enough to insert the sed commands.
  888. rm -f conftest.sh
  889. cat > conftest.sh <<EOF
  890. $SEDDEFS
  891. EOF
  892.  
  893. # Maximum number of lines to put in a single here document.
  894. maxshlines=9
  895.  
  896. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  897. # on the size of here documents.
  898.  
  899. while :
  900. do
  901.   lines=`grep -c . conftest.sh`
  902.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  903.   rm -f conftest.s1 conftest.s2
  904.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  905.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  906.   # Write a limited-size here document to append to conftest.sed.
  907.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  908.   cat conftest.s1 >> config.status
  909.   echo 'CONFEOF' >> config.status
  910.   rm -f conftest.s1 conftest.sh
  911.   mv conftest.s2 conftest.sh
  912. done
  913. rm -f conftest.sh
  914.  
  915. # Now back to your regularly scheduled config.status.
  916. cat >> config.status <<\EOF
  917. # This sed command replaces #undef's with comments.  This is necessary, for
  918. # example, in the case of _POSIX_SOURCE, which is predefined and required
  919. # on some systems where configure will not decide to define it in
  920. # machine.h.
  921. cat >> conftest.sed <<\CONFEOF
  922. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  923. CONFEOF
  924. rm -f conftest.h
  925. # Break up the sed commands because old seds have small limits.
  926. maxsedlines=20
  927. cp $top_srcdir/$gen_config.in conftest.h1
  928. while :
  929. do
  930.   lines=`grep -c . conftest.sed`
  931.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  932.   rm -f conftest.s1 conftest.s2 conftest.h2
  933.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  934.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  935.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  936.   rm -f conftest.s1 conftest.h1 conftest.sed
  937.   mv conftest.h2 conftest.h1
  938.   mv conftest.s2 conftest.sed
  939. done
  940. rm -f conftest.sed conftest.h
  941. echo "/* $gen_config.  Generated automatically by configure.  */" > conftest.h
  942. cat conftest.h1 >> conftest.h
  943. rm -f conftest.h1
  944. if cmp -s $gen_config conftest.h 2>/dev/null; then
  945.   # The file exists and we would not be changing it.
  946.   rm -f conftest.h
  947. else
  948.   rm -f $gen_config
  949.   mv conftest.h $gen_config
  950. fi
  951.  
  952.  
  953. exit 0
  954. EOF
  955. chmod +x config.status
  956. test -n "$no_create" || ./config.status
  957.  
  958. echo "Extensions to basic version: use configure --with-opt1 --with-opt2"
  959. echo "  Option:"
  960. echo "    --with-complex     incorporate complex functions"
  961. echo "    --with-sparse      incorporate sparse matrix functions"
  962. echo "    --with-all         both of the above"
  963. echo "    --with-unroll      unroll low level loops on vectors"
  964. echo "    --with-munroll     unroll low level loops on matrices"
  965. echo "    --with-float       single precision"
  966. echo "    --with-double      double precision (default)"
  967. echo "Re-run configure with these options if you want them"
  968. # configure.in copyright (C) Brook Milligan and David Stewart, 1993
  969.