Hi all,

Attached a patch that adds the current version number of TSP to the .so file 
name.
So apart from for example libtsp_common.so you will also find 
libtsp_common.so.0 and libtsp_common.so.0.4.4 (or whatever the latest version 
is).

The next step will be to define a so-called version script to tag the symbols.
(for more information see the man page of ld (--version-script) and the info 
pages of ld (VERSION Command)).
This will limit the symbols that are visible externally. This helps people to 
use only the symbols that are in the official API and not to use functions 
that are intended for internal use.

        Robert
Index: external/gtk-1.2/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/external/gtk-1.2/CMakeLists.txt,v
retrieving revision 1.5
diff -u -r1.5 CMakeLists.txt
--- external/gtk-1.2/CMakeLists.txt	17 Nov 2007 14:33:01 -0000	1.5
+++ external/gtk-1.2/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -35,6 +35,7 @@
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/external/gtk-1.2/)
 
 ADD_LIBRARY(gtk_1.2_utils ${LIBGTK1.2_SRC})
+SET_TARGET_PROPERTIES(gtk_1.2_utils PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 
 ADD_DEFINITIONS(${GTK_CFLAGS})
 
Index: src/consumers/ascii_writer/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/consumers/ascii_writer/CMakeLists.txt,v
retrieving revision 1.8
diff -u -r1.8 CMakeLists.txt
--- src/consumers/ascii_writer/CMakeLists.txt	30 Aug 2007 07:36:49 -0000	1.8
+++ src/consumers/ascii_writer/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -53,6 +53,7 @@
   PROPERTIES OUTPUT_NAME tsp_ascii_writer)
 ADD_LIBRARY(tsp_ascii_writer ${ASCII_SRC})
 ADD_DEPENDENCIES(tsp_ascii_writer-bin tsp_ascii_writer)
+SET_TARGET_PROPERTIES(tsp_ascii_writer PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 
 	
 TARGET_LINK_LIBRARIES(tsp_ascii_writer-bin tsp_ascii_writer tsp_consumer tsp_common tsp_services
Index: src/core/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/core/CMakeLists.txt,v
retrieving revision 1.16
diff -u -r1.16 CMakeLists.txt
--- src/core/CMakeLists.txt	29 Aug 2007 21:21:36 -0000	1.16
+++ src/core/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -43,6 +43,7 @@
 TSP_XINCLUDE(${SERVICES_LIB_SRCS} misc_utils/tsp_ringbuf misc_utils/tsp_services)
 ADD_LIBRARY(tsp_services ${SERVICES_LIB_SRCS})
 TARGET_LINK_LIBRARIES(tsp_services ${PTHREAD_LIBRARY_NAME})
+SET_TARGET_PROPERTIES(tsp_services PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 
 IF (WIN32) 
   TARGET_LINK_LIBRARIES(tsp_services Ws2_32 oncrpc)
@@ -71,6 +72,7 @@
 TSP_XINCLUDE(${COMMON_LIB_SRCS} common/tsp_common_filter)
 
 ADD_LIBRARY(tsp_common ${COMMON_LIB_SRCS})
+SET_TARGET_PROPERTIES(tsp_common PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 
 # Should be commonized with platform independant vars
 IF (ACPLT_ONCRPC_FOUND)
@@ -111,6 +113,7 @@
   IF (WIN32)
     TARGET_LINK_LIBRARIES(tsp_consumer tsp_services ${PTHREAD_LIBRARY_NAME} Ws2_32 oncrpc)
   ENDIF (WIN32)
+  SET_TARGET_PROPERTIES(tsp_consumer PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 ENDIF(BUILD_CONSUMER)
 
 #
@@ -156,6 +159,7 @@
     
     # PROVIDER LIB    
     ADD_LIBRARY(tsp_provider ${PROVIDER_LIB_SRCS})
+    SET_TARGET_PROPERTIES(tsp_provider PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
     TSP_LIBRARY_INSTALL(tsp_provider) 
     ADD_DEPENDENCIES(tsp_provider tsp_common)
     IF (WIN32)		
Index: src/util/libbb/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libbb/CMakeLists.txt,v
retrieving revision 1.17
diff -u -r1.17 CMakeLists.txt
--- src/util/libbb/CMakeLists.txt	4 Sep 2007 23:37:20 -0000	1.17
+++ src/util/libbb/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -56,8 +56,10 @@
 ENDIF (XML2_FOUND)
 TSP_LIBRARY_INSTALL(bb)
 TARGET_LINK_LIBRARIES(bb ${PTHREAD_LIBRARY_NAME} dl)
+SET_TARGET_PROPERTIES(bb PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 ADD_LIBRARY(sarray ${LIB_VARNAME_SARRAY_SRC})
 TSP_LIBRARY_INSTALL(sarray)
+SET_TARGET_PROPERTIES(sarray PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 
 ADD_SUBDIRECTORY(bbtools)
 
Index: src/util/libcalc/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libcalc/CMakeLists.txt,v
retrieving revision 1.5
diff -u -r1.5 CMakeLists.txt
--- src/util/libcalc/CMakeLists.txt	30 Aug 2007 15:26:25 -0000	1.5
+++ src/util/libcalc/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -9,4 +9,5 @@
     TARGET_LINK_LIBRARIES(tsp_calc m)
 ENDIF (WIN32)
 TSP_LIBRARY_INSTALL(tsp_calc)
+SET_TARGET_PROPERTIES(tsp_calc PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 TSP_XINCLUDE(${LIBCALC_SRC})
Index: src/util/libpages/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libpages/CMakeLists.txt,v
retrieving revision 1.3
diff -u -r1.3 CMakeLists.txt
--- src/util/libpages/CMakeLists.txt	18 Oct 2006 09:58:49 -0000	1.3
+++ src/util/libpages/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -6,3 +6,4 @@
 ADD_LIBRARY(tsp_page_config ${LIBPAGES_SRC})
 TSP_LIBRARY_INSTALL(tsp_page_config)
 TARGET_LINK_LIBRARIES(tsp_page_config ${XML2_LIBRARY})
+SET_TARGET_PROPERTIES(tsp_page_config PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
Index: src/util/libres/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libres/CMakeLists.txt,v
retrieving revision 1.3
diff -u -r1.3 CMakeLists.txt
--- src/util/libres/CMakeLists.txt	24 Nov 2006 07:49:34 -0000	1.3
+++ src/util/libres/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -7,3 +7,4 @@
 
 ADD_LIBRARY(tsp_res ${LIBRES_SRC})
 TSP_LIBRARY_INSTALL(tsp_res)
+SET_TARGET_PROPERTIES(tsp_res PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
Index: src/util/libtspcfg/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libtspcfg/CMakeLists.txt,v
retrieving revision 1.6
diff -u -r1.6 CMakeLists.txt
--- src/util/libtspcfg/CMakeLists.txt	25 Jun 2007 21:18:06 -0000	1.6
+++ src/util/libtspcfg/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -13,6 +13,7 @@
 
 ADD_LIBRARY(tspcfg ${_SRC})
 TSP_LIBRARY_INSTALL(tspcfg)
+SET_TARGET_PROPERTIES(tspcfg PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 ADD_EXECUTABLE(tsp_cfg tspcfg_file_main.c)
 TSP_PROGRAM_INSTALL(tsp_cfg)
 TARGET_LINK_LIBRARIES(tsp_cfg tspcfg ${XML2_LIBRARY} tsp_common)
Index: src/util/libutil/CMakeLists.txt
===================================================================
RCS file: /sources/tsp/tsp/src/util/libutil/CMakeLists.txt,v
retrieving revision 1.4
diff -u -r1.4 CMakeLists.txt
--- src/util/libutil/CMakeLists.txt	29 Jan 2007 16:52:39 -0000	1.4
+++ src/util/libutil/CMakeLists.txt	17 Nov 2007 20:44:31 -0000
@@ -3,10 +3,11 @@
 
 ADD_LIBRARY(tsp_util ${LIBUTIL_SRC})
 TSP_LIBRARY_INSTALL(tsp_util)
+SET_TARGET_PROPERTIES(tsp_util PROPERTIES VERSION ${PACKAGE_VERSION} SOVERSION ${PACKAGE_VERSION_MAJOR})
 ADD_EXECUTABLE(tsp_hash_dump tsp_hash.c tsp_hash_main.c)
 TSP_PROGRAM_INSTALL(tsp_hash_dump)
 ADD_EXECUTABLE(tsp_check_host_and_ip tsp_check_host_and_ip.c)
 TSP_PROGRAM_INSTALL(tsp_check_host_and_ip)
 IF (CMAKE_SYSTEM_NAME MATCHES "SunOS")
   TARGET_LINK_LIBRARIES(tsp_check_host_and_ip nsl)
-ENDIF (CMAKE_SYSTEM_NAME MATCHES "SunOS")
\ No newline at end of file
+ENDIF (CMAKE_SYSTEM_NAME MATCHES "SunOS")
_______________________________________________
Tsp-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tsp-devel

Répondre à