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 | # define this to override
|
---|
18 | AR_FLAGS="cr"
|
---|
19 |
|
---|
20 | # Allow program name tansformation
|
---|
21 | # will fill program_transform_name with appropriate sed regex
|
---|
22 | AC_ARG_PROGRAM
|
---|
23 |
|
---|
24 | AC_ARG_VAR(ARCHITECTURE, [The architecture to use when building libcfa])
|
---|
25 | AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)])
|
---|
26 | AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory])
|
---|
27 | AC_ARG_VAR(CFA_VERSION, [The long version of cfa])
|
---|
28 |
|
---|
29 | CFACC=${DRIVER_DIR}cfa
|
---|
30 | CFACPP=${DRIVER_DIR}cfa-cpp
|
---|
31 | AC_SUBST(CFACC)
|
---|
32 | AC_SUBST(CFACPP)
|
---|
33 | AC_SUBST(CFA_VERSION)
|
---|
34 |
|
---|
35 | #==============================================================================
|
---|
36 | #Handle specific flags
|
---|
37 | case $ARCHITECTURE in
|
---|
38 | "x64" ) ARCH_FLAGS="-m64";;
|
---|
39 | "x86" ) ARCH_FLAGS="-m32";;
|
---|
40 | "arm" ) ARCH_FLAGS="";;
|
---|
41 | esac
|
---|
42 |
|
---|
43 | AC_SUBST(ARCH_FLAGS)
|
---|
44 |
|
---|
45 | case $CONFIGURATION in
|
---|
46 | "debug" )
|
---|
47 | CONFIG_CFLAGS="-O0 -g"
|
---|
48 | CONFIG_CFAFLAGS="-debug"
|
---|
49 | CONFIG_BUILDLIB="yes"
|
---|
50 | ;;
|
---|
51 | "nodebug" )
|
---|
52 | CONFIG_CFLAGS="-O2 -s"
|
---|
53 | CONFIG_CFAFLAGS="-nodebug"
|
---|
54 | CONFIG_BUILDLIB="yes"
|
---|
55 | ;;
|
---|
56 | "nolib" )
|
---|
57 | CONFIG_CFLAGS="-O2 -s"
|
---|
58 | CONFIG_CFAFLAGS="-nolib"
|
---|
59 | CONFIG_BUILDLIB="no"
|
---|
60 | ;;
|
---|
61 | *)
|
---|
62 | AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION')
|
---|
63 | ;;
|
---|
64 | esac
|
---|
65 |
|
---|
66 | AC_SUBST(CONFIG_CFLAGS)
|
---|
67 | AC_SUBST(CONFIG_CFAFLAGS)
|
---|
68 | AC_SUBST(CONFIG_BUILDLIB)
|
---|
69 |
|
---|
70 | AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"])
|
---|
71 |
|
---|
72 | #==============================================================================
|
---|
73 | #Trasforming cc1 will break compilation
|
---|
74 | M4CFA_PROGRAM_NAME
|
---|
75 |
|
---|
76 | #==============================================================================
|
---|
77 | # Installation paths
|
---|
78 | M4CFA_PARSE_PREFIX
|
---|
79 |
|
---|
80 | # Checks for programs.
|
---|
81 | LT_INIT
|
---|
82 |
|
---|
83 | AC_PROG_CXX
|
---|
84 | AC_PROG_CC
|
---|
85 | AM_PROG_AS
|
---|
86 | AC_PROG_LIBTOOL
|
---|
87 | AC_PROG_INSTALL
|
---|
88 | AC_PROG_MAKE_SET
|
---|
89 |
|
---|
90 | AC_CONFIG_FILES([
|
---|
91 | Makefile
|
---|
92 | src/Makefile
|
---|
93 | prelude/Makefile
|
---|
94 | ])
|
---|
95 |
|
---|
96 | AC_OUTPUT()
|
---|
97 |
|
---|
98 | # Final text
|
---|
99 | AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".) |
---|