Browse Source

[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
personal/stbuehler/fix-fdevent
Glenn Strauss 3 years ago
parent
commit
4608ddec2f
  1. 40
      configure.ac
  2. 8
      src/Makefile.am

40
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([----------------------------------------])

8
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

Loading…
Cancel
Save