-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
157 lines (141 loc) · 4.39 KB
/
configure.ac
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
# Process this file with autoconf to produce a configure script.
##
# CHSM Language System
# configure.ac
#
# Copyright (C) 1996-2018 Paul J. Lucas & Fabio Riccardi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
##
AC_INIT([CHSM], [5.0], [paul@lucasmail.org],,[https://github.com/paul-j-lucas/chsm])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
# Checks for programs.
AC_PROG_CXX
gl_EARLY
AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
AM_PROG_AR
AC_PROG_INSTALL
AC_PROG_LEX
AC_PROG_MKDIR_P
AC_PROG_RANLIB
AC_PROG_YACC
AC_ARG_VAR([GROOVY_HOME],[Groovy home directory])
AC_ARG_VAR([JAVAC],[Java compiler command])
test "x$LEX" = xflex ||
AC_MSG_ERROR([required program "flex" not found])
test "x$YACC" = xyacc &&
AC_MSG_ERROR([required program "bison" or "byacc" not found])
# Checks for libraries.
# Checks for header files.
AC_HEADER_ASSERT
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([sysexits.h])
gl_INIT
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
# Program feature: stack-debug (enabled by default)
AC_ARG_ENABLE([stack-debug],
AS_HELP_STRING([--disable-stack-debug], [disable support for stack debugging]),
[],
[enable_stack_debug=yes]
)
AS_IF([test x$enable_stack_debug = xyes],
[AC_DEFINE([ENABLE_STACK_DEBUG], [1],
[Define to 1 if CHSM debugging is enabled.])]
)
# Program feature: yacc debug (disabled by default)
AC_ARG_ENABLE([yydebug],
AS_HELP_STRING([--enable-yydebug], [enable support for yacc debugging]),
[],
[enable_yydebug=no]
)
AS_IF([test x$enable_yydebug = xyes],
[AC_DEFINE([YYDEBUG], [1],
[Define to 1 if yacc debugging is enabled.])]
)
# Program feature: Groovy version (disabled by default)
AC_ARG_ENABLE([groovy],
AS_HELP_STRING([--enable-groovy], [enable Groovy version (implies --enable-java)]),
[],
[enable_groovy=no]
)
if test "x$enable_groovy" = xyes
then
test "x$GROOVY_HOME" != x ||
AC_MSG_ERROR([required GROOVY_HOME environment variable for --enable-groovy not set])
AC_SUBST([GROOVY_HOME],[$GROOVY_HOME])
fi
# Program feature: Java version (disabled by default)
AC_ARG_ENABLE([java],
AS_HELP_STRING([--enable-java], [enable Java version]),
[],
[enable_java=no]
)
if test "x$enable_groovy" = xyes
then enable_java=yes # --enable-groovy implies --enable-java
fi
if test "x$enable_java" = xyes
then
AX_PROG_ANT
AX_PROG_JAVAC
AX_PROG_JAVA
AC_DEFINE([ENABLE_JAVA], [1],
[Define to 1 if Java version is enabled.])
fi
# Makefile conditionals.
AM_CONDITIONAL([ENABLE_GROOVY], [test x$enable_groovy = xyes])
AM_CONDITIONAL([ENABLE_JAVA], [test x$enable_java = xyes])
AM_CONDITIONAL([ENABLE_STACK_DEBUG], [test x$enable_stack_debug = xyes])
AM_CONDITIONAL([ENABLE_YYDEBUG], [test x$enable_yydebug = xyes])
# Miscellaneous.
AC_LANG(C++)
AX_CXXFLAGS_WARN_ALL
AX_CXXFLAGS_GCC_OPTION([-Wcast-align])
AX_CXXFLAGS_GCC_OPTION([-Wextra])
AX_CXXFLAGS_GCC_OPTION([-Wredundant-decls])
AX_CXXFLAGS_GCC_OPTION([-Wwrite-strings])
# Generate files.
AH_TOP([#ifndef CHSM_config_H
#define CHSM_config_H])
AH_BOTTOM([#endif /* CHSM_config_H */])
AC_CONFIG_HEADERS([src/c++/config.h])
AC_CONFIG_FILES([
Makefile
lib/Makefile
src/Makefile
src/c++/Makefile
src/c++/chsmc/Makefile
src/c++/libchsm/Makefile
src/java/Makefile
src/java/libchsm/Makefile
src/java/libchsm/CHSM/Makefile
src/groovy/Makefile
src/groovy/libchsm/Makefile
src/groovy/libchsm/CHSM/Makefile
src/groovy/libchsm/CHSM/groovy/Makefile
man/Makefile
man/man1/Makefile
man/man4/Makefile
test/Makefile
test/c++/Makefile
test/java/Makefile
test/groovy/build.xml
test/groovy/Makefile
examples/Makefile
examples/c++/Makefile
examples/java/Makefile
])
AC_OUTPUT
# vim:set et sw=2 ts=2: