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