source: configure.ac @ 20221d4

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 20221d4 was facc44f, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

Added option to compile without concurrency using --disable-threading on the configure (will fail concurrency related tests)

  • Property mode set to 100644
File size: 6.2 KB
Line 
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])
6AC_CONFIG_AUX_DIR([automake])
7#AC_CONFIG_SRCDIR([src/main.cc])
8AC_CONFIG_HEADERS([config.h])
9AM_SILENT_RULES([no])
10
11if test "x${CXXFLAGS}" = "x"; then
12   export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}"  # defaults, no -O2 for debugging and failures
13else
14   export CXXFLAGS="-std=c++11 ${CXXFLAGS}"     # flags from configure command
15fi
16
17AM_INIT_AUTOMAKE
18AM_MAINTAINER_MODE(enable)                      # may require auto* software to be installed
19
20rm -f version
21echo ${PACKAGE_VERSION} > version               # file containing version number for other tools
22chmod ugo-w version
23ver_major=`cut -d '.' -f1 version`              # subdivide version number into components at periods
24ver_minor=`cut -d '.' -f2 version`
25ver_patch=`cut -d '.' -f3 version`
26ver_build=`cut -d '.' -f4 version`
27
28# AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version'])
29AC_DEFINE_UNQUOTED(CFA_VERSION_MAJOR, ${ver_major}, [Major version number.])
30AC_DEFINE_UNQUOTED(CFA_VERSION_MINOR, ${ver_minor}, [Minor version number.])
31AC_DEFINE_UNQUOTED(CFA_VERSION_PATCH, ${ver_patch}, [Patch version number.])
32AC_DEFINE_UNQUOTED(CFA_VERSION_BUILD, ${ver_build}, [Build version number.])
33AC_DEFINE_UNQUOTED(CFA_VERSION_SHORT, ["${ver_major}"], [Major])
34AC_DEFINE_UNQUOTED(CFA_VERSION, ["${ver_major}.${ver_minor}"], [Major.Minor])
35AC_DEFINE_UNQUOTED(CFA_VERSION_LONG, ["${ver_major}.${ver_minor}.${ver_patch}"], [Major.Minor.Patch])
36AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ["${ver_major}.${ver_minor}.${ver_patch}.${ver_build}"], [Major.Minor.Patch.Build])
37
38# Installation paths
39
40AC_ARG_WITH(backend-compiler,
41        [  --with-backend-compiler=PROGRAM     PROGRAM that performs the final code compilation (must be gcc-compatible) ],
42        backendcompiler=$withval, backendcompiler="")
43if test "x$backendcompiler" != "x"; then
44        BACKEND_CC=${backendcompiler}
45else
46        AC_PATH_PROG(BACKEND_CC, gcc, [])       # check gcc installed
47        if test "x$BACKEND_CC" = "x"; then
48                AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
49                exit 1
50        fi
51fi
52AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.])
53AC_SUBST(CFA_BACKEND_CC)
54
55
56
57AC_ARG_ENABLE(target-release, AS_HELP_STRING([--enable-target-release], [Build and install the release target]))
58AC_ARG_ENABLE(target-debug, AS_HELP_STRING([--enable-target-debug], [Build and install the debug target]))
59AC_ARG_ENABLE(threading, AS_HELP_STRING([--enable-threading], [Build and install libcfa with threading support (Enabled by default)]),
60[case "${enableval}" in
61  yes) build_threading-"yes" ;;
62  no)  build_threading="no" ;;
63  *) AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;
64esac],[build_threading="yes"])
65
66case "$enable_target_release" in
67        yes)
68                case "$enable_target_debug" in
69                        yes)
70                                build_release="yes"
71                                build_debug="yes"
72                                ;;
73                        no)
74                                build_release="yes"
75                                build_debug="no"
76                                ;;
77                        *)
78                                build_release="yes"
79                                build_debug="no"
80                                ;;
81                esac
82                ;;
83        no)
84                case "$enable_target_debug" in
85                        yes)
86                                build_release="no"
87                                build_debug="yes"
88                                ;;
89                        no)
90                                build_release="no"
91                                build_debug="no"
92                                ;;
93                        *)
94                                build_release="no"
95                                build_debug="yes"
96                                ;;
97                esac
98                ;;
99        *)
100                case "$enable_target_debug" in
101                        yes)
102                                build_release="no"
103                                build_debug="yes"
104                                ;;
105                        no)
106                                build_release="yes"
107                                build_debug="no"
108                                ;;
109                        *)
110                                build_release="yes"
111                                build_debug="yes"
112                                ;;
113                esac
114                ;;
115esac
116
117AM_CONDITIONAL([BUILD_RELEASE], [test "x$build_release" = "xyes"])
118AM_CONDITIONAL([BUILD_DEBUG], [test "x$build_debug" = "xyes"])
119AM_CONDITIONAL([BUILD_NO_LIB], [test "x$build_release$build_debug" = "xnono"])
120AM_CONDITIONAL([BUILD_CONCURRENCY], [test "x$build_threading" = "xyes"])
121
122if test "x$prefix" = "xNONE"; then
123        cfa_prefix=${ac_default_prefix}
124else
125        cfa_prefix=${prefix}
126fi
127AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
128AC_SUBST(CFA_PREFIX, ${cfa_prefix})
129
130if test "$includedir" = '${prefix}/include'; then
131        cfa_incdir="${cfa_prefix}/include/cfa"
132else
133        cfa_incdir=${includedir}
134fi
135AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
136AC_SUBST(CFA_INCDIR, ${cfa_incdir})
137
138if test "$bindir" = '${exec_prefix}/bin'; then
139        cfa_bindir="${cfa_prefix}/bin"
140else
141        cfa_bindir=${bindir}
142fi
143AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
144AC_SUBST(CFA_BINDIR, ${cfa_bindir})
145
146if test "$libdir" = '${exec_prefix}/lib'; then
147        cfa_libdir=${cfa_prefix}/lib
148else
149        cfa_libdir=${libdir}
150fi
151AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
152AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
153
154AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
155AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
156
157AC_CANONICAL_HOST
158AC_SUBST([MACHINE_TYPE],[$host_cpu])
159
160# Checks for programs.
161AC_PROG_CXX
162AC_PROG_CC
163AM_PROG_AS
164AM_PROG_CC_C_O  # deprecated
165# These are often not installed and people miss seeing the "no", so stop the configure.
166AC_PROG_YACC
167if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi
168AC_PROG_LEX
169if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi
170AC_PROG_INSTALL
171AC_PROG_MAKE_SET
172AC_PROG_RANLIB
173
174# Checks for libraries.
175
176# Checks for header files.
177AC_FUNC_ALLOCA
178AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h])
179
180# Checks for typedefs, structures, and compiler characteristics.
181AC_HEADER_STDBOOL
182AC_C_INLINE
183AC_TYPE_INT16_T
184AC_TYPE_INT32_T
185AC_TYPE_INT8_T
186AC_C_RESTRICT
187AC_TYPE_SIZE_T
188AC_TYPE_UINT16_T
189AC_TYPE_UINT32_T
190AC_TYPE_UINT8_T
191
192# Checks for library functions.
193AC_CHECK_FUNCS([memset putenv strchr strtol])
194
195AC_CONFIG_FILES([
196        Makefile
197        src/driver/Makefile
198        src/Makefile
199        src/benchmark/Makefile
200        src/examples/Makefile
201        src/tests/Makefile
202        src/prelude/Makefile
203        src/libcfa/Makefile
204        ])
205
206AC_OUTPUT
207
208AM_COND_IF([BUILD_RELEASE],
209        [AM_COND_IF([BUILD_DEBUG],
210                [AC_MSG_NOTICE(Building libcfa for target: release & debug)],
211                [AC_MSG_NOTICE(Building libcfa for target: release)])],
212        [AM_COND_IF([BUILD_DEBUG],
213                [AC_MSG_NOTICE(Building libcfa for target: debug)],
214                [AC_MSG_NOTICE(Running cfa without libcfa)])])
215
216# Final text
217AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.