dnl -*- m4 -*- AC_INIT(AST.h) AC_PREREQ(2.13) TI_FIX_SHELL AC_CONFIG_AUX_DIR(config-aux) AC_CANONICAL_SYSTEM AC_VALIDATE_CACHED_SYSTEM_TUPLE dnl $Format: "AM_INIT_AUTOMAKE($Project$,$ProjectVersion$)"$ AM_INIT_AUTOMAKE(titaniumc,2.205) AM_CONFIG_HEADER(config.h) TI_RESTORE_AUTOCONF_ENV([CC CXX CFLAGS CXXFLAGS CPPFLAGS LIBS MAKE GMAKE AR AS RANLIB REXEC PERL KSH SUM LEX YACC]) ######################################################################## ## ## Site-Specific Prefabricated Collections of Settings ## ## Berkeley Millennium cluster AC_MSG_CHECKING(for Berkeley Millennium cluster) AC_ARG_ENABLE(millennium, TI_OPTION_HELP(enable-millennium, use known directories for Berkeley Millennium cluster), , [case "`hostname`" in *.Millennium.Berkeley.EDU) enable_millennium=yes ;; *) enable_millennium=no ;; esac]) if test "$enable_millennium" = yes; then #with_ens=/usr/mill/lib # don't use ens on Millennium - AMVIA is broken anyhow with_includes=/usr/mill/include with_amvia=/home/cs/philipb/amvia_3/lib/Linux-i686 with_via=/home/cs/philipb/via/lib/Linux-i686-myrinet with_rexec=/usr/mill/bin fi AC_MSG_RESULT($enable_millennium) ## Berkeley NOW cluster AC_MSG_CHECKING(for Berkeley NOW cluster) AC_ARG_ENABLE(now, TI_OPTION_HELP(enable-now, use known directories for Berkeley NOW cluster), , [if test `hostname` = "now.CS.Berkeley.EDU" -o \( -d /usr/now/lib -a -d /usr/now/include \) ; then enable_now=yes else enable_now=no fi]) if test "$enable_now" = yes; then with_ens=/usr/now/lib with_includes=/usr/now/include fi AC_MSG_RESULT($enable_now) ######################################################################## ## ## Supporting Command-Line Tools ## ## perl AC_PATH_PROGS(PERL, perl5 perl) AC_MSG_CHECKING(for perl version 5.004 or later) if $PERL -e 'require 5.004;' 2>&AC_FD_CC; then AC_MSG_RESULT(yes) else AC_MSG_ERROR(cannot find perl 5.004 or later) fi ## other stuff AC_PATH_PROG(KSH, ksh) if test "$KSH" = "" ; then AC_WARN(Failed to find ksh - test suite disabled) KSH='/usr/bin/env ksh' fi TI_CHECK_PROGS(SUM,md5 cksum sum,checksum engine) TI_CHECK_PROGS(AR,ar gar,archiver) TI_CHECK_PROGS(AS,as $CC,assembler) TI_CHECK_PROGS(MAKE, $GMAKE gmake make $MAKE, GNU make) TI_PATH_PROGS(GMAKE, $GMAKE gmake make $MAKE, GNU make) AC_MSG_CHECKING(for GNU make) if $GMAKE --version | grep GNU ; then AC_MSG_RESULT(yes) else AC_MSG_ERROR(cannot find a version of GNU make - please install GNU make and/or set \$GMAKE to indicate where it's located) fi AC_SUBST(GMAKE) AC_PROG_RANLIB ######################################################################## ## ## C/C++ Compilers ## case "$build_os" in unicos*) TI_ENV_DEFAULT(CXX, KCC) TI_ENV_DEFAULT(CXXCPP, $CXX -E) ac_cv_prog_CXXCPP="$CXXCPP" # DOB: work-around for a gnarly Cray configure bug TI_ENV_DEFAULT(YACC, yacc) ;; esac AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_CXXCPP AM_PROG_LEX AC_PROG_LN_S AC_PROG_RANLIB AC_PROG_YACC AC_C_BIGENDIAN AC_CHECK_PROG(AR,ar) AC_CHECK_PROG(have_mpcc_r,mpcc_r,yes,no) AC_MSG_CHECKING(known buggy C compilers) AC_TRY_CPP([ #if __GNUC__ == 2 && __GNUC_MINOR__ == 96 && __GNUC_PATCHLEVEL__ == 0 # error #endif ],[ AC_MSG_RESULT(ok) ],[ AC_MSG_RESULT(gcc 2.96) gcc296msg="Use of gcc 2.96 for compiling this software is strongly discouraged. \ It is not an official GNU release and has many serious known bugs, especially \ in the optimizer, which may lead to bad code and incorrect runtime behavior. \ Consider using \$CC to select a different compiler." TI_IF_ENABLED(allow-gcc296, Allow the use of the broken gcc 2.96 compiler, [ AC_WARN([$gcc296msg]) ],[ AC_ERROR([$gcc296msg \ You may enable use of this broken compiler at your own risk by passing the --enable-allow-gcc296 flag.]) ]) ]) if test "$ac_cv_c_bigendian" = 'yes'; then ENDIANNESS="-DBIG_ENDIAN" else ENDIANNESS="-DLITTLE_ENDIAN=1234" fi AC_SUBST(ENDIANNESS) AC_SUBST(CC) AC_SUBST(CXX) AC_SUBST(RANLIB) AC_SUBST(AR) ## specific compiler families TI_FAMILY_CACHE_CHECK(C, CC, tc_cv_cc_family) if test "$tc_cv_cc_family" = MIPS; then # The MIPSPro C compiler has a broken C preprocessor exit code, so we hardwire some choices AC_DEFINE(MIPSPRO_COMPILER) tc_cv_cc_is_tera_cc=no tc_cv_cc_is_cray_t3e_cc=no tc_cv_cc_is_cray_gnu_cc=no ac_cv_header_sstream=yes TI_IF_ENABLED(mips64, Use MIPS-64 ABI, mipsabi="-64", mipsabi="-n32") fi MIPS_ABI_FLAG=$mipsabi AC_SUBST(MIPS_ABI_FLAG) ### # # choose the default optimization flags that tcbuild uses on generated C code # TI_TCBUILD_CFLAGS(common, common C, [ case "$tc_cv_cc_family" in GNU) withval=-fno-strict-aliasing ;; MIPS) withval="$mipsabi -common -OPT:alias=ANY -diag_suppress1116,1171,1174,1209,1552,1681" ;; # no space to keep from confusing makedepend XLC) withval="-qnoansialias" ;; Compaq) withval="-noansi_alias" ;; *) withval= ;; esac case "$target_os" in darwin*) withval="$withval -no-cpp-precomp" ;; *) ;; esac ]) TI_TCBUILD_CFLAGS(optimize, C optimization, [case "$tc_cv_cc_family" in GNU) withval="-O3" # -finline-limit not available on gcc 2.95 TI_TRY_CFLAG([-finline-limit=10000], [withval="$withval -finline-limit=10000"]) ;; Sun) withval=-xO5 ;; Cray) withval=-O2 ;; # DOB: -O3 is unstable on Cray cc MIPS) withval=-O3 ;; XLC) withval="-O5 -qsmp=noauto -qmaxmem=8192" ;; # -O5 == -O3 w/ intra-procedural analysis Compaq) withval="-O4 -msg_disable extrasemi -tune host -inline speed" # TODO: Compaq inliner sucks - even with -inline speed it ignores some explicit inline directives # -inline all works, but is way overkill (inlines everything in the program) ;; *) withval=-O ;; esac]) TI_TCBUILD_CFLAGS(debug, C debug, withval=-g) AC_LANG_SAVE AC_LANG_CPLUSPLUS TI_FAMILY_CACHE_CHECK(C++, CXX, tc_cv_cxx_family) AC_LANG_RESTORE AM_CONDITIONAL(CXX_FAMILY_KAI, test "$tc_cv_cxx_family" = KAI) AM_CONDITIONAL(CXX_FAMILY_MIPS, test "$tc_cv_cxx_family" = MIPS) if test "$tc_cv_cxx_family" = MIPS; then AR="$(top_srcdir)/ar-wrapper" # use a special ar for MIPSPro C++ fi # grab safe C++ flags that don't include tc-specific stuff GENERIC_CXXFLAGS="$CXXFLAGS" AC_SUBST(GENERIC_CXXFLAGS) # CXXFLAGSE is how we tell the C++ compiler that we may use exceptions CXXFLAGSE="" case "$tc_cv_cxx_family" in GNU) CXXFLAGSE="-fexceptions" CXXFLAGS="$CXXFLAGS -fno-exceptions" ;; KAI) CXXFLAGSE="--exceptions" #CXXFLAGS="$CXXFLAGS --no_exceptions --display_error_number --diag_suppress 611 --diag_suppress 610" ;; # Kai C++ requires all files to have the same exceptions setting # also need the -tlocal template instantiation mechanism to ensure # that the sublibraries which comprise tc (e.g. libomega) all instatiate # their required templates correctly CXXFLAGS="$CXXFLAGS $CXXFLAGSE --display_error_number --diag_suppress 611 --diag_suppress 610 -tlocal" ;; MIPS) CXXFLAGSE="-LANG:exceptions=ON" CXXFLAGS="$CXXFLAGS $mipsabi -LANG:exceptions=OFF -LANG:std -common -diag_suppress 1171,1174,1209,1552,1681,1682 -I$(top_srcdir)/c-headers" ;; esac AC_SUBST(CXXFLAGSE) TI_LIBGCC ######################################################################## ## ## Cluster computing libraries ## TI_CHECK_LIB(ens, NameServer_Init, have_libens=yes, , -L/usr/lib ${with_ens:+-L$with_ens}) AC_CHECK_LIB(glunix, Glib_Initialize, have_libglunix=yes, , -lsocket) fnname="A""M_Init" # work around an annoying autoconf BUG AC_CHECK_LIB(am2, $fnname, have_libam2=yes) TI_CHECK_LIB(amvia, $fnname, have_libamvia=yes, , ${with_amvia:+-L$with_amvia} ${with_via:+-L$with_via}, -lvia) AC_PATH_PROG(REXEC, $REXEC rexec, , $with_rexec:$PATH) AC_MSG_CHECKING(for Millennium rexec) # We're only interested in the Millennium version of rexec # the standard UNIX command 'rexec' has completely different behavior and is currently of no use to us if test -n "$REXEC" -a -n "`$REXEC 2> /dev/null | grep -- '-n #nodes'`"; then have_rexec=yes TIC_REXEC_DEFINES="-DREXEC" AC_MSG_RESULT(yes) else have_rexec=no TIC_REXEC_DEFINES="" AC_MSG_RESULT(no) fi if test "$have_libens" = yes ; then # need -L/usr/lib here or we'll get the wrong pthread lib on millennium TIC_ENS_LD_FLAGS="-L/usr/lib ${with_ens:+-L$with_ens -Wl,-R$with_ens}" TIC_ENS_INCLUDES="${with_ens:+-I$with_includes}" TIC_ENS_LIBS="-lens" AC_DEFINE(HAVE_ENAMESERVER_H) else TIC_ENS_LD_FLAGS="" TIC_ENS_INCLUDES="" TIC_ENS_LIBS="" fi if test "$have_libglunix" = yes ; then TIC_GLUNIX_DEFINES="-DGLUNIX" TIC_GLUNIX_INCLUDES="-I/usr/now/include" TIC_GLUNIX_LIBS="-lglunix -lsocket" else TIC_GLUNIX_DEFINES="" TIC_GLUNIX_INCLUDES="" TIC_GLUNIX_LIBS="" fi if test "$TI_CSPAWN_CMD" != "" ; then AC_DEFINE_UNQUOTED(TI_CSPAWN_CMD, "$TI_CSPAWN_CMD") fi if test "$have_libamvia" = yes ; then TIC_AM_DEFINES="-DUSERLIB" TIC_AM_LD_FLAGS="${with_amvia:+-L$with_amvia -Wl,-R$with_amvia} ${with_via:+-L$with_via -Wl,-R$with_via}" TIC_AM_INCLUDES="-I/home/cs/philipb/via/include -I/home/cs/philipb/amvia_3/include" TIC_AM_LIBS="-lamvia -lvia" elif test "$have_libam2" = yes ; then TIC_AM_DEFINES="" TIC_AM_LD_FLAGS="" TIC_AM_INCLUDES="-I/usr/now/include/am2" TIC_AM_LIBS="-lam2" else TIC_AM_DEFINES="" TIC_AM_LD_FLAGS="" TIC_AM_INCLUDES="" TIC_AM_LIBS="-lam2" fi case "$target_os" in solaris*) TIC_MACHINE_DEFINES="-DSOLARIS" TIC_THREAD_DEFINES="-D_REENTRANT" # on some systems static linking fails with -lpthread, # but need it or pthread_create will fail at runtime TIC_THREAD_LIBS="-lpthread" if test "no" = yes ; then ## Solaris threads (deprecated and no longer necessary) AC_CHECK_LIB(thread, thr_create, have_solthread=yes, have_solthread=no) TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lthread" fi TIC_DL_LIBS="-ldl" ;; linux*) TIC_MACHINE_DEFINES="-DLINUX" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lpthread" TIC_DL_LIBS="-ldl" ;; freebsd*) TIC_MACHINE_DEFINES="-DFREEBSD" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-pthread" TIC_DL_LIBS="" ;; cygwin*) TIC_MACHINE_DEFINES="-DCYGWIN" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lpthread" TIC_DL_LIBS="" ;; osf*) TIC_MACHINE_DEFINES="-DOSF" TIC_THREAD_DEFINES="-D_REENTRANT -D_THREAD_SAFE" TIC_THREAD_LIBS="-pthread -lpthreads" TIC_DL_LIBS="" ;; irix*) TIC_MACHINE_DEFINES="-DIRIX" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lpthread" TIC_DL_LIBS="" ;; hpux*) TIC_MACHINE_DEFINES="-DHPUX" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lpthread -lrt" TIC_DL_LIBS="" ;; darwin*) TIC_MACHINE_DEFINES="-DMACOSX" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="" TIC_DL_LIBS="" ;; aix*) TIC_MACHINE_DEFINES="-DAIX" TIC_THREAD_DEFINES="-D_REENTRANT -D_THREAD_SAFE" TIC_THREAD_LIBS="-lpthread" TIC_DL_LIBS="" ;; unicos*) TIC_MACHINE_DEFINES="-DUNICOS -DCRAY -DCRAYT3E" TIC_THREAD_DEFINES="-D_REENTRANT" TIC_THREAD_LIBS="-lpthread" TIC_DL_LIBS="" ;; *) AC_WARN(unknown OS - you may need to update the configure script) TIC_THREAD_DEFINES="-D_REENTRANT -D_THREAD_SAFE" OLDLIBS="$LIBS" LIBS="" AC_SEARCH_LIBS(pthread_create, pthread pthreads, , ) TIC_THREAD_LIBS="$LIBS" LIBS="$OLDLIBS" ;; esac ## verify POSIX threads seem to be working.. OLDLIBS="$LIBS" LIBS="$LIBS $TIC_THREAD_LIBS" AC_SEARCH_LIBS(pthread_create, pthread pthreads, have_pthread=yes, have_pthread=no) AC_SEARCH_LIBS(pthread_setconcurrency, pthread pthreads, AC_DEFINE(HAVE_PTHREAD_SETCONCURRENCY)) LIBS="$OLDLIBS" case "$target_os" in hpux*) # HPUX pthreads.h define pthread_create as a macro, so there's no external symbol have_pthread=yes AC_DEFINE(HAVE_PTHREAD_SETCONCURRENCY) esac if test "$have_pthread" = "no"; then AC_WARN(unable to detect pthreads libs - pthread functionality will be disabled) fi AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = yes) case "$target_os" in unicos*) # AMUDP not supported on Cray systems (due to 64-bit nature) # (actually is close to working on the Cray, # but we have a better shmem-based backend there anyhow) supported_amudp=no supported_ammpi=yes ;; *) supported_amudp=yes supported_ammpi=yes ;; esac if test $supported_amudp = yes; then # detect libraries necessary for udp-* backends OLDLIBS="$LIBS" LIBS="" AC_SEARCH_LIBS(ueth_init, ueth, have_ueth=yes, have_ueth=no) if test "$have_ueth" = "yes" ; then TIC_UETH_DEFINES="-DUETH" TIC_UDP_LIBS="$LIBS" have_amudp=yes else LIBS="" AC_SEARCH_LIBS(socket, socket, have_udp=yes, have_udp=no) AC_SEARCH_LIBS(gethostbyname, nsl, , have_udp=no) if test "$have_udp" = "yes" ; then TIC_UDP_LIBS="$LIBS" have_amudp=yes fi fi LIBS="$OLDLIBS" fi AC_SUBST(TIC_UDP_LIBS) AC_SUBST(TIC_UETH_DEFINES) AM_CONDITIONAL(USE_AMUDP, test "$supported_amudp$have_amudp" = yesyes) #--------------------------------------------------------------------------------------------------------------- # Configure MPI, if the AMMPI backends are supported # (In the future it would be nice to try and discover MPI setup automatically) if test $supported_ammpi = yes; then # user can explicitly configure MPI by setting MPI_CC, MPI_CFLAGS and MPI_LIBS have_mpi=yes # start by assuming they have it case "$target_os" in solaris*) if test "$enable_now" = "yes" ; then # this config is for AMMPI-over-MPI-over-AMNOW (Berkeley NOW cluster) # (not meant as a production platform) # Use Sun cc (man acc to see options) TI_ENV_DEFAULT(MPI_CC, /usr/sww/opt/SUNWspro/bin/cc) TI_ENV_DEFAULT(MPI_CFLAGS, -DAMMPI_COEXIST_WITH_AM \ -I/usr/now/am2/include -I/usr/now/include -I/usr/now/mpi/mpich/include \ -dalign -xarch=v8plusa -xchip=ultra -fast -xtarget=native -xO5 -w) TI_ENV_DEFAULT(MPI_LIBS, -lposix4 \ -L/usr/now/mpi/mpich/lib/solaris/am2 -L/usr/now/lib\ -L/usr/now/am2/lib -lmpi -lens -lglunix -lam2 -lthread\ -lsocket -lnsl) TI_ENV_DEFAULT(MPIRUN_CMD, glurun -%N %C) else # I don't have access to a Solaris cluster with MPI (other than NOW) # but these seem like sane defaults TI_ENV_DEFAULT(MPI_CC, mpicc) TI_ENV_DEFAULT(MPI_CFLAGS, $TCBUILD_CFLAGS_COMMON $TCBUILD_CFLAGS_OPTIMIZE) TI_ENV_DEFAULT(MPI_LIBS, ) TI_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) fi ;; linux*) TI_ENV_DEFAULT(MPI_CFLAGS, $TCBUILD_CFLAGS_COMMON $TCBUILD_CFLAGS_OPTIMIZE) TI_ENV_DEFAULT(MPI_LIBS, ) if test "$enable_millennium" = yes; then #mpi_loc=/usr/mill/bin # TCP/IP implementation # Millennium has screwy mpirun syntax to assure distinct nodes on TCP/IP p4 device #TI_ENV_DEFAULT(MPIRUN_CMD, ${mpi_loc}/mpirun -np %N -nodes %N %C) mpi_loc=/usr/mill/pkg/mpich-gm/bin # GM-based implementation TI_ENV_DEFAULT(MPIRUN_CMD, ${mpi_loc}/mpirun -np %N %C) TI_ENV_DEFAULT(MPI_CC, ${mpi_loc}/mpicc) else TI_ENV_DEFAULT(MPI_CC, mpicc) TI_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) fi ;; irix*) # use SGI native MPI library # user may need to do a "module load mpt" to make this work TI_ENV_DEFAULT(MPI_CC, cc $mipsabi) TI_ENV_DEFAULT(MPI_CFLAGS, -O2 -woff 1209 -common) TI_ENV_DEFAULT(MPI_LIBS, -lmpi) TI_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) ;; aix*) TI_ENV_DEFAULT(MPI_CC, mpcc) #TI_ENV_DEFAULT(MPI_CFLAGS, -O3 -qstrict -qmaxmem=8192) TI_ENV_DEFAULT(MPI_CFLAGS, -O3 -qstrict -qarch=pwr3 -qtune=pwr3 -qsmp=noauto -qmaxmem=8192) TI_ENV_DEFAULT(MPI_LIBS, [-Wl,-bbigtoc]) TI_ENV_DEFAULT(MPIRUN_CMD, poe %C -nodes %N -tasks_per_node 1 -rmpool 1 -euilib us -retry 1 -retrycount 10000) ;; unicos*) # Cray cc - need to enable private global vars and disable a silly warning # user may need to do a "module load mpt" to make this work TI_ENV_DEFAULT(MPI_CC, cc) TI_ENV_DEFAULT(MPI_CFLAGS, -O2 -htaskprivate -hnomessage=236) TI_ENV_DEFAULT(MPI_LIBS, $$LIBCM -lpthread) TI_ENV_DEFAULT(MPIRUN_CMD, mpprun -n %N %C) ;; osf*) TI_ENV_DEFAULT(MPI_CC, cc) TI_ENV_DEFAULT(MPI_CFLAGS, -O4 -tune host -msg_disable extrasemi -inline speed) TI_ENV_DEFAULT(MPI_LIBS, -lmpi -lelan -lrt) TI_ENV_DEFAULT(MPIRUN_CMD, prun -N %N %C) ;; *) # unknown OS - if user doesn't provide info, nothing we can do TI_ENV_DEFAULT(MPI_CC, mpicc) TI_ENV_DEFAULT(MPI_CFLAGS, -O) TI_ENV_DEFAULT(MPI_LIBS, ) TI_ENV_DEFAULT(MPIRUN_CMD, mpirun -np %N %C) if test "$MPI_CC" = ""; then AC_WARN(I don't know how to build MPI programs on your system) AC_WARN(consider using \$MPI_CC \$MPI_CFLAGS and \$MPI_LIBS to configure MPI support for your site if you want the mpi-* backends) have_mpi=no fi ;; esac # now run a basic test of the MPI configuration to make sure it works if test $have_mpi = yes; then AC_MSG_CHECKING(for working MPI configuration) # we need a clean slate here because MPI config may be totally different OLDCC="$CC" OLDCFLAGS="$CFLAGS" OLDCPPFLAGS="$CPPFLAGS" OLDLDFLAGS="$LDFLAGS" OLDLIBS="$LIBS" CC="$MPI_CC" CFLAGS="$MPI_CFLAGS" CPPFLAGS="" LDFLAGS="" LIBS="$MPI_LIBS" # we just try to link an MPI app - running MPI apps is a whole new can of worms AC_TRY_LINK( [ #include #include ], [ MPI_Init(NULL,NULL); MPI_Finalize(); ], [ mpi_test_worked=yes ], [ mpi_test_worked=no] ) CC="$OLDCC" CFLAGS="$OLDCFLAGS" CPPFLAGS="$OLDCPPFLAGS" LDFLAGS="$OLDLDFLAGS" LIBS="$OLDLIBS" if test "$mpi_test_worked" = yes ; then AC_MSG_RESULT(yes) if echo "$MPI_CFLAGS" | grep -- "-DAMMPI_COEXIST_WITH_AM" > /dev/null ; then # -DAMMPI_COEXIST_WITH_AM must be included whenever ammpi.h is compiled, or not at all MPI_DEFINES="$MPI_DEFINES -DAMMPI_COEXIST_WITH_AM" fi else AC_MSG_RESULT(no) AC_WARN(build test failed: I don't know how to build MPI programs on your system) AC_WARN(consider using \$MPI_CC \$MPI_CFLAGS and \$MPI_LIBS to configure MPI support for your site if you want the mpi-* backends) have_mpi=no fi fi fi AC_SUBST(MPI_CC) # compiler to be used to build AMMPI, and linker for AMMPI-based backends AC_SUBST(MPI_CFLAGS) # compiler flags (optimization, includes, etc) to be used with above compiler when building AMMPI AC_SUBST(MPI_LIBS) # libs and ldflags that must be used when linking AMMPI-based backend AC_SUBST(MPI_DEFINES) # preprocessor defs to be used for all client code that includes ammpi.h (not including AMMPI library itself) AC_SUBST(MPIRUN_CMD) # prototype command used by tcrun to run MPI programs AM_CONDITIONAL(USE_AMMPI, test "$have_mpi$supported_ammpi" = yesyes) #-------------------------------------------------------------------------------------------------------- AC_SUBST(TIC_MACHINE_DEFINES) AC_SUBST(TIC_THREAD_DEFINES) AC_SUBST(TIC_THREAD_LIBS) AC_SUBST(TIC_DL_LIBS) AC_SUBST(TIC_ENS_INCLUDES) AC_SUBST(TIC_ENS_LD_FLAGS) AC_SUBST(TIC_ENS_LIBS) AC_SUBST(TIC_GLUNIX_DEFINES) AC_SUBST(TIC_GLUNIX_INCLUDES) AC_SUBST(TIC_GLUNIX_LIBS) AC_SUBST(TIC_REXEC_DEFINES) AC_SUBST(TIC_AM_DEFINES) AC_SUBST(TIC_AM_LD_FLAGS) AC_SUBST(TIC_AM_LIBS) AC_SUBST(TIC_AM_INCLUDES) splitc=yes AM_CONDITIONAL(BACKEND_TIC,test "$splitc" = yes) #--------------------------------------------------------------------------------------------------------------- # Enable GASNet, if supported supported_gasnet=yes if test "$supported_gasnet" = yes; then TI_IF_ENABLED_WITH_AUTO(gasnet,Enable/disable GASNet backends, enable_gasnet=yes, enable_gasnet=no, enable_gasnet=yes) fi AM_CONDITIONAL(USE_GASNET, test "$supported_gasnet$enable_gasnet" = yesyes) if test "$supported_gasnet$enable_gasnet" = yesyes; then AC_CONFIG_SUBDIRS(runtime/gasnet) AC_DEFINE(USE_GASNET_TOOLS) GASNET_TOOLS_INCLUDES="-I\$(top_srcdir)/runtime/gasnet -I\$(top_builddir)/runtime/gasnet" # Enable GASNET_SEGMENT_EVERYTHING configuration we require #set -- $* --enable-segment-everything ac_configure_args="$ac_configure_args --enable-segment-everything" # TODO: Here we just take the user's word for it that these backends are available. # GASNet's configure script may actually reject some of these... TI_IF_ENABLED(elan, enable gasnet-elan-* backends, enable_gasnet_elan=yes) TI_IF_ENABLED(lapi, enable gasnet-lapi-* backends, enable_gasnet_lapi=yes) TI_IF_ENABLED(gm, enable gasnet-gm-* backends, enable_gasnet_gm=yes) if test "$enable_gasnet_gm" = yes; then TI_ENV_DEFAULT(GMRUN_CMD, %E/gasnetrun -np %N %C) AC_SUBST(GMRUN_CMD) fi TI_IF_ENABLED(mpi, enable gasnet-mpi-* backends, [ AC_MSG_WARN([The gasnet-mpi-* backends are for debugging purposes only.]) AC_MSG_WARN([They are expected to perform no better or worse than the mpi-cluster-* backends.]) enable_gasnet_mpi=yes]) fi AC_SUBST(GASNET_TOOLS_INCLUDES) ######################################################################## TI_IF_ENABLED(srs,use known directories for Berkeley SRS install, prefix='/project/cs/titanium/srs/${host_triplet}/${PACKAGE}/${VERSION}' datadir='/project/cs/titanium/srs/share/${PACKAGE}/${VERSION}' enable_sglobal_inference=yes) AM_CONDITIONAL(SRS,test "$enable_srs" = yes) TI_IF_ENABLED(debug-memory-usage,Track compiler's use (and misuse) of memory, AC_DEFINE(DEBUG_MEMORY_USAGE)) AM_CONDITIONAL(DEBUG_MEMORY_USAGE, test "$enable_debug_memory_usage" = yes) TI_IF_ENABLED(tc-gc,Use conservative garbage collector in compiler, AC_DEFINE(USE_TC_GC)) AM_CONDITIONAL(USE_TC_GC, test "$enable_tc_gc" = yes) TI_IF_ENABLED(aix-flex-hack,Workaround for spurious yytext symbols in AIX libc, AC_DEFINE(USE_AIX_FLEX_HACK) touch $(top_srcdir)/lexer.ll # ensure lexer.cc gets rebuilt ) AM_CONDITIONAL(USE_AIX_FLEX_HACK, test "$enable_aix_flex_hack" = yes) ######################################################################## # The PAPI library TI_IF_DISABLED(papi, Force disable of PAPI support, disable_papi=yes) if test "$disable_papi" != "yes" ; then AC_ARG_WITH(papi,TI_OPTION_HELP(with-papi=PATH,path to PAPI), papi="$withval") if test "$papi" = ""; then PAPI_INCLUDES="" LIBPAPI="-lpapi" else PAPI_INCLUDES="-I$papi/include" LIBPAPI="-L$papi/lib -lpapi" fi AC_SUBST(LIBPAPI) AC_SUBST(PAPI_INCLUDES) AC_ARG_WITH(pmapi,TI_OPTION_HELP(with-pmapi=PATH,path to pmapi library),pmapi="$withval") AC_LANG_SAVE AC_LANG_C OLDLIBS="$LIBS" case "$target_os" in aix*) LIBPAPI="$LIBPAPI -L$pmapi -lpmapi" ;; solaris*) LIBPAPI="$LIBPAPI -lcpc" ;; *) ;; esac TI_CHECK_LIB(papi, PAPI_lock, have_papi=yes, have_papi=no, [$PAPI_INCLUDES $LIBPAPI], ) if test "$have_papi" = "yes"; then AC_DEFINE(USE_PAPI) TI_CHECK_LIB(papi, PAPI_multiplex_init, AC_DEFINE(HAVE_PAPI_MULTIPLEX_INIT), , [$PAPI_INCLUDES $LIBPAPI], ) else LIBPAPI="" PAPI_INCLUDES="" fi LIBS="$OLDLIBS" AC_LANG_RESTORE fi ######################################################################## # The Stoptifu library AC_DEFINE(BUILD_OMEGA) AC_ARG_WITH(omega,TI_OPTION_HELP(with-omega=PATH,path to Omega libraries), omega="$withval") if test -z "$omega"; then omega="\$(srcdir)/runtime/omega/omega_lib/obj" fi AC_SUBST(omega) AC_ARG_WITH(OMEGA_INCLUDES, TI_OPTION_HELP(with-omega-headers=PATH,path to Omega headers), OMEGA_INCLUDES="$withval") if test -z "$OMEGA_INCLUDES"; then OMEGA_INCLUDES="-Iomega-include -I../omega-include" else OMEGA_INCLUDES="-I$OMEGA_INCLUDES" fi AC_SUBST(OMEGA_INCLUDES) AC_LANG_SAVE AC_LANG_CPLUSPLUS OLDLIBS="$LIBS" TI_CHECK_LIB(omega, Must_Be_Subset__FRC14Omega_RelationT0, LIBOMEGA="-L$omega -lomega", LIBOMEGA="", -L$omega, ) if test "x$LIBOMEGA" = "x"; then TI_CHECK_LIB(omega, _Z14Must_Be_SubsetRK14Omega_RelationS1_, LIBOMEGA="-L$omega -lomega", LIBOMEGA="", -L$omega, ) fi AM_CONDITIONAL(BUILD_OMEGA,test "x$LIBOMEGA" = "x") if test "x$LIBOMEGA" = "x"; then LIBOMEGA=runtime/omega-runtime/omega_lib/obj/libomega.a fi AC_SUBST(LIBOMEGA) LIBS="$OLDLIBS" AC_LANG_RESTORE ######################################################################## # Sglobal inference TI_IF_ENABLED_WITH_AUTO(sglobal-inference,Enable/disable sglobal inference, enable_sglobal_inference=yes, enable_sglobal_inference=no, enable_sglobal_inference=yes) if test "$enable_sglobal_inference" = yes ; then AC_DEFINE(USE_SGLOBAL_INFERENCE) fi AM_CONDITIONAL(USE_SGLOBAL_INFERENCE,test "$enable_sglobal_inference" = yes) ######################################################################## # Runtime Garbage Collection Support TI_IF_ENABLED_WITH_AUTO(runtime-gc,Enable/disable runtime garbage collection, setGcSupport=yes, setGcSupport=no, setGcSupport=auto) # Automatically detect whether to turn on the GC if test "$setGcSupport" = auto ; then AC_MSG_CHECKING(for garbage collector support) case "$target_os" in solaris* | linux-gnu* | cygwin* | irix* | hpux* | aix* | osf* | darwin* | freebsd*) setGcSupport=yes ;; *) setGcSupport=no ;; esac AC_MSG_RESULT($setGcSupport) fi # Set the proper values if test "$setGcSupport" = no ; then AC_DEFINE(USE_GC_NONE) TI_GC_CFLAGS="-DUSE_GC_NONE" else TI_GC_CFLAGS="-DLARGE_CONFIG" # optimize GC for large memory usage fi AM_CONDITIONAL(USE_GC_NONE,test "$setGcSupport" = no) AC_SUBST(TI_GC_CFLAGS) # Set other GC flags case "$target_os" in solaris*) GC_THREAD_CFLAGS='-DGC_SOLARIS_PTHREADS -D_REENTRANT' ;; aix*) GC_THREAD_CFLAGS='-D_REENTRANT -D_THREAD_SAFE' ;; *) GC_THREAD_CFLAGS='-D_REENTRANT' ;; esac AC_SUBST(GC_THREAD_CFLAGS) case "$target_os" in solaris*) GC_PTHREAD_CFLAGS='-DGC_SOLARIS_PTHREADS' ;; linux-gnu*) GC_PTHREAD_CFLAGS='-DGC_LINUX_THREADS' ;; cygwin*) GC_PTHREAD_CFLAGS='-DGC_WIN32_THREADS' ;; osf*) GC_PTHREAD_CFLAGS='-DGC_OSF1_THREADS' ;; irix*) GC_PTHREAD_CFLAGS='-DGC_IRIX_THREADS' ;; hpux*) GC_PTHREAD_CFLAGS='-DGC_HPUX_THREADS' ;; freebsd*) GC_PTHREAD_CFLAGS='-DGC_FREEBSD_THREADS' ;; aix*) GC_PTHREAD_CFLAGS='-DGC_AIX_THREADS' ;; #darwin*) GC_PTHREAD_CFLAGS='-DGC_MACOSX_THREADS' ;; # support to be added in gc6.2 darwin*) GC_PTHREAD_CFLAGS='-DUSE_GC_NONE' ;; *) GC_PTHREAD_CFLAGS='-DUSE_GC_NONE' ;; # threaded GC disabled by default on untested systems esac AC_SUBST(GC_PTHREAD_CFLAGS) # GC requires these to be included in all files that make thread calls TIC_THREAD_DEFINES="$TIC_THREAD_DEFINES $GC_THREAD_CFLAGS $GC_PTHREAD_CFLAGS" ######################################################################## # No Runtime Autobuild TI_IF_DISABLED(runtime-autobuild,No automatic building of runtime from top directory, setNoRuntimeAutobuild=yes) AM_CONDITIONAL(USE_NO_RUNTIME_AUTOBUILD,test "$setNoRuntimeAutobuild" = yes) case "$target_os" in cygwin*) EXESUFFIX='.exe' ;; *) EXESUFFIX='' ;; esac AC_SUBST(EXESUFFIX) ######################################################################## # Build the tlib-g library usetlibg=yes TI_IF_DISABLED(tlibg, Don't build tlib-g debug libraries, usetlibg=no) AM_CONDITIONAL(USE_TLIBG,test "$usetlibg" = yes) ######################################################################## AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING(for working iostreams) STDCXXLIB="" AC_TRY_LINK( [ #include ], [ std::cout << "hi" << std::endl; ], [ iostream_test_worked=yes ], [ iostream_test_worked=no] ) if test "$iostream_test_worked" = yes ; then AC_MSG_RESULT(yes) else OLDLIBS="$LIBS" LIBS="$LIBS -lstdc++" AC_TRY_LINK( [ #include ], [ std::cout << "hi" << std::endl; ], [], AC_MSG_ERROR("I can\'t figure out how to build a program that uses C++ iostreams") ) LIBS="$OLDLIBS" STDCXXLIB="$STDCXXLIB -lstdc++" AC_MSG_RESULT(yes: with -lstdc++) fi AC_SUBST(STDCXXLIB) AC_MSG_CHECKING(for long long output to ostreams) STDCXXLIB="" AC_TRY_LINK( [ #include ], [ std::cout << (long long) 9 << std::endl; ], [ ostream_long_long_test_worked=yes ], [ ostream_long_long_test_worked=no] ) if test "$ostream_long_long_test_worked" = yes ; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no: use long-long-support.h) AC_DEFINE(USE_LONG_LONG_SUPPORT_H) fi TI_TRY_CACHE_CHECK(for string::erase(), cxx_string_erase, [ #include ], [ std::string str; str.erase( 0, 1 ); ], AC_DEFINE(HAVE_STRING_ERASE)) TI_TRY_CACHE_CHECK(for binary adaptor templates, cxx_binary_adaptors, [ #include #include ], [ typedef std::queue< int, std::deque< int > > IntQueue; ], AC_DEFINE(HAVE_BINARY_ADAPTORS)) TI_TRY_CACHE_CHECK(for template specialization, cxx_template_specialization, [ template void foo(T); template <> void foo(int); ], [], AC_DEFINE(HAVE_TEMPLATE_SPECIALIZATION)) TI_TRY_CACHE_CHECK(for std/bastring.cc, cxx_std_bastring_cc, [ #include #include ], [], AC_DEFINE(HAVE_STD_BASTRING_CC)) TI_TRY_CACHE_CHECK(for implicit char_traits specialization, cxx_implicit_char_traits, [ #include ], [ typedef std::basic_string< unsigned short > ShortString; ShortString s; ], AC_DEFINE(IMPLICIT_CHAR_TRAITS)) TI_TRY_CACHE_CHECK(for ios::setstate(), cxx_ios_setstate, [ #include ], [ std::cin.setstate(std::ios::goodbit); ], AC_DEFINE(HAVE_IOS_SETSTATE)) AC_CHECK_HEADERS(hash_map ext/hash_map) AC_CHECK_HEADERS(sstream) # check for a certain broken sstream implementation (early GNU g++ release) AC_EGREP_HEADER([stream_len \+= 1;], sstream, AC_DEFINE(SSTREAM_BROKEN)) AC_CHECK_HEADERS(features.h sys/filio.h) # Check for alloca in C++ code TI_FUNC_ALLOCA AC_LANG_RESTORE # Check for alloca in C code AC_MSG_CHECKING(for alloca in C code) ALLOCA_IN_C="" AC_TRY_LINK([ /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif #endif ], [ char *p = (char *) alloca(10); ], [ alloca_in_c=yes ], [ alloca_in_c=no ]) if test "$alloca_in_c" = yes; then AC_MSG_RESULT(yes) ALLOCA_IN_C="1" else AC_MSG_RESULT(no) fi AC_SUBST(ALLOCA_IN_C) AC_CHECK_FUNCS(stat64 fstat64 open64 lseek64 llseek) TI_TRY_CACHE_CHECK(whether stat64 contains long longs, c_stat64_contains_long_long, [ #ifdef HAVE_FEATURES_H /* these get us 64-bit file declarations under several Unixen */ /* they must come before the first include of features.h */ #define _LARGEFILE64_SOURCE 1 #define _LARGEFILE_SOURCE 1 # include #endif #ifdef USE_RUNTIME_INTTYPES_H # include #endif #include #include #include long long foo() { struct stat64 stats; return stats.st_size; } ], [ ], AC_DEFINE(STAT64_CONTAINS_LONG_LONGS)) # -lm should only live in LIBM, and only if we have it (not in LIBS) OLDLIBS="$LIBS" # sin should be in everyone's libm if they've got one. AC_CHECK_LIB(m, sin, LIBM="-lm", LIBM="") AC_SUBST(LIBM) AC_SEARCH_LIBS(drem, m, AC_DEFINE(HAVE_DREM)) AC_SEARCH_LIBS(remainder, m, AC_DEFINE(HAVE_REMAINDER)) AC_SEARCH_LIBS(fmod, m, AC_DEFINE(HAVE_FMOD)) LIBS="$OLDLIBS" AC_CHECK_FUNCS(setenv putenv) ######################################################################## # hardware support for byte-swapping TI_TRY_CACHE_LINK(for byte-swapping macros, cc_has_swabn, [#include ], [__swab16(0); __swab32(0); __swab64(0);], AC_DEFINE(HAVE_SWABN_MACROS)) ######################################################################## case "$target_cpu" in sparc) ARCH_CFLAGS="-Wa,-xarch=v8plus" ;; esac AC_SUBST(ARCH_CFLAGS) TI_SUBST_FILE(gc_common_mk,runtime/gc-build/common.mk) ######################################################################## # Try to discover the C compiler's inline modifier inlinemod="" case "$tc_cv_cc_family" in Compaq) # force __inline on Compaq C, because it's the most effective AC_DEFINE(CC_INLINE_MODIFIER, __inline) inlinemod=__inline ;; esac if test "$inlinemod" = ""; then TI_TRY_CACHE_CHECK(for inline modifier, cc_modinline, [inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, inline) inlinemod=inline) fi if test "$inlinemod" = ""; then TI_TRY_CACHE_CHECK(for __inline__ modifier, cc_mod__inline__, [__inline__ int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, __inline__) inlinemod=__inline__) fi if test "$inlinemod" = ""; then TI_TRY_CACHE_CHECK(for __inline modifier, cc_mod__inline, [__inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, __inline) inlinemod=__inline) fi if test "$inlinemod" = ""; then TI_TRY_CACHE_CHECK(for _inline modifier, cc_mod_inline, [_inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, _inline) inlinemod=_inline) fi if test "$inlinemod" = ""; then TI_TRY_CACHE_CHECK(for _Inline modifier, cc_mod_Inline, [_Inline int dummy() { return 1; }], [], AC_DEFINE(CC_INLINE_MODIFIER, _Inline) inlinemod=_Inline) fi if test "$inlinemod" != ""; then AC_MSG_CHECKING(whether static $inlinemod works) AC_TRY_COMPILE([static $inlinemod int dummy() { return 1; }], [], [AC_DEFINE(STATIC_INLINE_WORKS) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) fi # Runtime Var Arrays TI_IF_ENABLED_WITH_AUTO(runtime-vararray, Use stack arrays of variable size in runtime code, AC_DEFINE(USE_RUNTIME_VARARRAY), , TI_TRY_CACHE_CHECK(for variable stack arrays, cc_vararray_mod, [void dummy(int x) { char y[x]; }], [], AC_DEFINE(USE_RUNTIME_VARARRAY))) # Runtime inttypes.h TI_IF_ENABLED_WITH_AUTO(runtime-inttypes-h, Use inttypes.h, AC_DEFINE(USE_RUNTIME_INTTYPES_H), [], [AC_CHECK_HEADER(inttypes.h, AC_DEFINE(USE_RUNTIME_INTTYPES_H))]) # Check if using the Tera C compiler TI_TRY_CACHE_CHECK(for Tera C compiler, cc_is_tera_cc, [ #ifndef __TERA__ # error Not the Tera C compiler #endif ]) # Check if using the GNU C for Cray compiler TI_TRY_CACHE_CHECK(for GNU C compiler for the Cray, cc_is_cray_gnu_cc, [ #if !(defined(__CRAY__) && defined(__GNUC__)) # error Not the Cray GNU C compiler #endif ], [], AC_DEFINE(USE_RUNTIME_CRAY_GNU_C)) AM_CONDITIONAL(RUNTIME_CC_IS_CRAY_GNU_CC,test $tc_cv_cc_is_cray_gnu_cc = yes) # Check if using the Cray C compiler TI_TRY_CACHE_CHECK(for Cray T3E C compiler, cc_is_cray_t3e_cc, [ #if !(defined(_CRAY) && defined(_CRAYT3E)) # error Not the Cray T3E C compiler #endif ], [], AC_DEFINE(USE_RUNTIME_CRAY_T3E_C) ) AM_CONDITIONAL(RUNTIME_CC_IS_CRAY_T3E_CC,test $tc_cv_cc_is_cray_t3e_cc = yes) # Use 64-bit point coord on Cray CC (workaround for PR291, see c-types/CtPointInstance.cc) if test $tc_cv_cc_is_cray_t3e_cc = yes ; then AC_DEFINE(USE_64BIT_POINTS) fi # Check if MAXPATHLEN is defined in sys/param.h TI_TRY_CACHE_CHECK(for MAXPATHLEN in sys/param.h, cc_sys_param_has_mpl, [ #include int dummy = MAXPATHLEN; ], [], AC_DEFINE(USE_RUNTIME_SYS_PARAM_H_MAXPATHLEN)) # Check for usleep TI_TRY_CACHE_CHECK(for usleep(), cc_has_usleep, [ #include ], [ usleep(500); ], AC_SEARCH_LIBS(usleep, posix4, AC_DEFINE(HAVE_USLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for nanosleep TI_TRY_CACHE_CHECK(for nanosleep(), cc_has_nanosleep, [ #include #include ], [ struct timespec tm, tmremaining; tm.tv_sec =1; tm.tv_nsec = 1000000; nanosleep(&tm, &tmremaining); ], AC_SEARCH_LIBS(nanosleep, posix4, AC_DEFINE(HAVE_NANOSLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for nsleep TI_TRY_CACHE_CHECK(for nsleep(), cc_has_nsleep, [ #include #include ], [ struct timespec tm, tmremaining; tm.tv_sec =1; tm.tv_nsec = 1000000; nsleep(&tm, &tmremaining); ], AC_SEARCH_LIBS(nsleep, posix4, AC_DEFINE(HAVE_NSLEEP), AC_MSG_RESULT(entry point not found - disabled))) # Check for sched_yield TI_TRY_CACHE_CHECK(for sched_yield(), cc_has_sched_yield, [ #include ], [ sched_yield(); ], AC_SEARCH_LIBS(sched_yield, posix4, AC_DEFINE(HAVE_SCHED_YIELD), AC_MSG_RESULT(entry point not found - disabled))) if test $tc_cv_cc_sys_param_has_mpl = no ; then # Check if PATHSIZE is defined in sys/param.h TI_TRY_CACHE_CHECK(for PATHSIZE in sys/param.h, cc_sys_param_has_ps, [ #include int dummy = PATHSIZE; ], [], AC_DEFINE(USE_RUNTIME_SYS_PARAM_H_PATHSIZE)) fi # Check for __builtin_expect (GCC 3.0) TI_TRY_CACHE_LINK(for __builtin_expect, cc_has_builtin_expect, [int x;], [if (__builtin_expect(x,1)) return 1;], AC_DEFINE(HAVE_BUILTIN_EXPECT)) TI_TRY_CACHE_LINK(for __func__, cc_has_func, [], [const char* p = __func__;], AC_DEFINE(HAVE_FUNC)) ######################################################################## # hunt for 16-, 32-, and 64-bit integer types # Some known sizes if test $tc_cv_cc_is_tera_cc = yes ; then # The Tera cross_short=2 cross_int=8 cross_long=8 cross_long_long=8 cross_void_P=8 else # Unknown cross_short=0 cross_int=0 cross_long=0 cross_long_long=0 cross_void_P=0 fi # Check sizes AC_CHECK_SIZEOF(short, $cross_short) AC_CHECK_SIZEOF(int, $cross_int) AC_CHECK_SIZEOF(long, $cross_long) AC_CHECK_SIZEOF(long long, $cross_long_long) AC_CHECK_SIZEOF(void *, $cross_void_P) AC_CHECK_HEADERS(inttypes.h) ######################################################################## ## tcbuild's cleanup script will use termcap if perl supports it AC_MSG_CHECKING(for perl termcap support) if $PERL -MTerm::Cap -e 'Tgetent Term::Cap { TERM => xterm, OSPEED => 9600 };'; then perl_termcap=yes else perl_termcap=no fi AM_CONDITIONAL(HAVE_PERL_TERMCAP, test "$perl_termcap" = yes) AC_MSG_RESULT($perl_termcap) # complete sp2 setup case "$target_os" in aix*) aix=yes AC_SUBST(SP2_LD_LIBS) AC_SUBST(SP2_DEFINES) AC_SUBST(SP2_INCLUDES) AC_SUBST(SP2_LD_FLAGS) SP2_LD_LIBS="-ltitanium-sp2 -lswclock" # AIX linker doesn't allow large enough TOC by default to accomodate # tc and most applications tcLDFLAGS="$tcLDFLAGS -Wl,-bbigtoc" LDFLAGS="$LDFLAGS -Wl,-bbigtoc" if test x"$ac_cv_sizeof_void_p" = x4; then # set the data segment size to the largest permitted size for 32-bit apps (2GB) # (don't set it for 64-bit apps because it would truncate addressable space) LDFLAGS="$LDFLAGS -Wl,-bmaxdata:0x80000000" SP3_CC="mpcc_r -qstrict" else SP3_CC="mpcc_r -q64 -qstrict" fi AC_SUBST(SP3_CC) # not sure that the TI_FAMILY_CACHE_CHECK thing works....autoconf gives it # /lib/cpp, not $(CC), and /lib/cpp usually doesn't carry machine-specific # macros if test "$tc_cv_cc_family" = "unknown"; then tc_cv_cc_family=sp2 fi if test "$tc_cv_cxx_family" = "unknown"; then tc_cv_cxx_family=sp2 fi ;; irix*) tcLDFLAGS="$tcLDFLAGS -LD_LAYOUT:lgot_buffer=20" LDFLAGS="$LDFLAGS -LD_LAYOUT:lgot_buffer=20" ;; esac AC_SUBST(tcLDFLAGS) AC_SUBST(LDFLAGS) ######### handle --with-gas switch if test "$with_gas" = yes; then AC_MSG_CHECKING(for GNU assembler) if test "$tc_cv_cxx_family" = "GNU"; then GASPATH=`which gas` if test -x $GASPATH; then AC_MSG_RESULT($GASPATH) GASDIR=`dirname $GASPATH` CXXFLAGS="$CXXFLAGS -B$GASDIR/g" else AC_MSG_RESULT(not found) fi else AC_MSG_RESULT(don't know how to get $tc_cv_cxx_family to use gas) fi fi ######################################################################## ## ## Backends ## ## I would love to tweak TI_CHECK_BACKEND so that it ## automatically takes care of the AM_CONDITIONAL for you. ## Unfortunately, that does not actually work due to limitations of ## automake-1.4, which requires all AM_CONDITIONAL declarations ## to be directly visible in the configure.in script. Phooey. ## AC_SUBST(BACKENDS) ## workstations and workstation clusters TI_CHECK_BACKEND(sequential, true) AM_CONDITIONAL(BACKEND_SEQUENTIAL, test "$enable_sequential" = yes) TI_CHECK_BACKEND(smp, test "$have_pthread" = yes) AM_CONDITIONAL(BACKEND_SMP, test "$enable_smp" = yes) TI_CHECK_BACKEND(udp-cluster-uniprocess, test "$supported_amudp$have_amudp" = yesyes) AM_CONDITIONAL(BACKEND_UDP_CLUSTER_UNIPROCESS, test "$enable_udp_cluster_uniprocess" = yes) TI_CHECK_BACKEND(udp-cluster-smp, test "$supported_amudp$have_amudp$have_pthread" = yesyesyes) AM_CONDITIONAL(BACKEND_UDP_CLUSTER_SMP, test "$enable_udp_cluster_smp" = yes) TI_CHECK_BACKEND(mpi-cluster-uniprocess, test "$have_mpi$supported_ammpi" = yesyes) AM_CONDITIONAL(BACKEND_MPI_CLUSTER_UNIPROCESS, test "$enable_mpi_cluster_uniprocess" = yes) TI_CHECK_BACKEND(mpi-cluster-smp, test "$have_mpi$supported_ammpi$have_pthread" = yesyesyes) AM_CONDITIONAL(BACKEND_MPI_CLUSTER_SMP, test "$enable_mpi_cluster_smp" = yes) # the mill-* backends are broken #TI_CHECK_BACKEND(mill-uniprocess, #test "$have_libens$have_pthread$have_rexec" = yesyesyes) #AM_CONDITIONAL(BACKEND_MILL_UNIPROCESS, test "$enable_mill_uniprocess" = yes) # #TI_CHECK_BACKEND(mill-smp, #test "$have_libens$have_pthread$have_rexec" = yesyesyes) #AM_CONDITIONAL(BACKEND_MILL_SMP, test "$enable_mill_smp" = yes) # #TI_CHECK_BACKEND(mill-cluster-uniprocess, #test "$have_libamvia$enable_mill_uniprocess" = yesyes) #AM_CONDITIONAL(BACKEND_MILL_CLUSTER_UNIPROCESS, test "$enable_mill_cluster_uniprocess" = yes) # #TI_CHECK_BACKEND(mill-cluster-smp, #test "$have_libamvia$enable_mill_smp" = yesyes) #AM_CONDITIONAL(BACKEND_MILL_CLUSTER_SMP, test "$enable_mill_cluster_smp" = yes) TI_CHECK_BACKEND(now-uniprocess, test "$have_libens$have_pthread$have_libglunix" = yesyesyes) AM_CONDITIONAL(BACKEND_NOW_UNIPROCESS, test "$enable_now_uniprocess" = yes) TI_CHECK_BACKEND(now-cluster-uniprocess, test "$have_libam2$enable_now_uniprocess" = yesyes) AM_CONDITIONAL(BACKEND_NOW_CLUSTER_UNIPROCESS, test "$enable_now_cluster_uniprocess" = yes) ## supercomputers TI_CHECK_BACKEND(tera-thread, test yes = "$tc_cv_cc_is_tera_cc") AM_CONDITIONAL(BACKEND_TERA_THREAD, test "$enable_tera_thread" = yes) dnl TI_CHECK_BACKEND(sp2, dnl test "$aix" = yes) TI_CHECK_BACKEND(sp2, false) AM_CONDITIONAL(BACKEND_SP2, test "$enable_sp2" = yes) dnl TI_CHECK_BACKEND(sp2clump, dnl test "$aix" = yes) TI_CHECK_BACKEND(sp2clump, false) AM_CONDITIONAL(BACKEND_SP2CLUMP, test "$enable_sp2clump" = yes) TI_CHECK_BACKEND(sp3, test "$aix$have_pthread$have_mpcc_r" = yesyesyes) AM_CONDITIONAL(BACKEND_SP3, test "$enable_sp3" = yes) TI_CHECK_BACKEND(cray-t3e, test yes = "$tc_cv_cc_is_cray_gnu_cc" -o yes = "$tc_cv_cc_is_cray_t3e_cc") AM_CONDITIONAL(BACKEND_CRAY_T3E, test "$enable_cray_t3e" = yes) # GASNet backends TI_CHECK_BACKEND(gasnet-elan-uni, test "$enable_gasnet_elan" = yes) AM_CONDITIONAL(BACKEND_GASNET_ELAN_UNI, test "$enable_gasnet_elan" = yes) TI_CHECK_BACKEND(gasnet-elan-smp, test "$enable_gasnet_elan$have_pthread" = yesyes) AM_CONDITIONAL(BACKEND_GASNET_ELAN_SMP, test "$enable_gasnet_elan$have_pthread" = yesyes) TI_CHECK_BACKEND(gasnet-lapi-uni, test "$enable_gasnet_lapi" = yes) AM_CONDITIONAL(BACKEND_GASNET_LAPI_UNI, test "$enable_gasnet_lapi" = yes) TI_CHECK_BACKEND(gasnet-lapi-smp, test "$enable_gasnet_lapi$have_pthread" = yesyes) AM_CONDITIONAL(BACKEND_GASNET_LAPI_SMP, test "$enable_gasnet_lapi$have_pthread" = yesyes) TI_CHECK_BACKEND(gasnet-gm-uni, test "$enable_gasnet_gm" = yes) AM_CONDITIONAL(BACKEND_GASNET_GM_UNI, test "$enable_gasnet_gm" = yes) TI_CHECK_BACKEND(gasnet-gm-smp, test "$enable_gasnet_gm$have_pthread" = yesyes) AM_CONDITIONAL(BACKEND_GASNET_GM_SMP, test "$enable_gasnet_gm$have_pthread" = yesyes) TI_CHECK_BACKEND(gasnet-mpi-uni, test "$enable_gasnet_mpi" = yes) AM_CONDITIONAL(BACKEND_GASNET_MPI_UNI, test "$enable_gasnet_mpi" = yes) TI_CHECK_BACKEND(gasnet-mpi-smp, test "$enable_gasnet_mpi$have_pthread" = yesyes) AM_CONDITIONAL(BACKEND_GASNET_MPI_SMP, test "$enable_gasnet_mpi$have_pthread" = yesyes) ######################################################################## ## ## Final Output ## TI_SAVE_AUTOCONF_ENV() TI_FIX_EXEC(cc-wrapper) TI_FIX_EXEC(runtime/gp-trace/gp-tracer) TI_FIX_EXEC(tcbuild/cleanup) TI_FIX_EXEC(tcbuild/makedepend) TI_FIX_EXEC(tcbuild/refresh-cache) TI_FIX_EXEC(tcbuild/tcbuild) TI_FIX_EXEC(tcbuild/tcbuild-demangler) TI_FIX_EXEC(tcbuild/tcrun) TI_FIX_EXEC(version) TI_FIX_EXEC(ex/TestSuite/bin/abort_norm) TI_FIX_EXEC(ex/TestSuite/bin/domain1_tester) TI_FIX_EXEC(ex/TestSuite/bin/error_tester) TI_FIX_EXEC(ex/TestSuite/bin/execute_tester) TI_FIX_EXEC(ex/TestSuite/bin/ignore_exitval) TI_FIX_EXEC(ex/TestSuite/bin/run_n_times) TI_FIX_EXEC(ex/TestSuite/bin/sort_stdout_err_norm) TI_FIX_EXEC(ex/TestSuite/bin/stats_norm) TI_FIX_EXEC(ex/TestSuite/bin/stoptifu_norm) TI_FIX_EXEC(ex/TestSuite/bin/stdout_err_norm) TI_FIX_EXEC(ex/TestSuite/bin/stdout_err_tester) TI_FIX_EXEC(ex/TestSuite/bin/stdout_err_test_exe) TI_FIX_EXEC(ex/TestSuite/bin/stdout_err_vnn_norm) TI_FIX_EXEC(ex/TestSuite/bin/tc_stats_tester) TI_FIX_EXEC(ex/TestSuite/bin/tc_stoptifu_tester) TI_FIX_EXEC(ex/TestSuite/bin/testDriver) TI_FIX_EXEC(ex/TestSuite/bin/ti_err_exe_tester) TI_FIX_EXEC(ex/TestSuite/bin/watchdog) AC_OUTPUT( cc-wrapper cc-wrapper.mk Makefile c-types/Makefile code-files/Makefile config-aux/Makefile ex/Makefile ex/ok/Makefile ex/TestSuite/Makefile stoptifu/Makefile ex/TestSuite/bin/Makefile ex/TestSuite/bin/abort_norm ex/TestSuite/bin/domain1_tester ex/TestSuite/bin/error_tester ex/TestSuite/bin/execute_tester ex/TestSuite/bin/ignore_exitval ex/TestSuite/bin/run_n_times ex/TestSuite/bin/sort_stdout_err_norm ex/TestSuite/bin/stats_norm ex/TestSuite/bin/stoptifu_norm ex/TestSuite/bin/stdout_err_norm ex/TestSuite/bin/stdout_err_tester ex/TestSuite/bin/stdout_err_test_exe ex/TestSuite/bin/stdout_err_vnn_norm ex/TestSuite/bin/tc_stats_tester ex/TestSuite/bin/tc_stoptifu_tester ex/TestSuite/bin/testDriver ex/TestSuite/bin/ti_err_exe_tester ex/TestSuite/bin/watchdog runtime/Makefile runtime/amlapi/Makefile runtime/amudp/Makefile runtime/amudp/src/Makefile.titanium runtime/ammpi/Makefile runtime/ammpi/src/Makefile.titanium runtime/backend/Makefile runtime/backend/common/Makefile runtime/backend/cray-t3e/Makefile runtime/backend/cray-t3e/cray-t3e.mk runtime/backend/gasnet-elan-smp/Makefile runtime/backend/gasnet-elan-smp/gasnet-elan-smp.mk runtime/backend/gasnet-elan-uni/Makefile runtime/backend/gasnet-elan-uni/gasnet-elan-uni.mk runtime/backend/gasnet-lapi-smp/Makefile runtime/backend/gasnet-lapi-smp/gasnet-lapi-smp.mk runtime/backend/gasnet-lapi-uni/Makefile runtime/backend/gasnet-lapi-uni/gasnet-lapi-uni.mk runtime/backend/gasnet-gm-smp/Makefile runtime/backend/gasnet-gm-smp/gasnet-gm-smp.mk runtime/backend/gasnet-gm-uni/Makefile runtime/backend/gasnet-gm-uni/gasnet-gm-uni.mk runtime/backend/gasnet-mpi-smp/Makefile runtime/backend/gasnet-mpi-smp/gasnet-mpi-smp.mk runtime/backend/gasnet-mpi-uni/Makefile runtime/backend/gasnet-mpi-uni/gasnet-mpi-uni.mk runtime/backend/mill-cluster-smp/Makefile runtime/backend/mill-cluster-smp/mill-cluster-smp.mk runtime/backend/mill-cluster-uniprocess/Makefile runtime/backend/mill-cluster-uniprocess/mill-cluster-uniprocess.mk runtime/backend/mill-smp/Makefile runtime/backend/mill-smp/mill-smp.mk runtime/backend/mill-uniprocess/Makefile runtime/backend/mill-uniprocess/mill-uniprocess.mk runtime/backend/mpi-cluster-smp/Makefile runtime/backend/mpi-cluster-smp/mpi-cluster-smp.mk runtime/backend/mpi-cluster-uniprocess/Makefile runtime/backend/mpi-cluster-uniprocess/mpi-cluster-uniprocess.mk runtime/backend/now-cluster-uniprocess/Makefile runtime/backend/now-cluster-uniprocess/now-cluster-uniprocess.mk runtime/backend/now-uniprocess/Makefile runtime/backend/now-uniprocess/now-uniprocess.mk runtime/backend/sequential/Makefile runtime/backend/sequential/sequential.mk runtime/backend/smp/Makefile runtime/backend/smp/smp.mk runtime/backend/sp2/Makefile runtime/backend/sp2/sp2.mk runtime/backend/sp2clump/Makefile runtime/backend/sp2clump/sp2clump.mk runtime/backend/sp3/Makefile runtime/backend/sp3/sp3.mk runtime/backend/tera-thread/Makefile runtime/backend/tera-thread/tera-thread.mk runtime/backend/udp-cluster-smp/Makefile runtime/backend/udp-cluster-smp/udp-cluster-smp.mk runtime/backend/udp-cluster-uniprocess/Makefile runtime/backend/udp-cluster-uniprocess/udp-cluster-uniprocess.mk runtime/fp-utils/Makefile runtime/gc-build/Makefile runtime/gc-build/common.mk runtime/gc-build/include/Makefile runtime/gc-build/include/private/Makefile runtime/gc-build/pthread/Makefile runtime/gc-build/uniproc/Makefile runtime/gp-trace/Makefile runtime/gp-trace/gp-tracer runtime/native/Makefile qual-infer/Makefile qual-infer/cqual/Makefile qual-infer/cqual/libcompat/Makefile qual-infer/local/Makefile qual-infer/sharing/Makefile qual-infer/sharing/early/Makefile qual-infer/sharing/late/Makefile tcbuild/Makefile tcbuild/cleanup tcbuild/config.mk tcbuild/makedepend tcbuild/refresh-cache tcbuild/tcbuild tcbuild/tcbuild-demangler tcbuild/tcbuild.mk tcbuild/tcrun templates/Makefile tlib/Makefile tlib/tlib.mk tlib/java/Makefile tlib/java/io/Makefile tlib/java/lang/Makefile tlib/java/util/Makefile tlib/ti/Makefile tlib/ti/domains/Makefile tlib/ti/internal/Makefile tlib/ti/lang/Makefile tlib/ti/io/Makefile version , TI_FIX_EXEC_OUTPUT(), TI_FIX_EXEC_SETUP() )