source: libcfa/configure.ac @ d65f92c

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since d65f92c was d65f92c, checked in by Thierry Delisle <tdelisle@…>, 5 years ago

Tests almost work, the only issue left is using -E and -CFA together

  • Property mode set to 100644
File size: 3.2 KB
RevLine 
[c59712e]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.68])
5AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca])
[38d12e7]6AC_CONFIG_AUX_DIR([automake])
7AC_CONFIG_MACRO_DIRS([automake])
[575a6e5]8AM_SILENT_RULES([yes])
[c59712e]9
[37fe352]10m4_include([../automake/cfa.m4])
11
[c59712e]12AM_INIT_AUTOMAKE([subdir-objects])
13
[575a6e5]14# don't use the default CFLAGS as they unconditonnaly add -O2
15: ${CFLAGS=""}
16
[2b3d6ff]17# define this to override
18AR_FLAGS="cr"
19
[c59712e]20# Allow program name tansformation
21# will fill program_transform_name with appropriate sed regex
22AC_ARG_PROGRAM
23
[37fe352]24AC_ARG_VAR(ARCHITECTURE,  [The architecture  to use when building libcfa])
[c59712e]25AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)])
[ff1e0f38]26AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory])
[c6bbcdb]27AC_ARG_VAR(CFA_VERSION, [The long version of cfa])
[ff1e0f38]28
[bbfd0e0]29AC_ARG_ENABLE(distcc,
30        [  --enable-distcc     whether or not to enable distributed compilation],
31        enable_distcc=$enableval, enable_distcc=no)
32
33echo -n "checking for distributated build... "
34if test x$enable_distcc = xno; then
35        CFACC=${DRIVER_DIR}cfa
36        PRELUDEFLAG='-in-tree'
37        echo "no"
38else
[d65f92c]39        tools="$(readlink -m $ac_confdir/)/../tools/build"
40        config=$(basename $(readlink -f .))
41        echo "$tools/distcc_hash $config"
42        CFADIR_HASH=$($tools/distcc_hash $config)
[14347ac]43        CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
[bbfd0e0]44        PRELUDEFLAG='-dist-tree'
45        echo "yes (hash=${CFADIR_HASH})"
46fi
[14347ac]47CFACPP=${DRIVER_DIR}cfa-cpp
[bbfd0e0]48LOCAL_CFACC=${DRIVER_DIR}cfa
49
50AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])
51
[ff1e0f38]52AC_SUBST(CFACC)
53AC_SUBST(CFACPP)
[bbfd0e0]54AC_SUBST(LOCAL_CFACC)
55AC_SUBST(CFADIR_HASH)
[c6bbcdb]56AC_SUBST(CFA_VERSION)
[bbfd0e0]57AC_SUBST(PRELUDEFLAG)
[ff1e0f38]58
[575a6e5]59#==============================================================================
60#Handle specific flags
[37fe352]61case $ARCHITECTURE in
62        "x64"        ) ARCH_FLAGS="-m64";;
63        "x86"        ) ARCH_FLAGS="-m32";;
64        "arm"        ) ARCH_FLAGS="";;
65esac
[ff1e0f38]66
[37fe352]67AC_SUBST(ARCH_FLAGS)
[ff1e0f38]68
[575a6e5]69case $CONFIGURATION in
70        "debug"   )
[3fcbdca1]71                CONFIG_CFLAGS="-Og -g"
[575a6e5]72                CONFIG_CFAFLAGS="-debug"
[e523b07]73                CONFIG_BUILDLIB="yes"
[575a6e5]74        ;;
75        "nodebug" )
[3fcbdca1]76                CONFIG_CFLAGS="-O3 -s"
[575a6e5]77                CONFIG_CFAFLAGS="-nodebug"
[e523b07]78                CONFIG_BUILDLIB="yes"
[575a6e5]79        ;;
80        "nolib"   )
[3fcbdca1]81                CONFIG_CFLAGS="-O3 -s"
[c9e640e]82                CONFIG_CFAFLAGS="-nolib"
[e523b07]83                CONFIG_BUILDLIB="no"
[575a6e5]84        ;;
[3fcbdca1]85        "profile" )
86                CONFIG_CFLAGS="-O3 -g -fno-omit-frame-pointer"
87                CONFIG_CFAFLAGS="-nodebug"
88                CONFIG_BUILDLIB="yes"
89        ;;
[d119b984]90        *)
91        AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION')
92        ;;
[575a6e5]93esac
94
[13363f4]95CONFIG_CFAFLAGS="${CONFIG_CFAFLAGS} ${CFAFLAGS}"
96
[575a6e5]97AC_SUBST(CONFIG_CFLAGS)
98AC_SUBST(CONFIG_CFAFLAGS)
[e523b07]99AC_SUBST(CONFIG_BUILDLIB)
100
101AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"])
[575a6e5]102
[37fe352]103#==============================================================================
104#Trasforming cc1 will break compilation
105M4CFA_PROGRAM_NAME
[ff1e0f38]106
[37fe352]107#==============================================================================
108# Installation paths
109M4CFA_PARSE_PREFIX
[c59712e]110
111# Checks for programs.
[38d12e7]112LT_INIT
113
[c59712e]114AC_PROG_CXX
115AC_PROG_CC
116AM_PROG_AS
[107b01a]117AC_PROG_LIBTOOL
[c59712e]118AC_PROG_INSTALL
119AC_PROG_MAKE_SET
120
121AC_CONFIG_FILES([
122        Makefile
123        src/Makefile
124        prelude/Makefile
125        ])
126
127AC_OUTPUT()
128
129# Final text
130AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.