Commit c5da8fbe authored by Tatiana A. Nurnberg's avatar Tatiana A. Nurnberg

Bug#34025: mysql_config is not returning -ldl lib flag needed when using embedded server

mysql_config did not output -ldl (or equivalent) when needed for --libmysqld-libs,
so its output could be insufficient to build an application using the embedded
server.

LIBDL was already set in configure; it's now propagated all the way into the
relevant mysql_config scripts.

scripts/Makefile.am:
  We "manually" replace configure's constants in .sh scripts using sed,
  so AC_SUBST() alone is not good enough. Add LIBDL to the substitution
  list; we'll be needing it for mysql_config --libmysqld-libs
scripts/mysql_config.pl.in:
  Add LIBDL (usually -ldl) to output of mysql_config --libmysqld-libs (perl version)
scripts/mysql_config.sh:
  Add LIBDL (usually -ldl) to output of mysql_config --libmysqld-libs (shell version)
parent 9a063775
...@@ -162,6 +162,7 @@ SUFFIXES = .sh ...@@ -162,6 +162,7 @@ SUFFIXES = .sh
-e 's!@''CFLAGS''@!@CFLAGS@!'\ -e 's!@''CFLAGS''@!@CFLAGS@!'\
-e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\ -e 's!@''CXXFLAGS''@!@CXXFLAGS@!'\
-e 's!@''LDFLAGS''@!@LDFLAGS@!'\ -e 's!@''LDFLAGS''@!@LDFLAGS@!'\
-e 's!@''LIBDL''@!@LIBDL@!'\
-e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \ -e 's!@''CLIENT_LIBS''@!@CLIENT_LIBS@!' \
-e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \ -e 's!@''ZLIB_LIBS''@!@ZLIB_LIBS@!' \
-e 's!@''LIBS''@!@LIBS@!' \ -e 's!@''LIBS''@!@LIBS@!' \
......
...@@ -202,7 +202,7 @@ $flags->{libs} = ...@@ -202,7 +202,7 @@ $flags->{libs} =
$flags->{libs_r} = $flags->{libs_r} =
[@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@']; [@ldflags,@lib_r_opts,'@ZLIB_DEPS@','@LIBS@','@openssl_libs@'];
$flags->{embedded_libs} = $flags->{embedded_libs} =
[@ldflags,@lib_e_opts,'@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@']; [@ldflags,@lib_e_opts,'@LIBDL@','@ZLIB_DEPS@','@LIBS@','@WRAPLIBS@','@innodb_system_libs@','@openssl_libs@'];
$flags->{include} = ["-I$pkgincludedir"]; $flags->{include} = ["-I$pkgincludedir"];
$flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')]; $flags->{cflags} = [@{$flags->{include}},split(" ",'@CFLAGS@')];
......
...@@ -107,7 +107,7 @@ fi ...@@ -107,7 +107,7 @@ fi
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@ @LIBS@ @openssl_libs@ "
embedded_libs=" $ldflags -L$pkglibdir -lmysqld @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ " embedded_libs=" $ldflags -L$pkglibdir -lmysqld @LIBDL@ @ZLIB_DEPS@ @LIBS@ @WRAPLIBS@ @innodb_system_libs@ @openssl_libs@ "
if [ -r "$pkglibdir/libmygcc.a" ]; then if [ -r "$pkglibdir/libmygcc.a" ]; then
# When linking against the static library with a different version of GCC # When linking against the static library with a different version of GCC
......
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