source: configure.ac @ c857ad3

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 c857ad3 was 65e9bc1, checked in by Thierry Delisle <tdelisle@…>, 8 years ago

Removed incorrect double negative

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