source: configure.ac@ 2042d41

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors deferred_resn demangler enum forall-pointer-decay jacob/cs343-translation jenkins-sandbox new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since 2042d41 was 2042d41, checked in by Peter A. Buhr <pabuhr@…>, 9 years ago

use \'cut\' to subdivide version number

  • Property mode set to 100644
File size: 4.3 KB
Line 
1# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ([2.68])
5AC_INIT([cfa-cc],[1.0.0.0],[cforall@plg.uwaterloo.ca])
6AC_CONFIG_AUX_DIR([automake])
7#AC_CONFIG_SRCDIR([src/main.cc])
8AC_CONFIG_HEADERS([config.h])
9AM_SILENT_RULES([no])
10
11if test "x${CXXFLAGS}" = "x"; then
12 export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}" # defaults, no -O2 for debugging and failures
13else
14 export CXXFLAGS="-std=c++11 ${CXXFLAGS}" # flags from configure command
15fi
16
17AM_INIT_AUTOMAKE
18AM_MAINTAINER_MODE(enable) # may require auto* software to be installed
19
20echo ${PACKAGE_VERSION} > version # file containing version number for other tools
21ver_major=`cut -d '.' -f1 version` # subdivide version number into components at periods
22ver_minor=`cut -d '.' -f2 version`
23ver_patch=`cut -d '.' -f3 version`
24ver_build=`cut -d '.' -f4 version`
25
26# AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version'])
27AC_DEFINE_UNQUOTED(CFA_VERSION_MAJOR, ${ver_major}, [Major version number.])
28AC_DEFINE_UNQUOTED(CFA_VERSION_MINOR, ${ver_minor}, [Minor version number.])
29AC_DEFINE_UNQUOTED(CFA_VERSION_PATCH, ${ver_patch}, [Patch version number.])
30AC_DEFINE_UNQUOTED(CFA_VERSION_BUILD, ${ver_build}, [Build version number.])
31AC_DEFINE_UNQUOTED(CFA_VERSION_SHORT, ["${ver_major}"], [Major])
32AC_DEFINE_UNQUOTED(CFA_VERSION, ["${ver_major}.${ver_minor}"], [Major.Minor])
33AC_DEFINE_UNQUOTED(CFA_VERSION_LONG, ["${ver_major}.${ver_minor}.${ver_patch}"], [Major.Minor.Patch])
34AC_DEFINE_UNQUOTED(CFA_VERSION_FULL, ["${ver_major}.${ver_minor}.${ver_patch}.${ver_build}"], [Major.Minor.Patch.Build])
35
36# Installation paths
37
38AC_ARG_WITH(backend-compiler,
39 [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ],
40 backendcompiler=$withval, backendcompiler="")
41if test "x$backendcompiler" != "x"; then
42 BACKEND_CC=${backendcompiler}
43else
44 AC_PATH_PROG(BACKEND_CC, gcc, []) # check gcc installed
45 if test "x$BACKEND_CC" = "x"; then
46 AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org)
47 exit 1
48 fi
49fi
50AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.])
51AC_SUBST(CFA_BACKEND_CC)
52
53if test "x$prefix" = "xNONE"; then
54 cfa_prefix=${ac_default_prefix}
55else
56 cfa_prefix=${prefix}
57fi
58AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.])
59AC_SUBST(CFA_PREFIX, ${cfa_prefix})
60
61if test "$includedir" = '${prefix}/include'; then
62 cfa_incdir="${cfa_prefix}/include"
63else
64 cfa_incdir=${includedir}
65fi
66AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.])
67AC_SUBST(CFA_INCDIR, ${cfa_incdir})
68
69if test "$bindir" = '${exec_prefix}/bin'; then
70 cfa_bindir="${cfa_prefix}/bin"
71else
72 cfa_bindir=${bindir}
73fi
74AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.])
75AC_SUBST(CFA_BINDIR, ${cfa_bindir})
76
77if test "$libdir" = '${exec_prefix}/lib'; then
78 cfa_libdir=${cfa_prefix}/lib
79else
80 cfa_libdir=${libdir}
81fi
82AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.])
83AC_SUBST(CFA_LIBDIR, ${cfa_libdir})
84
85AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.])
86AC_SUBST(CFA_FLAGS, ${CFAFLAGS})
87
88# Checks for programs.
89AC_PROG_CXX
90AC_PROG_CC
91AM_PROG_CC_C_O # deprecated
92# These are often not installed and people miss seeing the "no", so stop the configure.
93AC_PROG_YACC
94if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi
95AC_PROG_LEX
96if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi
97AC_PROG_INSTALL
98AC_PROG_MAKE_SET
99AC_PROG_RANLIB
100
101# Checks for libraries.
102
103# Checks for header files.
104AC_FUNC_ALLOCA
105AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h])
106
107# Checks for typedefs, structures, and compiler characteristics.
108AC_HEADER_STDBOOL
109AC_C_INLINE
110AC_TYPE_INT16_T
111AC_TYPE_INT32_T
112AC_TYPE_INT8_T
113AC_C_RESTRICT
114AC_TYPE_SIZE_T
115AC_TYPE_UINT16_T
116AC_TYPE_UINT32_T
117AC_TYPE_UINT8_T
118
119# Checks for library functions.
120AC_CHECK_FUNCS([memset putenv strchr strtol])
121
122AC_CONFIG_FILES([
123 Makefile
124 src/driver/Makefile
125 src/Makefile
126 src/examples/Makefile
127 src/tests/Makefile
128 src/libcfa/Makefile
129 ])
130
131AC_OUTPUT
132
133# Final text
134AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)
Note: See TracBrowser for help on using the repository browser.