hooks are always enabled now -> one less option
[libfirm] / configure.ac
1 dnl
2 dnl Project:     libFIRM
3 dnl File name:   configure.in
4 dnl Purpose:
5 dnl Author:      Matthias Braun
6 dnl CVS-ID:      $Id$
7 dnl Copyright:   (c) 2002-2007 University of Karlsruhe
8 dnl Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
9 dnl
10 AC_PREREQ([2.54])
11 AC_REVISION([$Id$])
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])
20
21 # see libtool manual on what version numbers mean!
22 LT_VERSION=0:0:0
23 AC_SUBST([LT_VERSION])
24
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])
28
29 dnl generate the config header file
30 AC_CONFIG_HEADER([config.h])
31
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)
35
36 dnl Package options
37 dnl ===============
38
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'`)
42
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'`)
46
47 dnl set debugging
48 dnl -------------
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         AC_DEFINE([DEBUG_libfirm], [], [define to enable debug mode and checks])
54 fi
55
56 AC_ARG_ENABLE([assert],
57 [AS_HELP_STRING([--disable-assert], [disable assertions])],
58 [enable_assert="$enableval"], [enable_assert="yes"])
59 if test "$enable_assert" = no; then
60   AC_DEFINE([NDEBUG], [], [define to disable asserts])
61 fi
62 AC_SUBST([enable_assert])
63
64 dnl set profiling
65 dnl -------------
66 AC_ARG_ENABLE([profile],
67 [AS_HELP_STRING([--enable-profile], [enable profiling])],
68 [enable_profile_libfirm="$enableval"], [enable_profile_libfirm="no"])
69
70 AC_SUBST([enable_profile_libfirm])
71
72 dnl enable Firm statistics
73 dnl -------------
74 AC_ARG_ENABLE([statistics],
75 [AS_HELP_STRING([--enable-statistics], [enable Firm statistics])],
76 [enable_statistics="$enableval"], [enable_statistics="yes"])
77
78 if test "$enable_statistics" = yes; then
79         FIRMCONFIG_FIRM_STATISTICS="#define FIRMCONFIG_FIRM_STATISTICS"
80 fi
81 AC_SUBST([FIRMCONFIG_FIRM_STATISTICS])
82 AC_SUBST([enable_statistics])
83
84 dnl enable ILP solver support
85 dnl --------------------------------
86 AC_ARG_ENABLE([ilp],
87 [AS_HELP_STRING([--enable-ilp], [enable ilp solver])],
88 [enable_ilp="$enableval"], [enable_ilp="no"])
89
90 if test "$enable_ilp" = yes; then
91   FIRMCONFIG_WITH_ILP="#define FIRMCONFIG_WITH_ILP"
92   AC_DEFINE([WITH_ILP], [], [enable to build code using ilp solvers])
93 fi
94
95 dnl enable wchar_t support for identifiers
96 dnl --------------------------------
97 AC_ARG_ENABLE([wchar_support],
98 [AS_HELP_STRING([--enable-wchar-support], [enable wchar_t support for identifiers (needed for java)])],
99 [enable_wchar_support="$enableval"], [enable_wchar_support="no"])
100
101 if test "$enable_wchar_support" = yes; then
102   FIRMCONFIG_FIRM_ENABLE_WCHAR="#define FIRM_ENABLE_WCHAR"
103 fi
104 AC_SUBST([FIRMCONFIG_FIRM_ENABLE_WCHAR])
105 AC_SUBST([enable_wchar_support])
106
107 dnl disable backend
108 dnl ---------------
109 AC_ARG_ENABLE([backend],
110 [AS_HELP_STRING([--disable-backend], [disable backends])],
111 [enable_backend="$enableval"], [enable_backend="yes"])
112
113 AC_SUBST(enable_backend)
114
115 dnl Checks for programs.
116 dnl ====================
117
118 dnl check for a C compiler
119 dnl ----------------------
120 AC_PROG_CC
121 AC_PROG_LIBTOOL
122
123 AC_PATH_PROGS(PERL, perl perl5)
124
125 dnl check for awk
126 dnl -------------
127 AC_PROG_AWK
128
129 dnl Checks for header files.
130 dnl ========================
131
132 AC_HEADER_STDC
133 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
134
135 dnl Checks for libraries.
136 dnl =====================
137
138 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
139 if test "$ac_m_library" != yes; then
140   dnl std math library not found.
141   AC_MSG_ERROR("standard math library not found")
142 fi
143
144 dnl Checks for typedefs, structures, and compiler characteristics.
145 dnl ==============================================================
146 AC_C_CONST
147 AC_C_VOLATILE
148 AC_C_INLINE
149 AC_C_BIGENDIAN(,,,)
150 AC_C_LONG_DOUBLE
151
152 dnl Checks for library functions.
153 dnl =============================
154
155 dnl check for strerror
156
157 AC_CHECK_FUNC(strerror,,
158   AC_MSG_ERROR("need strerror function")
159 )
160
161 dnl we use the gnu extension obstack_printf
162 AC_DEFINE([_GNU_SOURCE], [], [we use gnu extensions])
163 AC_CHECK_FUNC(strerror,,
164   AC_MSG_ERROR("need obstack_printf function")
165 )
166
167 dnl Error messaging
168 dnl ===============
169
170
171 dnl Output results
172 AC_CONFIG_FILES([
173         firm_config.h
174         Makefile
175         ir/Makefile
176         include/libfirm/Makefile
177         libfirm.pc
178 ])
179
180 #always do inlining
181 AC_DEFINE([INLINE], [inline], [define inline to compiler inline keyword])
182
183 BACKENDS=""
184 if test "$enable_backend" == yes; then
185         BACKENDS="arm ia32 mips ppc32"
186 fi
187 AC_SUBST([BACKENDS])
188
189 AC_OUTPUT
190
191 dnl output summary of firm configuration
192 echo ""
193 echo "firm configuration summary:"
194 echo "     backends              $BACKENDS"
195 echo "     profiling             $enable_profile_libfirm"
196 echo "     debug/verifiers       $enable_debug_libfirm"
197 echo "     assertions            $enable_assert"
198 echo "     statistics            $enable_statistics"
199 echo "     ilp                   $enable_ilp"
200 echo "     jvm                   $enable_jvm"
201 echo "     wide char support     $enable_wchar_support"
202 echo ""