~ubuntu-branches/ubuntu/oneiric/ubuntuone-client/oneiric

« back to all changes in this revision

Viewing changes to aclocal.m4

  • Committer: Bazaar Package Importer
  • Author(s): Rodrigo Moya
  • Date: 2010-06-23 23:08:15 UTC
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: james.westby@ubuntu.com-20100623230815-4m3ugh10u9x9xzw5
Tags: upstream-1.3.2
Import upstream version 1.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
])
53
53
 
54
54
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 
55
# serial 1 (pkg-config-0.24)
55
56
56
57
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
57
58
#
79
80
AC_DEFUN([PKG_PROG_PKG_CONFIG],
80
81
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
81
82
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
82
 
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
 
83
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
 
84
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
 
85
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
 
86
 
83
87
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
84
88
        AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
85
89
fi
92
96
                AC_MSG_RESULT([no])
93
97
                PKG_CONFIG=""
94
98
        fi
95
 
                
96
99
fi[]dnl
97
100
])# PKG_PROG_PKG_CONFIG
98
101
 
101
104
# Check to see whether a particular set of modules exists.  Similar
102
105
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
103
106
#
104
 
#
105
 
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
106
 
# this or PKG_CHECK_MODULES is called, or make sure to call
107
 
# PKG_CHECK_EXISTS manually
 
107
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 
108
# only at the first occurence in configure.ac, so if the first place
 
109
# it's called might be skipped (such as if it is within an "if", you
 
110
# have to call PKG_CHECK_EXISTS manually
108
111
# --------------------------------------------------------------
109
112
AC_DEFUN([PKG_CHECK_EXISTS],
110
113
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
111
114
if test -n "$PKG_CONFIG" && \
112
115
    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
113
 
  m4_ifval([$2], [$2], [:])
 
116
  m4_default([$2], [:])
114
117
m4_ifvaln([$3], [else
115
118
  $3])dnl
116
119
fi])
117
120
 
118
 
 
119
121
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
120
122
# ---------------------------------------------
121
123
m4_define([_PKG_CONFIG],
122
 
[if test -n "$PKG_CONFIG"; then
123
 
    if test -n "$$1"; then
124
 
        pkg_cv_[]$1="$$1"
125
 
    else
126
 
        PKG_CHECK_EXISTS([$3],
127
 
                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
128
 
                         [pkg_failed=yes])
129
 
    fi
130
 
else
131
 
        pkg_failed=untried
 
124
[if test -n "$$1"; then
 
125
    pkg_cv_[]$1="$$1"
 
126
 elif test -n "$PKG_CONFIG"; then
 
127
    PKG_CHECK_EXISTS([$3],
 
128
                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
 
129
                     [pkg_failed=yes])
 
130
 else
 
131
    pkg_failed=untried
132
132
fi[]dnl
133
133
])# _PKG_CONFIG
134
134
 
170
170
See the pkg-config man page for more details.])
171
171
 
172
172
if test $pkg_failed = yes; then
 
173
        AC_MSG_RESULT([no])
173
174
        _PKG_SHORT_ERRORS_SUPPORTED
174
175
        if test $_pkg_short_errors_supported = yes; then
175
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
 
176
                $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
176
177
        else 
177
 
                $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
 
178
                $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
178
179
        fi
179
180
        # Put the nasty error message in config.log where it belongs
180
181
        echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
181
182
 
182
 
        ifelse([$4], , [AC_MSG_ERROR(dnl
 
183
        m4_default([$4], [AC_MSG_ERROR(
183
184
[Package requirements ($2) were not met:
184
185
 
185
186
$$1_PKG_ERRORS
187
188
Consider adjusting the PKG_CONFIG_PATH environment variable if you
188
189
installed software in a non-standard prefix.
189
190
 
190
 
_PKG_TEXT
191
 
])],
192
 
                [AC_MSG_RESULT([no])
193
 
                $4])
 
191
_PKG_TEXT])dnl
 
192
        ])
194
193
elif test $pkg_failed = untried; then
195
 
        ifelse([$4], , [AC_MSG_FAILURE(dnl
 
194
        AC_MSG_RESULT([no])
 
195
        m4_default([$4], [AC_MSG_FAILURE(
196
196
[The pkg-config script could not be found or is too old.  Make sure it
197
197
is in your PATH or set the PKG_CONFIG environment variable to the full
198
198
path to pkg-config.
199
199
 
200
200
_PKG_TEXT
201
201
 
202
 
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
203
 
                [$4])
 
202
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
 
203
        ])
204
204
else
205
205
        $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
206
206
        $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
207
207
        AC_MSG_RESULT([yes])
208
 
        ifelse([$3], , :, [$3])
 
208
        $3
209
209
fi[]dnl
210
210
])# PKG_CHECK_MODULES
211
211