📄 aclocal.m4
字号:
AC_MSG_RESULT(no) echo "Fortran compiler did not produce object file" if test -s conftest.out ; then echo "Output from test was" cat conftest.out fi ifelse([$2],,:,[$2])else AC_MSG_RESULT(yes) ifelse([$1],,:,[$1])firm -f conftest* ])dnldnldnldnl Check that the Fortran 90 compiler works. dnl Perform first arg is yes, second if falsednl PAC_CHECK_F90_COMPILER_OK(true-action, false-action)dnl The name of the compiler is F90dnldefine(PAC_CHECK_F90_COMPILER_OK,[AC_MSG_CHECKING(that the compiler $F90 runs)cat >conftest.f <<EOF program main endEOF/bin/rm -f conftest.out$F90 $F90FLAGS -c conftest.f > conftest.out 2>&1if test $? != 0 ; then AC_MSG_RESULT(no) echo "Fortran 90 compiler returned non-zero return code" if test -s conftest.out ; then echo "Output from test was" cat conftest.out fi ifelse([$2],,:,[$2])elif test ! -s conftest.o ; then AC_MSG_RESULT(no) echo "Fortran 90 compiler did not produce object file" if test -s conftest.out ; then echo "Output from test was" cat conftest.out fi ifelse([$2],,:,[$2])else AC_MSG_RESULT(yes) ifelse([$1],,:,[$1]) /bin/mv -f conftest.f conftest.f90 AC_MSG_CHECKING(that the compiler $F90 accepts .f90 suffix) $F90 $F90FLAGS -c conftest.f90 > conftest.out 2>&1 if test $? != 0 ; then AC_MSG_RESULT(no) else AC_MSG_RESULT(yes) fifirm -f conftest* ])dnldnldnldnl PAC_PROGRAM_CHECK(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUNDdnl [, VALUE-IF-NOT-FOUND [,FULL-PATH-IF-FOUND])dnldnl The variable named by FULL-PATH-IF-FOUND will be set to thednl full path for the programdnldnl A fault with the routine in autoconf is that if PROG-TO-CHECK-FORdnl already has a path, it will FAIL!dnldnl An UNDOCUMENTED FEATURE is that if VARIABLE is already set, thisdnl routine DOES NOTHING!dnldnl An evil feature of the configure commands is that the 'variables' seemdnl to get added to the SUBST list automatically. I've disabled this dnl by NOT using ac_cv_prog_$1 which the configure code seems to use todnl do this.dnl define(PAC_PROGRAM_CHECK,[# Extract the first word of "$2", so it can be a program name with args.set dummy $2; ac_word=[$]2AC_MSG_CHECKING([for $ac_word])ac_prog_where=""if test -n "[$]$1"; then ac_pg_$1="[$]$1" # Let the user override the test.else ac_first_char=`expr "$2" : "\(.\)"` if test "$ac_first_char" = "/" -a -x "$2" ; then ac_pg_$1="$3" ac_prog_where=$2 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 ac_pg_$1="$3" ac_prog_where=$ac_dir/$ac_word break fi done IFS="$ac_save_ifs" fidnl If no 4th arg is given, leave the cache variable unset,dnl so AC_CHECK_PROGS will keep looking.ifelse([$4], , , [ test -z "[$]ac_pg_$1" && ac_pg_$1="$4"])dnlfi;dnl$1="$ac_pg_$1"if test -n "$ac_prog_where" ; then AC_MSG_RESULT(found $ac_prog_where ([$]$1)) ifelse([$5], , , [ $5=$ac_prog_where ] )else AC_MSG_RESULT(no)fidnl AC_SUBST($1)dnl])dnldnldnl PAC_PROGRAMS_CHECK is like PAC_PROGRAM_CHECK, but withdnl a list of programs.dnldefine(PAC_PROGRAMS_CHECK,[for p in $2doPAC_PROGRAM_CHECK($1, [$]p, [$]p,,$5)test -n "[$]$1" && breakdoneif test -z "[$]$1" ; then # We have to set this outside of the loop lest the first failure in # PROGRAM_CHECK set the value (which then terminates the effect of the # loop, since autoconf macros only set values that are null, they # don't override them $1="$4"fiifelse([$3],,, [test -n "[$]$1" || $1="$3"])])dnldnldnl PAC_CHECK_SIZEOF(TYPE)define(PAC_CHECK_SIZEOF,[changequote(<<, >>)dnldnl The name to #define.define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnldnl The cache variable name.define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnlchangequote([, ])dnldnl Can only do this test if not cross-compiling (and TESTCC not defined)if test "$cross_compiling" = 1 -a -z "$TESTCC" ; then echo "Cannot check for size of $1 when cross-compiling" AC_CV_NAME=0elseAC_MSG_CHECKING(size of $1)if test -n "$TESTCC" ; then CCsav="$CC" CC="$TESTCC"fiAC_TEST_PROGRAM([#include <stdio.h>main(){ FILE *f=fopen("cftestval", "w"); if (!f) exit(1); fprintf(f, "%d\n", sizeof($1)); exit(0);}], AC_CV_NAME=`cat cftestval`,AC_CV_NAME=0)rm -f cftestvalif test -n "$TESTCC" ; then CC="$CCsav"fiif test "$AC_CV_NAME" = 0 ; thenAC_MSG_RESULT($1 unsupported)elseAC_MSG_RESULT($AC_CV_NAME)fi$2=$AC_CV_NAMEdnl AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)fiundefine([AC_TYPE_NAME])dnlundefine([AC_CV_NAME])dnl])dnldnldnl We need routines to check that make works. Possible problems withdnl make includednldnl It is really gnumake, and contrary to the documentation on gnumake,dnl it insists on screaming everytime a directory is changed. The fixdnl is to add the argument --no-print-directory to the makednldnl It is really BSD 4.4 make, and can't handle 'include'. For somednl systems, this can be fatal; there is no fix (other than removing thisdnl aleged make).dnldnl It is the OSF V3 make, and can't handle a comment in a block of targednl code. There is no acceptable fix.dnldnl This assumes that "MAKE" holds the name of the make program. If itdnl determines that it is an improperly built gnumake, it addsdnl --no-print-directorytries to the symbol MAKE.define(PAC_MAKE_IS_GNUMAKE,[AC_MSG_CHECKING(gnumake)/bin/rm -f conftestcat > conftest <<.SHELL=/bin/shALL: @(dir=`pwd` ; cd .. ; \$(MAKE) -f \$\$dir/conftest SUB)SUB: @echo "success".str=`$MAKE -f conftest 2>&1`if test "$str" != "success" ; then str=`$MAKE --no-print-directory -f conftest 2>&1` if test "$str" = "success" ; then MAKE="$MAKE --no-print-directory" AC_MSG_RESULT(yes using --no-print-directory) else AC_MSG_RESULT(no) fielse AC_MSG_RESULT(no)fi/bin/rm -f confteststr=""])dnldnldnl PAC_MAKE_IS_BSD44([true text])dnldefine(PAC_MAKE_IS_BSD44,[AC_MSG_CHECKING(BSD 4.4 make)/bin/rm -f conftestcat > conftest <<.ALL: @echo "success".cat > conftest1 <<.include conftest.str=`$MAKE -f conftest1 2>&1`/bin/rm -f conftest conftest1if test "$str" != "success" ; then AC_MSG_RESULT(Found BSD 4.4 so-called make) echo "The BSD 4.4 make is INCOMPATIBLE with all other makes." echo "Using this so-called make may cause problems when building programs." echo "You should consider using gnumake instead." ifelse([$1],,[$1])else AC_MSG_RESULT(no - whew)fistr=""])dnldnldnl PAC_MAKE_IS_OSF([true text])dnldefine(PAC_MAKE_IS_OSF,[AC_MSG_CHECKING(OSF V3 make)/bin/rm -f conftestcat > conftest <<.SHELL=/bin/shALL: @# This is a valid comment! @echo "success".str=`$MAKE -f conftest 2>&1`/bin/rm -f conftest if test "$str" != "success" ; then AC_MSG_RESULT(Found OSF V3 make) echo "The OSF V3 make does not allow comments in target code." echo "Using this make may cause problems when building programs." echo "You should consider using gnumake instead." ifelse([$1],,[$1])else AC_MSG_RESULT(no)fistr=""])dnldnldnl Here begins macros for setting defaults for specific systems.dnl These handle things like C compilers with funny names and specialdnl options.dnldnldnl These make use of the GLOBALS; see each definition for which onesdnl are used:dnldnl (Not yet present)dnldnl PAC_GET_CC(arch)dnl Uses USERCC, CC, USERCLINKER, CLINKER, LIB_LIST. dnl Looks for special versionsdnl of C compilers, particularly cross compilers. May also set somednl compile flags. Clears GCC if it sets CC. Calls "print_error" fordnl error messagesdnldefine(PAC_GET_CC,[if test -z "$USERCC" ; thencase $1 in cenju3) if test $ARCH = abi then CCC=CC CCLINKER=cjCC CC=cc F77=f77 ASM=as if test -z "$USERFLINKER" ; then FLINKER=cjabif77 fi if test -z "$USERFLINKER" ; then CLINKER=cjabicc fi else CCC=CC CCLINKER=cjCC CC=/usr/necccs/bin/cc F77=/usr/necccs/bin/f77 ASM=/usr/necccs/bin/as if test ! -x $CC ; then CC=cc F77=f77 ASM=as fi# if test -z "$USERFLINKER" ; then FLINKER=cjf77 fi if test -z "$USERFLINKER" ; then CLINKER=cjcc fi fi# DEVCFLAGS="$DEVCFLAGS -O -Kmips2" MPILIBNAME=mpich ASMFILES_O=get_stack.o ;; intelnx|paragon) CC=icc ; GCC="" # If this version of the intel compiler accepts the -nx flag, use it. if icc -nx > /dev/null 2>&1 ; then # For some reason the lib list was commented out; we need # it to link with if we use the NX routines LIB_LIST="$LIB_LIST -nx" CFLAGS="$CFLAGS -nx" fi ;; cm5) CC=cc ; GCC="" ; if test -z "$USERCLINKER" ; then CLINKER="cmmd-ld -comp $CC" fi ;; cray_t3d) # Some Cray's require -Ccray-t3d instead of -Tcray-t3d. # We have no diagnostic for this behavior yet. CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3d -DT3D" ; GCC="" if test -z "$USERCLINKER" ; then CLINKER="$CC -Tcray-t3d" ; fi ;; cray_t3e) # Some Cray's require -Ccray-t3e instead of -Tcray-t3e. # We have no diagnostic for this behavior yet. CC=/mpp/bin/cc ; CFLAGS="$CFLAGS -Tcray-t3e -DT3E" ; GCC="" if test -z "$USERCLINKER" ; then CLINKER="$CC -Tcray-t3e" ; fi ;; hpux) if test "`which ${CC-cc}`" = "/usr/convex/bin/cc" ; then CFLAGS="$CFLAGS -or none -U_REENTRANT -D_POSIX_SOURCE -D_HPUX_SOURCE -DMPI_cspp" elif test "$CC" != "gcc" ; then # If cflags includes -Ae or -Aa, we don't need to add -Aa # In a perfect world, we might want to try -Ae # There is also -Aportable... hasarg=`echo A$CFLAGS | sed -n -e '/-A/p'` if test -z "$hasarg" ; then # Try to Add -Ae; add -Aa if that doesn't work PAC_CHECK_COMPILER_OPTION(-Ae,hasarg=1) if test -n "$hasarg" ; then CFLAGS="$CFLAGS -Ae" else PAC_CHECK_COMPILER_OPTION(-Aa,hasarg=1) if test -n "$hasarg" ; then CFLAGS="$CFLAGS -Aa" fi fi fi # We need these flags to get the correct system include # files. CFLAGS="$CFLAGS -D_POSIX_SOURCE -D_HPUX_SOURCE" # P4 needs these to get the correct system includes P4_CFLAGS="-D_POSIX_SOURCE -D_HPUX_SOURCE" # We MUST have an ANSI compiler for HPUX, even for USER code # If the regular cpp worked, we would not need to do this. PAC_CHECK_COMPILER_OPTION(-Aa,AaOPT=1,AaOPT=0) if test "$AaOPT" = 1 ; then USER_CFLAGS="$USER_CFLAGS -Aa" fi # Alternate... # -Ae is extended -Aa (only on some PA RISC systems) #CFLAGS="$CFLAGS -Ae +Olibcalls" #CLINKER="cc -Ae" # fort77 is the POSIX-compliant version of f77; fort77 can use # -Ldirectory #F77=fort77 #FLINKER=fort77 #FFLAGS="$FFLAGS +ppu" # Try and see that this works AC_COMPILE_CHECK(Checking that HP compiler has ANSI option...,,, hpux_ansi=1,hpux_ansi=0) if test $hpux_ansi = 0 ; then print_error "HPUX C compiler does not support ANSI mode!" print_error "This mode is required because severe bugs in HPUX CPP" print_error "cause problems. Configuration continuing BUT " print_error "if you have trouble, consider using the GNU C" print_error "compiler gcc instead." else print_error "HPUX C compiler is being forced into ANSI mode so that" print_error "severe bugs in HPUX CPP do not cause problems" fi fi ;; alpha) ;; convex_spp) CC="/usr/convex/bin/cc" ;; ibmpoe) dnl This is intended for the Standard POE/MPL version dnl This version REQUIRES you to have either mpCC or mpcc. dnl ??? is this safe ?? dnl An additional problem is that some sites will install mpCC dnl even though xlC is not available (!). This forces us dnl to test for both mpCC and xlC, then mpcc and xlc. CCval= PAC_PROGRAM_CHECK(CCval,xlC,xlC) if test -n "$CCval" ; then TESTCC="$CCval" CCval="" PAC_PROGRAM_CHECK(CCval,mpCC,mpCC) else PAC_PROGRAM_CHECK(CCval,xlc,xlc) if test -n "$CCval" ; then TESTCC="$CCval" CCval="" PAC_PROGRAM_CHECK(CCval,mpcc,mpcc) fi fi if test -z "$CCval" ; then print_error "Could not find mpCC or mpcc!" print_error "Make sure that you path is set correctly." exit 1 fi CC="$CCval" ;; meiko) dnl /opt/SUNWspro/bin/cc,/opt/apogee/bin/apcc,/opt/PGI/bin/cc, dnl /opt/gcc/bin/gcc CCval='' PAC_PROGRAMS_CHECK(CCval,cc apcc pgcc gcc) if test -z "$CCval" ; then print_error "Could not find a C compiler" exit 1 elif test "$CCVal" = "cc" ; then CC="cc -g -xcg92"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -