summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-01-19 12:07:01 -0500
committerGlenn Strauss <gstrauss@gluelogic.com>2019-01-19 17:42:12 -0500
commit4608ddec2f94daa84d69fc1b311a8b3aae16ec5c (patch)
tree37a4ace96d0f7f794cca48ab2747d7de0aad73ae
parentce7b47c015d6ce724ad6361c2df7a4853058654a (diff)
downloadlighttpd1.4-4608ddec2f94daa84d69fc1b311a8b3aae16ec5c.tar.gz
lighttpd1.4-4608ddec2f94daa84d69fc1b311a8b3aae16ec5c.zip
[build] autotools: try mysqlclient.pc and mariadb.pc (fixes #2925)
(thx helmut) x-ref: "autotools cross build failure with lighttpd" https://redmine.lighttpd.net/issues/2925
-rw-r--r--configure.ac40
-rw-r--r--src/Makefile.am8
2 files changed, 29 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index 780393e6..96c6f879 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,32 +226,42 @@ AC_ARG_WITH([mysql],
)
AC_MSG_RESULT([$WITH_MYSQL])
-MYSQL_INCLUDE=
+MYSQL_CFLAGS=
MYSQL_LIBS=
if test "$WITH_MYSQL" != no; then
if test "$WITH_MYSQL" = yes; then
- AC_PATH_PROG([MYSQL_CONFIG], [mysql_config])
+ PKG_CHECK_MODULES([MYSQL],[mariadb],[
+ MYSQL_CONFIG=$PKG_CONFIG
+ ],[
+ PKG_CHECK_MODULES([MYSQL],[mysqlclient],[
+ MYSQL_CONFIG=$PKG_CONFIG
+ ],[
+ AC_PATH_PROG([MYSQL_CONFIG], [mysql_config])
+ ])
+ ])
else
MYSQL_CONFIG=$WITH_MYSQL
fi
- if test -z "$MYSQL_CONFIG"; then
- AC_MSG_ERROR([mysql_config is not found])
- fi
- if test ! -x "$MYSQL_CONFIG"; then
- AC_MSG_ERROR([mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config])
- fi
+ if test "$MYSQL_CONFIG" != "$PKG_CONFIG"; then
+ if test -z "$MYSQL_CONFIG"; then
+ AC_MSG_ERROR([mysql_config is not found])
+ fi
+ if test ! -x "$MYSQL_CONFIG"; then
+ AC_MSG_ERROR([mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config])
+ fi
- if "$MYSQL_CONFIG" | grep -- '--include' > /dev/null ; then
- MYSQL_INCLUDE=`"$MYSQL_CONFIG" --include | sed s/\'//g`
- else
- MYSQL_INCLUDE=`"$MYSQL_CONFIG" --cflags | sed s/\'//g`
+ if "$MYSQL_CONFIG" | grep -- '--include' > /dev/null ; then
+ MYSQL_CFLAGS=`"$MYSQL_CONFIG" --include | sed s/\'//g`
+ else
+ MYSQL_CFLAGS=`"$MYSQL_CONFIG" --cflags | sed s/\'//g`
+ fi
+ MYSQL_LIBS=`"$MYSQL_CONFIG" --libs | sed s/\'//g`
fi
- MYSQL_LIBS=`"$MYSQL_CONFIG" --libs | sed s/\'//g`
AC_MSG_CHECKING([for MySQL includes at])
- AC_MSG_RESULT([$MYSQL_INCLUDE])
+ AC_MSG_RESULT([$MYSQL_CFLAGS])
AC_MSG_CHECKING([for MySQL libraries at])
AC_MSG_RESULT([$MYSQL_LIBS])
@@ -261,7 +271,7 @@ fi
AM_CONDITIONAL([BUILD_WITH_MYSQL], [test "$WITH_MYSQL" != no])
AC_SUBST([MYSQL_LIBS])
-AC_SUBST([MYSQL_INCLUDE])
+AC_SUBST([MYSQL_CFLAGS])
dnl Checks for pgsql
AC_MSG_NOTICE([----------------------------------------])
diff --git a/src/Makefile.am b/src/Makefile.am
index 25622a75..80feb0af 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -186,7 +186,7 @@ lib_LTLIBRARIES += mod_mysql_vhost.la
mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
-mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
+mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_CFLAGS)
endif
if BUILD_WITH_MYSQL
@@ -194,7 +194,7 @@ lib_LTLIBRARIES += mod_vhostdb_mysql.la
mod_vhostdb_mysql_la_SOURCES = mod_vhostdb_mysql.c
mod_vhostdb_mysql_la_LDFLAGS = $(common_module_ldflags)
mod_vhostdb_mysql_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
-mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
+mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_CFLAGS)
endif
if BUILD_WITH_PGSQL
@@ -364,7 +364,7 @@ lib_LTLIBRARIES += mod_authn_mysql.la
mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
-mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
+mod_authn_mysql_la_CPPFLAGS = $(MYSQL_CFLAGS)
endif
if BUILD_WITH_SASL
@@ -506,7 +506,7 @@ lighttpd_LDADD += $(PAM_LIB)
endif
if BUILD_WITH_MYSQL
lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c mod_vhostdb_mysql.c
-lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
+lighttpd_CPPFLAGS += $(MYSQL_CFLAGS)
lighttpd_LDADD += $(MYSQL_LIBS)
endif
if BUILD_WITH_PGSQL