1 | # -*- Autoconf -*- |
---|
2 | # Process this file with autoconf to produce a configure script. |
---|
3 | |
---|
4 | AC_PREREQ([2.68]) |
---|
5 | AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca]) |
---|
6 | AC_CONFIG_AUX_DIR([automake]) |
---|
7 | #AC_CONFIG_SRCDIR([src/main.cc]) |
---|
8 | AC_CONFIG_HEADERS([config.h]) |
---|
9 | |
---|
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 | |
---|
16 | AM_INIT_AUTOMAKE |
---|
17 | AM_MAINTAINER_MODE(enable) # may require auto* software to be installed |
---|
18 | |
---|
19 | # Installation paths |
---|
20 | |
---|
21 | AC_ARG_WITH(backend-compiler, |
---|
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 |
---|
29 | AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) |
---|
30 | exit 1 |
---|
31 | fi |
---|
32 | fi |
---|
33 | AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.]) |
---|
34 | AC_SUBST(CFA_BACKEND_CC) |
---|
35 | |
---|
36 | if test "x$prefix" = "xNONE"; then |
---|
37 | cfa_prefix=${ac_default_prefix} |
---|
38 | else |
---|
39 | cfa_prefix=${prefix} |
---|
40 | fi |
---|
41 | AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.]) |
---|
42 | AC_SUBST(CFA_PREFIX, ${cfa_prefix}) |
---|
43 | |
---|
44 | if test "$includedir" = '${prefix}/include'; then |
---|
45 | cfa_incdir="${cfa_prefix}/include" |
---|
46 | else |
---|
47 | cfa_incdir=${includedir} |
---|
48 | fi |
---|
49 | AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) |
---|
50 | AC_SUBST(CFA_INCDIR, ${cfa_incdir}) |
---|
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.]) |
---|
58 | AC_SUBST(CFA_BINDIR, ${cfa_bindir}) |
---|
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.]) |
---|
66 | AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) |
---|
67 | |
---|
68 | # Checks for programs. |
---|
69 | AC_PROG_CXX |
---|
70 | AC_PROG_CC |
---|
71 | AM_PROG_CC_C_O # deprecated |
---|
72 | # These are often not installed and people miss seeing the "no", so stop the configure. |
---|
73 | AC_PROG_YACC |
---|
74 | if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi |
---|
75 | AC_PROG_LEX |
---|
76 | if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi |
---|
77 | AC_PROG_INSTALL |
---|
78 | AC_PROG_MAKE_SET |
---|
79 | AC_PROG_RANLIB |
---|
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 | |
---|
102 | AC_CONFIG_FILES([ |
---|
103 | Makefile |
---|
104 | src/driver/Makefile |
---|
105 | src/Makefile |
---|
106 | src/examples/Makefile |
---|
107 | src/libcfa/Makefile |
---|
108 | ]) |
---|
109 | |
---|
110 | AC_OUTPUT |
---|
111 | |
---|
112 | # Final text |
---|
113 | AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".) |
---|