On 7/2/2014 18:13, Adrian Cornish wrote:
> My autoconf stuff is not very good, this seems to work for me - but
> what should I do to improve it
I'd prefer that it worked like this:
1. If --with-mysql* is given, use those values without question.
2. If mysql_config runs, use its outputs without question.
3. If we don't get paths from either the configure script flags or
mysql_config, use the current list of plausible paths to try and find
the headers and C API library automatically.
Explicit error checks aren't needed for options 1 and 2. They give us
inputs for the purpose of overriding the default behavior, so we should
believe whoever told us that these are good values. Later configure
script checks will implicitly test their correctness.
Option 1 is first to allow you to override the more automatic methods.
It should be extremely uncommon for there to be multiple mysql_config
scripts in the PATH, so making the user specify the location is
optimizing for the uncommon case. If there are multiple such scripts in
the system, we can assume that the local sysadmin put the "best" one
first in the PATH.
To use a secondary mysql_config script, you can say things like this:
CFLAGS="/path/to/mysql_config --cflags" LDFLAGS="..." ./configure
By the way, you don't need to put the patch inline. Mailers often wreck
inline patches, so attaching them is the best way.