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