MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jonathan Perkin Date:August 9 2010 1:27pm
Subject:bzr commit into mysql-5.5-itch branch (jonathan.perkin:3078) Bug#55215
View as plain text  
#At file:///Users/jonathan/bzr/mysql-5.5-itch/ based on revid:alik@ibmvm-20100804081425-u3d3gh1urrrxcd5k

 3078 Jonathan Perkin	2010-08-09
      Apply wlad's fix for bug#55215

    modified:
      .bzr-mysql/default.conf
      scripts/CMakeLists.txt
      scripts/mysql_config.sh
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	2010-08-04 08:14:25 +0000
+++ b/.bzr-mysql/default.conf	2010-08-09 13:27:04 +0000
@@ -1,4 +1,4 @@
 [MYSQL]
 post_commit_to = "commits@stripped"
 post_push_to = "commits@stripped"
-tree_name = "mysql-5.5"
+tree_name = "mysql-5.5-itch"

=== modified file 'scripts/CMakeLists.txt'
--- a/scripts/CMakeLists.txt	2010-07-19 14:00:29 +0000
+++ b/scripts/CMakeLists.txt	2010-08-09 13:27:04 +0000
@@ -1,4 +1,3 @@
-# Copyright (C) 2006 MySQL AB
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -251,43 +250,38 @@ IF(POLICY CMP0007)
   CMAKE_POLICY(SET CMP0007 OLD)
 ENDIF()
 
-LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "")
-LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS)
-FOREACH(lib ${mysqlclient_LIB_DEPENDS})
-  # Filter out "general", it is not a library, just CMake hint
-  IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ")
-     IF (lib MATCHES "^\\-l")
-       SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") 
-     ELSEIF(lib MATCHES "^/")
-       # Full path, convert to just filename, strip "lib" prefix and extension
-       GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE)
-       STRING(REGEX REPLACE "^lib" "" lib "${lib}")
-       SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) 
-     ELSE()
-       SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) 
-     ENDIF()
+# Extract dependencies using CMake's internal ${target}_LIB_DEPENDS variable
+# returned string in ${var} is can be passed to linker's command line
+MACRO(EXTRACT_LINK_LIBRARIES target var)
+  LIST(REMOVE_ITEM ${target}_LIB_DEPENDS "")
+  LIST(REMOVE_DUPLICATES ${target}_LIB_DEPENDS)
+  FOREACH(lib ${${target}_LIB_DEPENDS})
+    # Filter out "general", it is not a library, just CMake hint
+    # Also, remove duplicates
+    IF(NOT lib STREQUAL "general" AND NOT ${var}  MATCHES "-l${lib} ")
+      IF (lib MATCHES "^\\-l")
+        SET(${var} "${${var}} ${lib} ") 
+      ELSEIF(lib MATCHES "^/")
+        # Full path, convert to just filename, strip "lib" prefix and extension
+        GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE)
+        STRING(REGEX REPLACE "^lib" "" lib "${lib}")
+        SET(${var} "${${var}}-l${lib} " ) 
+      ELSE()
+        SET(${var} "${${var}}-l${lib} " ) 
+      ENDIF()
+    ENDIF()
+  ENDFOREACH()
+  IF(MSVC)
+    STRING(REPLACE "-l" "" ${var} "${${var}}")
   ENDIF()
-ENDFOREACH()
-
-
-IF(LIBDL AND NOT LIBDL MATCHES "-l")
-  SET(LIBDL "-l${LIBDL}")
-ENDIF()
+ENDMACRO()
 
-IF(LIBWRAP)
-  SET(WRAPLIBS "-lwrap")
-ENDIF()
-
-SET(LIBS "${CLIENT_LIBS}")
+EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS)
+EXTRACT_LINK_LIBRARIES(mysqlserver LIBS)
 
-IF(LIBCRYPT)
-  SET(LIBS "${LIBS} -l${LIBCRYPT}")
-ENDIF()
-
-IF(MSVC)
-  STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}")
-  STRING(REPLACE "-l" "" LIBS "${LIBS}" )
-ENDIF()
+# mysql_config evaluates ${LIBDL}, we want to avoid it
+# as our CLIENT_LIBS and LIBS are already correct
+SET(LIBDL)
 
 SET(NON_THREADED_LIBS ${CLIENT_LIBS})
 SET(mysql_config_COMPONENT COMPONENT Development)

=== modified file 'scripts/mysql_config.sh'
--- a/scripts/mysql_config.sh	2010-07-19 14:00:29 +0000
+++ b/scripts/mysql_config.sh	2010-08-09 13:27:04 +0000
@@ -108,7 +108,7 @@ fi
 # We intentionally add a space to the beginning and end of lib strings, simplifies replace later
 libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
 libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
-libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @LIBS@ @openssl_libs@ "
+libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
 embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
 
 if [ -r "$pkglibdir/libmygcc.a" ]; then


Attachment: [text/bzr-bundle] bzr/jonathan.perkin@oracle.com-20100809132704-ibsjrnvipigo6kau.bundle
Thread
bzr commit into mysql-5.5-itch branch (jonathan.perkin:3078) Bug#55215Jonathan Perkin9 Aug