[ 
https://issues.apache.org/jira/browse/AVRO-2063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16715415#comment-16715415
 ] 

ASF GitHub Bot commented on AVRO-2063:
--------------------------------------

dkulp closed pull request #239: AVRO-2063. C: VERSION, SOVERSION not set 
correctly for shared library
URL: https://github.com/apache/avro/pull/239
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lang/c/CMakeLists.txt b/lang/c/CMakeLists.txt
index fda4382a2..4161de244 100644
--- a/lang/c/CMakeLists.txt
+++ b/lang/c/CMakeLists.txt
@@ -47,6 +47,16 @@ if (UNIX)
     if(LIBAVRO_VERSION_RESULT)
         message(FATAL_ERROR "Cannot determine libavro version number")
     endif(LIBAVRO_VERSION_RESULT)
+
+    execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/version.sh libcurrent
+        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+        RESULT_VARIABLE LIBAVRO_SOVERSION_RESULT
+        OUTPUT_VARIABLE LIBAVRO_SOVERSION
+        OUTPUT_STRIP_TRAILING_WHITESPACE)
+    if(LIBAVRO_SOVERSION_RESULT)
+        message(FATAL_ERROR "Cannot determine libavro version number")
+    endif(LIBAVRO_SOVERSION_RESULT)
+
 else(UNIX)
     # Hard code for win32 -- need to figure out how to port version.sh for
     # Windows.
diff --git a/lang/c/src/CMakeLists.txt b/lang/c/src/CMakeLists.txt
index c21f1ce08..330d5466d 100644
--- a/lang/c/src/CMakeLists.txt
+++ b/lang/c/src/CMakeLists.txt
@@ -79,7 +79,7 @@ set(AVRO_SRC
 
 source_group(Avro FILES ${AVRO_SRC})
 
-# The version.sh script gives us a SOVERSION that uses colon as a
+# The version.sh script gives us a VERSION that uses colon as a
 # separator; we need periods.
 
 string(REPLACE ":" "." LIBAVRO_DOT_VERSION ${LIBAVRO_VERSION})
@@ -94,7 +94,8 @@ add_library(avro-shared SHARED ${AVRO_SRC})
 target_link_libraries(avro-shared ${JANSSON_LIBRARIES} ${CODEC_LIBRARIES} 
${THREADS_LIBRARIES})
 set_target_properties(avro-shared PROPERTIES
         OUTPUT_NAME avro
-        SOVERSION ${LIBAVRO_DOT_VERSION})
+        VERSION ${LIBAVRO_DOT_VERSION}
+        SOVERSION ${LIBAVRO_SOVERSION})
 endif(NOT WIN32)
 
 install(FILES


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> C: VERSION, SOVERSION not set correctly for shared library
> ----------------------------------------------------------
>
>                 Key: AVRO-2063
>                 URL: https://issues.apache.org/jira/browse/AVRO-2063
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: c
>    Affects Versions: 1.8.2
>            Reporter: Robert Edmonds
>            Priority: Minor
>             Fix For: 1.9.0
>
>
> Hi,
> I'm attempting to package avro-c for Debian. While doing so, I noticed that 
> the libavro.so symlink that gets installed points directly to the 
> libavro.so.23.0.0 library file, without an intermediate "libavro.so.23" 
> symlink, and that the SONAME embedded in the library file is set to 
> "libavro.so.23.0.0", rather than "libavro.so.23", which is what I would 
> expect for a library trying to follow the libtool-style current/revision/age 
> scheme on Linux systems.
> It looks like the recommended way to get CMake to produce the typical symlink 
> chain and SONAME is to set the VERSION property to "23.0.0" and the SOVERSION 
> to 23 on the shared library target. See this article for details: 
> http://pusling.com/blog/?p=352.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to