beifg: Simplify the implementation of be_ifg_foreach_node().
[libfirm] / configure.ac
1 dnl configure.ac file for libfirm, author Matthias Braun <matze@braunis.de>
2 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ([2.60])
4
5 dnl Firm Versions
6 dnl * Increment major/minor/micro version as you see fit. These 3 numbers
7 dnl   are intended for humans and are independent from the libtool versions
8 m4_define([firm_major_version], [1])
9 m4_define([firm_minor_version], [21])
10 m4_define([firm_micro_version], [0])
11 m4_define([firm_version],
12           [firm_major_version.firm_minor_version.firm_micro_version])
13
14 dnl Libtool versions
15 dnl
16 dnl * If any code has changed at all (i.e. bugfixes) increment revision
17 dnl * If any interface has been added, removed or changed increment
18 dnl   current, set revision to 0
19 dnl * If any interface has been added increment age
20 dnl * If any interfaces have been remove set age to 0
21 dnl * use lt_release if substantial things have been changed. The release can be
22 dnl   thought of as part of the library name. So changing the release creates
23 dnl   a new library.
24 m4_define([lt_current],  [1])
25 m4_define([lt_revision], [0])
26 m4_define([lt_age],      [0])
27 dnl we use firm major version as release
28 m4_define([lt_release],  [firm_major_version])
29
30 AC_INIT([libfirm], [firm_version], [firm@ipd.info.uni-karlsruhe.de])
31 AC_CONFIG_SRCDIR([ir/common/firm.c])
32 AM_INIT_AUTOMAKE([foreign dist-bzip2 silent-rules 1.11])
33
34 AM_SILENT_RULES([yes])
35
36 AC_DEFINE([libfirm_VERSION_MAJOR], [firm_major_version], [Firms major version number])
37 AC_DEFINE([libfirm_VERSION_MINOR], [firm_minor_version], [Firms minor version number])
38 AC_DEFINE([libfirm_VERSION_MICRO], [firm_micro_version], [Firms micro version number])
39
40 LT_VERSION="lt_current:lt_revision:lt_age"
41 AC_SUBST([LT_VERSION])
42 #LT_RELEASE="lt_release"
43 #AC_SUBST([LT_RELEASE])
44
45 dnl enable libtool
46 LT_INIT([win32-dll])
47 AC_SUBST([LIBTOOL_DEPS])
48
49 dnl generate the config header file
50 AC_CONFIG_HEADER([config.h])
51
52 AC_DEFINE([FIRM_BUILD], [], [Defined when firm library is built])
53 AC_DEFINE([FIRM_DLL], [], [Define when a dynamically loadable shared library is built])
54
55 AC_CONFIG_MACRO_DIR([m4])
56
57 dnl Package options
58 dnl ===============
59
60 dnl check for additional include dirs
61 AC_ARG_WITH(includedir, [  --with-includedir=add   colon seperated list of directories to include search path],
62     CPPFLAGS=$CPPFLAGS" -I"`echo $withval|sed 's;\:; -I;g'`)
63
64 dnl check for additional library dirs
65 AC_ARG_WITH(libdir, [  --with-libdir=add       colon seperated list of directories to linker search path],
66     LDFLAGS=$LDFLAGS" -L"`echo $withval|sed 's;\:; -L;g'`)
67
68 dnl set debugging
69 dnl -------------
70 AC_ARG_ENABLE([debug],
71 [AS_HELP_STRING([--disable-debug], [disable verifiers and additional debugging routines])],
72 [enable_debug_libfirm="$enableval"], [enable_debug_libfirm="yes"])
73 if test "$enable_debug_libfirm" = yes; then
74         AC_DEFINE([DEBUG_libfirm], [], [define to enable debug mode and checks])
75 fi
76
77 AC_ARG_ENABLE([assert],
78 [AS_HELP_STRING([--disable-assert], [disable assertions])],
79 [enable_assert="$enableval"], [enable_assert="yes"])
80 if test "$enable_assert" = no; then
81   AC_DEFINE([NDEBUG], [], [define to disable asserts])
82 fi
83 AC_SUBST([enable_assert])
84
85 dnl Checks for programs.
86 dnl ====================
87
88 dnl check for a C compiler
89 dnl ----------------------
90 AC_PROG_CC
91
92 dnl enable visibility hidden (if supported)
93 AX_CFLAGS_GCC_OPTION([-fvisibility=hidden])
94
95
96 AC_PATH_PROGS(PERL, perl perl5)
97
98 dnl check for awk
99 dnl -------------
100 AC_PROG_AWK
101
102 dnl Checks for header files.
103 dnl ========================
104
105 AC_HEADER_STDC
106 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
107
108 dnl Checks for libraries.
109 dnl =====================
110
111 AC_CHECK_LIB(m, main, ac_m_library="yes", ac_m_library="no")
112 if test "$ac_m_library" != yes; then
113   dnl std math library not found.
114   AC_MSG_ERROR("standard math library not found")
115 fi
116
117 dnl Checks for typedefs, structures, and compiler characteristics.
118 dnl ==============================================================
119 AC_C_CONST
120 AC_C_VOLATILE
121 AC_C_INLINE
122 AC_C_BIGENDIAN(,,,)
123
124 dnl Error messaging
125 dnl ===============
126
127
128 dnl Output results
129 AC_CONFIG_FILES([
130         Makefile
131         ir/Makefile
132         include/libfirm/Makefile
133         libfirm.pc
134 ])
135
136 AC_OUTPUT