📄 configure
字号:
#! /bin/shprogname="`echo $0 | sed 's:^\./\./:\./:'`"print_error() { echo "*# $*" 2>&1 ; }print_usage() {cat <<.Usage: ${progname} [-tcldir=TCLDIR] [-tkdir=TKDIR] [-opt=OPTFLAGS] [-cc=C_COMPILER] [-cflags=CFLAGS] [-tclincdir=TCLINCDIR] [-tkincdir=TKINCDIR]where TCLDIR = Directory containing tcl. Must have lib/libtcl.a. Must have include/tcl.h unless TCLINCDIR specified. TKDIR = Directory containing tk 3.3 or later. Must have lib/libtk.a. Must have include/tk.h unless TKINCDIR specified. May be the same as TCLDIR. TCLINCDIR = Directory containing include/tcl.h . TKINCDIR = Directory containing include/tk.h . OPTFLAGS = Flags for compiling (e.g., -g or -O) CFLAGS = flags to give C compiler C_COMPILER = Name of C compiler.}TK_DIR=""TCL_DIR=""for argdo case $arg in -tkdir=* | --tkdir=*) TK_DIR="`echo $arg|sed 's/-*tkdir=//'`" ;; -tcldir=* | --tcldir=*) TCL_DIR="`echo $arg|sed 's/-*tcldir=//'`" ;; -tkincdir=* | --tkincdir=*) TKINCDIR="`echo $arg|sed 's/-*tkincdir=//'`" ;; -tclincdir=* | --tclincdir=*) TCLINCDIR="`echo $arg|sed 's/-*tclincdir=//'`" ;; -opt=* | --opt=*) OPTFLAGS="`echo $arg|sed 's/-*opt=//'`" ;; -echo | --echo) set -x ;; -cc=* | --cc=*) CC=`echo $arg|sed 's/-*cc=//'` USERCC=1 ;; -cflags=* | --cflags=*) package="`echo $arg|sed 's/-*cflags=//'`" USER_CFLAGS="$package" CFLAGS="$CFLAGS $package" ;; -automountfix=* | --automountfix=*) AUTOMOUNTFIX="`echo $arg | sed 's/-*automountfix=//'`" ;; # Standard configure args from here to the end # For backward compatibility, also recognize exact --exec_prefix. -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*) exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) next_exec_prefix=yes ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) PREFIX=`echo $arg | sed 's/[-a-z_]*=//'` prefix=$PREFIX ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) next_prefix=yes ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) next_srcdir=yes ;; -datadir=* | --datadir=* ) datadir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -libdir=* | --libdir=* ) libdir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -bindir=* | --bindir=* ) bindir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -sbindir=* | --sbindir=* ) sbindir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -includedir=* | --includedir=* ) includedir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -u | -usage | --usage | --usag | --usa | --us | --u | -help | --help ) print_usage >& 2 exit 1 ;; -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v) verbose=yes ;; *) echo "Unrecognized argument $arg" exit 1 ;; esacdonetrap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15trap 'rm -f confdefs*' 0# NLS nuisances.# These must not be set unconditionally because not all systems understand# e.g. LANG=C (notably SCO).if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fiif test "${LANG+set}" = 'set' ; then LANG=C; export LANG; firm -f conftest* confdefs.h# AIX cpp loses on an empty file, so make sure it contains at least a newline.echo > confdefs.hcompile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'# A filename unique to this package, relative to the directory that# configure is in, which we can look for to find out if srcdir is correct.unique_file=nupshot.c# Find the source files, if location was not specified.if test -z "$srcdir"; then srcdirdefaulted=yes # Try the directory containing this script, then `..'. prog=$0 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'` test "X$confdir" = "X$prog" && confdir=. srcdir=$confdir if test ! -r $srcdir/$unique_file; then srcdir=.. fifiif test ! -r $srcdir/$unique_file; then if test x$srcdirdefaulted = xyes; then echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2 else echo "configure: Can not find sources in \`${srcdir}'." 1>&2 fi exit 1fi# Preserve a srcdir of `.' to avoid automounter screwups with pwd.# But we can't avoid them for `..', to make subdirectories work.case $srcdir in .|/*|~*) ;; *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.esac# Save the original args to write them into config.status later.configure_args="$*"# A problem. Some systems use an NFS automounter. This can generate# paths of the form /tmp_mnt/... . On SOME systems, that path is# not recognized, and you need to strip off the /tmp_mnt. On others, # it IS recognized, so you need to leave it in. Grumble.# The real problem is that OTHER nodes on the same NFS system may not# be able to find a directory based on a /tmp_mnt/... name.## It is WRONG to use $PWD, since that is maintained only by the C shell,# and if we use it, we may find the 'wrong' directory. To test this, we# try writing a file to the directory and then looking for it in the # current directory## First, find out where the real source is if this is a VPATH buildif test -s nupshot.c ; then tmpsrcdir=.else # try to determine the source dir tmpsrcdir=`echo $0 | sed -e 's%/configure%%' -e "s%^~/%$HOME/%"` if test ! -s $tmpsrcdir/nupshot.c ; then tmpsrcdir="" fifi# Find the source files, if location was not specified.if test "$srcdirdefaulted" = "yes" ; then srcdir="" # Try the directory containing this script, then `..'. prog=$0 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'` # Remove all trailing /'s confdir=`echo $confdir|sed 's%[/*]$%%'` test "X$confdir" = "X$prog" && confdir=. srcdir=$confdir if test ! -r $srcdir/$unique_file; then srcdir=.. fifiif test ! -r $srcdir/$unique_file; then if test x$srcdirdefaulted = xyes; then echo "configure: Cannot find sources in \`${confdir}' or \`..'." 1>&2 else echo "configure: Cannot find sources in \`${srcdir}'." 1>&2 fi exit 1fi# Preserve a srcdir of `.' to avoid automounter screwups with pwd.# (and preserve ./ and .//)# But we can't avoid them for `..', to make subdirectories work.case $srcdir in .|./|.//|/*|~*) ;; *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.esacif test "X$srcdir" != "X." -a -s $srcdir/nupshot.c ; then NUPSHOT_TRIAL=$srcdirelse NUPSHOT_TRIAL=$PWD if test "$NUPSHOT_TRIAL" != "" -a -d "$NUPSHOT_TRIAL" ; then if test -r $NUPSHOT_TRIAL/.foo ; then /bin/rm -f $NUPSHOT_TRIAL/.foo /bin/rm -f .foo fi if test -r $NUPSHOT_TRIAL/.foo -o -r .foo ; then NUPSHOT_TRIAL= else echo "test" > $NUPSHOT_TRIAL/.foo if test ! -r .foo ; then NUPSHOT_TRIAL= fi /bin/rm -f $NUPSHOT_TRIAL/.foo fi fifiif test "$NUPSHOT_TRIAL" = "" ; then NUPSHOT_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'`fi## First, test the PWD is sensibleif test ! -r $NUPSHOT_TRIAL/Makefile.in ; then # PWD must be messed up NUPSHOT_TRIAL=`pwd` if test ! -r $NUPSHOT_TRIAL/Makefile.in ; then print_error "Cannot determine the root directory!" exit 1 fi NUPSHOT_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'` if test ! -d $NUPSHOT_TRIAL ; then print_error "Warning: your default path uses the automounter; this may" print_error "cause some problems if you use other NFS-connected systems." NUPSHOT_TRIAL=`pwd` fifiif test -z "$NUPSHOT_TRIAL" ; then NUPSHOT_TRIAL=`pwd | sed -e 's%/tmp_mnt/%/%g'` if test ! -d $NUPSHOT_TRIAL ; then print_error "Warning: your default path uses the automounter; this may" print_error "cause some problems if you use other NFS-connected systems." NUPSHOT_TRIAL=`pwd` fifiNUPSHOT_HOME=$NUPSHOT_TRIALCC=${CC-cc}for hdr in unistd.hdotrhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`echo checking for ${hdr}echo checking how to run the C preprocessorif test -z "$CPP"; then # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and ``${CC-cc}'' will simply confuse # make. It must be expanded now. CPP="${CC-cc} -E" cat > conftest.c <<EOF#include "confdefs.h"#include <stdio.h>Syntax ErrorEOFerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`if test -z "$err"; then :else rm -rf conftest* CPP=/lib/cppfirm -f conftest*fitest ".${verbose}" != "." && echo " setting CPP to $CPP"cat > conftest.c <<EOF#include "confdefs.h"#include <${hdr}>EOFerr=`eval "($CPP conftest.c >/dev/null) 2>&1"`if test -z "$err"; then rm -rf conftest* {test -n "$verbose" && \echo " defining ${trhdr}"echo "#define" ${trhdr} 1 >> confdefs.hDEFS="$DEFS -D${trhdr}=1"}firm -f conftest*done# Make support for VPATHMAKE=${MAKE:-"make"}if test -z "$ac_echo_n" ; thenac_echo_n=yesif (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c='' ac_t=' ' else ac_n=-n ac_c= ac_t= fielse ac_n= ac_c='\c' ac_t=fiac_echo_test=`echo foo 1>&1`if test -z "$ac_echo_test" ; then print_error "Your sh shell does not handle the output redirection" print_error "1>&1 correctly. Configure will work around this problem," print_error "but you should report the problem to your vendor."fifiif test -z "$ac_echo_test" -a 1 = 1 ; thenecho $ac_n "checking for virtual path format""... $ac_c"elseecho $ac_n "checking for virtual path format""... $ac_c" 1>&1firm -rf conftest*mkdir conftestdircat >conftestdir/a.c <<EOFA sample fileEOFcat > conftest <<EOFall: a.oVPATH=.:conftestdir.c.o: @echo \$<EOFac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'`if test -n "$ac_out" ; then if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t""VPATH"elseecho "$ac_t""VPATH" 1>&1fi VPATH='VPATH=.:$(srcdir)'else rm -f conftest cat > conftest <<EOFall: a.o.PATH: . conftestdir.c.o: @echo \$<EOF ac_out=`$MAKE -f conftest 2>&1 | grep 'conftestdir/a.c'` if test -n "$ac_out" ; then if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t"".PATH"elseecho "$ac_t"".PATH" 1>&1fi VPATH='.PATH: . $(srcdir)' else if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t""neither VPATH nor .PATH works"elseecho "$ac_t""neither VPATH nor .PATH works" 1>&1fi fifirm -rf conftest*#--------------------------------------------------------------------# Include sys/select.h if it exists and if it supplies things# that appear to be useful and aren't already in sys/types.h.# This appears to be true only on the RS/6000 under AIX. Some# systems like OSF/1 have a sys/select.h that's of no use, and# other systems like SCO UNIX have a sys/select.h that's# pernicious. If "fd_set" isn't defined anywhere then set a# special flag.#--------------------------------------------------------------------echo checking for sys/select.hif test -z "$ac_echo_n" ; thenac_echo_n=yesif (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c='' ac_t=' ' else ac_n=-n ac_c= ac_t= fielse ac_n= ac_c='\c' ac_t=fiac_echo_test=`echo foo 1>&1`if test -z "$ac_echo_test" ; then print_error "Your sh shell does not handle the output redirection" print_error "1>&1 correctly. Configure will work around this problem," print_error "but you should report the problem to your vendor."fifiif test -z "$ac_echo_test" -a 1 = 1 ; thenecho $ac_n "checking for fd_set""... $ac_c"elseecho $ac_n "checking for fd_set""... $ac_c" 1>&1fiif test ! -f confdefs.h ; then if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t"""!! SHELL ERROR !!""elseecho "$ac_t"""!! SHELL ERROR !!"" 1>&1fi echo "The file confdefs.h created by configure has been removed" echo "This may be a problem with your shell; some versions of LINUX" echo "have this problem. See the Installation guide for more" echo "information." exit 1ficat > conftest.c <<EOF#include "confdefs.h"#include <sys/types.h>int main() { exit(0); }int t() { fd_set readMask, writeMask; }EOFif eval $compile; then if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t""yes"elseecho "$ac_t""yes" 1>&1fi :else expandcompile=`echo "$compile" | sed -e 's/>.*//'` eval echo "configure:$expandcompile" >> config.log echo "configure: failed program was:" >>config.log cat confdefs.h >> config.log cat conftest.c >> config.log if test -s conftest.out ; then cat conftest.out >> config.log else ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1 fi echo '#include "confdefs.h"#include <sys/select.h>' > conftest.ceval "$CPP conftest.c > conftest.out 2>&1"if egrep "fd_mask" conftest.out >/dev/null 2>&1; then rm -rf conftest* {test -n "$verbose" && \echo " defining HAVE_SYS_SELECT_H"echo "#define" HAVE_SYS_SELECT_H 1 >> confdefs.hDEFS="$DEFS -DHAVE_SYS_SELECT_H=1"}else rm -rf conftest* {test -n "$verbose" && \echo " defining NO_FD_SET"echo "#define" NO_FD_SET 1 >> confdefs.hDEFS="$DEFS -DNO_FD_SET=1"}firm -f conftest* if test -z "$ac_echo_test" -a 1 = 1 ; thenecho "$ac_t""no"elseecho "$ac_t""no" 1>&1fi expandcompile=`echo "$compile" | sed -e 's/>.*//'` eval echo "configure:$expandcompile" >> config.log echo "configure: failed program was:" >>config.log cat confdefs.h >> config.log cat conftest.c >> config.log if test -s conftest.out ; then cat conftest.out >> config.log else ${CC-cc} $CFLAGS conftest.c -o conftest $LDFLAGS $LIBS >> config.log 2>&1 fi
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -