--- pkg-config-0.20/Makefile.am.orig-syslibs 2005-10-16 21:09:39 +0400 +++ pkg-config-0.20/Makefile.am 2005-11-21 02:16:56 +0300 @@ -1,10 +1,10 @@ if USE_INSTALLED_GLIB included_glib_includes = @GLIB_CFLAGS@ -pkg_config_LDADD=@GLIB_LIBS@ +pkg_config_LDADD=@GLIB_LIBS@ -lpopt else SUBDIRS = glib-1.2.8 check included_glib_includes = -I./glib-1.2.8 -pkg_config_LDADD=glib-1.2.8/libglib.la +pkg_config_LDADD=glib-1.2.8/libglib.la -lpopt endif m4dir = $(datadir)/aclocal @@ -25,13 +25,4 @@ partial-glib.c \ parse.h \ parse.c \ - main.c \ - findme.c \ - findme.h \ - popt.c \ - popt.h \ - poptconfig.c \ - popthelp.c \ - poptint.h \ - poptparse.c - + main.c --- pkg-config-0.20/configure.in.orig-syslibs 2005-10-16 22:17:13 +0400 +++ pkg-config-0.20/configure.in 2005-11-21 02:22:40 +0300 @@ -1,5 +1,6 @@ AC_INIT(pkg-config.1) +AC_CONFIG_AUX_DIR(.) AM_INIT_AUTOMAKE(pkg-config, 0.20) AM_MAINTAINER_MODE @@ -64,7 +65,6 @@ case "$host" in *-*-mingw*) native_win32=yes - AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib]) ;; *) native_win32=no @@ -72,8 +72,6 @@ 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.]) ;; *) : ;; @@ -92,11 +90,49 @@ AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) +fi # !native_win32 + +AC_MSG_CHECKING(whether to build with system glib) +AC_ARG_WITH(sys_glib, + [ --with-sys-glib, compile with system glib (default=no)], + [ + case "$withval" in + y | yes) + AC_MSG_RESULT(yes) + with_sysglib=yes + ;; + + n | no) + AC_MSG_RESULT(no) + with_sysglib=no + ;; + + *) + AC_MSG_ERROR([Invalid parameter value for --with-sys-glib: $withval]) + ;; + esac + ], + [ + AC_MSG_RESULT(no) + with_sysglib=no + ] +) + +if test x$with_sysglib = xyes; then + GLIB_CFLAGS="-I$includedir/glib-2.0 -I$libdir/glib-2.0/include" + GLIB_LIBS="-L$libdir -lglib-2.0" + + AC_SUBST(GLIB_LIBS) + AC_SUBST(GLIB_CFLAGS) +fi - AC_CONFIG_AUX_DIR(.) +AM_CONDITIONAL(USE_INSTALLED_GLIB, test x$with_sysglib = xyes || test x$native_win32 = xyes) + +if test x$with_sysglib = xyes || test x$native_win32 = xyes; then + AC_DEFINE(USE_INSTALLED_GLIB, 1, [We are using an installed GLib]) else AC_CONFIG_SUBDIRS(glib-1.2.8) -fi # !native_win32 +fi AC_FUNC_ALLOCA --- pkg-config-0.20/main.c.orig-syslibs 2005-10-16 22:04:50 +0400 +++ pkg-config-0.20/main.c 2005-11-21 02:16:56 +0300 @@ -24,7 +24,7 @@ #include "pkg.h" #include "parse.h" -#include "popt.h" +#include #include #include #include @@ -170,7 +170,7 @@ } int -main (int argc, char **argv) +main (int argc, const char **argv) { int want_my_version = 0; int want_version = 0; --- pkg-config-0.20/parse.c.orig-syslibs 2005-10-16 21:09:39 +0400 +++ pkg-config-0.20/parse.c 2005-11-21 02:16:56 +0300 @@ -27,7 +27,7 @@ #include #include #include -#include "popt.h" +#include #ifdef HAVE_SYS_WAIT_H #include #endif @@ -732,7 +732,7 @@ /* Strip out -l and -L flags, put them in a separate list. */ char *trimmed; - char **argv = NULL; + const char **argv = NULL; int argc; int result; @@ -815,7 +815,7 @@ /* Strip out -I flags, put them in a separate list. */ char *trimmed; - char **argv = NULL; + const char **argv = NULL; int argc; int result; int i;