Branch: Tag:

2019-01-28

2019-01-28 13:35:59 by Henrik Grubbström (Grubba) <grubba@grubba.org>

MySQL: Attempt to have a consistent search order for -I/-L.

On systems with multiple installed versions of the MySQL client
libraries, it isn't a good idea to add include directories first
to the include search, but the corresponding lib directory last
to the library search...

104:    AC_MSG_RESULT($pike_cv_mysql_lib_dir)    if test "x$pike_cv_mysql_lib_dir" = "xno"; then :; else    echo Adding $pike_cv_mysql_lib_dir to the library search path. -  LDFLAGS="${LDFLAGS} -R$pike_cv_mysql_lib_dir -L$pike_cv_mysql_lib_dir" +  LDFLAGS="-R$pike_cv_mysql_lib_dir -L$pike_cv_mysql_lib_dir ${LDFLAGS}"    fi       AC_MSG_CHECKING(for Mysql include-directory)
130:    # NB: mariadb_config doens't distinguish between    # LDFLAGS and LIBS    MARIADB_LIBS="" +  MARIADB_LDFLAGS=""    set ignored `${MARIADB_CONFIG} --libs_r`    while test "$#" -gt 1; do    case "$2" in    -L*)    echo "Adding `echo $2 | sed -e 's/^-L//'` to the library search path." -  LDFLAGS="${LDFLAGS} $2 `echo $2 | sed -e 's/^-L/-R/'`" +  MARIADB_LDFLAGS="${MARIADB_LDFLAGS} $2 `echo $2 | sed -e 's/^-L/-R/'`"    ;;    -R*)    echo "Adding `echo $2 | sed -e 's/^-R//'` to the library runtime search path." -  LDFLAGS="${LDFLAGS} $2" +  MARIADB_LDFLAGS="${MARIADB_LDFLAGS} $2"    ;;    -lmaria*)    # We handle the client library itself later.
156:    shift    done    +  LDFLAGS="${MARIADB_LDFLAGS} ${LDFLAGS}" +     if echo " $MARIADB_LIBS" | grep -i iconv >/dev/null; then :; else    # NB: Sometimes iconv doesn't get listed by mariadb_config.    AC_CHECK_LIB(iconv, iconv_open, [