Commit 626ac303 authored by Matthias Braun's avatar Matthias Braun
Browse files

automake updates, set version number from configure script

[r15275]
parent 0df3478d
SUBDIRS = include/libfirm ir
EXTRA_DIST = README COPYING
EXTRA_DIST = README COPYING acinclude.m4
libfirmincludedir = $(includedir)/libfirm
libfirminclude_HEADERS = firm_config.h
......
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
#
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$PKG_CONFIG"; then
if test -n "$$1"; then
pkg_cv_[]$1="$$1"
else
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
fi
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
ifelse([$4], , [AC_MSG_ERROR(dnl
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT
])],
[$4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
[$4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
ifelse([$3], , :, [$3])
fi[]dnl
])# PKG_CHECK_MODULES
......@@ -6042,64 +6042,6 @@ SED=$lt_cv_path_SED
AC_MSG_RESULT([$SED])
])
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
dnl also defines GSTUFF_PKG_ERRORS on error
AC_DEFUN([PKG_CHECK_MODULES], [
succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
AC_MSG_CHECKING(for $2)
if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
succeeded=yes
AC_MSG_CHECKING($1_CFLAGS)
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
AC_MSG_RESULT($$1_CFLAGS)
AC_MSG_CHECKING($1_LIBS)
$1_LIBS=`$PKG_CONFIG --libs "$2"`
AC_MSG_RESULT($$1_LIBS)
else
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
ifelse([$4], ,echo $$1_PKG_ERRORS,)
fi
AC_SUBST($1_CFLAGS)
AC_SUBST($1_LIBS)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
ifelse([$3], , :, [$3])
else
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
fi
])
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
......@@ -6936,3 +6878,5 @@ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([acinclude.m4])
......@@ -9,7 +9,12 @@ dnl Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
dnl
AC_PREREQ([2.54])
AC_REVISION([$Id$])
AC_INIT([libfirm], [1.10.0], [firm@ipd.info.uni-karlsruhe.de])
m4_define([firm_major_version], [1])
m4_define([firm_minor_version], [10])
m4_define([firm_micro_version], [0])
m4_define([firm_version],
[firm_major_version.firm_minor_version.firm_micro_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])
......@@ -17,6 +22,10 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2 1.9])
LT_VERSION=0:0:0
AC_SUBST([LT_VERSION])
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])
dnl generate the config header file
AC_CONFIG_HEADER([config.h])
......
......@@ -187,15 +187,14 @@ struct _firm_parameter_t {
typedef struct _firm_parameter_t firm_parameter_t;
#define libFirm_VERSION_MAJOR 1
#define libFirm_VERSION_MINOR 4
/**
* The Firm version number.
*/
typedef struct _firm_version_t {
unsigned major;
unsigned minor;
unsigned micro;
unsigned build;
} firm_version_t;
/**
......
......@@ -347,7 +347,7 @@ EXTRA_DIST = \
# ia32 backend
libfirm_la_SOURCES += \
ia32_sources = \
be/ia32/bearch_ia32.c \
be/ia32/gen_ia32_emitter.c \
be/ia32/gen_ia32_machine.c \
......@@ -363,6 +363,8 @@ libfirm_la_SOURCES += \
be/ia32/ia32_util.c \
be/ia32/ia32_x87.c
libfirm_la_SOURCES += $(ia32_sources)
EXTRA_DIST += \
be/ia32/ia32_spec.pl \
be/ia32/bearch_ia32_t.h \
......@@ -378,6 +380,9 @@ EXTRA_DIST += \
be/ia32/ia32_util.h \
be/ia32/ia32_x87.h
# conservative aproximation of dependencies
$(ia32_sources): $(srcdir)/be/ia32/gen_ia32_new_nodes.h $(srcdir)/be/ia32/gen_ia32_regalloc_if.h $(srcdir)/be/ia32/gen_ia32_machine.h $(srcdir)/be/ia32/gen_ia32_regalloc_if.h
$(srcdir)/be/ia32/gen_ia32_new_nodes.c.inl $(srcdir)/be/ia32/gen_ia32_new_nodes.h: \
be/ia32/ia32_spec.pl be/scripts/generate_new_opcodes.pl
$(PERL) $(srcdir)/be/scripts/generate_new_opcodes.pl $(srcdir)/be/ia32/ia32_spec.pl $(srcdir)/be/ia32
......@@ -396,7 +401,7 @@ $(srcdir)/be/ia32/gen_ia32_regalloc_if.c $(srcdir)/be/ia32/gen_ia32_regalloc_if.
# arm backend
libfirm_la_SOURCES += \
arm_sources = \
be/arm/bearch_arm.c \
be/arm/gen_arm_emitter.c \
be/arm/gen_arm_machine.c \
......@@ -405,6 +410,7 @@ libfirm_la_SOURCES += \
be/arm/arm_map_regs.c \
be/arm/arm_new_nodes.c \
be/arm/arm_transform.c
libfirm_la_SOURCES += $(arm_sources)
EXTRA_DIST += \
......@@ -422,6 +428,9 @@ EXTRA_DIST += \
be/arm/gen_arm_regalloc_if.h \
be/arm/gen_arm_regalloc_if_t.h
# conservative aproximation of dependencies
$(arm_sources): $(srcdir)/be/arm/gen_arm_new_nodes.h $(srcdir)/be/arm/gen_arm_regalloc_if.h $(srcdir)/be/arm/gen_arm_machine.h $(srcdir)/be/arm/gen_arm_regalloc_if.h $(srcdir)/be/arm/gen_arm_new_nodes.c.inl
$(srcdir)/be/arm/gen_arm_new_nodes.c.inl $(srcdir)/be/arm/gen_arm_new_nodes.h: \
be/arm/arm_spec.pl be/scripts/generate_new_opcodes.pl
$(PERL) $(srcdir)/be/scripts/generate_new_opcodes.pl $(srcdir)/be/arm/arm_spec.pl $(srcdir)/be/arm
......@@ -440,7 +449,7 @@ $(srcdir)/be/arm/gen_arm_regalloc_if.c $(srcdir)/be/arm/gen_arm_regalloc_if.h: \
# mips backend
libfirm_la_SOURCES += \
mips_sources = \
be/mips/bearch_mips.c \
be/mips/gen_mips_emitter.c \
be/mips/gen_mips_machine.c \
......@@ -450,6 +459,7 @@ libfirm_la_SOURCES += \
be/mips/mips_new_nodes.c \
be/mips/mips_scheduler.c \
be/mips/mips_transform.c
libfirm_la_SOURCES += $(mips_sources)
EXTRA_DIST += \
be/mips/mips_spec.pl \
......@@ -463,6 +473,9 @@ EXTRA_DIST += \
be/mips/mips_transform.h \
be/mips/mips_util.h
# conservative aproximation of dependencies
$(mips_sources): $(srcdir)/be/mips/gen_mips_new_nodes.h $(srcdir)/be/mips/gen_mips_regalloc_if.h $(srcdir)/be/mips/gen_mips_machine.h $(srcdir)/be/mips/gen_mips_regalloc_if.h $(srcdir)/be/mips/gen_mips_new_nodes.c.inl
$(srcdir)/be/mips/gen_mips_new_nodes.c.inl $(srcdir)/be/mips/gen_mips_new_nodes.h: \
be/mips/mips_spec.pl be/scripts/generate_new_opcodes.pl
$(PERL) $(srcdir)/be/scripts/generate_new_opcodes.pl $(srcdir)/be/mips/mips_spec.pl $(srcdir)/be/mips
......@@ -481,7 +494,7 @@ $(srcdir)/be/mips/gen_mips_regalloc_if.c $(srcdir)/be/mips/gen_mips_regalloc_if.
# ppc32 backend
libfirm_la_SOURCES += \
ppc32_sources = \
be/ppc32/bearch_ppc32.c \
be/ppc32/gen_ppc32_emitter.c \
be/ppc32/gen_ppc32_machine.c \
......@@ -491,6 +504,7 @@ libfirm_la_SOURCES += \
be/ppc32/ppc32_new_nodes.c \
be/ppc32/ppc32_transform.c \
be/ppc32/ppc32_transform_conv.c
libfirm_la_SOURCES += $(ppc32_sources)
EXTRA_DIST += \
be/ppc32/ppc32_spec.pl \
......@@ -503,6 +517,9 @@ EXTRA_DIST += \
be/ppc32/ppc32_transform_conv.h \
be/ppc32/ppc32_transform.h
# conservative aproximation of dependencies
$(ppc32_sources): $(srcdir)/be/ppc32/gen_ppc32_new_nodes.h $(srcdir)/be/ppc32/gen_ppc32_regalloc_if.h $(srcdir)/be/ppc32/gen_ppc32_machine.h $(srcdir)/be/ppc32/gen_ppc32_regalloc_if.h $(srcdir)/be/ppc32/gen_ppc32_new_nodes.c.inl
$(srcdir)/be/ppc32/gen_ppc32_new_nodes.c.inl $(srcdir)/be/ppc32/gen_ppc32_new_nodes.h: \
be/ppc32/ppc32_spec.pl be/scripts/generate_new_opcodes.pl
$(PERL) $(srcdir)/be/scripts/generate_new_opcodes.pl $(srcdir)/be/ppc32/ppc32_spec.pl $(srcdir)/be/ppc32
......
......@@ -169,4 +169,6 @@ void free_firm(void) {
void firm_get_version(firm_version_t *version) {
version->major = libFirm_VERSION_MAJOR;
version->minor = libFirm_VERSION_MINOR;
version->micro = libfirm_VERSION_MICRO;
version->build = 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment