source: configure.ac @ 47a8d17

aaron-thesisarm-ehcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 47a8d17 was 47a8d17, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

cfa version is now based on file of the same name

  • Property mode set to 100644
File size: 4.4 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],[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
20ver_major=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\1/'`
21ver_minor=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\2/'`
22ver_patch=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\3/'`
23ver_build=`cat version | sed -r 's/([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)\.([[0-9]]+)/\4/'`
24ver_short="\"${ver_major}\""
25ver__long="\"${ver_major}.${ver_minor}\""
26ver__norm="\"${ver_major}.${ver_minor}.${ver_patch}\""
27ver__full="\"${ver_major}.${ver_minor}.${ver_patch}.${ver_build}\""
28
29AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version'])
30AC_DEFINE_UNQUOTED(CFA_VERSION_MAJOR, ${ver_major}, [Major version number.])
31AC_DEFINE_UNQUOTED(CFA_VERSION_MINOR, ${ver_minor}, [Minor version number.])
32AC_DEFINE_UNQUOTED(CFA_VERSION_PATCH, ${ver_patch}, [Patch version number.])
33AC_DEFINE_UNQUOTED(CFA_VERSION_BUILD, ${ver_build}, [Build version number.])
34AC_DEFINE_UNQUOTED(CFA_VERSION_SHORT, ${ver_short}, [Major])
35AC_DEFINE_UNQUOTED(CFA_VERSION, ${ver__long}, [Major.Minor])
36AC_DEFINE_UNQUOTED(CFA_VERSION_LONG, ${ver__norm}, [Major.Minor.Patch])
37AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ${ver__full}, [Major.Minor.Patch.Build])
38
39# Installation paths
40
41AC_ARG_WITH(backend-compiler,
42        [  --with-backend-compiler=PROGRAM     PROGRAM that performs the final code compilation (must be gcc-compatible) ],
43        backendcompiler=$withval, backendcompiler="")
44if test "x$backendcompiler" != "x"; then
45        BACKEND_CC=${backendcompiler}
46else
47        AC_PATH_PROG(BACKEND_CC, gcc, [])       # check gcc installed
48        if test "x$BACKEND_CC" = "x"; then
49                AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
50                exit 1
51        fi
52fi
53AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.])
54AC_SUBST(CFA_BACKEND_CC)
55
56if test "x$prefix" = "xNONE"; then
57        cfa_prefix=${ac_default_prefix}
58else
59        cfa_prefix=${prefix}
60fi
61AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
62AC_SUBST(CFA_PREFIX, ${cfa_prefix})
63
64if test "$includedir" = '${prefix}/include'; then
65        cfa_incdir="${cfa_prefix}/include"
66else
67        cfa_incdir=${includedir}
68fi
69AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
70AC_SUBST(CFA_INCDIR, ${cfa_incdir})
71
72if test "$bindir" = '${exec_prefix}/bin'; then
73        cfa_bindir="${cfa_prefix}/bin"
74else
75        cfa_bindir=${bindir}
76fi
77AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
78AC_SUBST(CFA_BINDIR, ${cfa_bindir})
79
80if test "$libdir" = '${exec_prefix}/lib'; then
81        cfa_libdir=${cfa_prefix}/lib
82else
83        cfa_libdir=${libdir}
84fi
85AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
86AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
87
88AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
89AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
90
91# Checks for programs.
92AC_PROG_CXX
93AC_PROG_CC
94AM_PROG_CC_C_O  # deprecated
95# These are often not installed and people miss seeing the "no", so stop the configure.
96AC_PROG_YACC
97if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi
98AC_PROG_LEX
99if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi
100AC_PROG_INSTALL
101AC_PROG_MAKE_SET
102AC_PROG_RANLIB
103
104# Checks for libraries.
105
106# Checks for header files.
107AC_FUNC_ALLOCA
108AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h])
109
110# Checks for typedefs, structures, and compiler characteristics.
111AC_HEADER_STDBOOL
112AC_C_INLINE
113AC_TYPE_INT16_T
114AC_TYPE_INT32_T
115AC_TYPE_INT8_T
116AC_C_RESTRICT
117AC_TYPE_SIZE_T
118AC_TYPE_UINT16_T
119AC_TYPE_UINT32_T
120AC_TYPE_UINT8_T
121
122# Checks for library functions.
123AC_CHECK_FUNCS([memset putenv strchr strtol])
124
125AC_CONFIG_FILES([
126        Makefile
127        src/driver/Makefile
128        src/Makefile
129        src/examples/Makefile
130        src/tests/Makefile
131        src/libcfa/Makefile
132        ])
133
134AC_OUTPUT
135
136# Final text
137AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.