# HG changeset patch
# User john.levon(a)sun.com
# 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 <john.levon(a)sun.com>
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_FLAGS(a)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_PRIVATE_@VERSION@ {
global:
- /* bridge.h */
+ # bridge.h
brAddBridge;
brAddInterface;
brAddTap;
@@ -286,7 +286,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
brShutdown;
- /* buf.h */
+ # buf.h
virBufferVSprintf;
virBufferAdd;
virBufferAddChar;
@@ -294,7 +294,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virBufferError;
- /* caps.h */
+ # caps.h
virCapabilitiesAddGuest;
virCapabilitiesAddGuestDomain;
virCapabilitiesAddGuestFeature;
@@ -310,7 +310,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virCapabilitiesSetMacPrefix;
- /* conf.h */
+ # conf.h
virConfNew;
virConfReadFile;
virConfReadMem;
@@ -322,7 +322,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virConfWriteMem;
- /* datatypes.h */
+ # datatypes.h
virGetDomain;
virGetNetwork;
virGetStoragePool;
@@ -331,7 +331,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virUnrefDomain;
- /* domain_conf.h */
+ # domain_conf.h
virDiskNameToBusDeviceIndex;
virDiskNameToIndex;
virDomainAssignDef;
@@ -375,7 +375,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainFSDefFree;
- /* domain_event.h */
+ # domain_event.h
virDomainEventCallbackListAdd;
virDomainEventCallbackListFree;
virDomainEventCallbackListRemove;
@@ -385,11 +385,11 @@ LIBVIRT_PRIVATE_@VERSION@ {
virDomainEventCallbackQueuePush;
- /* driver.h */
+ # driver.h
virDriverLoadModule;
- /* event.h */
+ # event.h
virEventAddHandle;
virEventAddTimeout;
virEventRemoveHandle;
@@ -398,7 +398,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virEventUpdateTimeout;
- /* hash.h */
+ # hash.h
virHashAddEntry;
virHashCreate;
virHashForEach;
@@ -410,7 +410,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virHashSize;
- /* iptables.h */
+ # iptables.h
iptablesAddForwardAllowCross;
iptablesAddForwardAllowIn;
iptablesAddForwardAllowOut;
@@ -435,7 +435,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
iptablesSaveRules;
- /* libvirt_internal.h */
+ # libvirt_internal.h
debugFlag;
virStateInitialize;
virStateCleanup;
@@ -455,14 +455,14 @@ LIBVIRT_PRIVATE_@VERSION@ {
virRegisterDeviceMonitor;
- /* memory.h */
+ # memory.h
virAlloc;
virAllocN;
virReallocN;
virFree;
- /* network_conf.h */
+ # network_conf.h
virNetworkAssignDef;
virNetworkDefFormat;
virNetworkDefFree;
@@ -479,11 +479,11 @@ LIBVIRT_PRIVATE_@VERSION@ {
virNetworkSaveConfig;
- /* nodeinfo.h */
+ # nodeinfo.h
virNodeInfoPopulate;
- /* node_device_conf.h */
+ # node_device_conf.h
virNodeDeviceObjRemove;
virNodeDevCapTypeToString;
virNodeDeviceFindByName;
@@ -493,18 +493,18 @@ LIBVIRT_PRIVATE_@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_PRIVATE_@VERSION@ {
virStorageBackendUpdateVolInfoFD;
- /* storage_conf.h */
+ # storage_conf.h
virStorageBackendPoolOptionsForType;
virStoragePoolDefFormat;
virStoragePoolDefFree;
@@ -546,7 +546,7 @@ LIBVIRT_PRIVATE_@VERSION@ {
virStoragePoolTypeFromString;
- /* util.h */
+ # util.h
virFileReadAll;
virStrToLong_i;
virStrToLong_ll;
@@ -577,26 +577,26 @@ LIBVIRT_PRIVATE_@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:
*;
};