forked from pmatos/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
153 lines (133 loc) · 4.54 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
# SPDX-License-Identifier: BSD-3-Clause
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([Boomerang],[0.3.1])
AC_CONFIG_SRCDIR([boomerang.cpp])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
LT_INIT([dlopen disable-static])
AC_ARG_ENABLE([modules],
[AS_HELP_STRING(
[--enable-modules],
[enable loadable modules for the loader and frontend])],
[],
[AS_VAR_SET([enable_modules], [no])])
AC_ARG_ENABLE([gui],
[AS_HELP_STRING(
[--disable-gui],
[do not build the GUI])],
[],
[AS_VAR_SET([enable_gui], [yes])])
AC_ARG_WITH([expat],
[AS_HELP_STRING(
[--with-expat],
[enable XML loading])],
[],
[AS_VAR_SET([with_expat], [no])])
AC_ARG_WITH([gc],
[AS_HELP_STRING(
[--with-gc],
[enable the garbage collector])],
[],
[AS_VAR_SET([with_gc], [no])])
AC_ARG_VAR([BISONPP],[bison++ command])
AC_ARG_VAR([FLEXPP],[flex++ command])
AC_ARG_VAR([M4],[m4 command])
AC_ARG_VAR([NOTANGLE],[notangle command])
AC_ARG_VAR([MOC],[Qt5 moc command])
AC_ARG_VAR([UIC],[Qt5 uic command])
AC_ARG_VAR([RCC],[Qt5 rcc command])
AC_ARG_VAR([NJMC_TOOLKIT],[SML/NJ njmc-toolkit command])
AC_ARG_VAR([TOOLS],[tools command])
AC_ARG_VAR([UNGENERATE],[ungenerate command])
# Checks for programs.
AC_PROG_CXX
AC_PROG_GREP
PKG_PROG_PKG_CONFIG
AX_CXX_COMPILE_STDCXX([17])
AC_CHECK_PROGS([BISONPP],[bison++])
AS_IF([test "x$BISONPP" = "x"],[AC_MSG_ERROR([no acceptable bison++ could be found in \$PATH])])
AC_CHECK_PROGS([FLEXPP],[flex++])
AS_IF([test "x$FLEXPP" = "x"],[AC_MSG_ERROR([no acceptable flex++ could be found in \$PATH])])
AC_CHECK_PROGS([M4],[m4])
AS_IF([test "x$M4" = "x"],[AC_MSG_ERROR([no acceptable m4 could be found in \$PATH])])
AC_CHECK_PROGS([NOTANGLE],[notangle])
AS_IF([test "x$NOTANGLE" = "x"],[AC_MSG_ERROR([no acceptable notangle could be found in \$PATH])])
AS_IF([test "x$enable_gui" = "xyes"], [
AC_CHECK_PROGS([MOC],[moc-qt5])
AS_IF([test "x$MOC" = "x"],[AC_MSG_ERROR([no acceptable moc could be found in \$PATH])])
AC_CHECK_PROGS([UIC],[uic-qt5])
AS_IF([test "x$UIC" = "x"],[AC_MSG_ERROR([no acceptable uic could be found in \$PATH])])
AC_CHECK_PROGS([RCC],[rcc-qt5])
AS_IF([test "x$RCC" = "x"],[AC_MSG_ERROR([no acceptable rcc could be found in \$PATH])])
])
# ML version of the toolkit
AC_CHECK_PROGS([NJMC_TOOLKIT],[njmc-toolkit])
AS_IF([test "x$NJMC_TOOLKIT" = "x"],[AC_MSG_ERROR([no acceptable njmc-toolkit could be found in \$PATH])])
# Icon version of the toolkit
AC_CHECK_PROGS([TOOLS],[tools],[:])
AC_CHECK_PROGS([UNGENERATE],[ungenerate],[:])
# Checks for libraries.
AS_IF([test "x$with_expat" = "xyes"], [
PKG_CHECK_MODULES([EXPAT],[expat])
])
AS_IF([test "x$with_gc" = "xyes"], [
PKG_CHECK_MODULES([GC],[bdw-gc])
])
AS_IF([test "x$enable_gui" = "xyes"], [
PKG_CHECK_MODULES([QT],[Qt5Core Qt5Gui Qt5Widgets])
AC_SUBST([QT_CXXFLAGS],[""])
AC_MSG_CHECKING([whether Qt5 code must be position independent])
AS_IF([$PKG_CONFIG --variable=qt_config Qt5Core | $GREP reduce_relocations >/dev/null 2>&1], [
QT_CXXFLAGS=$lt_prog_compiler_pic_CXX
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])
PKG_CHECK_MODULES([CPPUNIT],[cppunit],
[],
[AC_MSG_WARN([$CPPUNIT_PKG_ERRORS, needed only for testing])])
# Checks for header files.
#AC_HEADER_STDC
#AC_CHECK_HEADERS(fcntl.h unistd.h)
AC_CHECK_HEADERS([elf.h])
# Checks for typedefs, structures, and compiler characteristics.
#AC_C_BIGENDIAN
# Checks for library functions.
AM_CONDITIONAL([DYNAMIC], [test "x$enable_modules" = "xyes"])
AM_CONDITIONAL([GUI], [test "x$enable_gui" = "xyes"])
AM_CONDITIONAL([GC], [test "x$with_gc" = "xyes"])
AS_IF([test "x$enable_modules" = "xyes"], [
AC_DEFINE([DYNAMIC], [1], [Define to 1 to enable support for modules (requires dlopen)])
AC_DEFINE([MODPREFIX], [""], [Define to the module name prefix])
AC_DEFINE([MODSUFFIX], [".so"], [Define to the module name suffix])
])
AS_IF([test "x$with_expat" = "xyes"], [
AC_DEFINE([ENABLE_XML_LOAD], [1], [Define to 1 to enable XML loading (requires expat)])
])
AS_IF([test "x$with_gc" = "xyes"], [
AC_DEFINE([GARBAGE_COLLECTOR], [1], [Define to 1 to enable garbage collection (requires gc)])
])
AC_CONFIG_FILES([
Doxyfile
Makefile
c/Makefile
codegen/Makefile
db/Makefile
frontend/Makefile
loader/Makefile
qtgui2/Makefile
signatures/Makefile
transform/Makefile
transformations/Makefile
type/Makefile
util/Makefile
])
AC_CONFIG_FILES([frontend/mltk.sh],[chmod +x frontend/mltk.sh])
AC_CONFIG_HEADERS([include/config.h])
AC_OUTPUT