X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=aclocal.m4;h=30f72ad232f6cb7ce966f21b33700a6d8163c136;hb=ab61af3f38c8c2eba051fbb9b4f2e6b383b95b6c;hp=45c8636710b84b580348b2644bb210aca431b649;hpb=544e945d851bf69e520a6d675bbc7e31f8919320;p=libfirm diff --git a/aclocal.m4 b/aclocal.m4 index 45c863671..30f72ad23 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,16 +1,19 @@ - -dnl libFIRM Project - -dnl Macros for autoconf -dnl $Id$ +dnl +dnl Project: libFIRM +dnl File name: aclocal.m4 +dnl Purpose: Macros for autoconf +dnl Author: Till Riedel +dnl Modified by: +dnl Created: +dnl CVS-ID: $Id$ +dnl Copyright: (c) 2002-2003 Universität Karlsruhe +dnl Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE. +dnl dnl Set variable `LD' to the name of the linker program. -AC_DEFUN(LIBFIRM_PROG_LD, +AC_DEFUN(LIBFIRM_PROG_LD,[ dnl AC_REQUIRE([AC_PROG_CC]) -[if test -z "$LD" && test "$GCC" = yes; then - AC_CHECK_TOOL(LD, gld, "") -fi if test -z "$LD"; then AC_CHECK_TOOL(LD, ld) fi @@ -28,6 +31,7 @@ int foo() { return 0; } EOF if eval $ac_compile && mv conftest.o conftest2.o; then cat > conftest.$ac_ext </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 +])], + [AC_MSG_RESULT([no]) + $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 .])], + [$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 + dnl end of aclocal.m