home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / util / editor / gnuid16.sit / indent-1.6 / configure < prev    next >
Encoding:
Text File  |  1992-07-30  |  9.7 KB  |  398 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
  21. #        [--prefix=PREFIX] [--exec_prefix=PREFIX] [--with-PROGRAM] [TARGET]
  22. # Ignores all args except --srcdir, --prefix, --exec_prefix, and --no-create.
  23.  
  24. trap 'rm -f conftest* core; exit 1' 1 3 15
  25.  
  26. for arg
  27. do
  28.   # Handle --exec_prefix with a space before the argument.
  29.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  30.   # Handle --host with a space before the argument.
  31.   elif test x$next_host = xyes; then next_host=
  32.   # Handle --prefix with a space before the argument.
  33.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  34.   # Handle --srcdir with a space before the argument.
  35.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  36.   else
  37.     case $arg in
  38.      -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
  52.         no_create=1 ;;
  53.  
  54.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  55.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  56.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  57.     next_prefix=yes ;;
  58.  
  59.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  60.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  61.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  62.     next_srcdir=yes ;;
  63.  
  64.      -with-* | --with-*) ;;
  65.  
  66.      *) ;;
  67.     esac
  68.   fi
  69. done
  70.  
  71. rm -f conftest*
  72. compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  73.  
  74. # A filename unique to this package, relative to the directory that
  75. # configure is in, which we can look for to find out if srcdir is correct.
  76. unique_file=indent.c
  77.  
  78. # Find the source files, if location was not specified.
  79. if test -z "$srcdir"; then
  80.   srcdirdefaulted=yes; srcdir=.
  81.   if test ! -r $unique_file; then srcdir=..; fi
  82. fi
  83. if test ! -r $srcdir/$unique_file; then
  84.   if test x$srcdirdefaulted = xyes; then
  85.     echo "configure: Can not find sources in \`.' or \`..'." 1>&2
  86.   else
  87.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  88.   fi
  89.   exit 1
  90. fi
  91. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  92. # But we can't avoid them for `..', to make subdirectories work.
  93. case $srcdir in
  94.   .|/*|~*) ;;
  95.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  96. esac
  97.  
  98. if test -z "$CC"; then
  99.   echo checking for gcc
  100.   saveifs="$IFS"; IFS="${IFS}:"
  101.   for dir in $PATH; do
  102.     test -z "$dir" && dir=.
  103.     if test -f $dir/gcc; then
  104.       CC="gcc"
  105.       break
  106.     fi
  107.   done
  108.   IFS="$saveifs"
  109. fi
  110. test -z "$CC" && CC="cc"
  111.  
  112. # Find out if we are using GNU C, under whatever name.
  113. cat <<EOF > conftest.c
  114. #ifdef __GNUC__
  115.   yes
  116. #endif
  117. EOF
  118. ${CC-cc} -E conftest.c > conftest.out 2>&1
  119. if egrep yes conftest.out >/dev/null 2>&1; then
  120.   GCC=1 # For later tests.
  121.   CC="$CC -O"
  122. fi
  123. rm -f conftest*
  124.  
  125. echo checking how to run the C preprocessor
  126. if test -z "$CPP"; then
  127.   CPP='${CC-cc} -E'
  128.   cat <<EOF > conftest.c
  129.  
  130. #include <stdio.h>
  131. EOF
  132. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  133. if test -z "$err"; then
  134.   :
  135. else
  136.   CPP=/lib/cpp
  137. fi
  138. rm -f conftest*
  139. fi
  140.  
  141. # Make sure to not get the incompatible SysV /etc/install and
  142. # /usr/sbin/install, which might be in PATH before a BSD-like install,
  143. # or the SunOS /usr/etc/install directory.
  144. if test -z "$INSTALL"; then
  145.   echo checking for install
  146.   saveifs="$IFS"; IFS="${IFS}:"
  147.   for dir in $PATH; do
  148.     test -z "$dir" && dir=.
  149.     case $dir in
  150.     /etc|/usr/sbin|/usr/etc) ;;
  151.     *)
  152.       if test -f $dir/install; then
  153.     INSTALL="$dir/install -c"
  154.     INSTALL_PROGRAM='$(INSTALL)'
  155.     INSTALL_DATA='$(INSTALL) -m 644'
  156.     break
  157.       fi
  158.       ;;
  159.     esac
  160.   done
  161.   IFS="$saveifs"
  162. fi
  163. INSTALL=${INSTALL-cp}
  164. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  165. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  166.  
  167. echo checking for AIX
  168. cat <<EOF > conftest.c
  169.  
  170. #ifdef _AIX
  171.   yes
  172. #endif
  173.  
  174. EOF
  175. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  176. if egrep "yes" conftest.out >/dev/null 2>&1; then
  177.   DEFS="$DEFS -D_ALL_SOURCE=1"
  178. fi
  179. rm -f conftest*
  180.  
  181.  
  182. echo checking for minix/config.h
  183. cat <<EOF > conftest.c
  184.  
  185. #include <minix/config.h>
  186. EOF
  187. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  188. if test -z "$err"; then
  189.   MINIX=1
  190. fi
  191. rm -f conftest*
  192.  
  193. # The Minix shell can't assign to the same variable on the same line!
  194. if test -n "$MINIX"; then
  195.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  196.   DEFS="$DEFS -D_POSIX_1_SOURCE=2"
  197.   DEFS="$DEFS -D_MINIX=1"
  198. fi
  199.  
  200. echo checking for POSIXized ISC
  201. if test -d /etc/conf/kconfig.d &&
  202.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  203. then
  204.   ISC=1 # If later tests want to check for ISC.
  205.   DEFS="$DEFS -D_POSIX_SOURCE=1"
  206.   if test -n "$GCC"; then
  207.     CC="$CC -posix"
  208.   else
  209.     CC="$CC -Xp"
  210.   fi
  211. fi
  212.  
  213. echo checking for BSD string and memory functions
  214. echo "#include <strings.h>
  215. main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c
  216. if eval $compile; then
  217.   :
  218. else
  219.   DEFS="$DEFS -DUSG=1"
  220. fi
  221. rm -f conftest*
  222.  
  223. for func in memcpy
  224. do
  225. echo checking for ${func}
  226. echo "
  227. main() { exit(0); } t() { 
  228. /* Override any gcc2 internal prototype to avoid an error.  */
  229. extern char ${func}(); ${func}(); }" > conftest.c
  230. if eval $compile; then
  231.   :
  232. else
  233.   LIBOBJS="$LIBOBJS ${func}.o"
  234. fi
  235. rm -f conftest*
  236.  
  237. done
  238.  
  239. echo checking for unistd.h
  240. cat <<EOF > conftest.c
  241.  
  242. #include <unistd.h>
  243. EOF
  244. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  245. if test -z "$err"; then
  246.   DEFS="$DEFS -DHAVE_UNISTD_H=1"
  247. fi
  248. rm -f conftest*
  249.  
  250. echo checking for directory library header
  251. echo checking for dirent.h
  252. cat <<EOF > conftest.c
  253.  
  254. #include <dirent.h>
  255. EOF
  256. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  257. if test -z "$err"; then
  258.   DEFS="$DEFS -DDIRENT=1" dirheader=dirent.h
  259. fi
  260. rm -f conftest*
  261.  
  262. if test -z "$dirheader"; then
  263. echo checking for sys/ndir.h
  264. cat <<EOF > conftest.c
  265.  
  266. #include <sys/ndir.h>
  267. EOF
  268. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  269. if test -z "$err"; then
  270.   DEFS="$DEFS -DSYSNDIR=1" dirheader=sys/ndir.h
  271. fi
  272. rm -f conftest*
  273.  
  274. fi
  275. if test -z "$dirheader"; then
  276. echo checking for sys/dir.h
  277. cat <<EOF > conftest.c
  278.  
  279. #include <sys/dir.h>
  280. EOF
  281. err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
  282. if test -z "$err"; then
  283.   DEFS="$DEFS -DSYSDIR=1" dirheader=sys/dir.h
  284. fi
  285. rm -f conftest*
  286.  
  287. fi
  288.  
  289. echo checking for closedir return value
  290. cat <<EOF > conftest.c
  291. #include <sys/types.h>
  292. #include <$dirheader>
  293. int closedir(); main() { exit(0); }
  294. EOF
  295. eval $compile
  296. if test -s conftest && (./conftest 2>/dev/null) 2>/dev/null; then
  297.   :
  298. else
  299.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  300. fi
  301. rm -f conftest*
  302.  
  303. if test -z "$dirheader"; then
  304.   DEFS="$DEFS -DNODIR=1"
  305. fi
  306. echo checking for Xenix
  307. cat <<EOF > conftest.c
  308.  
  309. #if defined(M_XENIX) && !defined(M_UNIX)
  310.   yes
  311. #endif
  312.  
  313. EOF
  314. eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
  315. if egrep "yes" conftest.out >/dev/null 2>&1; then
  316.   XENIX=1
  317. fi
  318. rm -f conftest*
  319.  
  320. if test -n "$XENIX"; then
  321.   DEFS="$DEFS -DVOID_CLOSEDIR=1"
  322.   LIBS="$LIBS -lx"
  323.   case "$DEFS" in
  324.   *SYSNDIR*) ;;
  325.   *) LIBS="-ldir $LIBS" ;; # Make sure -ldir precedes any -lx.
  326.   esac
  327. fi
  328.  
  329. if test -n "$prefix"; then
  330.   test -z "$exec_prefix" && exec_prefix='$(prefix)'
  331.   prsub="s,^prefix[     ]*=.*$,prefix = $prefix,"
  332. fi
  333. if test -n "$exec_prefix"; then
  334.   prsub="$prsub
  335. s,^exec_prefix[     ]*=.*$,exec_prefix = $exec_prefix,"
  336. fi
  337.  
  338. trap 'rm -f config.status; exit 1' 1 3 15
  339. echo creating config.status
  340. rm -f config.status
  341. cat <<EOF > config.status
  342. #!/bin/sh
  343. # Generated automatically by configure.
  344. # Run this file to recreate the current configuration.
  345. # This directory was configured as follows:
  346. # $0 $*
  347.  
  348. case "\$1" in
  349.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  350.   exec /bin/sh $0 $* ;;
  351. esac
  352.  
  353. trap 'rm -f zmakefile; exit 1' 1 3 15
  354. CC='$CC'
  355. CPP='$CPP'
  356. INSTALL='$INSTALL'
  357. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  358. INSTALL_DATA='$INSTALL_DATA'
  359. LIBOBJS='$LIBOBJS'
  360. LIBS='$LIBS'
  361. srcdir='$srcdir'
  362. DEFS='$DEFS'
  363. prefix='$prefix'
  364. exec_prefix='$exec_prefix'
  365. prsub='$prsub'
  366. EOF
  367. cat <<\EOF >> config.status
  368.  
  369. top_srcdir=$srcdir
  370. for file in zmakefile; do
  371.   srcdir=$top_srcdir
  372.   # Remove last slash and all that follows it.  Not all systems have dirname.
  373.   dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  374.   if test "$dir" != "$file"; then
  375.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  376.     test ! -d $dir && mkdir $dir
  377.   fi
  378.   echo creating $file
  379.   rm -f $file
  380.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  381.   sed -e "
  382. $prsub
  383. s,@CC@,$CC,g
  384. s,@CPP@,$CPP,g
  385. s,@INSTALL@,$INSTALL,g
  386. s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
  387. s,@INSTALL_DATA@,$INSTALL_DATA,g
  388. s,@LIBOBJS@,$LIBOBJS,g
  389. s,@LIBS@,$LIBS,g
  390. s,@srcdir@,$srcdir,g
  391. s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
  392. done
  393.  
  394. EOF
  395. chmod +x config.status
  396. test -n "$no_create" || ./config.status
  397.  
  398.