home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / TCL / BLT / _BLT.TAR / usr / lib / blt / applications / kosherdill / configure < prev    next >
Encoding:
Text File  |  1993-11-23  |  10.6 KB  |  328 lines

  1.  
  2. # ---------------------------------------------------------------------------
  3. #    Configure.in for KOSHER DILL - Disk space management utility
  4. # ---------------------------------------------------------------------------
  5.  
  6. #!/bin/sh
  7. # Guess values for system-dependent variables and create Makefiles.
  8. # Generated automatically using autoconf.
  9. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  10.  
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2, or (at your option)
  14. # any later version.
  15.  
  16. # This program is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. # GNU General Public License for more details.
  20.  
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  
  25. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  26. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  27. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  28. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  29.  
  30. for arg
  31. do
  32.   # Handle --exec-prefix with a space before the argument.
  33.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  34.   # Handle --host with a space before the argument.
  35.   elif test x$next_host = xyes; then next_host=
  36.   # Handle --prefix with a space before the argument.
  37.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  38.   # Handle --srcdir with a space before the argument.
  39.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  40.   else
  41.     case $arg in
  42.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  43.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  44.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  45.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  46.     next_exec_prefix=yes ;;
  47.  
  48.      -gas | --gas | --ga | --g) ;;
  49.  
  50.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  51.      -host | --host | --hos | --ho | --h)
  52.     next_host=yes ;;
  53.  
  54.      -nfp | --nfp | --nf) ;;
  55.  
  56.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  57.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  59.     next_prefix=yes ;;
  60.  
  61.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  62.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  63.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  64.     next_srcdir=yes ;;
  65.  
  66.      -with-* | --with-*)
  67.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  68.        # Reject names that aren't valid shell variable names.
  69.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  70.          echo "configure: $package: invalid package name" >&2; exit 1
  71.        fi
  72.        package=`echo $package| sed 's/-/_/g'`
  73.        case "$arg" in
  74.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  75.          *) val=1 ;;
  76.        esac
  77.        eval "with_$package='$val'" ;;
  78.  
  79.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  80.        verbose=yes ;;
  81.  
  82.      *) ;;
  83.     esac
  84.   fi
  85. done
  86.  
  87. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  88. trap 'rm -f confdefs*' 0
  89.  
  90. # NLS nuisances.
  91. # These must not be set unconditionally because not all systems understand
  92. # e.g. LANG=C (notably SCO).
  93. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  94. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  95.  
  96. rm -f conftest* confdefs.h
  97. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  98. echo > confdefs.h
  99. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  100.  
  101. # A filename unique to this package, relative to the directory that
  102. # configure is in, which we can look for to find out if srcdir is correct.
  103. unique_file=
  104.  
  105. # Find the source files, if location was not specified.
  106. if test -z "$srcdir"; then
  107.   srcdirdefaulted=yes
  108.   # Try the directory containing this script, then `..'.
  109.   prog=$0
  110.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  111.   test "X$confdir" = "X$prog" && confdir=.
  112.   srcdir=$confdir
  113.   if test ! -r $srcdir/$unique_file; then
  114.     srcdir=..
  115.   fi
  116. fi
  117. if test ! -r $srcdir/$unique_file; then
  118.   if test x$srcdirdefaulted = xyes; then
  119.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  120.   else
  121.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  122.   fi
  123.   exit 1
  124. fi
  125. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  126. # But we can't avoid them for `..', to make subdirectories work.
  127. case $srcdir in
  128.   .|/*|~*) ;;
  129.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  130. esac
  131.  
  132.  
  133. # Save the original args to write them into config.status later.
  134. configure_args="$*"
  135.  
  136.  
  137. # ---------------------------------------------------------------------------
  138. #     Check for existence of install programs
  139. # ---------------------------------------------------------------------------
  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, or the AIX /bin/install,
  144. # or the AFS install, which mishandles nonexistent args, or
  145. # /usr/ucb/install on SVR4, which tries to use the nonexistent group
  146. # `staff'.  On most BSDish systems install is in /usr/bin, not /usr/ucb
  147. # anyway.  Sigh.
  148. if test "z${INSTALL}" = "z" ; then
  149.   echo checking for install
  150.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  151.   for dir in $PATH; do
  152.     test -z "$dir" && dir=.
  153.     case $dir in
  154.     /etc|/usr/sbin|/usr/etc|/usr/afsws/bin|/usr/ucb) ;;
  155.     *)
  156.       if test -f $dir/installbsd; then
  157.     INSTALL="$dir/installbsd -c" # OSF1
  158.     INSTALL_PROGRAM='$(INSTALL)'
  159.     INSTALL_DATA='$(INSTALL) -m 644'
  160.     break
  161.       fi
  162.       if test -f $dir/install; then
  163.     if grep dspmsg $dir/install >/dev/null 2>&1; then
  164.       : # AIX
  165.     else
  166.       INSTALL="$dir/install -c"
  167.       INSTALL_PROGRAM='$(INSTALL)'
  168.       INSTALL_DATA='$(INSTALL) -m 644'
  169.       break
  170.     fi
  171.       fi
  172.       ;;
  173.     esac
  174.   done
  175.   IFS="$saveifs"
  176. fi
  177. INSTALL=${INSTALL-cp}
  178. test -n "$verbose" && echo "    setting INSTALL to $INSTALL"
  179. INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
  180. test -n "$verbose" && echo "    setting INSTALL_PROGRAM to $INSTALL_PROGRAM"
  181. INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
  182. test -n "$verbose" && echo "    setting INSTALL_DATA to $INSTALL_DATA"
  183.  
  184.  
  185. # -----------------------------------------------------------------------
  186. #
  187. #     Set PWD variable if vendor's /bin/sh doesn't
  188. #
  189. # -----------------------------------------------------------------------
  190. PWD=`pwd`
  191.  
  192. # ---------------------------------------------------------------------------
  193. #     Installation path for scripts and help files
  194. # ---------------------------------------------------------------------------
  195.  
  196. echo "Where do you want to install the "scripts" and "Help" directories?"
  197. read KOSHERDILL_LIBRARY
  198. if test -z "$KOSHERDILL_LIBRARY" ; then
  199.     KOSHERDILL_LIBRARY=$PWD
  200. fi
  201.  
  202.  
  203. # ---------------------------------------------------------------------------
  204. #     Installation path for shell script
  205. # ---------------------------------------------------------------------------
  206.  
  207. echo "Where do you want to install the kosherdill executable?"
  208. read KOSHERDILL_PROGRAM
  209. if test -z "$KOSHERDILL_PROGRAM" ; then
  210.     KOSHERDILL_PROGRAM=    $PWD
  211. fi
  212.  
  213.  
  214. # ---------------------------------------------------------------------------
  215. #     BLT wish 
  216. # ---------------------------------------------------------------------------
  217.  
  218. echo "Which wish contains BLT?"
  219. read BLT_WISH
  220. if test -z "$BLT_WISH" ; then
  221.     BLT_WISH="$PWD/../../blt_wish"
  222. fi
  223.  
  224.  
  225. echo "setting KOSHERDILL_LIBRARY to "
  226. echo "  \"$KOSHERDILL_LIBRARY\""
  227. echo "setting KOSHERDILL_PROGRAM to "
  228. echo "  \"$KOSHERDILL_PROGRAM\""
  229. echo "setting BLT_WISH to "
  230. echo "  \"$BLT_WISH\""
  231.  
  232. # ---------------------------------------------------------------------------
  233. #     Generate only the Makefile
  234. # ---------------------------------------------------------------------------
  235. # Set default prefixes.
  236. if test -n "$prefix"; then
  237.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  238.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  239. fi
  240. if test -n "$exec_prefix"; then
  241.   prsub="$prsub
  242. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  243. fi
  244. # Quote sed substitution magic chars in DEFS.
  245. cat >conftest.def <<EOF
  246. $DEFS
  247. EOF
  248. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  249. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  250. rm -f conftest.def
  251. # Substitute for predefined variables.
  252.  
  253. trap 'rm -f config.status; exit 1' 1 3 15
  254. echo creating config.status
  255. rm -f config.status
  256. cat > config.status <<EOF
  257. #!/bin/sh
  258. # Generated automatically by configure.
  259. # Run this file to recreate the current configuration.
  260. # This directory was configured as follows,
  261. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  262. #
  263. # $0 $configure_args
  264.  
  265. for arg
  266. do
  267.   case "\$arg" in
  268.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  269.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  270.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  271.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  272.   esac
  273. done
  274.  
  275. trap 'rm -f Makefile; exit 1' 1 3 15
  276. INSTALL='$INSTALL'
  277. INSTALL_PROGRAM='$INSTALL_PROGRAM'
  278. INSTALL_DATA='$INSTALL_DATA'
  279. KOSHERDILL_LIBRARY='$KOSHERDILL_LIBRARY'
  280. KOSHERDILL_PROGRAM='$KOSHERDILL_PROGRAM'
  281. BLT_WISH='$BLT_WISH'
  282. LIBS='$LIBS'
  283. srcdir='$srcdir'
  284. DEFS='$DEFS'
  285. prefix='$prefix'
  286. exec_prefix='$exec_prefix'
  287. prsub='$prsub'
  288. extrasub='$extrasub'
  289. EOF
  290. cat >> config.status <<\EOF
  291.  
  292. top_srcdir=$srcdir
  293.  
  294. CONFIG_FILES=${CONFIG_FILES-"Makefile"}
  295. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  296.   srcdir=$top_srcdir
  297.   # Remove last slash and all that follows it.  Not all systems have dirname.
  298.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  299.   if test "$dir" != "$file"; then
  300.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  301.     test ! -d $dir && mkdir $dir
  302.   fi
  303.   echo creating $file
  304.   rm -f $file
  305.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  306.   sed -e "
  307. $prsub
  308. $extrasub
  309. s%@INSTALL@%$INSTALL%g
  310. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  311. s%@INSTALL_DATA@%$INSTALL_DATA%g
  312. s%@KOSHERDILL_LIBRARY@%$KOSHERDILL_LIBRARY%g
  313. s%@KOSHERDILL_PROGRAM@%$KOSHERDILL_PROGRAM%g
  314. s%@BLT_WISH@%$BLT_WISH%g
  315. s%@LIBS@%$LIBS%g
  316. s%@srcdir@%$srcdir%g
  317. s%@DEFS@%$DEFS%
  318. " $top_srcdir/${file}.in >> $file
  319. fi; done
  320.  
  321.  
  322. exit 0
  323. EOF
  324. chmod +x config.status
  325. ${CONFIG_SHELL-/bin/sh} config.status
  326.  
  327.  
  328.