648
648
AC_DEFUN([IT_PO_SUBDIR],
649
649
[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
651
dnl The following CONFIG_COMMANDS should be exetuted at the very end
651
dnl The following CONFIG_COMMANDS should be executed at the very end
652
652
dnl of config.status.
653
653
AC_CONFIG_COMMANDS_PRE([
654
654
AC_CONFIG_COMMANDS([$1/stamp-it], [
751
752
AC_DEFUN([PKG_PROG_PKG_CONFIG],
752
753
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
753
754
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
754
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
755
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
756
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
757
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
755
759
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
756
760
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
773
776
# Check to see whether a particular set of modules exists. Similar
774
777
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
777
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
778
# this or PKG_CHECK_MODULES is called, or make sure to call
779
# PKG_CHECK_EXISTS manually
779
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
780
# only at the first occurence in configure.ac, so if the first place
781
# it's called might be skipped (such as if it is within an "if", you
782
# have to call PKG_CHECK_EXISTS manually
780
783
# --------------------------------------------------------------
781
784
AC_DEFUN([PKG_CHECK_EXISTS],
782
785
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
783
786
if test -n "$PKG_CONFIG" && \
784
787
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
785
m4_ifval([$2], [$2], [:])
788
m4_default([$2], [:])
786
789
m4_ifvaln([$3], [else
791
793
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
792
794
# ---------------------------------------------
793
795
m4_define([_PKG_CONFIG],
794
[if test -n "$PKG_CONFIG"; then
795
if test -n "$$1"; then
798
PKG_CHECK_EXISTS([$3],
799
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
796
[if test -n "$$1"; then
798
elif test -n "$PKG_CONFIG"; then
799
PKG_CHECK_EXISTS([$3],
800
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
842
842
See the pkg-config man page for more details.])
844
844
if test $pkg_failed = yes; then
845
846
_PKG_SHORT_ERRORS_SUPPORTED
846
847
if test $_pkg_short_errors_supported = yes; then
847
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
848
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
849
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
850
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
851
852
# Put the nasty error message in config.log where it belongs
852
853
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
854
ifelse([$4], , [AC_MSG_ERROR(dnl
855
m4_default([$4], [AC_MSG_ERROR(
855
856
[Package requirements ($2) were not met:
859
860
Consider adjusting the PKG_CONFIG_PATH environment variable if you
860
861
installed software in a non-standard prefix.
866
865
elif test $pkg_failed = untried; then
867
ifelse([$4], , [AC_MSG_FAILURE(dnl
867
m4_default([$4], [AC_MSG_FAILURE(
868
868
[The pkg-config script could not be found or is too old. Make sure it
869
869
is in your PATH or set the PKG_CONFIG environment variable to the full
870
870
path to pkg-config.
874
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
874
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
877
877
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
878
878
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
879
879
AC_MSG_RESULT([yes])
880
ifelse([$3], , :, [$3])
882
882
])# PKG_CHECK_MODULES