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