4 AM_INIT_AUTOMAKE(pkg-config, 0.23)
7 AM_CONFIG_HEADER(config.h)
13 AC_DEFUN([PKG_CONFIG_FIND_PC_PATH],
15 AC_MSG_CHECKING([for default search path for .pc files])
17 [ --with-pc-path Override the default search path for .pc files ],
18 [ pc_path="$withval" ],
20 # This is slightly wrong, but hopefully causes less confusion than
21 # people being unable to find their .pc files in the standard location.
22 if test "${prefix}" = "NONE"; then
23 pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig'
25 pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
28 AC_MSG_RESULT([$pc_path])
33 PKG_CONFIG_FIND_PC_PATH
36 # Code taken from gtk+-2.0's configure.in.
38 # This causes pkg-config to not list private dependencies (a very
39 # common example is libm) on platforms which support inter-library
42 AC_ARG_ENABLE(indirect-deps,
43 [AC_HELP_STRING([--enable-indirect-deps],
44 [list both direct and indirect dependencies.])
45 AC_HELP_STRING([--disable-indirect-deps],
46 [only list direct dependencies.])
47 [default=auto]],use_indirect_deps=$enableval,
48 [use_indirect_deps=auto])
49 echo use_indirect_deps=$use_indirect_deps >&AS_MESSAGE_LOG_FD
50 AC_MSG_CHECKING([whether to list both direct and indirect dependencies])
51 case $use_indirect_deps in
53 deplibs_check_method=`(./libtool --config; echo eval echo \$deplibs_check_method) | sh`
54 if test "X$deplibs_check_method" = Xnone; then
55 echo "foo: $deplibs_check_method" >&AS_MESSAGE_LOG_FD
63 *) AC_MSG_ERROR([Value given to --enable-indirect-deps must be one of yes, no
67 AC_MSG_RESULT($use_indirect_deps)
70 # Choose default CFLAGS and warnings depending on compiler.
74 if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then
75 WARN_CFLAGS="-g -Wall -O2"
79 AC_DEFINE_UNQUOTED(ENABLE_INDIRECT_DEPS, `test $use_indirect_deps = no; echo $?`, [Link library to all dependent libraries, not only directly needed ones])
80 AC_SUBST(use_indirect_deps)
82 AC_MSG_CHECKING([for Win32])
91 AC_MSG_RESULT([$native_win32])
94 *lib64) AC_DEFINE(PREFER_LIB64,1,[Define if your native architecture defines libdir to be $prefix/lib64 instead of $prefix/lib.]) ;;
98 if test x$native_win32 = xyes; then
99 # On Win32, use the normal installed GLib. Yes, this is a circular
100 # dependency. But then, only experienced hackers that presumably can
101 # work around that will be building pkg-config and GLib on Win32
102 # anyway (especially using the auto*/configure/libtool
103 # mechanism). Others use prebuilt versions.
105 # These are correct for GLib 2.x
106 GLIB_CFLAGS="-I$includedir/glib-2.0 -I$libdir/glib-2.0/include"
107 GLIB_LIBS="-L$libdir -lglib-2.0 -liconv -lintl"
108 use_installed_glib=yes
110 use_installed_glib=no
111 AC_ARG_WITH([installed-glib],
112 [ --with-installed-glib Use installed Glib-2.x], [
113 if test x$withval = xyes; then
114 # Not on Win32, but the user requested to use the installed Glib-2.x,
115 # therefore we may assume that (some older version of) pkg-config can
116 # be found in the users PATH (otherwise we simply ignore the request).
117 AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], [])
118 if test -n $PKG_CONFIG && $PKG_CONFIG --exists glib-2.0; then
119 GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0`
120 GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0`
121 use_installed_glib=yes
125 fi # !use_installed_glib
127 AM_CONDITIONAL(USE_INSTALLED_GLIB, test x$use_installed_glib = xyes)
129 if test x$use_installed_glib = xyes; then
130 AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib])
132 AC_SUBST(GLIB_CFLAGS)
135 AC_CONFIG_SUBDIRS(glib-1.2.10)
140 AC_CHECK_FUNCS(setresuid setreuid,break)
141 AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])