From: Tollef Fog Heen Date: Sun, 25 Feb 2007 10:05:01 +0000 (+0100) Subject: 2007-02-25 Tollef Fog Heen X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3977a8299d06a7ee2c58415ceba9f7a1b30fdd2f;p=pkg-config 2007-02-25 Tollef Fog Heen * Makefile.am: Add support for using the system glib. Thanks to Peter Breitenlohner for the bug and the patch. Freedesktop #9708 * configure.in: Add support for using the system glib. * glib-patches/no-dist-distclean-files.diff, glib-patches/automake-warning.diff, glib-patches/autoconf-warning.diff: Get rid of some warnings when configuring glib. --- diff --git a/ChangeLog b/ChangeLog index 0709146..698a4ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2007-02-25 Tollef Fog Heen + + * Makefile.am: Add support for using the system glib. Thanks to + Peter Breitenlohner for the bug and the patch. Freedesktop #9708 + + * configure.in: Add support for using the system glib. + + * glib-patches/no-dist-distclean-files.diff, + glib-patches/automake-warning.diff, + glib-patches/autoconf-warning.diff: Get rid of some warnings when + configuring glib. + 2007-02-21 Tollef Fog Heen * parse.c (parse_package_file and others): Move the reversal of diff --git a/Makefile.am b/Makefile.am index 4fcde30..bb7db28 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,10 +2,11 @@ if USE_INSTALLED_GLIB included_glib_includes = @GLIB_CFLAGS@ pkg_config_LDADD=@GLIB_LIBS@ else -SUBDIRS = glib-1.2.8 check +GLIB_SUBDIR = glib-1.2.8 included_glib_includes = -I./glib-1.2.8 pkg_config_LDADD=glib-1.2.8/libglib.la endif +SUBDIRS = $(GLIB_SUBDIR) check m4dir = $(datadir)/aclocal m4_DATA = pkg.m4 diff --git a/configure.in b/configure.in index ac31b72..9102c5d 100644 --- a/configure.in +++ b/configure.in @@ -74,7 +74,6 @@ AC_MSG_CHECKING([for Win32]) case "$host" in *-*-mingw*) native_win32=yes - AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib]) ;; *) native_win32=no @@ -82,8 +81,6 @@ case "$host" in esac AC_MSG_RESULT([$native_win32]) -AM_CONDITIONAL(USE_INSTALLED_GLIB, test x$native_win32 = xyes) - case "$libdir" in *lib64) AC_DEFINE(PREFER_LIB64,1,[Define if your native architecture defines libdir to be $prefix/lib64 instead of $prefix/lib.]) ;; *) : ;; @@ -99,7 +96,29 @@ if test x$native_win32 = xyes; then # These are correct for GLib 2.x GLIB_CFLAGS="-I$includedir/glib-2.0 -I$libdir/glib-2.0/include" GLIB_LIBS="-L$libdir -lglib-2.0 -liconv -lintl" + use_installed_glib=yes +else + use_installed_glib=no + AC_ARG_WITH([installed-glib], + [ --with-installed-glib Use installed Glib-2.x], [ + if test x$withval = xyes; then + # Not on Win32, but the user requested to use the installed Glib-2.x, + # therefore we may assume that (some older version of) pkg-config can + # be found in the users PATH (otherwise we simply ignore the request). + AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], []) + if test -n $PKG_CONFIG && $PKG_CONFIG --exists glib-2.0; then + GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0` + GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0` + use_installed_glib=yes + fi + fi + ]) +fi # !use_installed_glib + +AM_CONDITIONAL(USE_INSTALLED_GLIB, test x$use_installed_glib = xyes) +if test x$use_installed_glib = xyes; then + AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib]) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) diff --git a/glib-patches/autoconf-warning.diff b/glib-patches/autoconf-warning.diff new file mode 100644 index 0000000..3965631 --- /dev/null +++ b/glib-patches/autoconf-warning.diff @@ -0,0 +1,24 @@ + This is file patch-06-autoconf-warning for pkg-config-0.21 + + Fix autoconf (2.61a) warning + AC_CACHE_VAL(glib_cv_sane_realloc, ...): suspicious presence of + an AC_DEFINE in the second argument, where no actions should be taken + +diff -ur -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x config.h.in -x 'config.h.in~' pkg-config-0.21.orig/glib-1.2.8/configure.in pkg-config-0.21/glib-1.2.8/configure.in +--- pkg-config-0.21.orig/glib-1.2.8/configure.in 2006-08-16 20:24:29.000000000 +0200 ++++ pkg-config-0.21/glib-1.2.8/configure.in 2007-01-19 15:05:37.000000000 +0100 +@@ -384,11 +384,13 @@ + return realloc (0, sizeof (int)) == 0; + }], + glib_cv_sane_realloc=yes +- AC_DEFINE(REALLOC_0_WORKS) + , + glib_cv_sane_realloc=no + ,) + ]) ++if test x$glib_cv_sane_realloc = xyes; then ++ AC_DEFINE(REALLOC_0_WORKS) ++fi + AC_MSG_RESULT($glib_cv_sane_realloc) + + diff --git a/glib-patches/automake-warning.diff b/glib-patches/automake-warning.diff new file mode 100644 index 0000000..0608cc1 --- /dev/null +++ b/glib-patches/automake-warning.diff @@ -0,0 +1,39 @@ + This is file patch-05-automake-warning for pkg-config-0.21 + + Fix automake (1.10) warnings + BUILT_SOURCES multiply defined in condition TRUE ... + noinst_DATA multiply defined in condition TRUE ... + whitespace following trailing backslash + +diff -ur -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x config.h.in -x 'config.h.in~' pkg-config-0.21.orig/glib-1.2.8/Makefile.am pkg-config-0.21/glib-1.2.8/Makefile.am +--- pkg-config-0.21.orig/glib-1.2.8/Makefile.am 2006-08-16 20:24:29.000000000 +0200 ++++ pkg-config-0.21/glib-1.2.8/Makefile.am 2007-01-19 15:03:19.000000000 +0100 +@@ -8,7 +8,7 @@ + configincludedir = $(pkglibdir)/include + + noinst_SCRIPTS=glib-config +-BUILT_SOURCES=glib-config ++#BUILT_SOURCES=glib-config + glib-config: glib-config.in + + INCLUDES = -DG_LOG_DOMAIN=g_log_domain_glib @GLIB_DEBUG_FLAGS@ +@@ -60,8 +60,8 @@ + noinst_HEADERS = \ + glib.h + +-noinst_DATA = \ +- glibconfig.h ++#noinst_DATA = \ ++# glibconfig.h + + CONFIGURE_DEPENDENCIES = acglib.m4 + +@@ -121,7 +121,7 @@ + fi \ + && cp glib.spec $(distdir) + +-DISTCLEANFILES = glibconfig-sysdefs.h glibconfig.h glibconfig.h.win32 \ ++DISTCLEANFILES = glibconfig-sysdefs.h glibconfig.h glibconfig.h.win32 \ + config.h.win32 + + CLEANFILES = stamp-gc-h makefile.msc diff --git a/glib-patches/no-dist-distclean-files.diff b/glib-patches/no-dist-distclean-files.diff new file mode 100644 index 0000000..67173dc --- /dev/null +++ b/glib-patches/no-dist-distclean-files.diff @@ -0,0 +1,18 @@ + This is file patch-07-dist for pkg-config-0.21 + to be applied on top of patch-05-automake-warning + + Don't distribute DISTCLEAN files + +diff -ur -x autom4te.cache -x aclocal.m4 -x configure -x Makefile.in -x config.h.in -x 'config.h.in~' pkg-config-0.21.orig/glib-1.2.8/Makefile.am pkg-config-0.21/glib-1.2.8/Makefile.am +--- pkg-config-0.21.orig/glib-1.2.8/Makefile.am 2007-01-19 15:03:19.000000000 +0100 ++++ pkg-config-0.21/glib-1.2.8/Makefile.am 2007-01-19 15:07:29.000000000 +0100 +@@ -23,9 +23,7 @@ + makefile.msc.in \ + makefile.msc \ + giowin32.c \ +- glibconfig.h.win32 \ + glibconfig.h.win32.in \ +- config.h.win32 \ + config.h.win32.in + + noinst_LTLIBRARIES = libglib.la