diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-16 18:16:07 +0300 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2010-08-16 18:16:07 +0300 |
commit | 5564e0837f8d6811acd6f8dc0369ec96dcab3c54 (patch) | |
tree | 94f7517b9264a7af5ea2dd14b146c7e10860363b /scripts | |
parent | 37da201f2fde90fc952b22a75eb34274ac2c3494 (diff) | |
parent | 32edab6bfe4fada3adbf8688375600c8f911c82c (diff) | |
download | mariadb-git-5564e0837f8d6811acd6f8dc0369ec96dcab3c54.tar.gz |
merged mysql-5.5 into WL1054-5.5
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/CMakeLists.txt | 71 | ||||
-rw-r--r-- | scripts/mysql_config.sh | 2 |
2 files changed, 35 insertions, 38 deletions
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index ced207da98b..c7eafac2781 100644 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. # # 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 @@ -11,8 +11,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Build comp_sql - used for embedding SQL in C or C++ programs IF(NOT CMAKE_CROSSCOMPILING) @@ -24,6 +23,7 @@ ENDIF() # Build mysql_fix_privilege_tables.sql (concatenate 2 sql scripts) IF(NOT WIN32 OR CMAKE_CROSSCOMPILING) FIND_PROGRAM(CAT_EXECUTABLE cat DOC "path to the executable") + MARK_AS_ADVANCED(CAT_EXECUTABLE) ENDIF() IF(CAT_EXECUTABLE) @@ -251,43 +251,40 @@ 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) + IF(${target}_LIB_DEPENDS) + 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() ENDIF() -ENDFOREACH() - - -IF(LIBDL AND NOT LIBDL MATCHES "-l") - SET(LIBDL "-l${LIBDL}") -ENDIF() - -IF(LIBWRAP) - SET(WRAPLIBS "-lwrap") -ENDIF() + IF(MSVC) + STRING(REPLACE "-l" "" ${var} "${${var}}") + ENDIF() +ENDMACRO() -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) diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 10755fc698b..69ec88d6724 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -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 |