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 | #AM_INIT_AUTOMAKE([foreign]) # do not follow GNU standard |
---|
7 | AM_INIT_AUTOMAKE |
---|
8 | AC_CONFIG_SRCDIR([src/main.cc]) |
---|
9 | AC_CONFIG_HEADERS([config.h]) |
---|
10 | |
---|
11 | # Installation paths |
---|
12 | |
---|
13 | AC_ARG_WITH(backend-compiler, |
---|
14 | [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ], |
---|
15 | backcompiler=$withval, backcompiler="") |
---|
16 | if test x$backcompiler != x; then |
---|
17 | AC_DEFINE_UNQUOTED(GCC_PATH, "${backcompiler}") |
---|
18 | BACKEND_CC=${backcompiler} |
---|
19 | else |
---|
20 | AC_PATH_PROG(GCC_PATH, gcc, N/A) |
---|
21 | if test "$GCC_PATH" = "N/A"; then |
---|
22 | AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) |
---|
23 | exit 1 |
---|
24 | fi |
---|
25 | AC_DEFINE_UNQUOTED(GCC_PATH, "${GCC_PATH}", [Path/name of C compiler.]) |
---|
26 | BACKEND_CC=${GCC_PATH} |
---|
27 | fi |
---|
28 | AC_SUBST(BACKEND_CC) |
---|
29 | |
---|
30 | CFA_PREFIX= |
---|
31 | if test "x$prefix" = "xNONE"; then |
---|
32 | cfa_prefix=${ac_default_prefix} |
---|
33 | else |
---|
34 | cfa_prefix=${prefix} |
---|
35 | fi |
---|
36 | AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa files.]) |
---|
37 | CFA_PREFIX=${cfa_prefix} |
---|
38 | AC_SUBST(CFA_PREFIX) |
---|
39 | |
---|
40 | CFA_INCDIR= |
---|
41 | if test "$includedir" = '${prefix}/include'; then |
---|
42 | cfa_incdir="${cfa_prefix}/include" |
---|
43 | else |
---|
44 | cfa_incdir=${$includedir} |
---|
45 | fi |
---|
46 | AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) |
---|
47 | CFA_INCDIR=${cfa_incdir} |
---|
48 | AC_SUBST(CFA_INCDIR) |
---|
49 | |
---|
50 | CFA_BINDIR= |
---|
51 | if test "$bindir" = '${exec_prefix}/bin'; then |
---|
52 | cfa_bindir="${cfa_prefix}/bin" |
---|
53 | else |
---|
54 | cfa_bindir=${bindir} |
---|
55 | fi |
---|
56 | AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.]) |
---|
57 | CFA_BINDIR=${cfa_bindir} |
---|
58 | AC_SUBST(CFA_BINDIR) |
---|
59 | |
---|
60 | CFA_LIBDIR= |
---|
61 | if test "$libdir" = '${exec_prefix}/lib'; then |
---|
62 | cfa_libdir=${cfa_prefix}/lib |
---|
63 | else |
---|
64 | cfa_libdir=${libdir} |
---|
65 | fi |
---|
66 | AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) |
---|
67 | CFA_LIBDIR=${cfa_libdir} |
---|
68 | AC_SUBST(CFA_LIBDIR) |
---|
69 | |
---|
70 | # Checks for programs. |
---|
71 | AC_PROG_CXX |
---|
72 | AC_PROG_AWK |
---|
73 | AC_PROG_CC |
---|
74 | AC_PROG_INSTALL |
---|
75 | AC_PROG_MAKE_SET |
---|
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_FUNC_MALLOC |
---|
97 | AC_FUNC_REALLOC |
---|
98 | AC_CHECK_FUNCS([memset putenv strchr strtol]) |
---|
99 | |
---|
100 | AC_CONFIG_FILES([Makefile |
---|
101 | src/Makefile |
---|
102 | driver/Makefile |
---|
103 | libcfa/Makefile |
---|
104 | src/examples/Makefile]) |
---|
105 | |
---|
106 | AC_OUTPUT |
---|
107 | |
---|
108 | # Final text |
---|
109 | AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".) |
---|