source: trunk/third/rep-gtk/aclocal.m4 @ 18404

Revision 18404, 4.5 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18403, which included commits to RCS files with non-trunk default branches.
Line 
1dnl aclocal.m4 generated automatically by aclocal 1.4-p6
2
3dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl This program is distributed in the hope that it will be useful,
9dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11dnl PARTICULAR PURPOSE.
12
13dnl Configure paths for librep
14dnl $Id: aclocal.m4,v 1.1.1.2 2003-01-05 00:30:20 ghudson Exp $
15dnl
16dnl AM_PATH_REP([MINIMUM_VERSION])
17dnl Test for librep, define REP_VERSION, REP_CFLAGS, REP_LIBS and REP_EXECDIR
18dnl
19AC_DEFUN(AM_PATH_REP,
20[dnl
21  AC_ARG_WITH(rep_prefix,[  --with-rep-prefix=PFX   Prefix where rep is installed (optional)],
22              [rep_prefix="$withval"], [rep_prefix=""])
23  if test "x$rep_prefix" = "x"; then
24    rep_config="rep-config"
25  else
26    rep_config="${rep_prefix}/bin/rep-config"
27  fi
28  min_rep_version=ifelse([$1], ,0.1,$1)
29  AC_MSG_CHECKING(for rep - version >= $min_rep_version)
30  rep_version=`$rep_config --version`
31  if test $? -eq 0; then
32    rep_major=`echo $rep_version \
33        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
34    rep_minor=`echo $rep_version \
35        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
36    min_rep_major=`echo $min_rep_version \
37        | sed -e 's/\([[0-9]]*\)\..*/\1/'`
38    min_rep_minor=`echo $min_rep_version \
39        | sed -e 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
40    if test '(' $rep_major -gt $min_rep_major ')' \
41        -o '(' $rep_major -eq $min_rep_major \
42               -a $rep_minor -ge $min_rep_minor ')';
43    then
44      REP_VERSION="${rep_version}"
45      REP_CFLAGS="`$rep_config --cflags`"
46      REP_LIBS="`$rep_config --libs`"
47      REP_EXECDIR="`$rep_config --execdir`"
48      AC_SUBST(REP_VERSION)
49      AC_SUBST(REP_CFLAGS)
50      AC_SUBST(REP_LIBS)
51      AC_SUBST(REP_EXECDIR)
52      AC_MSG_RESULT([version ${rep_version}])
53    else
54      AC_MSG_ERROR([version ${rep_version}; require $min_rep_version])
55    fi
56  else
57    AC_MSG_ERROR([can't find librep; is it installed?])
58  fi
59
60  dnl scan for GNU msgfmt
61  AC_MSG_CHECKING(for GNU msgfmt)
62  REP_MSGFMT=
63  for p in `echo "$PATH" | sed -e 's/:/ /g'`; do
64    if test -x $p/msgfmt; then
65      if $p/msgfmt --version 2>&1 | grep GNU >/dev/null; then
66        REP_MSGFMT=$p/msgfmt
67      fi
68    fi
69  done
70  if test x$REP_MSGFMT != x; then
71    AC_MSG_RESULT($REP_MSGFMT)
72  else
73    AC_MSG_RESULT(unavailable, disabling i18n)
74    REP_MSGFMT=true
75  fi
76  AC_SUBST(REP_MSGFMT)
77])
78
79
80dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
81dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
82dnl also defines GSTUFF_PKG_ERRORS on error
83AC_DEFUN(PKG_CHECK_MODULES, [
84  succeeded=no
85
86  if test -z "$PKG_CONFIG"; then
87    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
88  fi
89
90  if test "$PKG_CONFIG" = "no" ; then
91     echo "*** The pkg-config script could not be found. Make sure it is"
92     echo "*** in your path, or set the PKG_CONFIG environment variable"
93     echo "*** to the full path to pkg-config."
94     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
95  else
96     PKG_CONFIG_MIN_VERSION=0.9.0
97     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
98        AC_MSG_CHECKING(for $2)
99
100        if $PKG_CONFIG --exists "$2" ; then
101            AC_MSG_RESULT(yes)
102            succeeded=yes
103
104            AC_MSG_CHECKING($1_CFLAGS)
105            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
106            AC_MSG_RESULT($$1_CFLAGS)
107
108            AC_MSG_CHECKING($1_LIBS)
109            $1_LIBS=`$PKG_CONFIG --libs "$2"`
110            AC_MSG_RESULT($$1_LIBS)
111        else
112            $1_CFLAGS=""
113            $1_LIBS=""
114            ## If we have a custom action on failure, don't print errors, but
115            ## do set a variable so people can do so.
116            $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
117            ifelse([$4], ,echo $$1_PKG_ERRORS,)
118        fi
119
120        AC_SUBST($1_CFLAGS)
121        AC_SUBST($1_LIBS)
122     else
123        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
124        echo "*** See http://www.freedesktop.org/software/pkgconfig"
125     fi
126  fi
127
128  if test $succeeded = yes; then
129     ifelse([$3], , :, [$3])
130  else
131     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])
132  fi
133])
134
135
136
Note: See TracBrowser for help on using the repository browser.