| 1 | AC_INIT(cfa-cc, 1.0, cforall@plg.uwaterloo.ca)
|
|---|
| 2 | AC_CONFIG_SRCDIR([src/main.cc])
|
|---|
| 3 |
|
|---|
| 4 | AM_INIT_AUTOMAKE([foreign]) # do not follow GNU standard
|
|---|
| 5 | AM_CONFIG_HEADER(config.h)
|
|---|
| 6 |
|
|---|
| 7 | dnl This comes from `autoscan'
|
|---|
| 8 | dnl Checks for programs.
|
|---|
| 9 | AC_PROG_YACC
|
|---|
| 10 | AC_PROG_CXX
|
|---|
| 11 | AC_PROG_CC # ???
|
|---|
| 12 | AM_PROG_LEX
|
|---|
| 13 | AC_PROG_MAKE_SET
|
|---|
| 14 | AC_PROG_INSTALL
|
|---|
| 15 |
|
|---|
| 16 | dnl Checks for header libraries.
|
|---|
| 17 |
|
|---|
| 18 | dnl Checks for header files.
|
|---|
| 19 | AC_CHECK_HEADERS([malloc.h unistd.h])
|
|---|
| 20 |
|
|---|
| 21 | dnl Checks for typedefs, structures, and compiler characteristics.
|
|---|
| 22 | AC_C_CONST
|
|---|
| 23 | AC_C_INLINE
|
|---|
| 24 | AC_STRUCT_TM
|
|---|
| 25 |
|
|---|
| 26 | test "${prefix}" != "NONE" || prefix=$ac_default_prefix
|
|---|
| 27 |
|
|---|
| 28 | preludedir=${prefix}/share/cfa
|
|---|
| 29 | AC_ARG_WITH(preludedir,
|
|---|
| 30 | [ --with-preludedir=DIR DIR that contains prelude.cf and other necessary files ],
|
|---|
| 31 | preludedir=$withval )
|
|---|
| 32 | AC_SUBST(preludedir)
|
|---|
| 33 |
|
|---|
| 34 | AC_ARG_WITH(backend-compiler,
|
|---|
| 35 | [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ],
|
|---|
| 36 | backcompiler=$withval, backcompiler="")
|
|---|
| 37 | if test x$backcompiler != x; then
|
|---|
| 38 | AC_DEFINE_UNQUOTED(GCC_PATH, "${backcompiler}")
|
|---|
| 39 | BACKEND_CC=${backcompiler}
|
|---|
| 40 | else
|
|---|
| 41 | AC_PATH_PROG(GCC_PATH, gcc, N/A)
|
|---|
| 42 | if test "$GCC_PATH" = "N/A"; then
|
|---|
| 43 | AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
|
|---|
| 44 | exit 1
|
|---|
| 45 | fi
|
|---|
| 46 | AC_DEFINE_UNQUOTED(GCC_PATH, "${GCC_PATH}", [Path/name of C compiler.])
|
|---|
| 47 | BACKEND_CC=${GCC_PATH}
|
|---|
| 48 | fi
|
|---|
| 49 | AC_SUBST(BACKEND_CC)
|
|---|
| 50 |
|
|---|
| 51 | AC_PATH_PROG(CPP_PATH, cpp, N/A)
|
|---|
| 52 | if test "$CPP_PATH" = "N/A"; then
|
|---|
| 53 | AC_MSG_ERROR(cpp not found)
|
|---|
| 54 | exit 1
|
|---|
| 55 | fi
|
|---|
| 56 | AC_DEFINE_UNQUOTED(CPP_PATH, "${CPP_PATH}", [Path/name of cpp preprocessor.])
|
|---|
| 57 |
|
|---|
| 58 | # Purify instrumenting
|
|---|
| 59 | dnl AC_ARG_WITH(enablepurify,
|
|---|
| 60 | dnl [ --with-purify Enable Purify ],
|
|---|
| 61 |
|
|---|
| 62 | dnl Installation paths
|
|---|
| 63 | CFA_PREFIX=
|
|---|
| 64 | if test "x$prefix" = "xNONE"; then
|
|---|
| 65 | cfa_prefix=${ac_default_prefix}
|
|---|
| 66 | else
|
|---|
| 67 | cfa_prefix=${prefix}
|
|---|
| 68 | fi
|
|---|
| 69 | AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa files.])
|
|---|
| 70 | CFA_PREFIX=${cfa_prefix}
|
|---|
| 71 | AC_SUBST(CFA_PREFIX)
|
|---|
| 72 |
|
|---|
| 73 | CFA_INCDIR=
|
|---|
| 74 | if test "$includedir" = '${prefix}/include'; then
|
|---|
| 75 | cfa_incdir="${cfa_prefix}/include"
|
|---|
| 76 | else
|
|---|
| 77 | cfa_incdir=${$includedir}
|
|---|
| 78 | fi
|
|---|
| 79 | AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
|
|---|
| 80 | CFA_INCDIR=${cfa_incdir}
|
|---|
| 81 | AC_SUBST(CFA_INCDIR)
|
|---|
| 82 |
|
|---|
| 83 | CFA_BINDIR=
|
|---|
| 84 | if test "$bindir" = '${exec_prefix}/bin'; then
|
|---|
| 85 | cfa_bindir="${cfa_prefix}/bin"
|
|---|
| 86 | else
|
|---|
| 87 | cfa_bindir=${bindir}
|
|---|
| 88 | fi
|
|---|
| 89 | AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
|
|---|
| 90 | CFA_BINDIR=${cfa_bindir}
|
|---|
| 91 | AC_SUBST(CFA_BINDIR)
|
|---|
| 92 |
|
|---|
| 93 | CFA_LIBDIR=
|
|---|
| 94 | if test "$libdir" = '${exec_prefix}/lib'; then
|
|---|
| 95 | cfa_libdir=${cfa_prefix}/lib
|
|---|
| 96 | else
|
|---|
| 97 | cfa_libdir=${libdir}
|
|---|
| 98 | fi
|
|---|
| 99 | AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
|
|---|
| 100 | CFA_LIBDIR=${cfa_libdir}
|
|---|
| 101 | AC_SUBST(CFA_LIBDIR)
|
|---|
| 102 |
|
|---|
| 103 | AC_OUTPUT([ Makefile src/Makefile driver/Makefile libcfa/Makefile src/examples/Makefile ])
|
|---|
| 104 |
|
|---|
| 105 | dnl Final text
|
|---|
| 106 |
|
|---|
| 107 | AC_MSG_RESULT(Cforall configuraton completed. Type "make install".)
|
|---|