# -*- 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]) AC_ARG_ENABLE(distcc, [ --enable-distcc whether or not to enable distributed compilation], enable_distcc=$enableval, enable_distcc=no) echo -n "checking for distributated build... " if test x$enable_distcc = xno; then CFACC=${DRIVER_DIR}cfa echo "no" else tools="$(readlink -m $ac_confdir/)/../tools/build" config=$(basename $(readlink -f .)) echo "$tools/distcc_hash $config" CFADIR_HASH=$($tools/distcc_hash $config) CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa" echo "yes (hash=${CFADIR_HASH})" fi CFACPP=${DRIVER_DIR}cfa-cpp LOCAL_CFACC=${DRIVER_DIR}cfa LOCAL_CC1=${DRIVER_DIR}cc1 AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes]) AC_SUBST(CFACC) AC_SUBST(CFACPP) AC_SUBST(LOCAL_CFACC) AC_SUBST(LOCAL_CC1) AC_SUBST(CFADIR_HASH) 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".)