# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca]) AC_CONFIG_AUX_DIR([automake]) #AC_CONFIG_SRCDIR([src/main.cc]) AC_CONFIG_HEADERS([config.h]) AM_SILENT_RULES([no]) if test "x${CXXFLAGS}" = "x"; then export CXXFLAGS="-std=c++11 -g ${CXXFLAGS}" # defaults, no -O2 for debugging and failures else export CXXFLAGS="-std=c++11 ${CXXFLAGS}" # flags from configure command fi AM_INIT_AUTOMAKE AM_MAINTAINER_MODE(enable) # may require auto* software to be installed # Installation paths AC_ARG_WITH(backend-compiler, [ --with-backend-compiler=PROGRAM PROGRAM that performs the final code compilation (must be gcc-compatible) ], backendcompiler=$withval, backendcompiler="") if test "x$backendcompiler" != "x"; then BACKEND_CC=${backendcompiler} else AC_PATH_PROG(BACKEND_CC, gcc, []) # check gcc installed if test "x$BACKEND_CC" = "x"; then AC_MSG_ERROR(some version of gcc is needed. Get it at ftp://ftp.gnu.org) exit 1 fi fi AC_DEFINE_UNQUOTED(CFA_BACKEND_CC, "${BACKEND_CC}", [Location of include files.]) AC_SUBST(CFA_BACKEND_CC) if test "x$prefix" = "xNONE"; then cfa_prefix=${ac_default_prefix} else cfa_prefix=${prefix} fi AC_DEFINE_UNQUOTED(CFA_PREFIX, "${cfa_prefix}", [Location of cfa install.]) AC_SUBST(CFA_PREFIX, ${cfa_prefix}) if test "$includedir" = '${prefix}/include'; then cfa_incdir="${cfa_prefix}/include" else cfa_incdir=${includedir} fi AC_DEFINE_UNQUOTED(CFA_INCDIR, "${cfa_incdir}", [Location of include files.]) AC_SUBST(CFA_INCDIR, ${cfa_incdir}) if test "$bindir" = '${exec_prefix}/bin'; then cfa_bindir="${cfa_prefix}/bin" else cfa_bindir=${bindir} fi AC_DEFINE_UNQUOTED(CFA_BINDIR, "${cfa_bindir}", [Location of cfa command.]) AC_SUBST(CFA_BINDIR, ${cfa_bindir}) if test "$libdir" = '${exec_prefix}/lib'; then cfa_libdir=${cfa_prefix}/lib else cfa_libdir=${libdir} fi AC_DEFINE_UNQUOTED(CFA_LIBDIR, "${cfa_libdir}", [Location of cc1 and cfa-cpp commands.]) AC_SUBST(CFA_LIBDIR, ${cfa_libdir}) AC_DEFINE_UNQUOTED(CFA_FLAGS, "${CFAFLAGS}", [compilation flags for cfa libraries and test programs.]) AC_SUBST(CFA_FLAGS, ${CFAFLAGS}) # Checks for programs. AC_PROG_CXX AC_PROG_CC AM_PROG_CC_C_O # deprecated # These are often not installed and people miss seeing the "no", so stop the configure. AC_PROG_YACC if test "${YACC}" = "yacc" ; then echo "Error: bison required." ; exit 1 ; fi AC_PROG_LEX if test "${LEX}" = "lex" ; then echo "Error: flex required." ; exit 1 ; fi AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB # Checks for libraries. # Checks for header files. AC_FUNC_ALLOCA AC_CHECK_HEADERS([fenv.h float.h inttypes.h libintl.h limits.h malloc.h stddef.h stdlib.h string.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT8_T AC_C_RESTRICT AC_TYPE_SIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T # Checks for library functions. AC_CHECK_FUNCS([memset putenv strchr strtol]) AC_CONFIG_FILES([ Makefile src/driver/Makefile src/Makefile src/examples/Makefile src/tests/Makefile src/libcfa/Makefile ]) AC_OUTPUT # Final text AC_MSG_RESULT(Cforall configuraton completed. Type "make -j 8 install".)