[c59712e] | 1 | # -*- Autoconf -*- |
---|
| 2 | # Process this file with autoconf to produce a configure script. |
---|
| 3 | |
---|
| 4 | AC_PREREQ([2.68]) |
---|
| 5 | AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca]) |
---|
[38d12e7] | 6 | AC_CONFIG_AUX_DIR([automake]) |
---|
| 7 | AC_CONFIG_MACRO_DIRS([automake]) |
---|
[575a6e5] | 8 | AM_SILENT_RULES([yes]) |
---|
[c59712e] | 9 | |
---|
[37fe352] | 10 | m4_include([../automake/cfa.m4]) |
---|
| 11 | |
---|
[c59712e] | 12 | AM_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 |
---|
| 18 | AR_FLAGS="cr" |
---|
| 19 | |
---|
[c59712e] | 20 | # Allow program name tansformation |
---|
| 21 | # will fill program_transform_name with appropriate sed regex |
---|
| 22 | AC_ARG_PROGRAM |
---|
| 23 | |
---|
[37fe352] | 24 | AC_ARG_VAR(ARCHITECTURE, [The architecture to use when building libcfa]) |
---|
[c59712e] | 25 | AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)]) |
---|
[ff1e0f38] | 26 | AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory]) |
---|
[c6bbcdb] | 27 | AC_ARG_VAR(CFA_VERSION, [The long version of cfa]) |
---|
[ff1e0f38] | 28 | |
---|
| 29 | CFACC=${DRIVER_DIR}cfa |
---|
| 30 | CFACPP=${DRIVER_DIR}cfa-cpp |
---|
| 31 | AC_SUBST(CFACC) |
---|
| 32 | AC_SUBST(CFACPP) |
---|
[c6bbcdb] | 33 | AC_SUBST(CFA_VERSION) |
---|
[ff1e0f38] | 34 | |
---|
[575a6e5] | 35 | #============================================================================== |
---|
| 36 | #Handle specific flags |
---|
[37fe352] | 37 | case $ARCHITECTURE in |
---|
| 38 | "x64" ) ARCH_FLAGS="-m64";; |
---|
| 39 | "x86" ) ARCH_FLAGS="-m32";; |
---|
| 40 | "arm" ) ARCH_FLAGS="";; |
---|
| 41 | esac |
---|
[ff1e0f38] | 42 | |
---|
[37fe352] | 43 | AC_SUBST(ARCH_FLAGS) |
---|
[ff1e0f38] | 44 | |
---|
[575a6e5] | 45 | case $CONFIGURATION in |
---|
| 46 | "debug" ) |
---|
[3fcbdca1] | 47 | CONFIG_CFLAGS="-Og -g" |
---|
[575a6e5] | 48 | CONFIG_CFAFLAGS="-debug" |
---|
[e523b07] | 49 | CONFIG_BUILDLIB="yes" |
---|
[575a6e5] | 50 | ;; |
---|
| 51 | "nodebug" ) |
---|
[3fcbdca1] | 52 | CONFIG_CFLAGS="-O3 -s" |
---|
[575a6e5] | 53 | CONFIG_CFAFLAGS="-nodebug" |
---|
[e523b07] | 54 | CONFIG_BUILDLIB="yes" |
---|
[575a6e5] | 55 | ;; |
---|
| 56 | "nolib" ) |
---|
[3fcbdca1] | 57 | CONFIG_CFLAGS="-O3 -s" |
---|
[c9e640e] | 58 | CONFIG_CFAFLAGS="-nolib" |
---|
[e523b07] | 59 | CONFIG_BUILDLIB="no" |
---|
[575a6e5] | 60 | ;; |
---|
[3fcbdca1] | 61 | "profile" ) |
---|
| 62 | CONFIG_CFLAGS="-O3 -g -fno-omit-frame-pointer" |
---|
| 63 | CONFIG_CFAFLAGS="-nodebug" |
---|
| 64 | CONFIG_BUILDLIB="yes" |
---|
| 65 | ;; |
---|
[d119b984] | 66 | *) |
---|
| 67 | AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION') |
---|
| 68 | ;; |
---|
[575a6e5] | 69 | esac |
---|
| 70 | |
---|
[13363f4] | 71 | CONFIG_CFAFLAGS="${CONFIG_CFAFLAGS} ${CFAFLAGS}" |
---|
| 72 | |
---|
[575a6e5] | 73 | AC_SUBST(CONFIG_CFLAGS) |
---|
| 74 | AC_SUBST(CONFIG_CFAFLAGS) |
---|
[e523b07] | 75 | AC_SUBST(CONFIG_BUILDLIB) |
---|
| 76 | |
---|
| 77 | AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"]) |
---|
[575a6e5] | 78 | |
---|
[37fe352] | 79 | #============================================================================== |
---|
| 80 | #Trasforming cc1 will break compilation |
---|
| 81 | M4CFA_PROGRAM_NAME |
---|
[ff1e0f38] | 82 | |
---|
[37fe352] | 83 | #============================================================================== |
---|
| 84 | # Installation paths |
---|
| 85 | M4CFA_PARSE_PREFIX |
---|
[c59712e] | 86 | |
---|
| 87 | # Checks for programs. |
---|
[38d12e7] | 88 | LT_INIT |
---|
| 89 | |
---|
[c59712e] | 90 | AC_PROG_CXX |
---|
| 91 | AC_PROG_CC |
---|
| 92 | AM_PROG_AS |
---|
[107b01a] | 93 | AC_PROG_LIBTOOL |
---|
[c59712e] | 94 | AC_PROG_INSTALL |
---|
| 95 | AC_PROG_MAKE_SET |
---|
| 96 | |
---|
| 97 | AC_CONFIG_FILES([ |
---|
| 98 | Makefile |
---|
| 99 | src/Makefile |
---|
| 100 | prelude/Makefile |
---|
| 101 | ]) |
---|
| 102 | |
---|
| 103 | AC_OUTPUT() |
---|
| 104 | |
---|
| 105 | # Final text |
---|
| 106 | AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".) |
---|