home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / BLT / BLT1.7L1 / BLT1 / blt-1.7 / configure < prev    next >
Encoding:
Text File  |  1994-08-18  |  35.7 KB  |  1,411 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]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --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-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.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=src/bltInit.c
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131.  
  132. # -----------------------------------------------------------------------
  133. #
  134. #     C compiler and debugging flags
  135. #
  136. # -----------------------------------------------------------------------
  137. # check whether --with-gcc was given
  138. withval="$with_gcc"
  139. if test -n "$withval"; then
  140.   CC=gcc
  141. fi
  142.  
  143. # check whether --with-acc was given
  144. withval="$with_acc"
  145. if test -n "$withval"; then
  146.   CC=acc
  147. fi
  148.  
  149. # check whether --with-lcc was given
  150. withval="$with_lcc"
  151. if test -n "$withval"; then
  152.   CC=lcc
  153. fi
  154.  
  155. # check whether --with-cc was given
  156. withval="$with_cc"
  157. if test -n "$withval"; then
  158.   CC=cc
  159. fi
  160.  
  161. if test -z "$CC" ; then 
  162.     CC=cc
  163. fi
  164. compiler=`basename $CC`
  165. if test "$compiler" = "gcc" ; then
  166.     CC="$CC -fwritable-strings -Wall"
  167. fi
  168.  
  169.  
  170. CDEBUGFLAGS="-O"
  171. # check whether --with-debug was given
  172. withval="$with_debug"
  173. if test -n "$withval"; then
  174.   CDEBUGFLAGS=-g
  175. fi
  176.  
  177.  
  178.  
  179. # -----------------------------------------------------------------------
  180. #
  181. #     Set prefix variable if one wasn't provided
  182. #
  183. # -----------------------------------------------------------------------
  184. if test -z "$prefix" ; then
  185.     prefix=/usr/local
  186. fi
  187.  
  188.  
  189. # -----------------------------------------------------------------------
  190. #
  191. #     Set PWD variable if vendor's /bin/sh doesn't
  192. #
  193. # -----------------------------------------------------------------------
  194. if test -z "$PWD" ; then
  195.     PWD=`pwd`
  196. fi
  197.  
  198. # -----------------------------------------------------------------------
  199. #
  200. #     Check for existence of ranlib and install programs
  201. #
  202. # -----------------------------------------------------------------------
  203. # Make sure to not get the incompatible SysV /etc/install and
  204. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  205. # or the SunOS /usr/etc/install directory, or the AIX /bin/install,
  206. # or the AFS install, which mishandles nonexistent args, or
  207. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  208. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  209. # anyway.  Sigh.
  210. if test "z${INSTALL}" = "z" ; then
  211.   echo checking for install
  212.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  213.   for dir in $PATH; do
  214.     test -z "$dir" && dir=.
  215.     case $dir in
  216.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  217.     *)
  218.       if test -f $dir/installbsd; then
  219.     INSTALL="$dir/installbsd -c" # OSF1
  220.     INSTALL_PROGRAM='$(INSTALL) -s'
  221.     INSTALL_DATA='$(INSTALL) -m 644'
  222.     break
  223.       fi
  224.       if test -f $dir/install; then
  225.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  226.       : # AIX
  227.     else
  228.       INSTALL="$dir/install -c"
  229.       INSTALL_PROGRAM='$(INSTALL) -s'
  230.       INSTALL_DATA='$(INSTALL) -m 644'
  231.       break
  232.     fi
  233.       fi
  234.       ;;
  235.     esac
  236.   done
  237.   IFS="$saveifs"
  238. fi
  239. INSTALL=${INSTALL-cp}
  240. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  241. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  242. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  243. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  244. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  245.  
  246. if test -z "$RANLIB"; then
  247.   # Extract the first word of `ranlib', so it can be a program name with args.
  248.   set dummy ranlib; word=$2
  249.   echo checking for $word
  250.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  251.   for dir in $PATH; do
  252.     test -z "$dir" && dir=.
  253.     if test -f $dir/$word; then
  254.       RANLIB="ranlib"
  255.       break
  256.     fi
  257.   done
  258.   IFS="$saveifs"
  259. fi
  260. test -z "$RANLIB" && RANLIB=":"
  261. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  262.  
  263. echo checking how to run the C preprocessor
  264. if test -z "$CPP"; then
  265.   # This must be in double quotes, not single quotes, because CPP may get
  266.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  267.   # make.  It must be expanded now.
  268.   CPP="${CC-cc} -E"
  269.   cat > conftest.c <<EOF
  270. #include "confdefs.h"
  271. #include <stdio.h>
  272. Syntax Error
  273. EOF
  274. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  275. if test -z "$err"; then
  276.   :
  277. else
  278.   rm -rf conftest*
  279.   CPP=/lib/cpp
  280. fi
  281. rm -f conftest*
  282. fi
  283. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  284.  
  285.  
  286.  
  287.  
  288. # -----------------------------------------------------------------------
  289. #
  290. #     Check for header files
  291. #
  292. # -----------------------------------------------------------------------
  293. echo checking for ANSI C header files
  294. cat > conftest.c <<EOF
  295. #include "confdefs.h"
  296. #include <stdlib.h>
  297. #include <stdarg.h>
  298. #include <string.h>
  299. #include <float.h>
  300. EOF
  301. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  302. if test -z "$err"; then
  303.   rm -rf conftest*
  304.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  305. echo '#include "confdefs.h"
  306. #include <string.h>' > conftest.c
  307. eval "$CPP conftest.c > conftest.out 2>&1"
  308. if egrep "memchr" conftest.out >/dev/null 2>&1; then
  309.   rm -rf conftest*
  310.   # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  311. cat > conftest.c <<EOF
  312. #include "confdefs.h"
  313. #include <ctype.h>
  314. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  315. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  316. #define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
  317. int main () { int i; for (i = 0; i < 256; i++)
  318. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  319. exit (0); }
  320.  
  321. EOF
  322. eval $compile
  323. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  324.   
  325. {
  326. test -n "$verbose" && \
  327. echo "    defining STDC_HEADERS"
  328. echo "#define" STDC_HEADERS 1 >> confdefs.h
  329. DEFS="$DEFS -DSTDC_HEADERS=1"
  330. SEDDEFS="${SEDDEFS}\${SEDdA}STDC_HEADERS\${SEDdB}STDC_HEADERS\${SEDdC}1\${SEDdD}
  331. \${SEDuA}STDC_HEADERS\${SEDuB}STDC_HEADERS\${SEDuC}1\${SEDuD}
  332. \${SEDeA}STDC_HEADERS\${SEDeB}STDC_HEADERS\${SEDeC}1\${SEDeD}
  333. "
  334. }
  335.  
  336.  
  337. fi
  338. rm -fr conftest*
  339.  
  340. fi
  341. rm -f conftest*
  342.  
  343.  
  344. fi
  345. rm -f conftest*
  346.  
  347. for hdr in stdlib.h string.h float.h malloc.h
  348. do
  349. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  350. echo checking for ${hdr}
  351. cat > conftest.c <<EOF
  352. #include "confdefs.h"
  353. #include <${hdr}>
  354. EOF
  355. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  356. if test -z "$err"; then
  357.   rm -rf conftest*
  358.   
  359. {
  360. test -n "$verbose" && \
  361. echo "    defining ${trhdr}"
  362. echo "#define" ${trhdr} 1 >> confdefs.h
  363. DEFS="$DEFS -D${trhdr}=1"
  364. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  365. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  366. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  367. "
  368. }
  369.  
  370.  
  371. fi
  372. rm -f conftest*
  373. done
  374.  
  375. for hdr in errno.h unistd.h memory.h limits.h sys/time.h sys/wait.h
  376. do
  377. trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
  378. echo checking for ${hdr}
  379. cat > conftest.c <<EOF
  380. #include "confdefs.h"
  381. #include <${hdr}>
  382. EOF
  383. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  384. if test -z "$err"; then
  385.   rm -rf conftest*
  386.   
  387. {
  388. test -n "$verbose" && \
  389. echo "    defining ${trhdr}"
  390. echo "#define" ${trhdr} 1 >> confdefs.h
  391. DEFS="$DEFS -D${trhdr}=1"
  392. SEDDEFS="${SEDDEFS}\${SEDdA}${trhdr}\${SEDdB}${trhdr}\${SEDdC}1\${SEDdD}
  393. \${SEDuA}${trhdr}\${SEDuB}${trhdr}\${SEDuC}1\${SEDuD}
  394. \${SEDeA}${trhdr}\${SEDeB}${trhdr}\${SEDeC}1\${SEDeD}
  395. "
  396. }
  397.  
  398.  
  399. fi
  400. rm -f conftest*
  401. done
  402.  
  403. echo checking for whether time.h and sys/time.h may both be included
  404. cat > conftest.c <<EOF
  405. #include "confdefs.h"
  406. #include <sys/types.h>
  407. #include <sys/time.h>
  408. #include <time.h>
  409. int main() { exit(0); }
  410. int t() { struct tm *tp; }
  411. EOF
  412. if eval $compile; then
  413.   rm -rf conftest*
  414.   
  415. {
  416. test -n "$verbose" && \
  417. echo "    defining TIME_WITH_SYS_TIME"
  418. echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
  419. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  420. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  421. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  422. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  423. "
  424. }
  425.  
  426.  
  427. fi
  428. rm -f conftest*
  429.  
  430.  
  431. # -----------------------------------------------------------------------
  432. #     Check for strerror, strdup, strcasecmp.
  433. # -----------------------------------------------------------------------
  434. for func in strerror strdup strcasecmp
  435. do
  436. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  437. echo checking for ${func}
  438. cat > conftest.c <<EOF
  439. #include "confdefs.h"
  440. #include <ctype.h>
  441. int main() { exit(0); }
  442. int t() { 
  443. /* The GNU C library defines this for functions which it implements
  444.     to always fail with ENOSYS.  Some functions are actually named
  445.     something starting with __ and the normal name is an alias.  */
  446. #if defined (__stub_${func}) || defined (__stub___${func})
  447. choke me
  448. #else
  449. /* Override any gcc2 internal prototype to avoid an error.  */
  450. extern char ${func}(); ${func}();
  451. #endif
  452.  }
  453. EOF
  454. if eval $compile; then
  455.   rm -rf conftest*
  456.   {
  457. test -n "$verbose" && \
  458. echo "    defining ${trfunc}"
  459. echo "#define" ${trfunc} 1 >> confdefs.h
  460. DEFS="$DEFS -D${trfunc}=1"
  461. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  462. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  463. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  464. "
  465. }
  466.  
  467.  
  468. fi
  469. rm -f conftest*
  470. done
  471.  
  472. echo checking for size_t in sys/types.h
  473. echo '#include "confdefs.h"
  474. #include <sys/types.h>' > conftest.c
  475. eval "$CPP conftest.c > conftest.out 2>&1"
  476. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  477.   :
  478. else
  479.   rm -rf conftest*
  480.   
  481. {
  482. test -n "$verbose" && \
  483. echo "    defining" size_t to be unsigned
  484. echo "#define" size_t unsigned >> confdefs.h
  485. DEFS="$DEFS -Dsize_t=unsigned"
  486. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  487. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  488. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  489. "
  490. }
  491.  
  492. fi
  493. rm -f conftest*
  494.  
  495.  
  496. LOSSAGE=""
  497. #--------------------------------------------------------------------
  498. #    The check below checks whether <sys/wait.h> defines the type
  499. #    "union wait" correctly.  It's needed because of weirdness in
  500. #    HP-UX where "union wait" is defined in both the BSD and SYS-V
  501. #    environments.  Checking the usability of WIFEXITED seems to do
  502. #    the trick.
  503. #--------------------------------------------------------------------
  504.  
  505. echo checking for union wait
  506. cat > conftest.c <<EOF
  507. #include "confdefs.h"
  508. #include <sys/types.h> 
  509. #include <sys/wait.h>
  510. int main() { exit(0); }
  511. int t() { 
  512. union wait x;
  513. WIFEXITED(x);        /* Generates compiler error if WIFEXITED
  514.              * uses an int. */
  515.  }
  516. EOF
  517. if eval $compile; then
  518.   :
  519. else
  520.   rm -rf conftest*
  521.    LOSSAGE="$LOSSAGE -DNO_UNION_WAIT" 
  522. fi
  523. rm -f conftest*
  524.  
  525.  
  526. # -----------------------------------------------------------------------
  527. #     Check if postscript prolog can be inlined.
  528. # -----------------------------------------------------------------------
  529. echo "checking if postscript prolog can be inlined"
  530. cat > conftest.c <<EOF
  531. #include "confdefs.h"
  532.  
  533. #include "$PWD/src/bltGrPS.h"
  534. int main() { exit(0); }
  535.  
  536. EOF
  537. eval $compile
  538. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  539.   :
  540. else
  541.    LOSSAGE="$LOSSAGE -DNO_INLINE_PROLOG" 
  542. fi
  543. rm -fr conftest*
  544.  
  545.  
  546.     
  547. # -----------------------------------------------------------------------
  548. #     Run xmkmf to check for location of X libraries and includes.
  549. #    Fill in some default values if we still can't find anything.
  550. # -----------------------------------------------------------------------
  551. # If we find X, set shell vars x_includes and x_libraries to the paths.
  552. no_x=true
  553. echo checking for X include and library files with xmkmf
  554. rm -fr conftestdir
  555. if mkdir conftestdir; then
  556.   cd conftestdir
  557.   cat > Imakefile <<\EOF
  558. acfindx:
  559.     @echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
  560. EOF
  561.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  562.     no_x=
  563.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  564.     eval `make acfindx | grep -v make`
  565.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  566.     if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
  567.       im_usrlibdir=$im_libdir
  568.     fi
  569.     case "$im_incroot" in
  570.     /usr/include) ;;
  571.     *) x_includes="$im_incroot" ;;
  572.     esac
  573.     case "$im_usrlibdir" in
  574.     /usr/lib | /lib) ;;
  575.     *) x_libraries="$im_usrlibdir" ;;
  576.     esac
  577.   fi
  578.   cd ..
  579.   rm -fr conftestdir
  580. fi
  581.  
  582. if test -z "$im_usrlibdir"; then
  583. echo checking for X include and library files directly
  584. cat > conftest.c <<EOF
  585. #include "confdefs.h"
  586. #include <X11/Intrinsic.h>
  587. EOF
  588. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  589. if test -z "$err"; then
  590.   rm -rf conftest*
  591.   no_x=
  592.  
  593. else
  594.   rm -rf conftest*
  595.   for dir in \
  596.     /usr/local/include \
  597.     /usr/unsupported/include \
  598.     /usr/x386/include \
  599.     /usr/local/x11r5/include \
  600.     /usr/include/X11R5 \
  601.     /usr/include/X11R4 \
  602.     /usr/X11R5/include \
  603.     /usr/X11/include \
  604.     /usr/openwin/include \
  605.     /usr/openwin/share/include \
  606.     /usr/lpp/Xamples/include \
  607.     ; \
  608.   do
  609.     if test -r $dir/X11/Intrinsic.h; then
  610.       x_includes=$dir; no_x=
  611.       break
  612.     fi
  613.   done
  614. fi
  615. rm -f conftest*
  616.  
  617. # Check for the libraries.  First see if replacing the `include' by
  618. # `lib' works.
  619. LIBS_save="${LIBS}"
  620. LIBS="${LIBS} -lXt"
  621. have_lib=""
  622. echo checking for -lXt
  623. cat > conftest.c <<EOF
  624. #include "confdefs.h"
  625.  
  626. int main() { exit(0); }
  627. int t() { main(); }
  628. EOF
  629. if eval $compile; then
  630.   rm -rf conftest*
  631.   have_lib="1"
  632.  
  633. fi
  634. rm -f conftest*
  635. LIBS="${LIBS_save}"
  636. if test -n "${have_lib}"; then
  637.    :; no_x=
  638. else
  639.    :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  640.   /usr/local/lib \
  641.   /usr/unsupported/lib \
  642.   /usr/x386/lib \
  643.   /usr/local/x11r5/lib \
  644.   /usr/lib/X11 \
  645.   /usr/lib/X11R4 \
  646.   /usr/X11R5/lib \
  647.   /usr/X11/lib \
  648.   /usr/openwin/lib \
  649.   /usr/lpp/Xamples/lib \
  650.   ; \
  651. do
  652.   for extension in a so sl; do
  653.     if test -r $dir/libXt.$extension; then
  654.       x_libraries=$dir; no_x=
  655.       break 2
  656.     fi
  657.   done
  658. done
  659. fi
  660.  
  661. fi
  662. if test -n "$verbose"; then
  663.   test -n "$x_includes" && echo "    found X11 headers in $x_includes"
  664.   test -n "$x_libraries" && echo "    found X11 libraries in $x_libraries"
  665. fi
  666.  
  667. XINCDIR="$x_includes"
  668. if test -z "$XINCDIR" ; then
  669.     cat > conftest.c <<EOF
  670. #include "confdefs.h"
  671. #include <X11/Intrinsic.h>
  672. EOF
  673. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  674. if test -z "$err"; then
  675.   rm -rf conftest*
  676.    XINCDIR="default" 
  677.  
  678. else
  679.   rm -rf conftest*
  680.   
  681.     places="/usr/X11/include \
  682.     /usr/X386/include \
  683.     /usr/X11R5/include \
  684.     /usr/local/X11R5/include \
  685.     /usr/include/X11R5 \
  686.     /usr/openwin/include \
  687.     /usr/local/X11R4/include \
  688.     /usr/include/X11R4 \
  689.     /usr/local/include \
  690.     /usr/unsupported/include \
  691.     /usr/include"
  692.     for dir in $places; do
  693.     if test -r $dir/X11/Intrinsic.h; then
  694.         XINCDIR=$dir
  695.         break
  696.     fi
  697.     done
  698.     if test -z "$XINCDIR" ; then
  699.         echo "Warning:  couldn't find any X11 include files."
  700.         XINCDIR="default"
  701.     fi 
  702. fi
  703. rm -f conftest*
  704. fi
  705. if test "$XINCDIR" = "/usr/include" ; then
  706.     XINCDIR="default"
  707. fi
  708.  
  709. XLIBDIR="$x_libraries"
  710. if test -z "$XLIBDIR" ; then
  711.     LIBS_save="${LIBS}"
  712. LIBS="${LIBS} -lX11"
  713. have_lib=""
  714. echo checking for -lX11
  715. cat > conftest.c <<EOF
  716. #include "confdefs.h"
  717.  
  718. int main() { exit(0); }
  719. int t() { main(); }
  720. EOF
  721. if eval $compile; then
  722.   rm -rf conftest*
  723.   have_lib="1"
  724.  
  725. fi
  726. rm -f conftest*
  727. LIBS="${LIBS_save}"
  728. if test -n "${have_lib}"; then
  729.    :;  XLIBDIR="default" 
  730. else
  731.    :; 
  732.     places="/usr/X11/lib \
  733.         /usr/X386/lib \
  734.         /usr/X11R5/lib \
  735.         /usr/local/X11R5/lib \
  736.         /usr/lib/X11R5 \
  737.         /usr/openwin/lib \
  738.         /usr/local/X11R4/lib \
  739.         /usr/lib/X11R4 \ 
  740.         /usr/local/lib \
  741.         /usr/unsupported/lib \
  742.         /usr/lib \
  743.         /lib"
  744.     for dir in $places; do
  745.         if test -r $dir/libX11.a; then
  746.             XLIBDIR=$dir
  747.             break
  748.         fi
  749.     done
  750.     if test -z "$XLIBDIR" ; then
  751.     echo "Warning:  couldn't find the X11 library archive. "
  752.     XLIBDIR="default"
  753.     fi 
  754. fi
  755.  
  756. fi
  757. if test "$XLIBDIR" = "/usr/lib" ; then
  758.     XLIBDIR="default"
  759. fi
  760.  
  761. XINCSW=""
  762. if test "$XINCDIR" != "default" ; then
  763.     XINCSW="-I$XINCDIR"
  764. fi
  765.  
  766. XLIBSW=""
  767. if test "$XLIBDIR" != "default" ; then
  768.     XLIBSW="-L$XLIBDIR"
  769. fi
  770.  
  771.  
  772.  
  773. # -----------------------------------------------------------------------
  774. #
  775. #     Make some guesses where the Tcl/Tk include files and 
  776. #    libraries are.  I'm not crazy about doing it this way.  
  777. #    It might be better to specify some command-line options
  778. #    when invoking configure.
  779. #
  780. #     Look first in the Tcl/Tk distributions and then move on 
  781. #    to the standard include file/library locations.  If it's 
  782. #    still not found then query for it.
  783. #
  784. # -----------------------------------------------------------------------
  785.  
  786. # -----------------------------------------------------------------------
  787. #    tcl.h
  788. # -----------------------------------------------------------------------
  789. echo "checking for tcl.h"
  790. TCLINCDIR=""
  791. places="$PWD/../tcl7.3 \
  792.     $PWD/../tcl7.2 \
  793.     $PWD/../tcl7.1 \
  794.     $PWD/../tcl7.0 \
  795.     $PWD/../tcl7.0b3 \
  796.     $prefix/include/tcl \
  797.     $prefix/include \
  798.     $XINCDIR/tk \
  799.     $XINCDIR \
  800.     /usr/local/include/tcl \
  801.     /usr/local/include \
  802.     /opt/cellar/tcl/tcl7.3/include \
  803.     /usr/include/tcl \
  804.     /usr/include"
  805. for dir in $places; do
  806.     if test -r $dir/tcl.h ; then
  807.         TCLINCDIR=$dir
  808.         break
  809.     fi
  810. done
  811. while test -z "$TCLINCDIR" ; do
  812.     echo "What directory contains tcl.h (absolute path) ?"
  813.     read TCLINCDIR
  814. done
  815. if test "$TCLINCDIR" = "/usr/include" ; then
  816.     TCLINCDIR= "default"
  817. fi
  818.  
  819. TCLINCSW=""
  820. if test "$TCLINCDIR" != "default" ; then
  821.     TCLINCSW="-I$TCLINCDIR"
  822. fi
  823.  
  824.  
  825. # -----------------------------------------------------------------------
  826. #    libtcl.a
  827. # -----------------------------------------------------------------------
  828. echo "checking for libtcl.a"
  829. TCLLIBDIR=""
  830. places="$PWD/../tcl7.3 \
  831.     $PWD/../tcl7.2 \
  832.     $PWD/../tcl7.1 \
  833.     $PWD/../tcl7.0 \
  834.     $PWD/../tcl7.0b3 \
  835.     $prefix/lib \
  836.     /opt/cellar/tcl/tcl7.3/lib \
  837.     $XLIBDIR \
  838.     /usr/local/lib \
  839.     /usr/lib"
  840. for dir in $places; do
  841.     if test -r $dir/libtcl.a ; then
  842.         TCLLIBDIR=$dir
  843.         break
  844.     fi
  845. done
  846. while test -z "$TCLLIBDIR" ; do
  847.     echo "What directory contains libtcl.a ?"
  848.     read TCLLIBDIR
  849. done
  850. if test "$TCLLIBDIR" = "/usr/lib" ; then
  851.     TCLLIBDIR= "default"
  852. fi
  853.  
  854. TCLLIBSW=""
  855. if test "$TCLLIBDIR" != "default" ; then
  856.     TCLLIBSW="-L$TCLLIBDIR"
  857. fi
  858.  
  859.  
  860.  
  861. # -----------------------------------------------------------------------
  862. #     tk.h
  863. # -----------------------------------------------------------------------
  864. echo "checking for tk.h"
  865. TKINCDIR=""
  866. places="$PWD/../tk3.6 \
  867.     $PWD/../tk3.5 \
  868.     $PWD/../tk3.4 \
  869.     $PWD/../tk3.3 \
  870.     $PWD/../tk3.3b3 \
  871.     $XINCDIR/tk \
  872.     $XINCDIR \
  873.     $prefix/include/tcl \
  874.     $prefix/include \
  875.     /opt/cellar/tk/tk3.6/include \
  876.     /usr/local/include/tcl \
  877.     /usr/local/include \
  878.     /usr/include/tcl \
  879.     /usr/include"
  880. for dir in $places; do
  881.     if test -r $dir/tk.h ; then
  882.         TKINCDIR=$dir
  883.         break
  884.     fi
  885. done
  886. while test -z "$TKINCDIR" ; do
  887.     echo "What directory contains tk.h (absolute path) ?"
  888.     read TKINCDIR
  889. done
  890. if test "$TKINCDIR" = "/usr/include" ; then
  891.     TKINCDIR="default"
  892. fi
  893.  
  894. TKINCSW=""
  895. if test "$TKINCDIR" != "default" ; then
  896.     TKINCSW="-I$TKINCDIR"
  897. fi
  898.  
  899.  
  900. # -----------------------------------------------------------------------
  901. #     libtk.a
  902. # -----------------------------------------------------------------------
  903. echo "checking for libtk.a"
  904. TKLIBDIR=""
  905. places="$PWD/../tk3.6 \
  906.     $PWD/../tk3.5 \
  907.     $PWD/../tk3.4 \
  908.     $PWD/../tk3.3 \
  909.     $PWD/../tk3.3b3 \
  910.     $prefix/lib \
  911.     /opt/cellar/tk/tk3.6/lib \
  912.     $XLIBDIR \
  913.     /usr/local/lib \
  914.     /usr/lib"
  915. for dir in $places; do
  916.     if test -r $dir/libtk.a ; then
  917.         TKLIBDIR=$dir
  918.         break
  919.     fi
  920. done
  921. while test -z "$TKLIBDIR" ; do
  922.     echo "What directory contains libtk.a ?"
  923.     read TKLIBDIR
  924. done
  925. if test "$TKLIBDIR" = "/usr/lib" ; then
  926.     TKLIBDIR="default"
  927. fi
  928.  
  929. TKLIBSW=""
  930. if test "$TKLIBDIR" != "default" ; then
  931.     TKLIBSW="-L$TKLIBDIR"
  932. fi
  933.  
  934.  
  935.  
  936.  
  937. #--------------------------------------------------------------------
  938. #    Check for the existence of various libraries.  The order here
  939. #    is important, so that then end up in the right order in the
  940. #    command line generated by Make.
  941. #--------------------------------------------------------------------
  942. LIBS_save="${LIBS}"
  943. LIBS="${LIBS} -lXbsd"
  944. have_lib=""
  945. echo checking for -lXbsd
  946. cat > conftest.c <<EOF
  947. #include "confdefs.h"
  948.  
  949. int main() { exit(0); }
  950. int t() { main(); }
  951. EOF
  952. if eval $compile; then
  953.   rm -rf conftest*
  954.   have_lib="1"
  955.  
  956. fi
  957. rm -f conftest*
  958. LIBS="${LIBS_save}"
  959. if test -n "${have_lib}"; then
  960.    :; LIBS="$LIBS -lXbsd"
  961. else
  962.    :; 
  963. fi
  964.  
  965. LIBS_save="${LIBS}"
  966. LIBS="${LIBS} -lsocket"
  967. have_lib=""
  968. echo checking for -lsocket
  969. cat > conftest.c <<EOF
  970. #include "confdefs.h"
  971.  
  972. int main() { exit(0); }
  973. int t() { main(); }
  974. EOF
  975. if eval $compile; then
  976.   rm -rf conftest*
  977.   have_lib="1"
  978.  
  979. fi
  980. rm -f conftest*
  981. LIBS="${LIBS_save}"
  982. if test -n "${have_lib}"; then
  983.    :; LIBS="$LIBS -lsocket"
  984. else
  985.    :; 
  986. fi
  987.  
  988. LIBS_save="${LIBS}"
  989. LIBS="${LIBS} -lnsl"
  990. have_lib=""
  991. echo checking for -lnsl
  992. cat > conftest.c <<EOF
  993. #include "confdefs.h"
  994.  
  995. int main() { exit(0); }
  996. int t() { main(); }
  997. EOF
  998. if eval $compile; then
  999.   rm -rf conftest*
  1000.   have_lib="1"
  1001.  
  1002. fi
  1003. rm -f conftest*
  1004. LIBS="${LIBS_save}"
  1005. if test -n "${have_lib}"; then
  1006.    :; LIBS="$LIBS -lnsl"
  1007. else
  1008.    :; 
  1009. fi
  1010.  
  1011. # -----------------------------------------------------------------------
  1012. #     The library libieee.a is a Linux deal. I don't know what effect 
  1013. #    it will have.
  1014. # -----------------------------------------------------------------------
  1015. LIBS_save="${LIBS}"
  1016. LIBS="${LIBS} -lieee"
  1017. have_lib=""
  1018. echo checking for -lieee
  1019. cat > conftest.c <<EOF
  1020. #include "confdefs.h"
  1021.  
  1022. int main() { exit(0); }
  1023. int t() { main(); }
  1024. EOF
  1025. if eval $compile; then
  1026.   rm -rf conftest*
  1027.   have_lib="1"
  1028.  
  1029. fi
  1030. rm -f conftest*
  1031. LIBS="${LIBS_save}"
  1032. if test -n "${have_lib}"; then
  1033.    :; LIBS="$LIBS -lieee"
  1034. else
  1035.    :; 
  1036. fi
  1037.  
  1038. LIBS_save="${LIBS}"
  1039. LIBS="${LIBS} -lm"
  1040. have_lib=""
  1041. echo checking for -lm
  1042. cat > conftest.c <<EOF
  1043. #include "confdefs.h"
  1044.  
  1045. int main() { exit(0); }
  1046. int t() { main(); }
  1047. EOF
  1048. if eval $compile; then
  1049.   rm -rf conftest*
  1050.   have_lib="1"
  1051.  
  1052. fi
  1053. rm -f conftest*
  1054. LIBS="${LIBS_save}"
  1055. if test -n "${have_lib}"; then
  1056.    :; LIBS="$LIBS -lm"
  1057. else
  1058.    :; 
  1059. fi
  1060.  
  1061.  
  1062.  
  1063. #--------------------------------------------------------------------
  1064. #    Set flags to generate shared libraries for systems that we 
  1065. #    know about.
  1066. #--------------------------------------------------------------------
  1067. echo "checking how to make shared libraries"
  1068. SHLIB_CCFLAGS=""
  1069. SHLIB_LDFLAGS=""
  1070. SHLIB_LOADER=""
  1071. SHLIB_SUFFIX=""
  1072. if test -z "$uname_found"; then
  1073.   # Extract the first word of `uname', so it can be a program name with args.
  1074.   set dummy uname; word=$2
  1075.   echo checking for $word
  1076.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1077.   for dir in $PATH; do
  1078.     test -z "$dir" && dir=.
  1079.     if test -f $dir/$word; then
  1080.       uname_found="1"
  1081.       break
  1082.     fi
  1083.   done
  1084.   IFS="$saveifs"
  1085. fi
  1086. test -z "$uname_found" && uname_found="0"
  1087. test -n "$uname_found" && test -n "$verbose" && echo "    setting uname_found to $uname_found"
  1088.  
  1089.  if test $uname_found -eq 1 ; then
  1090.     system=`uname -s`-`uname -r`
  1091.     case $system in 
  1092.       SunOS-4*) 
  1093.         SHLIB_CCFLAGS="-pic"
  1094.         SHLIB_LDFLAGS="-assert pure-text"
  1095.         SHLIB_LOADER="ld"
  1096.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION).$(MINOR_VERSION)'
  1097.         ;;
  1098.       HP-UX-*.09.*)
  1099.         SHLIB_CCFLAGS="+z"
  1100.         SHLIB_LDFLAGS="-b -n"
  1101.         SHLIB_LOADER="ld"
  1102.         SHLIB_SUFFIX=".sl"
  1103.         ;;
  1104.       SunOS-5*)
  1105.         SHLIB_CCFLAGS="-K pic"
  1106.         SHLIB_LDFLAGS='-G -ztext -h $(SHARED_LIBRARY)'
  1107.         SHLIB_LOADER="$CC"
  1108.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1109.         ;;
  1110.       OSF-1.*)
  1111.         SHLIB_CCFLAGS="-fpic"
  1112.         SHLIB_LDFLAGS="-shared"
  1113.         SHLIB_LOADER="$CC"
  1114.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1115.     ;;
  1116.       IRIX-5.*)
  1117.         SHLIB_CCFLAGS="-KPIC"
  1118.         SHLIB_LDFLAGS="-shared"
  1119.         SHLIB_LOADER="$CC"
  1120.         SHLIB_SUFFIX='.so.$(MAJOR_VERSION)'
  1121.         ;;
  1122.       *)
  1123.     echo "Don't know how to make shared libraries for $system"
  1124.     ;;
  1125.     esac
  1126.     if test ! -z "SHLIB_CCFLAGS" ; then 
  1127.         if test "$compiler" = "gcc" ; then
  1128.             SHLIB_CCFLAGS="-fpic"
  1129.         fi
  1130.     fi
  1131. fi 
  1132.  
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138. #--------------------------------------------------------------------
  1139. #    Propagate prefix argument as installation directory.
  1140. #--------------------------------------------------------------------
  1141. DESTDIR="$prefix"
  1142. BINDIR="$DESTDIR/bin"
  1143. LIBDIR="$DESTDIR/lib"
  1144. MANDIR="$DESTDIR/man"
  1145. BLT_LIBRARY="$DESTDIR/lib/blt"
  1146.  
  1147.  
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153. #--------------------------------------------------------------------
  1154. #
  1155. #    Generate the following Makefiles
  1156. #
  1157. #       ./Makefile
  1158. #       ./src/Makefile
  1159. #       ./src/shared/Makefile
  1160. #       ./man/Makefile
  1161. #       ./library/Makefile
  1162. #
  1163. #--------------------------------------------------------------------
  1164. # Set default prefixes.
  1165. if test -n "$prefix"; then
  1166.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  1167.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  1168. fi
  1169. if test -n "$exec_prefix"; then
  1170.   prsub="$prsub
  1171. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  1172. fi
  1173. # Quote sed substitution magic chars in DEFS.
  1174. cat >conftest.def <<EOF
  1175. $DEFS
  1176. EOF
  1177. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  1178. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  1179. rm -f conftest.def
  1180. # Substitute for predefined variables.
  1181.  
  1182. trap 'rm -f config.status; exit 1' 1 3 15
  1183. echo creating config.status
  1184. rm -f config.status
  1185. cat > config.status <<EOF
  1186. #!/bin/sh
  1187. # Generated automatically by configure.
  1188. # Run this file to recreate the current configuration.
  1189. # This directory was configured as follows,
  1190. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  1191. #
  1192. # $0 $configure_args
  1193.  
  1194. for arg
  1195. do
  1196.   case "\$arg" in
  1197.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  1198.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  1199.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  1200.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  1201.   esac
  1202. done
  1203.  
  1204. trap 'rm -fr Makefile src/Makefile src/shared/Makefile man/Makefile library/Makefile src/bltConfig.h conftest*; exit 1' 1 3 15
  1205. CC='$CC'
  1206. CDEBUGFLAGS='$CDEBUGFLAGS'
  1207. prefix='$prefix'
  1208. INSTALL='$INSTALL'
  1209. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  1210. INSTALL_DATA='$INSTALL_DATA'
  1211. RANLIB='$RANLIB'
  1212. CPP='$CPP'
  1213. LOSSAGE='$LOSSAGE'
  1214. XINCSW='$XINCSW'
  1215. XLIBSW='$XLIBSW'
  1216. XLIBDIR='$XLIBDIR'
  1217. TCLINCSW='$TCLINCSW'
  1218. TCLLIBSW='$TCLLIBSW'
  1219. TCLLIBDIR='$TCLLIBDIR'
  1220. TKINCSW='$TKINCSW'
  1221. TKLIBSW='$TKLIBSW'
  1222. TKLIBDIR='$TKLIBDIR'
  1223. LIBS='$LIBS'
  1224. uname_found='$uname_found'
  1225. SHLIB_CCFLAGS='$SHLIB_CCFLAGS'
  1226. SHLIB_LDFLAGS='$SHLIB_LDFLAGS'
  1227. SHLIB_LOADER='$SHLIB_LOADER'
  1228. SHLIB_SUFFIX='$SHLIB_SUFFIX'
  1229. DESTDIR='$DESTDIR'
  1230. BINDIR='$BINDIR'
  1231. LIBDIR='$LIBDIR'
  1232. MANDIR='$MANDIR'
  1233. BLT_LIBRARY='$BLT_LIBRARY'
  1234. srcdir='$srcdir'
  1235. prefix='$prefix'
  1236. exec_prefix='$exec_prefix'
  1237. prsub='$prsub'
  1238. extrasub='$extrasub'
  1239. EOF
  1240. cat >> config.status <<\EOF
  1241.  
  1242. top_srcdir=$srcdir
  1243.  
  1244. CONFIG_FILES=${CONFIG_FILES-"Makefile src/Makefile src/shared/Makefile man/Makefile library/Makefile"}
  1245. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  1246.   srcdir=$top_srcdir
  1247.   # Remove last slash and all that follows it.  Not all systems have dirname.
  1248.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  1249.   if test "$dir" != "$file"; then
  1250.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  1251.     test ! -d $dir && mkdir $dir
  1252.   fi
  1253.   echo creating $file
  1254.   rm -f $file
  1255.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  1256.   sed -e "
  1257. $prsub
  1258. $extrasub
  1259. s%@CC@%$CC%g
  1260. s%@CDEBUGFLAGS@%$CDEBUGFLAGS%g
  1261. s%@prefix@%$prefix%g
  1262. s%@INSTALL@%$INSTALL%g
  1263. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  1264. s%@INSTALL_DATA@%$INSTALL_DATA%g
  1265. s%@RANLIB@%$RANLIB%g
  1266. s%@CPP@%$CPP%g
  1267. s%@LOSSAGE@%$LOSSAGE%g
  1268. s%@XINCSW@%$XINCSW%g
  1269. s%@XLIBSW@%$XLIBSW%g
  1270. s%@XLIBDIR@%$XLIBDIR%g
  1271. s%@TCLINCSW@%$TCLINCSW%g
  1272. s%@TCLLIBSW@%$TCLLIBSW%g
  1273. s%@TCLLIBDIR@%$TCLLIBDIR%g
  1274. s%@TKINCSW@%$TKINCSW%g
  1275. s%@TKLIBSW@%$TKLIBSW%g
  1276. s%@TKLIBDIR@%$TKLIBDIR%g
  1277. s%@LIBS@%$LIBS%g
  1278. s%@uname_found@%$uname_found%g
  1279. s%@SHLIB_CCFLAGS@%$SHLIB_CCFLAGS%g
  1280. s%@SHLIB_LDFLAGS@%$SHLIB_LDFLAGS%g
  1281. s%@SHLIB_LOADER@%$SHLIB_LOADER%g
  1282. s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
  1283. s%@DESTDIR@%$DESTDIR%g
  1284. s%@BINDIR@%$BINDIR%g
  1285. s%@LIBDIR@%$LIBDIR%g
  1286. s%@MANDIR@%$MANDIR%g
  1287. s%@BLT_LIBRARY@%$BLT_LIBRARY%g
  1288. s%@srcdir@%$srcdir%g
  1289. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  1290. fi; done
  1291.  
  1292. CONFIG_HEADERS=${CONFIG_HEADERS-"src/bltConfig.h"}
  1293. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  1294. echo creating $file
  1295.  
  1296. # These sed commands are put into SEDDEFS when defining a macro.
  1297. # They are broken into pieces to make the sed script easier to manage.
  1298. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  1299. # is the cpp macro being defined and VALUE is the value it is being given.
  1300. # Each defining turns into a single global substitution command.
  1301. #
  1302. # SEDd sets the value in "#define NAME VALUE" lines.
  1303. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  1304. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  1305. SEDdC='\3'
  1306. SEDdD='@g'
  1307. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  1308. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1309. SEDuB='\([     ]\)@\1#\2define\3'
  1310. SEDuC=' '
  1311. SEDuD='\4@g'
  1312. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  1313. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  1314. SEDeB='$@\1#\2define\3'
  1315. SEDeC=' '
  1316. SEDeD='@g'
  1317. rm -f conftest.sed
  1318. EOF
  1319. # Turn off quoting long enough to insert the sed commands.
  1320. rm -f conftest.sh
  1321. cat > conftest.sh <<EOF
  1322. $SEDDEFS
  1323. EOF
  1324.  
  1325. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  1326. # on the size of here documents.
  1327.  
  1328. # Maximum number of lines to put in a single here document.
  1329. maxshlines=9
  1330.  
  1331. while :
  1332. do
  1333.   # wc gives bogus results for an empty file on some systems.
  1334.   lines=`grep -c . conftest.sh`
  1335.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1336.   rm -f conftest.s1 conftest.s2
  1337.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  1338.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  1339.   # Write a limited-size here document to append to conftest.sed.
  1340.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  1341.   cat conftest.s1 >> config.status
  1342.   echo 'CONFEOF' >> config.status
  1343.   rm -f conftest.s1 conftest.sh
  1344.   mv conftest.s2 conftest.sh
  1345. done
  1346. rm -f conftest.sh
  1347.  
  1348. # Now back to your regularly scheduled config.status.
  1349. cat >> config.status <<\EOF
  1350. # This sed command replaces #undef's with comments.  This is necessary, for
  1351. # example, in the case of _POSIX_SOURCE, which is predefined and required
  1352. # on some systems where configure will not decide to define it in
  1353. # src/bltConfig.h.
  1354. cat >> conftest.sed <<\CONFEOF
  1355. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  1356. CONFEOF
  1357. rm -f conftest.h
  1358. # Break up the sed commands because old seds have small limits.
  1359. maxsedlines=20
  1360. cp $top_srcdir/$file.in conftest.h1
  1361. while :
  1362. do
  1363.   lines=`grep -c . conftest.sed`
  1364.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  1365.   rm -f conftest.s1 conftest.s2 conftest.h2
  1366.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  1367.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  1368.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  1369.   rm -f conftest.s1 conftest.h1 conftest.sed
  1370.   mv conftest.h2 conftest.h1
  1371.   mv conftest.s2 conftest.sed
  1372. done
  1373. rm -f conftest.sed conftest.h
  1374. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  1375. cat conftest.h1 >> conftest.h
  1376. rm -f conftest.h1
  1377. if cmp -s $file conftest.h 2>/dev/null; then
  1378.   # The file exists and we would not be changing it.
  1379.   echo "$file is unchanged"
  1380.   rm -f conftest.h
  1381. else
  1382.   rm -f $file
  1383.   mv conftest.h $file
  1384. fi
  1385. fi; done
  1386.  
  1387.  
  1388.  
  1389. exit 0
  1390. EOF
  1391. chmod +x config.status
  1392. ${CONFIG_SHELL-/bin/sh} config.status
  1393.  
  1394.  
  1395. #--------------------------------------------------------------------
  1396. #    Print out some of the more important settings 
  1397. #--------------------------------------------------------------------
  1398. echo "
  1399. Configuration results (edit and run ./config.status to modify):
  1400.  
  1401. directory containing \"tcl.h\"      => $TCLINCDIR
  1402. directory containing \"tk.h\"       => $TKINCDIR
  1403. directory containing \"X11/Xlib.h\" => $XINCDIR
  1404. directory containing \"libtcl.a\"   => $TCLLIBDIR
  1405. directory containing \"libtk.a\"    => $TKLIBDIR
  1406. directory containing \"libX11.a\"   => $XLIBDIR
  1407. directory to install \"blt_wish\"   => $BINDIR
  1408. directory to install \"libBLT.a\"   => $LIBDIR
  1409. directory to install BLT library files => $BLT_LIBRARY
  1410. "
  1411.