On 07/03/11 01:55, Miles Bader wrote:
Jef Driesen<jefdrie...@hotmail.com> writes:
is pkg.m4 in /usr/share/aclocal ?
No. I suppose that file is only present if pkg-config is installed?
I'm trying to build on Mac OS X in case that would matter.
I use some hacks to make the resulting configure script work even if
autoconf can't find pkg.m4. Basically I just use "m4_define_default" to
define stub versions of the PKG_... macros:
# Check for pkg-config program, used for configuring some libraries.
#
m4_define_default([PKG_PROG_PKG_CONFIG],
[AC_MSG_CHECKING([pkg-config])
AC_MSG_RESULT([no])])
PKG_PROG_PKG_CONFIG
# If the pkg-config autoconf support isn't installed, define its
# autoconf macro to disable any packages depending on it.
#
m4_define_default([PKG_CHECK_MODULES],
[AC_MSG_CHECKING([$1])
AC_MSG_RESULT([no])
$4])
... etc
PKG_CHECK_MODULES([libpng], [libpng], [have_libpng=yes], [:])
... etc
Isn't it easier to just check for the presence of the header file and/or the
library file, avoiding pkg-config entirely?