Commit 2bf05ace authored by Helmut Grohne's avatar Helmut Grohne Committed by Helmut Grohne

cross.patch: cherry-picked from upstream

parent 9bac3065
commit 4608ddec2f94daa84d69fc1b311a8b3aae16ec5c
Author: Glenn Strauss <gstrauss@gluelogic.com>
Date: Sat Jan 19 12:07:01 2019 -0500
[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
--- lighttpd.orig/configure.ac
+++ lighttpd/configure.ac
@@ -226,32 +226,42 @@
)
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 @@
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([----------------------------------------])
--- lighttpd.orig/src/Makefile.am
+++ lighttpd/src/Makefile.am
@@ -178,7 +178,7 @@
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
@@ -186,7 +186,7 @@
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
@@ -356,7 +356,7 @@
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
@@ -498,7 +498,7 @@
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
http_auth_backends_assertion.patch
connection_close.patch
cross.patch
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