3 dnl File name: configure.in
5 dnl Author: Matthias Braun
7 dnl Copyright: (c) 2002-2007 University of Karlsruhe
8 dnl Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
12 m4_define([firm_major_version], [1])
13 m4_define([firm_minor_version], [13])
14 m4_define([firm_micro_version], [0])
15 m4_define([firm_version],
16 [firm_major_version.firm_minor_version.firm_micro_version])
17 AC_INIT([libfirm], [firm_version], [firm@ipd.info.uni-karlsruhe.de])
18 AC_CONFIG_SRCDIR([ir/common/firm.c])
19 AM_INIT_AUTOMAKE([foreign dist-bzip2 1.9])
21 # see libtool manual on what version numbers mean!
23 AC_SUBST([LT_VERSION])
25 AC_DEFINE([libfirm_VERSION_MAJOR], [firm_major_version], [Firms major version number])
26 AC_DEFINE([libfirm_VERSION_MINOR], [firm_minor_version], [Firms minor version number])
27 AC_DEFINE([libfirm_VERSION_MICRO], [firm_micro_version], [Firms micro version number])
29 dnl generate the config header file
30 AC_CONFIG_HEADER([config.h])
32 dnl keep track of the environment set by the user
33 libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS'}"
34 AC_SUBST(libfirm_conf_env)
39 dnl check for additional include dirs
40 AC_ARG_WITH(includedir, [ --with-includedir=add colon seperated list of directories to include search path],
41 CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`)
43 dnl check for additional library dirs
44 AC_ARG_WITH(libdir, [ --with-libdir=add colon seperated list of directories to linker search path],
45 LDFLAGS=$LDFLAGS" -L"`echo $withval|sed 's;\:; -L;g'`)
49 AC_ARG_ENABLE([debug],
50 [AS_HELP_STRING([--disable-debug], [disable verifiers and additional debugging routines])],
51 [enable_debug_libfirm="$enableval"], [enable_debug_libfirm="yes"])
52 if test "$enable_debug_libfirm" = yes; then
53 FIRMCONFIG_DEBUG_libfirm="#define DEBUG_libfirm"
55 AC_SUBST([FIRMCONFIG_DEBUG_libfirm])
56 AC_SUBST([enable_debug_libfirm])
58 AC_ARG_ENABLE([assert],
59 [AS_HELP_STRING([--disable-assert], [disable assertions])],
60 [enable_assert="$enableval"], [enable_assert="yes"])
61 if test "$enable_assert" = no; then
62 AC_DEFINE([NDEBUG], [], [define to disable asserts])
64 AC_SUBST([enable_assert])
68 AC_ARG_ENABLE([inlining],
69 [AS_HELP_STRING([--disable-inlining], [disable inline C-extension])],
70 [enable_inlining="$enableval"], [enable_inlining="yes"])
72 if test "$enable_inlining" = yes; then
73 FIRMCONFIG_USE_INLINING="#define USE_INLINING"
75 AC_SUBST([FIRMCONFIG_USE_INLINING])
76 AC_SUBST([enable_inlining])
80 AC_ARG_ENABLE([profile],
81 [AS_HELP_STRING([--enable-profile], [enable profiling])],
82 [enable_profile_libfirm="$enableval"], [enable_profile_libfirm="no"])
84 AC_SUBST([enable_profile_libfirm])
88 AC_ARG_ENABLE([hooks],
89 [AS_HELP_STRING([--disable-hooks], [disable Firm hooks])],
90 [enable_hooks="$enableval"], [enable_hooks="yes"])
92 if test "$enable_hooks" = yes; then
93 FIRMCONFIG_FIRM_ENABLE_HOOKS="#define FIRM_ENABLE_HOOKS"
95 AC_SUBST([FIRMCONFIG_FIRM_ENABLE_HOOKS])
97 dnl enable Firm statistics
99 AC_ARG_ENABLE([statistics],
100 [AS_HELP_STRING([--enable-statistics], [enable Firm statistics])],
101 [enable_statistics="$enableval"], [enable_statistics="yes"])
103 if test "$enable_statistics" = yes; then
104 FIRMCONFIG_FIRM_STATISTICS="#define FIRMCONFIG_FIRM_STATISTICS"
106 AC_SUBST([FIRMCONFIG_FIRM_STATISTICS])
107 AC_SUBST([enable_statistics])
109 dnl enable ILP solver support
110 dnl --------------------------------
112 [AS_HELP_STRING([--enable-ilp], [enable ilp solver])],
113 [enable_ilp="$enableval"], [enable_ilp="no"])
115 if test "$enable_ilp" = yes; then
116 FIRMCONFIG_WITH_ILP="#define FIRMCONFIG_WITH_ILP"
118 AC_SUBST([FIRMCONFIG_WITH_ILP])
121 dnl enable wchar_t support for identifiers
122 dnl --------------------------------
123 AC_ARG_ENABLE([wchar_support],
124 [AS_HELP_STRING([--enable-wchar-support], [enable wchar_t support for identifiers (needed for java)])],
125 [enable_wchar_support="$enableval"], [enable_wchar_support="no"])
127 if test "$enable_wchar_support" = yes; then
128 FIRMCONFIG_FIRM_ENABLE_WCHAR="#define FIRM_ENABLE_WCHAR"
130 AC_SUBST([FIRMCONFIG_FIRM_ENABLE_WCHAR])
131 AC_SUBST([enable_wchar_support])
135 AC_ARG_ENABLE([backend],
136 [AS_HELP_STRING([--disable-backend], [disable backends])],
137 [enable_backend="$enableval"], [enable_backend="yes"])
139 AC_SUBST(enable_backend)
141 dnl Checks for programs.
142 dnl ====================
144 dnl check for a C compiler
145 dnl ----------------------
149 AC_PATH_PROGS(PERL, perl perl5)
155 dnl Checks for header files.
156 dnl ========================
159 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
161 dnl Checks for libraries.
162 dnl =====================
164 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
165 if test "$ac_m_library" != yes; then
166 dnl std math library not found.
167 AC_MSG_ERROR("standard math library not found")
170 dnl Checks for typedefs, structures, and compiler characteristics.
171 dnl ==============================================================
178 dnl Checks for library functions.
179 dnl =============================
181 dnl check for strerror
183 AC_CHECK_FUNC(strerror,,
184 AC_MSG_ERROR("need strerror function")
187 dnl we use the gnu extension obstack_printf
188 AC_DEFINE([_GNU_SOURCE], [], [we use gnu extensions])
189 AC_CHECK_FUNC(strerror,,
190 AC_MSG_ERROR("need obstack_printf function")
202 include/libfirm/Makefile
207 if test "$enable_backend" == yes; then
208 BACKENDS="arm ia32 mips ppc32"
214 dnl output summary of firm configuration
216 echo "firm configuration summary:"
217 echo " backends $BACKENDS"
218 echo " profiling $enable_profile_libfirm"
219 echo " debug/verifiers $enable_debug_libfirm"
220 echo " assertions $enable_assert"
221 echo " hooks $enable_hooks"
222 echo " statistics $enable_statistics"
223 echo " ilp $enable_ilp"
224 echo " jvm $enable_jvm"
225 echo " wide char support $enable_wchar_support"