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]) |
---|
6 | AC_CONFIG_AUX_DIR([automake]) |
---|
7 | AC_CONFIG_MACRO_DIRS([automake]) |
---|
8 | AM_SILENT_RULES([yes]) |
---|
9 | |
---|
10 | m4_include([../automake/cfa.m4]) |
---|
11 | |
---|
12 | AM_INIT_AUTOMAKE([subdir-objects]) |
---|
13 | |
---|
14 | # don't use the default CFLAGS as they unconditonnaly add -O2 |
---|
15 | : ${CFLAGS=""} |
---|
16 | |
---|
17 | # Allow program name tansformation |
---|
18 | # will fill program_transform_name with appropriate sed regex |
---|
19 | AC_ARG_PROGRAM |
---|
20 | |
---|
21 | AC_ARG_VAR(ARCHITECTURE, [The architecture to use when building libcfa]) |
---|
22 | AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)]) |
---|
23 | AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory]) |
---|
24 | |
---|
25 | CFACC=${DRIVER_DIR}cfa |
---|
26 | CFACPP=${DRIVER_DIR}cfa-cpp |
---|
27 | AC_SUBST(CFACC) |
---|
28 | AC_SUBST(CFACPP) |
---|
29 | |
---|
30 | #============================================================================== |
---|
31 | #Handle specific flags |
---|
32 | case $ARCHITECTURE in |
---|
33 | "x64" ) ARCH_FLAGS="-m64";; |
---|
34 | "x86" ) ARCH_FLAGS="-m32";; |
---|
35 | "arm" ) ARCH_FLAGS="";; |
---|
36 | esac |
---|
37 | |
---|
38 | AC_SUBST(ARCH_FLAGS) |
---|
39 | |
---|
40 | case $CONFIGURATION in |
---|
41 | "debug" ) |
---|
42 | CONFIG_CFLAGS="-O0 -g" |
---|
43 | CONFIG_CFAFLAGS="-debug" |
---|
44 | CONFIG_BUILDLIB="yes" |
---|
45 | ;; |
---|
46 | "nodebug" ) |
---|
47 | CONFIG_CFLAGS="-O2 -s" |
---|
48 | CONFIG_CFAFLAGS="-nodebug" |
---|
49 | CONFIG_BUILDLIB="yes" |
---|
50 | ;; |
---|
51 | "nolib" ) |
---|
52 | CONFIG_CFLAGS="-O2 -s" |
---|
53 | CONFIG_CFAFLAGS="-nodebug" |
---|
54 | CONFIG_BUILDLIB="no" |
---|
55 | ;; |
---|
56 | esac |
---|
57 | |
---|
58 | AC_SUBST(CONFIG_CFLAGS) |
---|
59 | AC_SUBST(CONFIG_CFAFLAGS) |
---|
60 | AC_SUBST(CONFIG_BUILDLIB) |
---|
61 | |
---|
62 | AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"]) |
---|
63 | |
---|
64 | #============================================================================== |
---|
65 | #Trasforming cc1 will break compilation |
---|
66 | M4CFA_PROGRAM_NAME |
---|
67 | |
---|
68 | #============================================================================== |
---|
69 | # Installation paths |
---|
70 | M4CFA_PARSE_PREFIX |
---|
71 | |
---|
72 | # Checks for programs. |
---|
73 | LT_INIT |
---|
74 | |
---|
75 | AC_PROG_CXX |
---|
76 | AC_PROG_CC |
---|
77 | AM_PROG_AS |
---|
78 | AC_PROG_INSTALL |
---|
79 | AC_PROG_MAKE_SET |
---|
80 | |
---|
81 | AC_CONFIG_FILES([ |
---|
82 | Makefile |
---|
83 | src/Makefile |
---|
84 | prelude/Makefile |
---|
85 | ]) |
---|
86 | |
---|
87 | AC_OUTPUT() |
---|
88 | |
---|
89 | # Final text |
---|
90 | AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".) |
---|