auto* updates
[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], [18])
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 enable libtool
30 LT_INIT([win32-dll])
31
32 dnl generate the config header file
33 AC_CONFIG_HEADER([config.h])
34
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)
38
39 dnl Package options
40 dnl ===============
41
42 dnl check for additional include dirs
43 AC_ARG_WITH(includedir, [  --with-includedir=add   colon seperated list of directories to include search path],
44     CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`)
45
46 dnl check for additional library dirs
47 AC_ARG_WITH(libdir, [  --with-libdir=add       colon seperated list of directories to linker search path],
48     LDFLAGS=$LDFLAGS" -L"`echo $withval|sed 's;\:; -L;g'`)
49
50 dnl set debugging
51 dnl -------------
52 AC_ARG_ENABLE([debug],
53 [AS_HELP_STRING([--disable-debug], [disable verifiers and additional debugging routines])],
54 [enable_debug_libfirm="$enableval"], [enable_debug_libfirm="yes"])
55 if test "$enable_debug_libfirm" = yes; then
56         AC_DEFINE([DEBUG_libfirm], [], [define to enable debug mode and checks])
57 fi
58
59 AC_ARG_ENABLE([assert],
60 [AS_HELP_STRING([--disable-assert], [disable assertions])],
61 [enable_assert="$enableval"], [enable_assert="yes"])
62 if test "$enable_assert" = no; then
63   AC_DEFINE([NDEBUG], [], [define to disable asserts])
64 fi
65 AC_SUBST([enable_assert])
66
67 dnl set profiling
68 dnl -------------
69 AC_ARG_ENABLE([profile],
70 [AS_HELP_STRING([--enable-profile], [enable profiling])],
71 [enable_profile_libfirm="$enableval"], [enable_profile_libfirm="no"])
72
73 AC_SUBST([enable_profile_libfirm])
74
75 dnl enable Firm statistics
76 dnl -------------
77 AC_ARG_ENABLE([statistics],
78 [AS_HELP_STRING([--enable-statistics], [enable Firm statistics])],
79 [enable_statistics="$enableval"], [enable_statistics="yes"])
80
81 if test "$enable_statistics" = yes; then
82         FIRMCONFIG_FIRM_STATISTICS="#define FIRMCONFIG_FIRM_STATISTICS"
83 fi
84 AC_SUBST([FIRMCONFIG_FIRM_STATISTICS])
85 AC_SUBST([enable_statistics])
86
87 dnl enable ILP solver support
88 dnl --------------------------------
89 AC_ARG_ENABLE([ilp],
90 [AS_HELP_STRING([--enable-ilp], [enable ilp solver])],
91 [enable_ilp="$enableval"], [enable_ilp="no"])
92
93 if test "$enable_ilp" = yes; then
94   FIRMCONFIG_WITH_ILP="#define FIRMCONFIG_WITH_ILP"
95   AC_DEFINE([WITH_ILP], [], [enable to build code using ilp solvers])
96 fi
97
98 dnl disable backend
99 dnl ---------------
100 AC_ARG_ENABLE([backend],
101 [AS_HELP_STRING([--disable-backend], [disable backends])],
102 [enable_backend="$enableval"], [enable_backend="yes"])
103
104 AC_SUBST(enable_backend)
105
106 dnl Checks for programs.
107 dnl ====================
108
109 dnl check for a C compiler
110 dnl ----------------------
111 AC_PROG_CC
112
113 AC_PATH_PROGS(PERL, perl perl5)
114
115 dnl check for awk
116 dnl -------------
117 AC_PROG_AWK
118
119 dnl Checks for header files.
120 dnl ========================
121
122 AC_HEADER_STDC
123 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
124 AC_CHECK_HEADERS([alloca.h])
125
126 dnl Checks for libraries.
127 dnl =====================
128
129 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
130 if test "$ac_m_library" != yes; then
131   dnl std math library not found.
132   AC_MSG_ERROR("standard math library not found")
133 fi
134
135 dnl Checks for typedefs, structures, and compiler characteristics.
136 dnl ==============================================================
137 AC_C_CONST
138 AC_C_VOLATILE
139 AC_C_INLINE
140 AC_C_BIGENDIAN(,,,)
141 AC_C_LONG_DOUBLE
142
143 dnl Checks for library functions.
144 dnl =============================
145
146 AC_FUNC_STRTOLD
147
148 dnl Error messaging
149 dnl ===============
150
151
152 dnl Output results
153 AC_CONFIG_FILES([
154         Makefile
155         ir/Makefile
156         include/libfirm/Makefile
157         libfirm.pc
158 ])
159
160 #always do inlining
161 AC_DEFINE([INLINE], [inline], [define inline to compiler inline keyword])
162
163 BACKENDS=""
164 if test "$enable_backend" = yes; then
165         BACKENDS="arm ia32 mips ppc32 sparc"
166 fi
167 AC_SUBST([BACKENDS])
168
169 AC_OUTPUT
170
171 dnl output summary of firm configuration
172 echo ""
173 echo "firm configuration summary:"
174 echo "     backends              $BACKENDS"
175 echo "     profiling             $enable_profile_libfirm"
176 echo "     debug/verifiers       $enable_debug_libfirm"
177 echo "     assertions            $enable_assert"
178 echo "     statistics            $enable_statistics"
179 echo "     ilp                   $enable_ilp"
180 echo ""