Bug #71040 mysql_config gives "--libmysqld-flags" even when built without embedded server
Submitted: 29 Nov 2013 17:51 Modified: 29 Nov 2013 18:02
Reporter: Hartmut Holzgraefe Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: C API (client library) Severity:S3 (Non-critical)
Version:5.6.14, all OS:Linux
Assigned to: CPU Architecture:Any

[29 Nov 2013 17:51] Hartmut Holzgraefe
Description:
Calling

  mysql_config --libmysqld-flags

returns results even if mysql was built with

  WITH_EMBEDDED_SERVER=OFF

How to repeat:
In unpacked mysql source directory do

  mkdir _build
  cd _build
  cmake -DWITH_EMBEDDED_SERVER=OFF ..
  make

make sure libmysqld was *not* built:

  $ ls libmysqld/
  ls: cannot access libmysqld/: No such file or directory

now check mysql_config output:

  $ scripts/mysql_config --libmysqld-libs
  -L/usr/local/mysql/lib -lmysqld

so mysql_config provices link options pointing to a library that actually doesn't exist (won't get installed to /usr/local/mysql/lib as it wasn't built at all)

and there is no way to find out whether building against the embedded server library would succeed or not by just checking mysql_config output alone 

Suggested fix:
IMHO mysql_config should return nothing at all for --libmysqld-libs in this case,
or should even return a non-zero exit status and print an appropriate error message to stderr
[29 Nov 2013 17:55] Hartmut Holzgraefe
Filed as S3 but it is probably just slightly above the feature request threshold, so I wouldn't mind too much if it goes down to S4 ...
[29 Nov 2013 18:02] Sveta Smirnova
Thank you for the report.

Verified as described.