Skip to content

Commit bec1ce6

Browse files
author
Tor Didriksen
committed
Bug#18235669 MYSQL_CONFIG TO PROVIDE R FLAG ON SOLARIS
'mysql_config --libs' outputs -L/path/to/library on SunOS we also want it to output '-R/path/to/library' in order to find libraries at runtime.
1 parent d18f67b commit bec1ce6

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

cmake/libutils.cmake

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -158,6 +158,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
158158
IF(OSLIBS)
159159
LIST(REMOVE_DUPLICATES OSLIBS)
160160
TARGET_LINK_LIBRARIES(${TARGET} ${OSLIBS})
161+
MESSAGE(STATUS "Library ${TARGET} depends on OSLIBS ${OSLIBS}")
161162
ENDIF()
162163

163164
# Make the generated dummy source file depended on all static input

scripts/CMakeLists.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -228,6 +228,11 @@ SET(pkglibdir ${prefix}/${INSTALL_LIBDIR})
228228
SET(pkgplugindir ${prefix}/${INSTALL_PLUGINDIR})
229229
SET(localstatedir ${MYSQL_DATADIR})
230230

231+
SET(RPATH_OPTION "")
232+
IF(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
233+
SET(RPATH_OPTION "-R$pkglibdir")
234+
ENDIF()
235+
231236
# some scripts use @TARGET_LINUX@
232237
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
233238
SET(TARGET_LINUX "true")
@@ -312,6 +317,9 @@ IF(WIN32)
312317
INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/${file}.pl COMPONENT Server_Scripts)
313318
ENDFOREACH()
314319
ELSE()
320+
# Configure this one, for testing, but do not install it.
321+
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/mysql_config.pl.in
322+
${CMAKE_CURRENT_BINARY_DIR}/mysql_config.pl ESCAPE_QUOTES @ONLY)
315323
# On Unix, most of the files end up in the bin directory
316324
SET(mysql_config_COMPONENT COMPONENT Development)
317325
SET(BIN_SCRIPTS

scripts/mysql_config.pl.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/perl
22
# -*- cperl -*-
33
#
4-
# Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
4+
# Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
55
#
66
# This program is free software; you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -189,7 +189,7 @@ if ( $^O eq "MSWin32" )
189189
}
190190
else
191191
{
192-
my $linkpath = "-L$pkglibdir";
192+
my $linkpath = "-L$pkglibdir @RPATH_OPTION@";
193193
@lib_opts = ($linkpath,"-lmysqlclient");
194194
@lib_r_opts = ($linkpath,"-lmysqlclient_r");
195195
@lib_e_opts = ($linkpath,"-lmysqld");

scripts/mysql_config.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
33
#
44
# This program is free software; you can redistribute it and/or modify
55
# it under the terms of the GNU General Public License as published by
@@ -110,10 +110,10 @@ fi
110110

111111
# Create options
112112
# We intentionally add a space to the beginning and end of lib strings, simplifies replace later
113-
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
113+
libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
114114
libs="$libs @openssl_libs@ @STATIC_NSS_FLAGS@ "
115-
libs_r=" $ldflags -L$pkglibdir -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
116-
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
115+
libs_r=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqlclient_r @ZLIB_DEPS@ @CLIENT_LIBS@ @openssl_libs@ "
116+
embedded_libs=" $ldflags -L$pkglibdir @RPATH_OPTION@ -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @openssl_libs@ "
117117

118118
if [ -r "$pkglibdir/libmygcc.a" ]; then
119119
# When linking against the static library with a different version of GCC

0 commit comments

Comments
 (0)