# HG changeset patch
# User [email protected]
# Date 1229369745 28800
# Node ID ce24d41d372948cd5440cf17bdb58ce33faffa84
# Parent  9e1a44b5c166b73e36d3cffc5398af0bec39ddc7
Port library versioning to Solaris

Use a more-porable comment character in the version file, and pass in
the right linker options.

Signed-off-by: John Levon <[email protected]>

diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -59,6 +59,11 @@ AM_PROG_LIBTOOL
 AM_PROG_LIBTOOL
 
 AM_PROG_CC_C_O
+
+VERSION_SCRIPT_FLAGS=-Wl,--version-script=
+`/usr/bin/ld --help 2>&1 | grep -- --version-script >/dev/null` || \
+    VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,"
+AC_SUBST(VERSION_SCRIPT_FLAGS)
 
 LIBVIRT_COMPILE_WARNINGS([maximum])
 
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -395,7 +395,7 @@ libvirt_la_SOURCES =
 libvirt_la_SOURCES =
 libvirt_la_LIBADD += \
                    @CYGWIN_EXTRA_LIBADD@ ../gnulib/lib/libgnu.la
-libvirt_la_LDFLAGS = -Wl,--version-script=libvirt_sym.version \
+libvirt_la_LDFLAGS = @version_script_fl...@libvirt_sym.version \
                      -version-info @LIBVIRT_VERSION_INFO@ \
                     $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
                     $(LIBXML_LIBS) $(SELINUX_LIBS) \
diff --git a/src/libvirt_sym.version.in b/src/libvirt_sym.version.in
--- a/src/libvirt_sym.version.in
+++ b/src/libvirt_sym.version.in
@@ -1,21 +1,21 @@
-/*
- * WARNING: libvirt_sym.version.in  is the master file
- *
- * WARNING: libvirt_sym.version is auto-generated by configure
- */
-
-/*
- * First officially exported symbols, for which header
- * file definitions are installed in /usr/include/libvirt
- * either from libvirt.h and virterror.h
- *
- * Versions here are *fixed* to match the libvirt version
- * at which the symbol was introduced. This ensures that
- * a new client app requiring symbol foo() can't accidentally
- * run with old libvirt.so not providing foo() - the global
- * soname version info can't enforce this since we never
- * change the soname
- */
+#
+# WARNING: libvirt_sym.version.in  is the master file
+#
+# WARNING: libvirt_sym.version is auto-generated by configure
+#
+
+#
+# First officially exported symbols, for which header
+# file definitions are installed in /usr/include/libvirt
+# either from libvirt.h and virterror.h
+#
+# Versions here are *fixed* to match the libvirt version
+# at which the symbol was introduced. This ensures that
+# a new client app requiring symbol foo() can't accidentally
+# run with old libvirt.so not providing foo() - the global
+# soname version info can't enforce this since we never
+# change the soname
+#/
 LIBVIRT_0.0.3 {
     global:
        virConnectClose;
@@ -249,30 +249,30 @@ LIBVIRT_0.5.0 {
 
 } LIBVIRT_0.4.5;
 
-/* .... define new API here using predicted next version number .... */
-
-
-
-
-/*
- * Finally these symbols are private and semantics may change
- * on every release, hence the version number is spliced in at
- * build time. This ensures that if libvirtd, virsh, or a driver
- * module was built against one libvirt release, it will refuse
- * to load with another where symbols may have same names but
- * different semantics.
- *
- * No header files are provided outside the source tree.
- *
- * Keep this section ordered alphabetically by header file name
- *
- * Symbols here are only for use by virsh, libvirtd and dlopen
- * driver modules
- */
+# .... define new API here using predicted next version number ....
+
+
+
+
+#
+# Finally these symbols are private and semantics may change
+# on every release, hence the version number is spliced in at
+# build time. This ensures that if libvirtd, virsh, or a driver
+# module was built against one libvirt release, it will refuse
+# to load with another where symbols may have same names but
+# different semantics.
+#
+# No header files are provided outside the source tree.
+#
+# Keep this section ordered alphabetically by header file name
+#
+# Symbols here are only for use by virsh, libvirtd and dlopen
+# driver modules
+#/
 libvirt_priva...@version@ {
 
   global:
-       /* bridge.h */
+       # bridge.h
        brAddBridge;
        brAddInterface;
        brAddTap;
@@ -286,7 +286,7 @@ libvirt_priva...@version@ {
        brShutdown;
 
 
-       /* buf.h */
+       # buf.h
        virBufferVSprintf;
        virBufferAdd;
        virBufferAddChar;
@@ -294,7 +294,7 @@ libvirt_priva...@version@ {
        virBufferError;
 
 
-       /* caps.h */
+       # caps.h
        virCapabilitiesAddGuest;
        virCapabilitiesAddGuestDomain;
        virCapabilitiesAddGuestFeature;
@@ -310,7 +310,7 @@ libvirt_priva...@version@ {
        virCapabilitiesSetMacPrefix;
 
 
-       /* conf.h */
+       # conf.h
        virConfNew;
        virConfReadFile;
        virConfReadMem;
@@ -322,7 +322,7 @@ libvirt_priva...@version@ {
        virConfWriteMem;
 
 
-       /* datatypes.h */
+       # datatypes.h
        virGetDomain;
        virGetNetwork;
        virGetStoragePool;
@@ -331,7 +331,7 @@ libvirt_priva...@version@ {
        virUnrefDomain;
 
 
-       /* domain_conf.h */
+       # domain_conf.h
        virDiskNameToBusDeviceIndex;
        virDiskNameToIndex;
        virDomainAssignDef;
@@ -375,7 +375,7 @@ libvirt_priva...@version@ {
        virDomainFSDefFree;
 
 
-       /* domain_event.h */
+       # domain_event.h
        virDomainEventCallbackListAdd;
        virDomainEventCallbackListFree;
        virDomainEventCallbackListRemove;
@@ -385,11 +385,11 @@ libvirt_priva...@version@ {
        virDomainEventCallbackQueuePush;
 
 
-       /* driver.h */
+       # driver.h
        virDriverLoadModule;
 
 
-       /* event.h */
+       # event.h
        virEventAddHandle;
        virEventAddTimeout;
        virEventRemoveHandle;
@@ -398,7 +398,7 @@ libvirt_priva...@version@ {
        virEventUpdateTimeout;
 
 
-       /* hash.h */
+       # hash.h
        virHashAddEntry;
        virHashCreate;
        virHashForEach;
@@ -410,7 +410,7 @@ libvirt_priva...@version@ {
        virHashSize;
 
 
-       /* iptables.h */
+       # iptables.h
        iptablesAddForwardAllowCross;
        iptablesAddForwardAllowIn;
        iptablesAddForwardAllowOut;
@@ -435,7 +435,7 @@ libvirt_priva...@version@ {
        iptablesSaveRules;
 
 
-       /* libvirt_internal.h */
+       # libvirt_internal.h
        debugFlag;
        virStateInitialize;
        virStateCleanup;
@@ -455,14 +455,14 @@ libvirt_priva...@version@ {
        virRegisterDeviceMonitor;
 
 
-       /* memory.h */
+       # memory.h
        virAlloc;
        virAllocN;
        virReallocN;
        virFree;
 
 
-       /* network_conf.h */
+       # network_conf.h
        virNetworkAssignDef;
        virNetworkDefFormat;
        virNetworkDefFree;
@@ -479,11 +479,11 @@ libvirt_priva...@version@ {
        virNetworkSaveConfig;
 
 
-       /* nodeinfo.h */
+       # nodeinfo.h
        virNodeInfoPopulate;
 
 
-       /* node_device_conf.h */
+       # node_device_conf.h
        virNodeDeviceObjRemove;
        virNodeDevCapTypeToString;
        virNodeDeviceFindByName;
@@ -493,18 +493,18 @@ libvirt_priva...@version@ {
        virNodeDeviceDefFormat;
 
 
-       /* qparams.h */
+       # qparams.h
        qparam_get_query;
        qparam_query_parse;
        free_qparam_set;
 
 
-       /* stats_linux.h */
+       # stats_linux.h
        linuxDomainInterfaceStats;
        xenLinuxDomainBlockStats;
 
 
-       /* storage_backend.h */
+       # storage_backend.h
        virStorageBackendForType;
        virStorageBackendFromString;
        virStorageBackendPartTableTypeFromString;
@@ -517,7 +517,7 @@ libvirt_priva...@version@ {
        virStorageBackendUpdateVolInfoFD;
 
 
-       /* storage_conf.h */
+       # storage_conf.h
         virStorageBackendPoolOptionsForType;
        virStoragePoolDefFormat;
        virStoragePoolDefFree;
@@ -546,7 +546,7 @@ libvirt_priva...@version@ {
        virStoragePoolTypeFromString;
 
 
-       /* util.h */
+       # util.h
        virFileReadAll;
        virStrToLong_i;
        virStrToLong_ll;
@@ -577,26 +577,26 @@ libvirt_priva...@version@ {
        virSkipSpaces;
 
 
-       /* uuid.h */
+       # uuid.h
        virUUIDFormat;
        virUUIDGenerate;
        virUUIDParse;
 
 
-       /* virterror_internal.h */
+       # virterror_internal.h
        virReportErrorHelper;
        virErrorMsg;
        virRaiseError;
 
 
-       /* xml.h */
+       # xml.h
        virXPathLong;
        virXPathNodeSet;
        virXPathString;
        virXMLPropString;
 
 
-       /* Finally everything else is totally private */
+       # Finally everything else is totally private
     local:
        *;
 };

--
Libvir-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to