source: configure.ac @ 7a560c1

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

added benchmark folder and appropriate makefile

  • Property mode set to 100644
File size: 5.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
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]))
59
60case "$enable_target_release" in
61        yes)
62                case "$enable_target_debug" in
63                        yes)
64                                build_release="yes"
65                                build_debug="yes"
66                                ;;
67                        no)
68                                build_release="yes"
69                                build_debug="no"
70                                ;;
71                        *)
72                                build_release="yes"
73                                build_debug="no"
74                                ;;
75                esac
76                ;;
77        no)
78                case "$enable_target_debug" in
79                        yes)
80                                build_release="no"
81                                build_debug="yes"
82                                ;;
83                        no)
84                                build_release="no"
85                                build_debug="no"
86                                ;;
87                        *)
88                                build_release="no"
89                                build_debug="yes"
90                                ;;
91                esac
92                ;;
93        *)
94                case "$enable_target_debug" in
95                        yes)
96                                build_release="no"
97                                build_debug="yes"
98                                ;;
99                        no)
100                                build_release="yes"
101                                build_debug="no"
102                                ;;
103                        *)
104                                build_release="yes"
105                                build_debug="yes"
106                                ;;
107                esac
108                ;;
109esac
110
111AM_CONDITIONAL([BUILD_RELEASE], [test "x$build_release" = "xyes"])
112AM_CONDITIONAL([BUILD_DEBUG], [test "x$build_debug" = "xyes"])
113AM_CONDITIONAL([BUILD_NO_LIB], [test "x$build_release$build_debug" = "xnono"])
114
115if test "x$prefix" = "xNONE"; then
116        cfa_prefix=${ac_default_prefix}
117else
118        cfa_prefix=${prefix}
119fi
120AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
121AC_SUBST(CFA_PREFIX, ${cfa_prefix})
122
123if test "$includedir" = '${prefix}/include'; then
124        cfa_incdir="${cfa_prefix}/include/cfa"
125else
126        cfa_incdir=${includedir}
127fi
128AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
129AC_SUBST(CFA_INCDIR, ${cfa_incdir})
130
131if test "$bindir" = '${exec_prefix}/bin'; then
132        cfa_bindir="${cfa_prefix}/bin"
133else
134        cfa_bindir=${bindir}
135fi
136AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
137AC_SUBST(CFA_BINDIR, ${cfa_bindir})
138
139if test "$libdir" = '${exec_prefix}/lib'; then
140        cfa_libdir=${cfa_prefix}/lib
141else
142        cfa_libdir=${libdir}
143fi
144AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
145AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
146
147AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
148AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
149
150AC_CANONICAL_HOST
151AC_SUBST([MACHINE_TYPE],[$host_cpu])
152
153# Checks for programs.
154AC_PROG_CXX
155AC_PROG_CC
156AM_PROG_AS
157AM_PROG_CC_C_O  # deprecated
158# These are often not installed and people miss seeing the "no", so stop the configure.
159AC_PROG_YACC
160if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi
161AC_PROG_LEX
162if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi
163AC_PROG_INSTALL
164AC_PROG_MAKE_SET
165AC_PROG_RANLIB
166
167# Checks for libraries.
168
169# Checks for header files.
170AC_FUNC_ALLOCA
171AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h])
172
173# Checks for typedefs, structures, and compiler characteristics.
174AC_HEADER_STDBOOL
175AC_C_INLINE
176AC_TYPE_INT16_T
177AC_TYPE_INT32_T
178AC_TYPE_INT8_T
179AC_C_RESTRICT
180AC_TYPE_SIZE_T
181AC_TYPE_UINT16_T
182AC_TYPE_UINT32_T
183AC_TYPE_UINT8_T
184
185# Checks for library functions.
186AC_CHECK_FUNCS([memset putenv strchr strtol])
187
188AC_CONFIG_FILES([
189        Makefile
190        src/driver/Makefile
191        src/Makefile
192        src/benchmark/Makefile
193        src/examples/Makefile
194        src/tests/Makefile
195        src/prelude/Makefile
196        src/libcfa/Makefile
197        ])
198
199AC_OUTPUT
200
201AM_COND_IF([BUILD_RELEASE],
202        [AM_COND_IF([BUILD_DEBUG],
203                [AC_MSG_NOTICE(Building libcfa for target: release & debug)],
204                [AC_MSG_NOTICE(Building libcfa for target: release)])],
205        [AM_COND_IF([BUILD_DEBUG],
206                [AC_MSG_NOTICE(Building libcfa for target: debug)],
207                [AC_MSG_NOTICE(Running cfa without libcfa)])])
208
209# Final text
210AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.