From bf9d5f394997c0ff9d7b4a3671ac04499d0c3fb2 Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Fri, 18 Jun 2010 01:25:46 +0100 Subject: [PATCH] build: distinguish CLUTTER_WINSYS and CLUTTER_SONAME_INFIX This adds a separate variable name "CLUTTER_SONAME_INFIX" to define the infix for the clutter library that gets linked. Currently the WINSYS corresponds to the directory we enter when building to compile the window system and input support, but it is desirable to be able to define multiple flavours that use the same WINSYS but should result in different library names. For example we are planning to combine the eglx and eglnative window systems into one "egl" winsys but we will need to preserve the current library names for the eglx and eglnative flavours. --- Makefile.am | 4 ++-- clutter.pc.in | 3 ++- clutter/Makefile.am | 16 ++++++++-------- configure.ac | 9 ++++++++- doc/reference/clutter/Makefile.am | 2 +- tests/conform/Makefile.am | 2 +- tests/interactive/Makefile.am | 2 +- tests/micro-bench/Makefile.am | 2 +- 8 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Makefile.am b/Makefile.am index fc7ef37d3..e501c12f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ ACLOCAL_AMFLAGS = -I build/autotools pcfiles = \ clutter-$(CLUTTER_API_VERSION).pc \ - clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc \ + clutter-$(CLUTTER_SONAME_INFIX)-$(CLUTTER_API_VERSION).pc \ $(NULL) # clutter-..pc - for generic dependencies @@ -16,7 +16,7 @@ clutter-$(CLUTTER_API_VERSION).pc: clutter.pc $(QUIET_GEN)cp $< $@ # clutter--..pc - for backend-specific dependencies -clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc: clutter.pc +clutter-$(CLUTTER_SONAME_INFIX)-$(CLUTTER_API_VERSION).pc: clutter.pc $(QUIET_GEN)cp $< $@ .PHONY: test-report full-report diff --git a/clutter.pc.in b/clutter.pc.in index f6d5904cc..e2f0dae34 100644 --- a/clutter.pc.in +++ b/clutter.pc.in @@ -6,12 +6,13 @@ apiversion=@CLUTTER_API_VERSION@ requires=@CLUTTER_REQUIRES@ backend=@CLUTTER_WINSYS@ #only kept for backward compatability winsys=@CLUTTER_WINSYS@ +soname_infix=@CLUTTER_SONAME_INFIX@ cogl=@COGL_DRIVER@ #only kept for backward compatability cogl_driver=@COGL_DRIVER@ Name: Clutter Description: Clutter Core Library (${winsys}/${cogl_driver} backend) Version: @VERSION@ -Libs: -L${libdir} -lclutter-${winsys}-${apiversion} +Libs: -L${libdir} -lclutter-${soname_infix}-${apiversion} Cflags: -I${includedir}/clutter-${apiversion} Requires: ${requires} diff --git a/clutter/Makefile.am b/clutter/Makefile.am index e269dfb39..4577e609f 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -256,7 +256,7 @@ source_h_priv = \ $(srcdir)/clutter-timeout-interval.h \ $(NULL) -libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LIBADD = \ +libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(CLUTTER_LIBS) \ $(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \ $(top_builddir)/clutter/cogl/pango/libcoglpango.la \ @@ -264,7 +264,7 @@ libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LIBADD = \ $(clutter_json_libadd) \ $(CLUTTER_WINSYS_BASE_LIB) -libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ +libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ $(top_builddir)/clutter/cogl/cogl/libclutter-cogl.la \ $(top_builddir)/clutter/cogl/pango/libcoglpango.la \ $(top_builddir)/clutter/$(CLUTTER_WINSYS)/libclutter-$(CLUTTER_WINSYS).la \ @@ -272,17 +272,17 @@ libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_DEPENDENCIES = \ $(CLUTTER_WINSYS_BASE_LIB) \ $(win32_resources) -libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_SOURCES = \ +libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_SOURCES = \ $(source_c) \ $(source_h) \ $(source_c_priv) \ $(source_h_priv) -nodist_libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_SOURCES = \ +nodist_libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_SOURCES = \ $(built_source_c) \ $(built_source_h) -libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LDFLAGS = \ +libclutter_@CLUTTER_SONAME_INFIX@_@CLUTTER_API_VERSION@_la_LDFLAGS = \ $(CLUTTER_LT_LDFLAGS) \ $(GCOV_LDFLAGS) \ -export-dynamic \ @@ -293,7 +293,7 @@ libclutter_@CLUTTER_WINSYS@_@CLUTTER_API_VERSION@_la_LDFLAGS = \ lib_LTLIBRARIES = $(CLUTTER_WINSYS_LIB) -EXTRA_LTLIBRARIES = libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la +EXTRA_LTLIBRARIES = libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la clutterdir = $(includedir)/clutter-$(CLUTTER_API_VERSION)/clutter clutter_HEADERS = \ @@ -333,7 +333,7 @@ if HAVE_INTROSPECTION # subdir Makefile.am, so just extract them from cogl.h instead. The doc # comments for COGL are in the headers, so we don't need the source files. -Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la +Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(QUIET_GEN)$(INTROSPECTION_SCANNER) -v \ --namespace Clutter --nsversion=@CLUTTER_API_VERSION@ \ $(INCLUDES) \ @@ -348,7 +348,7 @@ Clutter-@CLUTTER_API_VERSION@.gir: $(INTROSPECTION_SCANNER) libclutter-@CLUTTER_ --include=PangoCairo-1.0 \ --include=Cogl-@CLUTTER_API_VERSION@ \ $(json_gir_include) \ - --library=libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la \ + --library=libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la \ --libtool="$(top_builddir)/libtool" \ --pkg gobject-2.0 \ $(json_gir_pkg) \ diff --git a/configure.ac b/configure.ac index 2ca979c93..036bfb27b 100644 --- a/configure.ac +++ b/configure.ac @@ -158,6 +158,7 @@ AS_CASE([$CLUTTER_FLAVOUR], CLUTTER_WINSYS=glx CLUTTER_WINSYS_BASE=x11 CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" + CLUTTER_SONAME_INFIX=glx # Mesa 7.3 added a GL pkg-config file, finally PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], []) @@ -178,6 +179,7 @@ AS_CASE([$CLUTTER_FLAVOUR], CLUTTER_WINSYS=eglx CLUTTER_WINSYS_BASE=x11 CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la" + CLUTTER_SONAME_INFIX=eglx ], [eglnative], @@ -199,6 +201,7 @@ AS_CASE([$CLUTTER_FLAVOUR], FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS" CLUTTER_WINSYS=eglnative + CLUTTER_SONAME_INFIX=eglnative ], [fruity], @@ -217,6 +220,7 @@ AS_CASE([$CLUTTER_FLAVOUR], FLAVOUR_LIBS="$FLAVOUR_LIBS -ObjC -framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreSurface -framework GraphicsServices -framework OpenGLES -framework LayerKit -framework UIKit" CLUTTER_WINSYS=fruity + CLUTTER_SONAME_INFIX=fruity ], [osx], @@ -234,6 +238,7 @@ AS_CASE([$CLUTTER_FLAVOUR], FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL" CLUTTER_WINSYS=osx + CLUTTER_SONAME_INFIX=osx ], [win32], @@ -257,6 +262,7 @@ AS_CASE([$CLUTTER_FLAVOUR], fi CLUTTER_WINSYS=win32 + CLUTTER_SONAME_INFIX=win32 ], [AC_MSG_ERROR([Invalid backend for Clutter: use glx, osx, win32, eglx, eglnative or fruity])] @@ -415,8 +421,9 @@ AC_SUBST([CLUTTER_WINSYS_BASE]) AC_SUBST([CLUTTER_WINSYS_BASE_LIB]) AC_SUBST(CLUTTER_GL_HEADER) AC_SUBST(CLUTTER_STAGE_TYPE) +AC_SUBST(CLUTTER_SONAME_INFIX) -CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_WINSYS-$CLUTTER_API_VERSION.la +CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_SONAME_INFIX-$CLUTTER_API_VERSION.la AC_SUBST([CLUTTER_WINSYS_LIB]) dnl === Clutter substitutions kept for backwards compatibility ================ diff --git a/doc/reference/clutter/Makefile.am b/doc/reference/clutter/Makefile.am index 949bace3e..417a7806d 100644 --- a/doc/reference/clutter/Makefile.am +++ b/doc/reference/clutter/Makefile.am @@ -147,7 +147,7 @@ expand_content_files= \ # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl -I$(top_builddir) -I$(top_builddir)/clutter -I$(top_builddir)/clutter/cogl $(CLUTTER_CFLAGS) -GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) +GTKDOC_LIBS=$(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am index 645a99786..cc04d44a9 100644 --- a/tests/conform/Makefile.am +++ b/tests/conform/Makefile.am @@ -107,7 +107,7 @@ test_conformance_CPPFLAGS = \ test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS) -test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) +test_conformance_LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la $(CLUTTER_LIBS) test_conformance_LDFLAGS = -rdynamic diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am index a3aa5faf1..a28063671 100644 --- a/tests/interactive/Makefile.am +++ b/tests/interactive/Makefile.am @@ -94,7 +94,7 @@ INCLUDES = \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl -common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la +common_ldadd = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la noinst_PROGRAMS = test-interactive diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am index 05ef4973e..1f2ce6034 100644 --- a/tests/micro-bench/Makefile.am +++ b/tests/micro-bench/Makefile.am @@ -11,7 +11,7 @@ INCLUDES = \ -I$(top_srcdir)/clutter/cogl \ -I$(top_builddir)/clutter \ -I$(top_builddir)/clutter/cogl -LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_WINSYS@-@CLUTTER_API_VERSION@.la +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_SONAME_INFIX@-@CLUTTER_API_VERSION@.la AM_CFLAGS = \ $(CLUTTER_CFLAGS) \ $(MAINTAINER_CFLAGS) \