amd64: Spell amd64 as AMD64 in macro names.
[libfirm] / configure.ac
index f2e04c6..7110908 100644 (file)
@@ -1,40 +1,58 @@
-dnl
-dnl Project:     libFIRM
-dnl File name:   configure.in
-dnl Purpose:
-dnl Author:      Matthias Braun
-dnl CVS-ID:      $Id$
-dnl Copyright:   (c) 2002-2007 University of Karlsruhe
-dnl Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
-dnl
-AC_PREREQ([2.54])
-AC_REVISION([$Id$])
+dnl configure.ac file for libfirm, author Matthias Braun <matze@braunis.de>
+dnl Process this file with autoconf to produce a configure script.
+AC_PREREQ([2.60])
+
+dnl Firm Versions
+dnl * Increment major/minor/micro version as you see fit. These 3 numbers
+dnl   are intended for humans and are independent from the libtool versions
 m4_define([firm_major_version], [1])
-m4_define([firm_minor_version], [17])
+m4_define([firm_minor_version], [21])
 m4_define([firm_micro_version], [0])
 m4_define([firm_version],
           [firm_major_version.firm_minor_version.firm_micro_version])
+
+dnl Libtool versions
+dnl
+dnl * If any code has changed at all (i.e. bugfixes) increment revision
+dnl * If any interface has been added, removed or changed increment
+dnl   current, set revision to 0
+dnl * If any interface has been added increment age
+dnl * If any interfaces have been remove set age to 0
+dnl * use lt_release if substantial things have been changed. The release can be
+dnl   thought of as part of the library name. So changing the release creates
+dnl   a new library.
+m4_define([lt_current],  [1])
+m4_define([lt_revision], [0])
+m4_define([lt_age],      [0])
+dnl we use firm major version as release
+m4_define([lt_release],  [firm_major_version])
+
 AC_INIT([libfirm], [firm_version], [firm@ipd.info.uni-karlsruhe.de])
 AC_CONFIG_SRCDIR([ir/common/firm.c])
-AM_INIT_AUTOMAKE([foreign dist-bzip2 1.9])
+AM_INIT_AUTOMAKE([foreign dist-bzip2 silent-rules 1.11])
 
-# see libtool manual on what version numbers mean!
-LT_VERSION=0:0:0
-AC_SUBST([LT_VERSION])
+AM_SILENT_RULES([yes])
 
 AC_DEFINE([libfirm_VERSION_MAJOR], [firm_major_version], [Firms major version number])
 AC_DEFINE([libfirm_VERSION_MINOR], [firm_minor_version], [Firms minor version number])
 AC_DEFINE([libfirm_VERSION_MICRO], [firm_micro_version], [Firms micro version number])
 
+LT_VERSION="lt_current:lt_revision:lt_age"
+AC_SUBST([LT_VERSION])
+#LT_RELEASE="lt_release"
+#AC_SUBST([LT_RELEASE])
+
 dnl enable libtool
 LT_INIT([win32-dll])
+AC_SUBST([LIBTOOL_DEPS])
 
 dnl generate the config header file
 AC_CONFIG_HEADER([config.h])
 
-dnl keep track of the environment set by the user
-libfirm_conf_env="${CC+CC='$CC'} ${CFLAGS+CFLAGS='$CFLAGS'} ${CPP+CPP='$CPP'} ${CPPFLAGS+CPPFLAGS='$CPPFLAGS'} ${LDFLAGS+LDFLAGS='$LDFLAGS'} ${LIBS+LIBS='$LIBS -lm'}"
-AC_SUBST(libfirm_conf_env)
+AC_DEFINE([FIRM_BUILD], [], [Defined when firm library is built])
+AC_DEFINE([FIRM_DLL], [], [Define when a dynamically loadable shared library is built])
+
+AC_CONFIG_MACRO_DIR([m4])
 
 dnl Package options
 dnl ===============
@@ -64,45 +82,6 @@ if test "$enable_assert" = no; then
 fi
 AC_SUBST([enable_assert])
 
-dnl set profiling
-dnl -------------
-AC_ARG_ENABLE([profile],
-[AS_HELP_STRING([--enable-profile], [enable profiling])],
-[enable_profile_libfirm="$enableval"], [enable_profile_libfirm="no"])
-
-AC_SUBST([enable_profile_libfirm])
-
-dnl enable Firm statistics
-dnl -------------
-AC_ARG_ENABLE([statistics],
-[AS_HELP_STRING([--enable-statistics], [enable Firm statistics])],
-[enable_statistics="$enableval"], [enable_statistics="yes"])
-
-if test "$enable_statistics" = yes; then
-       FIRMCONFIG_FIRM_STATISTICS="#define FIRMCONFIG_FIRM_STATISTICS"
-fi
-AC_SUBST([FIRMCONFIG_FIRM_STATISTICS])
-AC_SUBST([enable_statistics])
-
-dnl enable ILP solver support
-dnl --------------------------------
-AC_ARG_ENABLE([ilp],
-[AS_HELP_STRING([--enable-ilp], [enable ilp solver])],
-[enable_ilp="$enableval"], [enable_ilp="no"])
-
-if test "$enable_ilp" = yes; then
-  FIRMCONFIG_WITH_ILP="#define FIRMCONFIG_WITH_ILP"
-  AC_DEFINE([WITH_ILP], [], [enable to build code using ilp solvers])
-fi
-
-dnl disable backend
-dnl ---------------
-AC_ARG_ENABLE([backend],
-[AS_HELP_STRING([--disable-backend], [disable backends])],
-[enable_backend="$enableval"], [enable_backend="yes"])
-
-AC_SUBST(enable_backend)
-
 dnl Checks for programs.
 dnl ====================
 
@@ -110,6 +89,10 @@ dnl check for a C compiler
 dnl ----------------------
 AC_PROG_CC
 
+dnl enable visibility hidden (if supported)
+AX_CFLAGS_GCC_OPTION([-fvisibility=hidden])
+
+
 AC_PATH_PROGS(PERL, perl perl5)
 
 dnl check for awk
@@ -121,7 +104,6 @@ dnl ========================
 
 AC_HEADER_STDC
 AC_CHECK_HEADERS([math.h], , AC_MSG_ERROR("math header file not found"))
-AC_CHECK_HEADERS([alloca.h])
 
 dnl Checks for libraries.
 dnl =====================
@@ -138,22 +120,6 @@ AC_C_CONST
 AC_C_VOLATILE
 AC_C_INLINE
 AC_C_BIGENDIAN(,,,)
-AC_C_LONG_DOUBLE
-
-dnl Checks for library functions.
-dnl =============================
-
-dnl check for strerror
-
-AC_CHECK_FUNC(strerror,,
-  AC_MSG_ERROR("need strerror function")
-)
-
-dnl we use the gnu extension obstack_printf
-AC_DEFINE([_GNU_SOURCE], [], [we use gnu extensions])
-AC_CHECK_FUNC(strerror,,
-  AC_MSG_ERROR("need obstack_printf function")
-)
 
 dnl Error messaging
 dnl ===============
@@ -167,24 +133,4 @@ AC_CONFIG_FILES([
        libfirm.pc
 ])
 
-#always do inlining
-AC_DEFINE([INLINE], [inline], [define inline to compiler inline keyword])
-
-BACKENDS=""
-if test "$enable_backend" = yes; then
-       BACKENDS="arm ia32 mips ppc32"
-fi
-AC_SUBST([BACKENDS])
-
 AC_OUTPUT
-
-dnl output summary of firm configuration
-echo ""
-echo "firm configuration summary:"
-echo "     backends              $BACKENDS"
-echo "     profiling             $enable_profile_libfirm"
-echo "     debug/verifiers       $enable_debug_libfirm"
-echo "     assertions            $enable_assert"
-echo "     statistics            $enable_statistics"
-echo "     ilp                   $enable_ilp"
-echo ""