diff options
-rw-r--r-- | .cvsignore | 1 | ||||
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | Makefile.am | 6 | ||||
-rw-r--r-- | acinclude.m4 | 187 | ||||
-rw-r--r-- | configure.in | 71 | ||||
-rw-r--r-- | gconf-2.0.pc.in | 12 |
6 files changed, 264 insertions, 28 deletions
@@ -18,5 +18,6 @@ ABOUT-NLS intl config.h.in gconf-config +gconf-2.0.pc gconf.spec gconf.m4 @@ -1,3 +1,18 @@ +2001-03-18 Martin Baulig <baulig@suse.de> + + We're now on the GNOME 2.0 platform. + + * configure.in: Set MAJOR_VERSION to 2, use pkg-config to + check for stuff; GTK+ is now optional and only used for + the examples; depend on ORBit2. + + * acinclude.m4: Add the contents of + gnome-common/macros2/gnome-pkgconfig.m4 here. + + * Makefile.am: Install gconf-2.0.pc. + + * gconf-2.0.pc.in: New file. + 2001-03-13 Kjartan Maraas <kmaraas@gnome.org> * backends/xml-entry.c: Merge from branch. Use xmlFree(). diff --git a/Makefile.am b/Makefile.am index 71d6928e..95f560c7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,8 @@ SUBDIRS = gconf backends wrappers po doc examples standard-schemas DIST_SUBDIRS=tests $(SUBDIRS) -EXTRA_DIST=gconf-config.in gconf.m4.in gconf.spec.in gconf.spec TODO +EXTRA_DIST=gconf-config.in gconf.m4.in gconf.spec.in gconf.spec TODO \ + gconf-2.0.pc.in WARNING_MESSAGE="If this is your first install of GConf, you may need to move $(prefix)/etc/gconf/$(MAJOR_VERSION)/path.example to $(prefix)/etc/gconf/$(MAJOR_VERSION)/path, so that the default configuration is sane. If you are already using GConf, you may need to move your old configuration into place if $(MAJOR_VERSION) is not the same as your old version." @@ -25,5 +26,8 @@ install-data-local: @echo $(WARNING_MESSAGE) @echo "**************" +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = gconf-2.0.pc + install-schemas: (cd standard-schemas && $(MAKE) $(AM_MAKEFLAGS) install-schemas) diff --git a/acinclude.m4 b/acinclude.m4 index 9abb53dd..1d81f045 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -336,3 +336,190 @@ strdup __argz_count __argz_stringify __argz_next]) < $srcdir/po/POTFILES.in > po/POTFILES ]) +dnl GNOME_PKGCONFIG_CHECK_VERSION() extracts up to 6 decimal numbers out of given-version +dnl and required-version, using any non-number letters as delimiters. it then +dnl compares each of those 6 numbers in order 1..6 to each other, requirering +dnl all of the 6 given-version numbers to be greater than, or at least equal +dnl to the corresponding number of required-version. +dnl GNOME_PKGCONFIG_CHECK_VERSION(given-version, required-version [, match-action] [, else-action]) +AC_DEFUN([GNOME_PKGCONFIG_CHECK_VERSION],[ +[eval `echo "$1:0:0:0:0:0:0" | sed -e 's/^[^0-9]*//' -e 's/[^0-9]\+/:/g' \ + -e 's/\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):.*/ac_v1=\1 ac_v2=\2 ac_v3=\3 ac_v4=\4 ac_v5=\5 ac_v6=\6/' \ +`] +[eval `echo "$2:0:0:0:0:0:0" | sed -e 's/^[^0-9]*//' -e 's/[^0-9]\+/:/g' \ + -e 's/\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):\([^:]*\):.*/ac_r1=\1 ac_r2=\2 ac_r3=\3 ac_r4=\4 ac_r5=\5 ac_r6=\6/' \ +`] +ac_vm=[`expr \( $ac_v1 \> $ac_r1 \) \| \( \( $ac_v1 \= $ac_r1 \) \& \( \ + \( $ac_v2 \> $ac_r2 \) \| \( \( $ac_v2 \= $ac_r2 \) \& \( \ + \( $ac_v3 \> $ac_r3 \) \| \( \( $ac_v3 \= $ac_r3 \) \& \( \ + \( $ac_v4 \> $ac_r4 \) \| \( \( $ac_v4 \= $ac_r4 \) \& \( \ + \( $ac_v5 \> $ac_r5 \) \| \( \( $ac_v5 \= $ac_r5 \) \& \( \ + \( $ac_v6 \>= $ac_r6 \) \ + \) \) \ + \) \) \ + \) \) \ + \) \) \ + \) \) `] +case $ac_vm in +[1)] + [$3] + ;; +*[)] + [$4] + ;; +esac +]) + +dnl +dnl GNOME_CHECK_PKGCONFIG (script-if-enabled, [failflag]) +dnl +AC_DEFUN([GNOME_CHECK_PKGCONFIG],[ + AC_PATH_PROG(PKG_CONFIG, pkg-config) + have_pkgconfig=no + if test -x "$PKG_CONFIG" ; then + have_pkgconfig=yes + else + PKG_CONFIG= + fi + AC_MSG_CHECKING(for pkg-config) + if test x$have_pkgconfig = xyes ; then + pkgconfig_required_version=0.4.1 + pkgconfig_version=`pkg-config --version` + GNOME_PKGCONFIG_CHECK_VERSION($pkgconfig_version, $pkgconfig_required_version, [have_pkgconfig=yes], [have_pkgconfig=no]) + fi + if test x$have_pkgconfig = xyes ; then + AC_MSG_RESULT(yes) + else + PKG_CONFIG= + AC_MSG_RESULT(not found) + if test x$2 = xfail; then + AC_MSG_ERROR([ +*** You need the latest pkg-config (at least $pkgconfig_required_version). +*** Get the latest version of pkg-config from +*** http://pkgconfig.sourceforce.net.]) + fi + fi + AC_SUBST(PKG_CONFIG) + + AC_PROVIDE([GNOME_REQUIRE_PKGCONFIG]) +]) + +dnl +dnl GNOME_REQUIRE_PKGCONFIG +dnl +AC_DEFUN([GNOME_REQUIRE_PKGCONFIG],[ + GNOME_CHECK_PKGCONFIG([], fail) +]) + +dnl Check if the C compiler accepts a certain C flag, and if so adds it to +dnl CFLAGS +AC_DEFUN([GNOME_PKGCONFIG_CHECK_CFLAG], [ + AC_REQUIRE([GNOME_REQUIRE_PKGCONFIG]) + + AC_MSG_CHECKING(if C compiler accepts $1) + save_CFLAGS="$CFLAGS" + + dnl make sure we add it only once + dnl this one doesn't seem to work: *[\ \ ]$1[\ \ ]*) ;; + case " $CFLAGS " in + *\ $1\ *) echo $ac_n "(already in CFLAGS) ... " ;; + *\ $1\ *) echo $ac_n "(already in CFLAGS) ... " ;; + *\ $1\ *) echo $ac_n "(already in CFLAGS) ... " ;; + *\ $1\ *) echo $ac_n "(already in CFLAGS) ... " ;; + *) CFLAGS="$CFLAGS $1" ;; + esac + + AC_TRY_COMPILE([#include <stdio.h>], [printf("hello");], + [ AC_MSG_RESULT(yes)],dnl + [ CFLAGS="$save_CFLAGS" AC_MSG_RESULT(no) ]) +]) + +dnl add $ACLOCAL_FLAGS (and optionally more dirs) to the aclocal +dnl commandline, so make can work even if it needs to rerun aclocal +AC_DEFUN([GNOME_PKGCONFIG_ACLOCALFLAGS], +[ + AC_REQUIRE([GNOME_REQUIRE_PKGCONFIG]) + + test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + + for i in "$1"; do + ACLOCAL="$ACLOCAL -I $i" + done +]) + +AC_DEFUN([GNOME_PKGCONFIG_CHECK_OPTIONAL_MODULES], +[ + AC_REQUIRE([GNOME_REQUIRE_PKGCONFIG]) + + name=$1 + depvar=$3 + + AC_MSG_CHECKING(for libraries) + pkg_list="" + for module in $2 ""; do + if test -n "$module"; then + if `echo $module |grep -q ":"`; then + dnl has version requirement + pkg_module_name=`echo $module |sed 's/\(.*\):.*/\1/'` + test_version=`echo $module |sed 's/.*:\(.*\)/\1/'` + + msg=`$PKG_CONFIG $pkg_module_name 2>&1` + if test -z "$msg"; then + dnl module exists + pkg_version=`$PKG_CONFIG --modversion $pkg_module_name` + GNOME_PKGCONFIG_CHECK_VERSION($pkg_version, $test_version, + dnl has the right version + echo $ac_n "$pkg_module_name " + pkg_list="$pkg_list $pkg_module_name" + , + AC_MSG_RESULT([($pkg_module_name)]) + if test x$4 = xfail ; then + AC_MSG_ERROR([An old version of $pkg_module_name (version $pkg_version) was found. You need at least version $test_version]) + else + AC_MSG_WARN([An old version of $pkg_module_name (version $pkg_version) was found. You need at least version $test_version]) + fi + ) + else + dnl doesn't exist + AC_MSG_RESULT([($pkg_module_name)]) + if test x$4 = xfail ; then + AC_MSG_ERROR([$msg]) + else + AC_MSG_WARN([$msg]) + fi + fi + else + msg=`$PKG_CONFIG $module 2>&1` + if test -z "$msg"; then + echo $ac_n "$module " + pkg_list="$pkg_list $module" + else + AC_MSG_RESULT([($module)]) + if test x$4 = xfail ; then + AC_MSG_ERROR([$msg]) + else + AC_MSG_WARN([$msg]) + fi + fi + fi + fi + done + AC_MSG_RESULT([]) + if test -n "$pkg_list"; then + eval $name'_CFLAGS'=\"`$PKG_CONFIG --cflags $pkg_list`\" + eval $name'_LIBS'=\"`$PKG_CONFIG --libs $pkg_list`\" + if test -n "$depvar"; then + eval $depvar'_DEPENDS'=\"\$$depname'_DEPENDS' $pkg_list\" + else + eval $name'_DEPENDS'=\"$pkg_list\" + fi + if test -z "$4" ; then + eval 'HAVE_'$name=yes + fi + fi +]) + +AC_DEFUN([GNOME_PKGCONFIG_CHECK_MODULES], +[ + GNOME_PKGCONFIG_CHECK_OPTIONAL_MODULES($1,$2,$3,fail) +]) diff --git a/configure.in b/configure.in index fe1bee13..bdd49b6f 100644 --- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ changequote(,)dnl if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; + *) CFLAGS="$CFLAGS" ;; esac if test "x$enable_ansi" = "xyes"; then @@ -39,7 +39,7 @@ changequote([,])dnl dnl used to rename everything and support simultaneous installs. dnl not incremented for bugfix or unstable releases. -MAJOR_VERSION=1 +MAJOR_VERSION=2 AC_SUBST(MAJOR_VERSION) GETTEXT_PACKAGE=gconf$MAJOR_VERSION @@ -137,24 +137,23 @@ if test "x$docs_only" = "xyes"; then AC_FYI("Only building documentation") else -AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR(glib not found or too old),gmodule) -AM_PATH_OAF(0.2.0,,AC_MSG_ERROR([OAF not found or too old])) -AM_PATH_GTK(1.2.0,,HAVE_GTK=no) - -AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno) - -AC_PATH_PROG(XML_CONFIG,xml-config,no) -if test x$XML_CONFIG = xno; then - AC_MSG_ERROR(Couldn't find xml-config need to install libxml) -fi -XML_LIBS=`$XML_CONFIG --libs` -XML_CFLAGS=`$XML_CONFIG --cflags` -if test "x$XML_LIBS" = x; then - AC_MSG_ERROR(Failed to get link flags for libxml) -fi +GNOME_PKGCONFIG_CHECK_MODULES(GLIB, gmodule-2.0:1.3.1 gobject-2.0:1.3.1) +GNOME_PKGCONFIG_CHECK_OPTIONAL_MODULES(GTK, gtk+-2.0:1.3.1) +GNOME_PKGCONFIG_CHECK_MODULES(OAF, oaf-2.0) +GNOME_PKGCONFIG_CHECK_MODULES(XML, libxml-2.0:2.2.8) +AC_PATH_PROG(OAF_CONFIG, oaf-config) +AC_SUBST(OAF_CONFIG) +AC_SUBST(GLIB_LIBS) +AC_SUBST(GLIB_CFLAGS) +AC_SUBST(OAF_LIBS) +AC_SUBST(OAF_CFLAGS) +AC_SUBST(GTK_LIBS) +AC_SUBST(GTK_CFLAGS) AC_SUBST(XML_LIBS) AC_SUBST(XML_CFLAGS) +AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno) + BDB_LIBS= BDB_CFLAGS= @@ -175,16 +174,6 @@ AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt, *** ftp://ftp.redhat.com/pub/redhat/code/popt and try again.]]))]) AC_SUBST(POPT_LIBS) -AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) -if test x$ORBIT_CONFIG = xno; then - AC_MSG_ERROR(Couldn't find orbit-config) -fi - -ORBIT_LIBS=`$ORBIT_CONFIG --libs server` -ORBIT_CFLAGS=`$ORBIT_CONFIG --cflags server` -AC_SUBST(ORBIT_LIBS) -AC_SUBST(ORBIT_CFLAGS) - AC_PATH_PROG(GUILE_CONFIG,guile-config,no) if (test x$GUILE_CONFIG = xno); then AC_MSG_WARN(didn't find guile-config, won't build Guile wrappers) @@ -227,6 +216,34 @@ AC_SUBST(LDFLAGS) absolute_top_srcdir=`pwd` AC_SUBST(absolute_top_srcdir) +# define a MAINT-like variable REBUILD which is set if Perl +# and awk are found, so autogenerated sources can be rebuilt + +AC_PROG_AWK +AC_CHECK_PROGS(PERL, perl5 perl) + +# We would like indent, but don't require it. +AC_CHECK_PROG(INDENT, indent, indent) + +_found_perl=0 +if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then + _found_perl=1 +else + # The version string for perl changed for 'version 5' to 'v5' in + # perl 5.6 or therabouts + if test -n "$PERL" && $PERL -v | grep 'v5.' > /dev/null ; then + _found_perl=1 + fi +fi + +REBUILD=\# +if test $_found_perl -eq 1; then + if test -n "$AWK" ; then + REBUILD= + fi +fi +AC_SUBST(REBUILD) + AC_OUTPUT([ Makefile gconf-config diff --git a/gconf-2.0.pc.in b/gconf-2.0.pc.in new file mode 100644 index 00000000..3d37fb2d --- /dev/null +++ b/gconf-2.0.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + + +Name: gconf +Description: GNOME Config System. +Version: @VERSION@ +Requires: oaf-2.0 +Libs: -L${libdir} -lgconf-@MAJOR_VERSION@ +Cflags: -I${includedir}/gconf/@MAJOR_VERSION@ |