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], [18])
14 m4_define([firm_micro_version], [1])
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])
32 dnl generate the config header file
33 AC_CONFIG_HEADER([config.h])
35 dnl keep track of the environment set by the user
36 libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS -lm'}"
37 AC_SUBST(libfirm_conf_env)
39 dnl enable visibility hidden
40 CFLAGS="-fvisibility=hidden"
41 AC_DEFINE([FIRM_BUILD], [], [Defined when firm library is built])
46 dnl check for additional include dirs
47 AC_ARG_WITH(includedir, [ --with-includedir=add colon seperated list of directories to include search path],
48 CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`)
50 dnl check for additional library dirs
51 AC_ARG_WITH(libdir, [ --with-libdir=add colon seperated list of directories to linker search path],
52 LDFLAGS=$LDFLAGS" -L"`echo $withval|sed 's;\:; -L;g'`)
56 AC_ARG_ENABLE([debug],
57 [AS_HELP_STRING([--disable-debug], [disable verifiers and additional debugging routines])],
58 [enable_debug_libfirm="$enableval"], [enable_debug_libfirm="yes"])
59 if test "$enable_debug_libfirm" = yes; then
60 AC_DEFINE([DEBUG_libfirm], [], [define to enable debug mode and checks])
63 AC_ARG_ENABLE([assert],
64 [AS_HELP_STRING([--disable-assert], [disable assertions])],
65 [enable_assert="$enableval"], [enable_assert="yes"])
66 if test "$enable_assert" = no; then
67 AC_DEFINE([NDEBUG], [], [define to disable asserts])
69 AC_SUBST([enable_assert])
73 AC_ARG_ENABLE([profile],
74 [AS_HELP_STRING([--enable-profile], [enable profiling])],
75 [enable_profile_libfirm="$enableval"], [enable_profile_libfirm="no"])
77 AC_SUBST([enable_profile_libfirm])
79 dnl enable Firm statistics
81 AC_ARG_ENABLE([statistics],
82 [AS_HELP_STRING([--enable-statistics], [enable Firm statistics])],
83 [enable_statistics="$enableval"], [enable_statistics="yes"])
85 if test "$enable_statistics" = yes; then
86 FIRMCONFIG_FIRM_STATISTICS="#define FIRMCONFIG_FIRM_STATISTICS"
88 AC_SUBST([FIRMCONFIG_FIRM_STATISTICS])
89 AC_SUBST([enable_statistics])
91 dnl enable ILP solver support
92 dnl --------------------------------
94 [AS_HELP_STRING([--enable-ilp], [enable ilp solver])],
95 [enable_ilp="$enableval"], [enable_ilp="no"])
97 if test "$enable_ilp" = yes; then
98 FIRMCONFIG_WITH_ILP="#define FIRMCONFIG_WITH_ILP"
99 AC_DEFINE([WITH_ILP], [], [enable to build code using ilp solvers])
104 AC_ARG_ENABLE([backend],
105 [AS_HELP_STRING([--disable-backend], [disable backends])],
106 [enable_backend="$enableval"], [enable_backend="yes"])
108 AC_SUBST(enable_backend)
110 dnl Checks for programs.
111 dnl ====================
113 dnl check for a C compiler
114 dnl ----------------------
117 AC_PATH_PROGS(PERL, perl perl5)
123 dnl Checks for header files.
124 dnl ========================
127 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
128 AC_CHECK_HEADERS([alloca.h])
130 dnl Checks for libraries.
131 dnl =====================
133 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
134 if test "$ac_m_library" != yes; then
135 dnl std math library not found.
136 AC_MSG_ERROR("standard math library not found")
139 dnl Checks for typedefs, structures, and compiler characteristics.
140 dnl ==============================================================
147 dnl Checks for library functions.
148 dnl =============================
160 include/libfirm/Makefile
165 AC_DEFINE([INLINE], [inline], [define inline to compiler inline keyword])
168 if test "$enable_backend" = yes; then
169 BACKENDS="arm ia32 mips ppc32 sparc amd64"
175 dnl output summary of firm configuration
177 echo "firm configuration summary:"
178 echo " backends $BACKENDS"
179 echo " profiling $enable_profile_libfirm"
180 echo " debug/verifiers $enable_debug_libfirm"
181 echo " assertions $enable_assert"
182 echo " statistics $enable_statistics"
183 echo " ilp $enable_ilp"