Commit 69091c49 authored by Jonathan Perkin's avatar Jonathan Perkin

Merge to mysql-5.5-bugfixing

parents 88b32056 2355224c
# Copyright (C) 2006 MySQL AB
# #
# This program is free software; you can redistribute it and/or modify # 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 # it under the terms of the GNU General Public License as published by
...@@ -252,43 +251,40 @@ IF(POLICY CMP0007) ...@@ -252,43 +251,40 @@ IF(POLICY CMP0007)
CMAKE_POLICY(SET CMP0007 OLD) CMAKE_POLICY(SET CMP0007 OLD)
ENDIF() ENDIF()
LIST(REMOVE_ITEM mysqlclient_LIB_DEPENDS "") # Extract dependencies using CMake's internal ${target}_LIB_DEPENDS variable
LIST(REMOVE_DUPLICATES mysqlclient_LIB_DEPENDS) # returned string in ${var} is can be passed to linker's command line
FOREACH(lib ${mysqlclient_LIB_DEPENDS}) MACRO(EXTRACT_LINK_LIBRARIES target var)
# Filter out "general", it is not a library, just CMake hint IF(${target}_LIB_DEPENDS)
IF(NOT lib STREQUAL "general" AND NOT CLIENT_LIBS MATCHES "-l${lib} ") LIST(REMOVE_ITEM ${target}_LIB_DEPENDS "")
IF (lib MATCHES "^\\-l") LIST(REMOVE_DUPLICATES ${target}_LIB_DEPENDS)
SET(CLIENT_LIBS "${CLIENT_LIBS} ${lib} ") FOREACH(lib ${${target}_LIB_DEPENDS})
ELSEIF(lib MATCHES "^/") # Filter out "general", it is not a library, just CMake hint
# Full path, convert to just filename, strip "lib" prefix and extension # Also, remove duplicates
GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE) IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
STRING(REGEX REPLACE "^lib" "" lib "${lib}") IF (lib MATCHES "^\\-l")
SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) SET(${var} "${${var}} ${lib} ")
ELSE() ELSEIF(lib MATCHES "^/")
SET(CLIENT_LIBS "${CLIENT_LIBS}-l${lib} " ) # Full path, convert to just filename, strip "lib" prefix and extension
ENDIF() 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()
ENDIF() ENDIF()
ENDFOREACH() IF(MSVC)
STRING(REPLACE "-l" "" ${var} "${${var}}")
ENDIF()
IF(LIBDL AND NOT LIBDL MATCHES "-l") ENDMACRO()
SET(LIBDL "-l${LIBDL}")
ENDIF()
IF(LIBWRAP)
SET(WRAPLIBS "-lwrap")
ENDIF()
SET(LIBS "${CLIENT_LIBS}")
IF(LIBCRYPT) EXTRACT_LINK_LIBRARIES(mysqlclient CLIENT_LIBS)
SET(LIBS "${LIBS} -l${LIBCRYPT}") EXTRACT_LINK_LIBRARIES(mysqlserver LIBS)
ENDIF()
IF(MSVC) # mysql_config evaluates ${LIBDL}, we want to avoid it
STRING(REPLACE "-l" "" CLIENT_LIBS "${CLIENT_LIBS}") # as our CLIENT_LIBS and LIBS are already correct
STRING(REPLACE "-l" "" LIBS "${LIBS}" ) SET(LIBDL)
ENDIF()
SET(NON_THREADED_LIBS ${CLIENT_LIBS}) SET(NON_THREADED_LIBS ${CLIENT_LIBS})
SET(mysql_config_COMPONENT COMPONENT Development) SET(mysql_config_COMPONENT COMPONENT Development)
......
...@@ -108,7 +108,7 @@ fi ...@@ -108,7 +108,7 @@ fi
# We intentionally add a space to the beginning and end of lib strings, simplifies replace later # 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=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ " 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@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
if [ -r "$pkglibdir/libmygcc.a" ]; then if [ -r "$pkglibdir/libmygcc.a" ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment