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