# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca]) AC_CONFIG_AUX_DIR([automake]) AC_CONFIG_MACRO_DIRS([automake]) AM_SILENT_RULES([yes]) m4_include([../automake/cfa.m4]) AM_INIT_AUTOMAKE([subdir-objects]) # don't use the default CFLAGS as they unconditonnaly add -O2 : ${CFLAGS=""} # define this to override AR_FLAGS="cr" # Allow program name tansformation # will fill program_transform_name with appropriate sed regex AC_ARG_PROGRAM AC_ARG_VAR(ARCHITECTURE, [The architecture to use when building libcfa]) AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)]) AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory]) AC_ARG_VAR(CFA_VERSION, [The long version of cfa]) CFACC=${DRIVER_DIR}cfa CFACPP=${DRIVER_DIR}cfa-cpp AC_SUBST(CFACC) AC_SUBST(CFACPP) AC_SUBST(CFA_VERSION) #============================================================================== #Handle specific flags case $ARCHITECTURE in "x64" ) ARCH_FLAGS="-m64";; "x86" ) ARCH_FLAGS="-m32";; "arm" ) ARCH_FLAGS="";; esac AC_SUBST(ARCH_FLAGS) case $CONFIGURATION in "debug" ) CONFIG_CFLAGS="-Og -g" CONFIG_CFAFLAGS="-debug" CONFIG_BUILDLIB="yes" ;; "nodebug" ) CONFIG_CFLAGS="-O3 -s" CONFIG_CFAFLAGS="-nodebug" CONFIG_BUILDLIB="yes" ;; "nolib" ) CONFIG_CFLAGS="-O3 -s" CONFIG_CFAFLAGS="-nolib" CONFIG_BUILDLIB="no" ;; "profile" ) CONFIG_CFLAGS="-O3 -g -fno-omit-frame-pointer" CONFIG_CFAFLAGS="-nodebug" CONFIG_BUILDLIB="yes" ;; *) AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION') ;; esac CONFIG_CFAFLAGS="${CONFIG_CFAFLAGS} ${CFAFLAGS}" AC_SUBST(CONFIG_CFLAGS) AC_SUBST(CONFIG_CFAFLAGS) AC_SUBST(CONFIG_BUILDLIB) AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"]) #============================================================================== #Trasforming cc1 will break compilation M4CFA_PROGRAM_NAME #============================================================================== # Installation paths M4CFA_PARSE_PREFIX # Checks for programs. LT_INIT AC_PROG_CXX AC_PROG_CC AM_PROG_AS AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_MAKE_SET AC_CONFIG_FILES([ Makefile src/Makefile prelude/Makefile ]) AC_OUTPUT() # Final text AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".)