~ubuntu-branches/ubuntu/feisty/syslog-ng/feisty-security

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): SZALAY Attila
  • Date: 2006-11-17 09:37:45 UTC
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20061117093745-5no9gnsa443j48v2
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1033
1033
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1034
1034
fi
1035
1035
if test -n "$PKG_CONFIG"; then
1036
 
        _pkg_min_version=m4_default([$1], [0.9.0])
 
1036
        _pkg_min_version=m4_ifval([$1], [$1], [0.9.0])
1037
1037
        AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1038
1038
        if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1039
1039
                AC_MSG_RESULT([yes])
1045
1045
fi[]dnl
1046
1046
])# PKG_PROG_PKG_CONFIG
1047
1047
 
1048
 
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1049
 
#
1050
 
# Check to see whether a particular set of modules exists.  Similar
1051
 
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1052
 
#
1053
 
#
1054
 
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
1055
 
# this or PKG_CHECK_MODULES is called, or make sure to call
1056
 
# PKG_CHECK_EXISTS manually
1057
 
# --------------------------------------------------------------
1058
 
AC_DEFUN([PKG_CHECK_EXISTS],
1059
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1060
 
if test -n "$PKG_CONFIG" && \
1061
 
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1062
 
  m4_ifval([$2], [$2], [:])
1063
 
m4_ifvaln([$3], [else
1064
 
  $3])dnl
1065
 
fi])
1066
 
 
1067
 
 
1068
1048
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1069
1049
# ---------------------------------------------
1070
1050
m4_define([_PKG_CONFIG],
1071
 
[if test -n "$PKG_CONFIG"; then
1072
 
    if test -n "$$1"; then
1073
 
        pkg_cv_[]$1="$$1"
1074
 
    else
1075
 
        PKG_CHECK_EXISTS([$3],
1076
 
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1077
 
                         [pkg_failed=yes])
1078
 
    fi
 
1051
[if test "x$ac_cv_env_[]$1[]_set" = "xset"; then
 
1052
        pkg_cv_[]$1=$ac_cv_env_[]$1[]_value
 
1053
elif test -n "$PKG_CONFIG"; then
 
1054
        if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then
 
1055
                pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
 
1056
        else
 
1057
                pkg_failed=yes
 
1058
        fi
1079
1059
else
1080
1060
        pkg_failed=untried
1081
1061
fi[]dnl
1082
1062
])# _PKG_CONFIG
1083
1063
 
1084
 
# _PKG_SHORT_ERRORS_SUPPORTED
1085
 
# -----------------------------
1086
 
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1087
 
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1088
 
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1089
 
        _pkg_short_errors_supported=yes
1090
 
else
1091
 
        _pkg_short_errors_supported=no
1092
 
fi[]dnl
1093
 
])# _PKG_SHORT_ERRORS_SUPPORTED
1094
 
 
1095
 
 
1096
1064
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1097
1065
# [ACTION-IF-NOT-FOUND])
1098
1066
#
1099
1067
#
1100
1068
# Note that if there is a possibility the first call to
1101
1069
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1102
 
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 
1070
# explicit call to PKG_PROG_PKG_CONFIG in your configure.in
1103
1071
#
1104
1072
#
1105
1073
# --------------------------------------------------------------
1109
1077
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1110
1078
 
1111
1079
pkg_failed=no
1112
 
AC_MSG_CHECKING([for $1])
1113
 
 
1114
 
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1115
 
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1116
 
 
1117
 
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1118
 
and $1[]_LIBS to avoid the need to call pkg-config.
1119
 
See the pkg-config man page for more details.])
 
1080
AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS],
 
1081
        [_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])])
 
1082
AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS],
 
1083
        [_PKG_CONFIG([$1][_LIBS], [libs], [$2])])
1120
1084
 
1121
1085
if test $pkg_failed = yes; then
1122
 
        _PKG_SHORT_ERRORS_SUPPORTED
1123
 
        if test $_pkg_short_errors_supported = yes; then
1124
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
1125
 
        else 
1126
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1127
 
        fi
 
1086
        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1128
1087
        # Put the nasty error message in config.log where it belongs
1129
 
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
 
1088
        echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD
1130
1089
 
1131
1090
        ifelse([$4], , [AC_MSG_ERROR(dnl
1132
 
[Package requirements ($2) were not met:
1133
 
 
1134
 
$$1_PKG_ERRORS
1135
 
 
 
1091
[Package requirements ($2) were not met.
1136
1092
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1137
1093
installed software in a non-standard prefix.
1138
1094
 
1139
 
_PKG_TEXT
1140
 
])],
 
1095
Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
 
1096
to avoid the need to call pkg-config.  See the pkg-config man page for
 
1097
more details.])],
1141
1098
                [$4])
1142
1099
elif test $pkg_failed = untried; then
1143
1100
        ifelse([$4], , [AC_MSG_FAILURE(dnl
1145
1102
is in your PATH or set the PKG_CONFIG environment variable to the full
1146
1103
path to pkg-config.
1147
1104
 
1148
 
_PKG_TEXT
 
1105
Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables
 
1106
to avoid the need to call pkg-config.  See the pkg-config man page for
 
1107
more details.
1149
1108
 
1150
1109
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
1151
1110
                [$4])
1152
1111
else
1153
1112
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1154
1113
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1155
 
        AC_MSG_RESULT([yes])
1156
1114
        ifelse([$3], , :, [$3])
1157
1115
fi[]dnl
1158
1116
])# PKG_CHECK_MODULES