source: configure.ac @ 4d4882a

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 4d4882a was 6e4b913, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago

allow 32-bit compilation of cfa-cpp, and 32-bit compilation of CFA programs (including CFA libraries)

  • Property mode set to 100644
File size: 3.3 KB
RevLine 
[5d6ce1f]1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.68])
[42336618]5AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca])
[00cc023]6AC_CONFIG_AUX_DIR([automake])
[d3b7937]7#AC_CONFIG_SRCDIR([src/main.cc])
[5d6ce1f]8AC_CONFIG_HEADERS([config.h])
[ef7d253]9AM_SILENT_RULES([no])
[5d6ce1f]10
[90c3b1c]11if test "x${CXXFLAGS}" = "x"; then
[6e4b913]12   export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}"  # defaults, no -O2 for debugging and failures
[90c3b1c]13else
[6e4b913]14   export CXXFLAGS="-std=c++11 ${CXXFLAGS}"     # flags from configure command
[90c3b1c]15fi
16
[00cc023]17AM_INIT_AUTOMAKE
[6e4b913]18AM_MAINTAINER_MODE(enable)                      # may require auto* software to be installed
[00cc023]19
[5d6ce1f]20# Installation paths
21
[ef7d253]22AC_ARG_WITH(backend-compiler,
23        [  --with-backend-compiler=PROGRAM     PROGRAM that performs the final code compilation (must be gcc-compatible) ],
[e24f13a]24        backendcompiler=$withval, backendcompiler="")
[6e4b913]25if test "x$backendcompiler" != "x"; then
[e24f13a]26        BACKEND_CC=${backendcompiler}
27else
[6e4b913]28        AC_PATH_PROG(BACKEND_CC, gcc, [])       # check gcc installed
[e24f13a]29        if test "x$BACKEND_CC" = "x"; then
[00cc023]30                AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
31                exit 1
32        fi
[e24f13a]33fi
34AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.])
35AC_SUBST(CFA_BACKEND_CC)
[5d6ce1f]36
37if test "x$prefix" = "xNONE"; then
[00cc023]38        cfa_prefix=${ac_default_prefix}
[5d6ce1f]39else
[00cc023]40        cfa_prefix=${prefix}
[ef7d253]41fi
[d3b7937]42AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
[00cc023]43AC_SUBST(CFA_PREFIX, ${cfa_prefix})
[5d6ce1f]44
45if test "$includedir" = '${prefix}/include'; then
46        cfa_incdir="${cfa_prefix}/include"
47else
[faf8857]48        cfa_incdir=${includedir}
[ef7d253]49fi
[5d6ce1f]50AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
[00cc023]51AC_SUBST(CFA_INCDIR, ${cfa_incdir})
[5d6ce1f]52
53if test "$bindir" = '${exec_prefix}/bin'; then
54        cfa_bindir="${cfa_prefix}/bin"
55else
56        cfa_bindir=${bindir}
[ef7d253]57fi
[5d6ce1f]58AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
[00cc023]59AC_SUBST(CFA_BINDIR, ${cfa_bindir})
[5d6ce1f]60
61if test "$libdir" = '${exec_prefix}/lib'; then
62        cfa_libdir=${cfa_prefix}/lib
63else
64        cfa_libdir=${libdir}
[ef7d253]65fi
[5d6ce1f]66AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
[00cc023]67AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
[5d6ce1f]68
[6e4b913]69AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
70AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
71
[5d6ce1f]72# Checks for programs.
73AC_PROG_CXX
74AC_PROG_CC
[00cc023]75AM_PROG_CC_C_O  # deprecated
[c3a4385]76# These are often not installed and people miss seeing the "no", so stop the configure.
[56c3935]77AC_PROG_YACC
[c3a4385]78if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi
[56c3935]79AC_PROG_LEX
[c3a4385]80if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi
[5d6ce1f]81AC_PROG_INSTALL
82AC_PROG_MAKE_SET
[00cc023]83AC_PROG_RANLIB
[5d6ce1f]84
85# Checks for libraries.
86
87# Checks for header files.
88AC_FUNC_ALLOCA
89AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h])
90
91# Checks for typedefs, structures, and compiler characteristics.
92AC_HEADER_STDBOOL
93AC_C_INLINE
94AC_TYPE_INT16_T
95AC_TYPE_INT32_T
96AC_TYPE_INT8_T
97AC_C_RESTRICT
98AC_TYPE_SIZE_T
99AC_TYPE_UINT16_T
100AC_TYPE_UINT32_T
101AC_TYPE_UINT8_T
102
103# Checks for library functions.
104AC_CHECK_FUNCS([memset putenv strchr strtol])
105
[00cc023]106AC_CONFIG_FILES([
107        Makefile
[6e7e2b36]108        src/driver/Makefile
[00cc023]109        src/Makefile
110        src/examples/Makefile
[ef7d253]111        src/tests/Makefile
[6e7e2b36]112        src/libcfa/Makefile
[00cc023]113        ])
[5d6ce1f]114
115AC_OUTPUT
[7e91d4f]116
[5d6ce1f]117# Final text
118AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.