1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
|
## -*- mode: Autoconf -*-
##
## Copyright (c) 2012, 2013, 2014, 2015, 2016 The University of Utah
## All rights reserved.
##
## This file is distributed under the University of Illinois Open Source
## License. See the file COPYING for details.
###############################################################################
m4_include([version.m4])
AC_INIT(creduce, CREDUCE_VERSION, CREDUCE_BUGREPORT, creduce, CREDUCE_URL)
AC_CONFIG_SRCDIR(clang_delta/ClangDelta.cpp)
AC_CONFIG_AUX_DIR(autoconf)
AC_CONFIG_MACRO_DIR(m4)
AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_TARGET
# `-Wno-portability': avoid warnings about using `:=' in `Makefile.am' files.
AM_INIT_AUTOMAKE([-Wall -Wno-portability])
AM_MAINTAINER_MODE
# Avoid configure-time warnings about `--datarootdir' being ignored.
# This can perhaps be removed in a few years after Autoconf 2.60.
# See <http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html>
#
AC_DEFUN([AC_DATAROOTDIR_CHECKED])
###############################################################################
## clang_delta
dnl AC_PROG_CC # Automake 1.11 want us to use AM_PROG_CC_C_O instead...
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_LIBTOOL
AX_LLVM([3.9],[engine])
# Handle configure-time choice of assertion-checking method.
#
AC_ARG_ENABLE([trans-assert],
AS_HELP_STRING([--enable-trans-assert],
[use assert() in clang_delta transformations [default=yes]]),
[],
[enable_trans_assert=yes])
AS_IF([test "x$enable_trans_assert" = "xyes"],
AC_DEFINE([ENABLE_TRANS_ASSERT], [1],
[Use assert() in clang_delta transformations.]))
# If we are using g++ or clang++, set the default `CXXFLAGS' to something more
# pedantic. (Both g++ and clang++ cause `GXX' to be set.)
#
# `-fno-strict-aliasing' quiets many warnings about LLVM headers and possibly
# improves our chances at working code.
# `-Wno-unused-parameter' quiets many warnings about LLVM headers.
# `-Wno-missing-field-initializers' quiets many warnings about LLVM headers.
#
if test "$ac_test_CXXFLAGS" = set; then
# The user specified `CXXFLAGS', so do nothing.
CXXFLAGS="$CXXFLAGS"
elif test "$GXX" = yes; then
CXXFLAGS="-g -O3 -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers"
fi
###############################################################################
## clex
AM_PROG_LEX
###############################################################################
## creduce
AC_ARG_VAR([PERL], [Perl interpreter])
AC_PATH_PROG([PERL], [perl], [no])
AS_IF([test "x$PERL" = "xno"],
AC_MSG_ERROR([a Perl interpreter was not found]))
AX_PROG_PERL_VERSION([5.10.0],
[],
AC_MSG_ERROR([C-Reduce requires Perl 5.10.0 or later]))
# Check for the run-time prerequisites of C-Reduce. We only warn the user when
# these are not found at configure time. Let the user install the dependencies
# later.
#
missing_required_runtime_prereq=no
missing_optional_runtime_prereq=no
#
# creduce/creduce.in
#
AX_PROG_PERL_MODULES(
[
Exporter::Lite
File::Which
Getopt::Tabular
Regexp::Common
],
[
REQUIRED_PERL_MODULES=yes
],
[
REQUIRED_PERL_MODULES=no
missing_required_runtime_prereq=yes
])
AX_PROG_PERL_MODULES(
[
Sys::CPU
Term::ReadKey
],
[
OPTIONAL_PERL_MODULES=yes
],
[
OPTIONAL_PERL_MODULES=no
missing_optional_runtime_prereq=yes
])
#
# creduce/pass_indent.pm
#
AC_ARG_VAR([CLANG_FORMAT], [`clang-format' (LLVM/Clang) program])
AC_PATH_PROG([CLANG_FORMAT], [clang-format], [no], [$LLVM_BINDIR:$PATH])
AS_IF([test "x$CLANG_FORMAT" = "xno"], [missing_required_runtime_prereq=yes])
###############################################################################
AC_OUTPUT(
Makefile
clang_delta/Makefile
clex/Makefile
creduce/Makefile
delta/Makefile
scripts/Makefile
tests/Makefile
unifdef/Makefile
)
###############################################################################
# Warn about things that will be needed at run time, but which we did not find
# at configure time.
#
# First warn about required run-time dependencies...
#
AS_IF([test "$missing_required_runtime_prereq" = "yes"],
AS_BOX([WARNING: You cannot run C-Reduce until you install missing dependencies!]))
AS_IF([test "$REQUIRED_PERL_MODULES" = "no"],
[
AC_MSG_WARN([You must install Perl modules required by C-Reduce.])
])
AS_IF([test "x$CLANG_FORMAT" = "xno"],
[
AC_MSG_WARN([You must install `clang-format' before running C-Reduce.])
CLANG_FORMAT=clang-format
])
AS_IF([test "$missing_required_runtime_prereq" = "yes"],
AC_MSG_WARN([Read the INSTALL file for info about C-Reduce dependencies.]))
# ...and then warn about optional run-time dependencies.
#
AS_IF([test "$missing_optional_runtime_prereq" = "yes"],
AS_BOX([NOTE: The following optional C-Reduce dependencies were not found. ]))
AS_IF([test "$OPTIONAL_PERL_MODULES" = "no"],
[
AC_MSG_NOTICE([One or more useful Perl modules were not found.])
])
AS_IF([test "$missing_optional_runtime_prereq" = "yes"],
AC_MSG_NOTICE([C-Reduce will use these tools if you install them in the future.]))
AS_IF([test "$missing_optional_runtime_prereq" = "yes"],
AC_MSG_NOTICE([Read the INSTALL file for info about C-Reduce dependencies.]))
###############################################################################
## End of file.
|