configure
来自「包含哈希,对称以及非对称的经典算法 包含经典事例」· 代码 · 共 1,795 行 · 第 1/4 页
TXT
1,795 行
# Find the source files, if location was not specified.if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fielse ac_srcdir_defaulted=nofiif test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fifisrcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`# Prefer explicitly selected file to automatically selected ones.if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fififor ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fidoneif test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_fileelse echo "creating cache $cache_file" > $cache_filefiac_ext=c# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.ac_cpp='echo $CPP $CPPFLAGS 1>&5;$CPP $CPPFLAGS'ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5;${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5;${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'if (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=fi# Find a compiler to use.# Check 1) The $CC environment varaible, 2) gcc, 3) acc, and 4) cc.# This deals with brain-damaged Sun systems that place a bogus cc or# acc executable in the $PATH, which just prints an error and exit.# We deal with this by actually trying to compile a trivial test program.if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "checking For C compiler (cached)""... $ac_c" 1>&6 CC="$ac_cv_prog_CC" echo "$ac_t""$CC" 1>&6elif test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. echo $ac_n "checking For C compiler""... $ac_c" 1>&6 echo "$ac_t""$CC" 1>&6else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" echo 'main(){return 0;}' > conftest.$ac_ext for ac_prog in gcc acc cc; do# Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -x "$ac_dir/$ac_word"; then CC="$ac_prog" if eval $ac_compile; then ac_cv_prog_CC="$ac_prog" fi break fi done CC="$ac_cv_prog_CC" if test -n "$CC"; then echo "$ac_t""$ac_dir/$CC" 1>&6 break; fi echo "$ac_t""no" 1>&6 done if test ! -n "$CC"; then { echo "configure: error: no C compiler found" 1>&2; exit 1; } fi IFS="$ac_save_ifs" rm -f conftest*fiecho $ac_n "checking whether we are using GNU CC""... $ac_c" 1>&6if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else cat > conftest.c <<EOF#ifdef __GNUC__ yes;#endifEOFif ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yeselse ac_cv_prog_gcc=nofifiecho "$ac_t""$ac_cv_prog_gcc" 1>&6if test $ac_cv_prog_gcc = yes; then if test "${CFLAGS+set}" != set; thenecho $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6if eval "test \"`echo '$''{'ac_cv_prog_gcc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else echo 'void f(){}' > conftest.cif test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then ac_cv_prog_gcc_g=yeselse ac_cv_prog_gcc_g=nofirm -f conftest*fiecho "$ac_t""$ac_cv_prog_gcc_g" 1>&6 fi # If we're using GCC, perform some Deep Magic to enable the result to # link cleanly with code compiled with a compiler that doesn't understand # GCC's support library (-lgcc). Do a link, to relocatable object form, # with just -lgcc. If it's not GCC, do the normal -c thing. # These substitutions are used in the Makefile to force that behaviour. GCCMAGIC1='-Wl,-r -nostdlib' GCCMAGIC2=-lgccelse GCCMAGIC1=-c GCCMAGIC2=fi# Now, figure out the CFLAGS we want. If the user didn't *ask*# for CFLAGS, we're going to use some ideas of our own.if test "$(CFLAGS+set)" != set; then# First, remember one useful thing that was just figured out,# namely whether the compiler can take -g with -O. (Most compilers# seem to do the opposite of what I want here - if you give both, -g# overrides and disables optimization.) This is only done for# gcc at the moment, and the no/yes combination is possible but# misleadingif test $ac_cv_prog_gcc$ac_cv_prog_gcc_g = yesyes; then CFLAGS=-gelse CFLAGS=""fi# Now, the whole raison d'e^tre of this library is that it's *fast*.# So we are *not* happy with autoconf's normal conservative compilation# flags. Try to figure out what kind the compiler we're using and soup# things up a bit. Also turn on warnings if possible.# If it's GCC, crank up optimization to -O6, and try to add some# -m options, too.# Otherwise, it gets even more ad-hoc, but the test below works for the# SunPro C compiler and cranks it up to maximum optimization.echo $ac_n "checking for useful tuning options (\$TUNE)""... $ac_c" 1>&6if test $ac_cv_prog_gcc = yes; then : ${WARN="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"} if test "${TUNE+set}" != set; then TUNE=-O6 case `$CC -v 2>&1` in *gcc-lib/sparc-*) # Try to use the architecture-detecting tool with SunPro CC. if bn_tune=`(fpversion -foption) 2>/dev/null`; then if test "$bn_tune" = xcg92 || test "$bn_tune" = cg92; then TUNE="$TUNE -mv8" elif test "$bn_tune" != xcg89 && test "$bn_tune" != cg89; then TUNE="$TUNE -mv8" bn_tune_guess=yes fi else TUNE="$TUNE -mv8" bn_tune_guess=yes fi esac fielif $CC -flags 2>&1 | grep SunSoft >/dev/null 2>&1; then if test "${WARN+set}" != set; then if $CC -flags 2>&1 | grep 'checking' | grep '^-vc' > /dev/null 2>&1; then WARN=-vc elif $CC -flags 2>&1 | grep 'checking' | grep '^-v ' > /dev/null 2>&1; then WARN=-v fi if $CC -flags 2>&1 | grep '^-xstrconst' > /dev/null 2>&1; then WARN="${WARN}${WARN+ }-xstrconst" fi fi # SunPro C compiler - now grok version and platform if test "${TUNE+set}" != set; then if $CC -flags 2>&1 | grep '^-xO.*5' >/dev/null 2>&1; then TUNE=-xO5 else TUNE=-xO4 fi # Architecture: -native iv avail., else as fpversion says, else guess -mv8 if $CC -flags 2>&1 | grep '^-native' >/dev/null 2>&1; then TUNE="$TUNE -native" elif bn_tune=`(fpversion -foption) 2>/dev/null`; then TUNE="$TUNE -$bn_tune" elif $CC -flags 2>&1 | grep '^-xcg92' >/dev/null 2>&1; then TUNE="$TUNE -xcg92" bn_tune_guess=yes fi fifibn_tune_set=${TUNE+set}# If nothing better is available, turn on -O: ${TUNE=-O}echo "$ac_t""${TUNE-none}" 1>&6if test "$bn_tune_set" != set; then echo "configure: warning: not optimizing heavily - try setting \$CFLAGS" 1>&2elif test "$bn_tune_guess" = yes; then echo "configure: warning: architecture guessed. If incorrect, use explicit \$TUNE." 1>&2fiecho $ac_n "checking for useful warning options (\$WARN)""... $ac_c" 1>&6echo "$ac_t""${WARN-none}" 1>&6fi # ^^ End of "$(CFLAGS+set)" != set condition# Find "ranlib". Sone systems don't have or need ranlib. If so,# ":" (do nothing) is used instead.# Extract the first word of "ranlib", so it can be a program name with args.set dummy ranlib; ac_word=$2echo $ac_n "checking for $ac_word""... $ac_c" 1>&6if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -x $ac_dir/$ac_word; then ac_cv_prog_RANLIB="ranlib" fi break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"fifiRANLIB="$ac_cv_prog_RANLIB"if test -n "$RANLIB"; then echo "$ac_t""$RANLIB" 1>&6else echo "$ac_t""no" 1>&6fiecho $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6# On Suns, sometimes $CPP names a directory.if test -n "$CPP" && test -d "$CPP"; then CPP=fiif test -z "$CPP"; thenif eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else # This must be in double quotes, not single quotes, because CPP may get # substituted into the Makefile and "${CC-cc}" will confuse make. CPP="${CC-cc} -E" # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF#line 758 "configure"#include "confdefs.h"#include <assert.h>Syntax ErrorEOFeval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"ac_err=`grep -v '^ *+' conftest.out`if test -z "$ac_err"; then :else echo "$ac_err" >&5 rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF#line 772 "configure"#include "confdefs.h"#include <assert.h>Syntax ErrorEOFeval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"ac_err=`grep -v '^ *+' conftest.out`if test -z "$ac_err"; then :else echo "$ac_err" >&5 rm -rf conftest* CPP=/lib/cppfirm -f conftest*firm -f conftest* ac_cv_prog_CPP="$CPP"fi CPP="$ac_cv_prog_CPP"else ac_cv_prog_CPP="$CPP"fiecho "$ac_t""$CPP" 1>&6# If we cannot run a trivial program, we must be cross compiling.echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else if test "$cross_compiling" = yes; then ac_cv_c_cross=yeselsecat > conftest.$ac_ext <<EOF#line 806 "configure"#include "confdefs.h"main(){return(0);}EOFeval $ac_linkif test -s conftest && (./conftest; exit) 2>/dev/null; then ac_cv_c_cross=noelse ac_cv_c_cross=yesfifirm -fr conftest*fiecho "$ac_t""$ac_cv_c_cross" 1>&6cross_compiling=$ac_cv_c_crossecho $ac_n "checking for ANSI C header files""... $ac_c" 1>&6if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6else cat > conftest.$ac_ext <<EOF#line 828 "configure"#include "confdefs.h"#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <float.h>EOFeval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"ac_err=`grep -v '^ *+' conftest.out`if test -z "$ac_err"; then rm -rf conftest* ac_cv_header_stdc=yeselse echo "$ac_err" >&5 rm -rf conftest* ac_cv_header_stdc=nofirm -f conftest*if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI.cat > conftest.$ac_ext <<EOF#line 850 "configure"#include "confdefs.h"#include <string.h>EOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "memchr" >/dev/null 2>&1; then :else rm -rf conftest* ac_cv_header_stdc=nofirm -f conftest*fiif test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.cat > conftest.$ac_ext <<EOF#line 868 "configure"#include "confdefs.h"#include <stdlib.h>EOFif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "free" >/dev/null 2>&1; then :else rm -rf conftest* ac_cv_header_stdc=nofirm -f conftest*fiif test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.if test "$cross_compiling" = yes; then :elsecat > conftest.$ac_ext <<EOF#line 889 "configure"#include "confdefs.h"#include <ctype.h>#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))int main () { int i; for (i = 0; i < 256; i++)if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);exit (0); }EOF
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?