Libgtop parallel install fix [Was: Re: gnome-utils porting report]



> > Post 'em here, if no one sees problems let's put them in.
>
> Patch for libgtop 1.0.x attached, it's fairly strict forward -- just moving
> headers. 1.1.x is *much* more complex (due to conflicting lib names), and
> need a little bit of time for cleaning up and testing.
> Will post the patch for 1.1.x once it's done.

OK, patch for libgtop 1.1.x paralle installation also attached. However I
got stuck in a few issues:

1. Are the backend/common libraries just dlopen'ed? Currently I just
   assume so (just a guess, from source code), and moved the backend
   directory from $datadir to $libdir/libgtop.

2. I'm following libgda's versioning to allow parallel installation, i.e.
   use versioned include paths such as /usr/include/libgtop-1.1.6/gtoplib
   and /usr/lib/libgtop/1.1.6/include . Is that OK, or
   /usr/include/libgtop-2.0/gtoplib is preferred?

Abel

PS: patch for libgtop 1.0.x is attached again, seems it's lost in the air.
--- libgtop-orig/doc/libgtop.texi	Sun Sep 26 03:01:18 1999
+++ libgtop/doc/libgtop.texi	Tue Oct 16 00:53:15 2001
@@ -1,6 +1,6 @@
 \input texinfo   @c -*-texinfo-*-
 @c %**start of header
- setfilename libgtop.info
+ setfilename libgtop2.info
 @settitle LibGTop Reference Manual
 @setchapternewpage odd
 @c %**end of header
@@ -44,7 +44,7 @@
 @format
 @dircategory Libraries:
 @direntry
-* libgtop: (libgtop).			Library to get system specific data
+* libgtop2: (libgtop2).			Library to get system specific data
 					such as cpu and memory usage, active
 					processes
 @end direntry
--- libgtop-orig/doc/Makefile.am	Tue Oct 16 00:30:20 2001
+++ libgtop/doc/Makefile.am	Tue Oct 16 01:04:24 2001
@@ -1,10 +1,10 @@
-info_TEXINFOS		= libgtop.texi
+info_TEXINFOS		= libgtop2.texi
 
-libgtop_TEXINFOS	= libgtop.texi about.texi reference.texi \
+libgtop2_TEXINFOS	= libgtop2.texi about.texi reference.texi \
 			  auto-macros.texi version.texi main.texi \
 			  white-paper.texi internals.texi
 
-MAKEINFO		= -I @libgtop_top_builddir@/doc
+MAKEINFO		+= -I @libgtop_top_builddir@/doc
 
 EXTRA_DIST		= auto-macros.texi.in
 
--- libgtop-orig/include/glibtop/Makefile.am	Sat Apr 21 03:48:57 2001
+++ libgtop/include/glibtop/Makefile.am	Tue Oct 16 01:19:59 2001
@@ -1,4 +1,4 @@
-glibtopdir		= $(includedir)/glibtop
+glibtopdir		= $(includedir)/$(PACKAGE)-$(LIBGTOP_VERSION)/glibtop
 
 glibtop_HEADERS		= close.h loadavg.h prockernel.h procstate.h \
 			  sem_limits.h uptime.h mem.h proclist.h \
--- libgtop-orig/libgtop-config.in	Wed May 12 18:25:33 1999
+++ libgtop/libgtop-config.in	Tue Oct 16 03:26:17 2001
@@ -3,10 +3,10 @@
 usage="\
 Usage: libgtop-config [--version] [--config] [--features-def-file] [--cflags] [--libs] [--extra-libs]"
 
-config_file="@LIBGTOP_LIBDIR@/libgtopConf.sh"
+config_file="@LIBGTOP_LIBDIR@/libgtop2Conf.sh"
 . $config_file
 
-features_def_file="@LIBGTOP_LIBDIR@/libgtop-features.def"
+features_def_file="@LIBGTOP_LIBDIR@/libgtop2-features.def"
 
 if test $# -eq 0; then
       echo "${usage}" 1>&2
--- libgtop-orig/Makefile.am	Tue Oct 16 00:30:14 2001
+++ libgtop/Makefile.am	Tue Oct 16 03:53:58 2001
@@ -2,8 +2,8 @@
 
 SUBDIRS = po intl misc include lib sysdeps src doc dtd scripts
 
-include_HEADERS = glibtop.h
-configincludedir = $(pkglibdir)/include
+glibtopinclude_HEADERS = glibtop.h
+glibtopincludedir = $(includedir)/$(PACKAGE)-$(LIBGTOP_VERSION)
 
 EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt libgtopConf.sh.in \
 	LIBGTOP-VERSION features.def structures.def libgtop-config.in \
@@ -29,22 +29,22 @@
 ## Put `exec' in the name because this should be installed by
 ## `install-exec', not `install-data'.
 confexecdir	= $(libdir)
-confexec_DATA	= $(top_builddir)/libgtopConf.sh \
-		  $(top_builddir)/libgtop-features.def \
-		  $(top_builddir)/libgtop-structures.def
+confexec_DATA	= $(top_builddir)/libgtop2Conf.sh \
+		  $(top_builddir)/libgtop2-features.def \
+		  $(top_builddir)/libgtop2-structures.def
 
-CLEANFILES=libgtopConf.sh
+CLEANFILES=libgtop2Conf.sh
 
-bin_SCRIPTS = $(top_builddir)/libgtop-config
+bin_SCRIPTS = $(top_builddir)/libgtop2-config
 
-## We create libgtopConf.sh here and not from configure because we want
+## We create libgtop2Conf.sh here and not from configure because we want
 ## to get the paths expanded correctly.  Macros like srcdir are given
 ## the value NONE in configure if the user doesn't specify them (this
 ## is an autoconf feature, not a bug).
-libgtopConf.sh: libgtopConf.sh.in Makefile
+libgtop2Conf.sh: libgtopConf.sh.in Makefile
 ## Use sed and then mv to avoid problems if the user interrupts.
 	sed -e 's#\ LIBGTOP_LIBDIR\@#$(libdir)#g' \
-	  -e 's#\ LIBGTOP_INCLUDEDIR\@#$(includedir)#g' \
+	  -e 's#\ LIBGTOP_INCLUDEDIR\@#$(includedir)/$(PACKAGE)-$(LIBGTOP_VERSION)#g' \
 	  -e 's#\ LIBGTOP_DATADIR\@#$(datadir)#g' \
 	  -e 's#\ LIBGTOP_BACKEND_DIR\@#$(LIBGTOP_BACKEND_DIR)#g' \
 	  -e 's#\ LIBGTOP_EXTRA_LIBS\@#$(LIBGTOP_EXTRA_LIBS)#g' \
@@ -66,18 +66,18 @@
 	  -e 's#\ libgtop_have_sysdeps\@#$(libgtop_have_sysdeps)#g' \
 	  -e 's#\ libgtop_use_machine_h\@#$(libgtop_use_machine_h)#g' \
 	      < $(srcdir)/libgtopConf.sh.in > libgtopConf.tmp \
-	  && mv libgtopConf.tmp libgtopConf.sh
+	  && mv libgtopConf.tmp libgtop2Conf.sh
 
-libgtop-config: libgtop-config.in Makefile
+libgtop2-config: libgtop-config.in Makefile
 	sed -e 's#\ LIBGTOP_LIBDIR\@#$(libdir)#g' \
 	      < $(srcdir)/libgtop-config.in > libgtop-config.tmp \
-	  && mv libgtop-config.tmp libgtop-config && \
-		chmod 755 libgtop-config
+	  && mv libgtop-config.tmp libgtop2-config && \
+		chmod 755 libgtop2-config
 
-libgtop-features.def: features.def
+libgtop2-features.def: features.def
 	@LN_S@ $< $@
 
-libgtop-structures.def: structures.def
+libgtop2-structures.def: structures.def
 	@LN_S@ $< $@
 
 pkgconfigdir = $(libdir)/pkgconfig
--- libgtop-orig/sysdeps/names/Makefile.am	Mon Apr 24 21:08:48 2000
+++ libgtop/sysdeps/names/Makefile.am	Tue Oct 16 04:50:14 2001
@@ -2,9 +2,9 @@
 
 INCLUDES			= @INCLUDES@
 
-lib_LTLIBRARIES			= libgtop_names.la
+lib_LTLIBRARIES			= libgtop_names-1.1.la
 
-libgtop_names_la_SOURCES	= cpu.c mem.c swap.c uptime.c loadavg.c \
+libgtop_names_1_1_la_SOURCES	= cpu.c mem.c swap.c uptime.c loadavg.c \
 				  shm_limits.c msg_limits.c sem_limits.c \
 				  proclist.c sysdeps.c procstate.c procuid.c \
 				  proctime.c procmem.c procsignal.c \
@@ -12,5 +12,5 @@
 				  mountlist.c procargs.c procmap.c netinfo.c \
 				  netload.c interfaces.c ppp.c
 
-libgtop_names_la_LDFLAGS	= $(LT_VERSION_INFO)
+libgtop_names_1_1_la_LDFLAGS	= $(LT_VERSION_INFO)
 
--- libgtop-orig/lib/Makefile.am	Sat Apr 21 06:29:57 2001
+++ libgtop/lib/Makefile.am	Tue Oct 16 04:54:37 2001
@@ -12,11 +12,11 @@
 
 noinst_PROGRAMS			= test-backends
 
-lib_LTLIBRARIES			= libgtop.la
+lib_LTLIBRARIES			= libgtop-1.1.la
 
 noinst_LTLIBRARIES		= libgtop_server.la
 
-libgtop_la_SOURCES		= errors.c glibtop-backend-info.c \
+libgtop_1_1_la_SOURCES		= errors.c glibtop-backend-info.c \
 				  glibtop-client.c glibtop-server.c \
 				  glibtop-backend.c glibtop-client-private.h \
 				  glibtop-server-private.h xmalloc.c error.c \
@@ -24,15 +24,15 @@
 
 libgtop_server_la_SOURCES	= error.c xmalloc.c
 
-libgtop_la_LDFLAGS		= $(LT_VERSION_INFO)
-libgtop_la_LIBADD		= $(GLIB_LIBS) $(XML_LIBS)
+libgtop_1_1_la_LDFLAGS		= $(LT_VERSION_INFO)
+libgtop_1_1_la_LIBADD		= $(GLIB_LIBS) $(XML_LIBS)
 
 test_backends_SOURCES		= \
 	test-backends.c
 
-test_backends_LDADD		= libgtop.la
+test_backends_LDADD		= libgtop-1.1.la
 
-glibtopdir			= $(includedir)/glibtop
+glibtopdir			= $(pkglibdir)/$(LIBGTOP_VERSION)/include
 
 glibtop_HEADERS			= structures.h
 
--- libgtop-orig/libgtop-2.0.pc.in	Sat Oct 13 21:43:19 2001
+++ libgtop/libgtop-2.0.pc.in	Tue Oct 16 05:15:16 2001
@@ -1,11 +1,11 @@
 prefix= prefix@
 exec_prefix= exec_prefix@
 libdir= libdir@
-includedir= includedir@
+includedir= includedir@/@PACKAGE -@LIBGTOP_VERSION@
 
 Name: libgtop
 Description: Portable System Access Library
 Requires: glib-2.0 libxml-2.0
 Version: @VERSION@
-Libs: -L${libdir} -lgtop
-Cflags: -I${includedir}
+Libs: -L${libdir} -lgtop-1.1
+Cflags: -I${includedir} -I${libdir}/@PACKAGE@/@LIBGTOP_VERSION@/include
--- libgtop-orig/configure.in	Tue Oct 16 00:30:14 2001
+++ libgtop/configure.in	Tue Oct 16 05:45:09 2001
@@ -42,7 +42,7 @@
 LT_CURRENT=`expr $LIBGTOP_MICRO_VERSION - $LIBGTOP_INTERFACE_AGE`
 LT_REVISION=$LIBGTOP_INTERFACE_AGE
 LT_AGE=`expr $LIBGTOP_BINARY_AGE - $LIBGTOP_INTERFACE_AGE`
-LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE} -release ${LT_RELEASE}'
+LT_VERSION_INFO='-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}'
 AC_SUBST(LT_VERSION_INFO)
 AC_SUBST(LT_RELEASE)
 AC_SUBST(LT_CURRENT)
@@ -123,6 +123,7 @@
 
 dnl Check for glib
 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.1 gmodule-2.0 >= 1.3.1 gobject-2.0 >= 1.3.1)
+AM_CONDITIONAL(LIBGTOP_USE_GMODULE, test "x$GLIB_CFLAGS" != "x")
 AC_SUBST(GLIB_CFLAGS)
 AC_SUBST(GLIB_LIBS)
 
@@ -191,7 +192,7 @@
 
 dnl These definitions are expanded in make.
 LIBGTOP_LIBS='-L$(libdir)'
-LIBGTOP_INCS='-I$(includedir) -I$(pkglibdir)/include'
+LIBGTOP_INCS='-I$(includedir)/$(PACKAGE)-$(LIBGTOP_VERSION) -I$(pkglibdir)/$(LIBGTOP_VERSION)/include'
 
 if test x$build_inodedb = xyes ; then
   LIBGTOP_INCS="$LIBGTOP_INCS -DGLIBTOP_INODEDB"
@@ -201,9 +202,9 @@
 
 LIBGTOP_EXTRA_LIBS="$LIBGTOP_EXTRA_LIBS $GLIB_LIBS $XML_LIBS"
 
-LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop_common -lgtop"
+LIBGTOP_LIBS="$LIBGTOP_LIBS -lgtop-1.1"
 
-LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS -lgtop_names"
+LIBGTOP_NAMES_LIBS="$LIBGTOP_LIBS -lgtop_names-1.1"
 
 LIBGTOP_LIBS="$LIBGTOP_LIBS" 
 LIBGTOP_NAMES_LIBS="$LIBGTOP_NAMES_LIBS"
@@ -214,7 +215,7 @@
 
 AC_SUBST(machine_incs)
 
-LIBGTOP_BACKEND_DIR="\$(datadir)/libgtop/backends"
+LIBGTOP_BACKEND_DIR="\$(pkglibdir)/\$(LIBGTOP_VERSION)/backends"
 
 INCLUDES="-D_IN_LIBGTOP -D_GNU_SOURCE -DGLIBTOP_NAMES -Werror -I\$(top_builddir) -I\$(top_srcdir) -I\$(top_srcdir)/sysdeps/$sysdeps_dir -I\$(top_srcdir)/include -I\$(top_builddir)/include -I\$(top_srcdir)/intl $GNOMESUPPORT_CFLAGS $GLIB_CFLAGS $XML_CFLAGS $CFLAGS $X_CFLAGS "'-DGTOPLOCALEDIR=\"$(datadir)/locale\" -DLIBGTOP_VERSION=\"'"$LIBGTOP_VERSION"'\" -DLIBGTOP_VERSION_CODE='$LIBGTOP_VERSION_CODE' -DLIBGTOP_BACKEND_DIR=\"'"$LIBGTOP_BACKEND_DIR"'\"'
 
--- libgtop-orig/sysdeps/common/Makefile.am	Sat Apr 21 06:31:06 2001
+++ libgtop/sysdeps/common/Makefile.am	Tue Oct 16 19:56:42 2001
@@ -17,5 +17,5 @@
 	@GLIB_LIBS@
 
 libgtop_backend_common_la_LDFLAGS = \
-	$(LT_VERSION_INFO)
+	-avoid-version -module
 
diff -ur libgtop-1.0.12-orig/configure.in libgtop-1.0.12/configure.in
--- libgtop-1.0.12-orig/configure.in	Tue Feb 27 21:20:02 2001
+++ libgtop-1.0.12/configure.in	Sat Oct 13 14:31:16 2001
@@ -338,7 +338,7 @@
 
 dnl These definitions are expanded in make.
 LIBGTOP_LIBS='-L$(libdir)'
-LIBGTOP_INCS='-I$(includedir)'
+LIBGTOP_INCS='-I$(includedir)/libgtop-1.0'
 
 if test x$libgtop_use_machine_h = xyes ; then
   LIBGTOP_INCS="$LIBGTOP_INCS -DHAVE_GLIBTOP_MACHINE_H"
diff -ur libgtop-1.0.12-orig/include/glibtop/Makefile.am libgtop-1.0.12/include/glibtop/Makefile.am
--- libgtop-1.0.12-orig/include/glibtop/Makefile.am	Mon Oct 26 18:38:43 1998
+++ libgtop-1.0.12/include/glibtop/Makefile.am	Sat Oct 13 14:31:46 2001
@@ -1,4 +1,4 @@
-glibtopdir		= $(includedir)/glibtop
+glibtopdir		= $(includedir)/libgtop-1.0/glibtop
 
 glibtop_HEADERS		= close.h loadavg.h prockernel.h procstate.h \
 			  sem_limits.h uptime.h command.h mem.h proclist.h \
--- libgtop-1.0.12-orig/Makefile.am	Thu Feb 15 07:48:16 2001
+++ libgtop-1.0.12/Makefile.am	Sat Oct 13 16:33:12 2001
@@ -13,7 +13,8 @@
 SUBDIRS = po intl $(support) macros misc include sysdeps lib src \
 	  $(examples_SUBDIRS) doc
 
-include_HEADERS = glibtop.h
+libgtopinclude_HEADERS = glibtop.h
+libgtopincludedir = $(includedir)/libgtop-1.0
 
 EXTRA_DIST = autogen.sh libgtop.spec.in copyright.txt libgtopConf.sh.in \
 	LIBGTOP-VERSION features.def libgtop-config.in RELNOTES-0.25 \
@@ -51,7 +52,7 @@
 libgtopConf.sh: libgtopConf.sh.in Makefile
 ## Use sed and then mv to avoid problems if the user interrupts.
 	sed -e 's#\ LIBGTOP_LIBDIR\@#$(libdir)#g' \
-	  -e 's#\ LIBGTOP_INCLUDEDIR\@#$(includedir)#g' \
+	  -e 's#\ LIBGTOP_INCLUDEDIR\@#$(includedir)/libgtop-1.0#g' \
 	  -e 's#\ LIBGTOP_DATADIR\@#$(datadir)#g' \
 	  -e 's#\ LIBGTOP_EXTRA_LIBS\@#$(LIBGTOP_EXTRA_LIBS)#g' \
 	  -e 's#\ LIBGTOP_LIBS\@#$(LIBGTOP_LIBS)#g' \
--- libgtop-1.0.12-orig/sysdeps/linux/Makefile.am	Tue Feb 16 23:13:17 1999
+++ libgtop-1.0.12/sysdeps/linux/Makefile.am	Sat Oct 13 16:41:17 2001
@@ -14,4 +14,5 @@
 
 libgtop_sysdeps_la_LDFLAGS	= $(LT_VERSION_INFO)
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
--- libgtop-1.0.12-orig/sysdeps/kernel/Makefile.am	Tue Feb 16 23:13:15 1999
+++ libgtop-1.0.12/sysdeps/kernel/Makefile.am	Sat Oct 13 16:42:45 2001
@@ -13,7 +13,8 @@
 
 libgtop_sysdeps_la_LDFLAGS	= $(LT_VERSION_INFO)
 
-include_HEADERS			= glibtop_server.h
+libgtopinclude_HEADERS		= glibtop_server.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
 
 noinst_HEADERS			= kernel.h
 
--- libgtop-1.0.12-orig/sysdeps/freebsd/Makefile.am	Tue Feb 16 23:13:09 1999
+++ libgtop-1.0.12/sysdeps/freebsd/Makefile.am	Sat Oct 13 16:43:13 2001
@@ -17,6 +17,6 @@
 
 libgtop_sysdeps_suid_la_LDFLAGS	= $(LT_VERSION_INFO)
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h \
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h \
 				  glibtop_suid.h
-
+libgtopincludedir		= $(includedir)/libgtop-1.0
--- libgtop-1.0.12-orig/sysdeps/osf1/Makefile.am	Sat Feb 20 05:32:46 1999
+++ libgtop-1.0.12/sysdeps/osf1/Makefile.am	Sat Oct 13 16:44:21 2001
@@ -17,6 +17,7 @@
 libgtop_sysdeps_suid_la_LDFLAGS	= $(LT_VERSION_INFO)
 libgtop_sysdeps_suid_la_LIBADD	= -lmach
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
 
 noinst_HEADERS			= glibtop_suid.h
--- libgtop-1.0.12-orig/sysdeps/solaris/Makefile.am	Thu Feb 15 07:48:48 2001
+++ libgtop-1.0.12/sysdeps/solaris/Makefile.am	Sat Oct 13 16:44:53 2001
@@ -21,6 +21,8 @@
 libgtop_sysdeps_suid_la_LDFLAGS	= $(LT_VERSION_INFO)
 
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
+
 noinst_HEADERS			= glibtop_private.h glibtop_suid.h safeio.h
 
--- libgtop-1.0.12-orig/sysdeps/sun4/Makefile.am	Tue Feb 16 23:13:26 1999
+++ libgtop-1.0.12/sysdeps/sun4/Makefile.am	Sat Oct 13 16:45:15 2001
@@ -16,6 +16,7 @@
 libgtop_sysdeps_suid_la_LDFLAGS	= $(LT_VERSION_INFO)
 libgtop_sysdeps_suid_la_LIBADD	= -lkvm
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
 
 noinst_HEADERS			= glibtop_suid.h
--- libgtop-1.0.12-orig/sysdeps/stub/Makefile.am	Tue Feb 16 23:13:22 1999
+++ libgtop-1.0.12/sysdeps/stub/Makefile.am	Sat Oct 13 16:46:31 2001
@@ -13,5 +13,5 @@
 
 libgtop_sysdeps_la_LDFLAGS	= $(LT_VERSION_INFO)
 
-include_HEADERS			= glibtop_server.h
-
+libgtopinclude_HEADERS		= glibtop_server.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
--- libgtop-1.0.12-orig/sysdeps/stub_suid/Makefile.am	Tue Feb 16 23:13:24 1999
+++ libgtop-1.0.12/sysdeps/stub_suid/Makefile.am	Sat Oct 13 16:46:51 2001
@@ -17,6 +17,7 @@
 
 libgtop_sysdeps_suid_la_LDFLAGS	= $(LT_VERSION_INFO)
 
-include_HEADERS			= glibtop_server.h glibtop_machine.h
+libgtopinclude_HEADERS		= glibtop_server.h glibtop_machine.h
+libgtopincludedir		= $(includedir)/libgtop-1.0
 
 noinst_HEADERS			= glibtop_suid.h


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]