Project

General

Profile

cross.patch

autotools: try mysqlclient.pc and mariadb.pc - helmut, 2019-01-14 08:17

View differences:

lighttpd-1.4.52/configure.ac
226 226
)
227 227
AC_MSG_RESULT([$WITH_MYSQL])
228 228

  
229
MYSQL_INCLUDE=
229
MYSQL_CFLAGS=
230 230
MYSQL_LIBS=
231 231

  
232
if test "$WITH_MYSQL" != no; then
233
  if test "$WITH_MYSQL" = yes; then
234
    AC_PATH_PROG([MYSQL_CONFIG], [mysql_config])
235
  else
232
AS_IF([test "$WITH_MYSQL" != no],[
233
  AS_IF([test "$WITH_MYSQL" = yes],[
234
    PKG_CHECK_MODULES([MYSQL],[mariadb],[
235
      MYSQL_CONFIG=$PKG_CONFIG
236
    ],[
237
      PKG_CHECK_MODULES([MYSQL],[mysqlclient],[
238
        MYSQL_CONFIG=$PKG_CONFIG
239
      ],[
240
        AC_PATH_PROG([MYSQL_CONFIG], [mysql_config])
241
      ])
242
    ])
243
  ],[
236 244
    MYSQL_CONFIG=$WITH_MYSQL
237
  fi
245
  ])
238 246

  
239
  if test -z "$MYSQL_CONFIG"; then
240
    AC_MSG_ERROR([mysql_config is not found])
241
  fi
242
  if test ! -x "$MYSQL_CONFIG"; then
243
    AC_MSG_ERROR([mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config])
244
  fi
247
  AS_IF([test "$MYSQL_CONFIG" != "$PKG_CONFIG"],[
248
    if test -z "$MYSQL_CONFIG"; then
249
      AC_MSG_ERROR([mysql_config is not found])
250
    fi
251
    if test ! -x "$MYSQL_CONFIG"; then
252
      AC_MSG_ERROR([mysql_config not exists or not executable, use --with-mysql=path-to-mysql_config])
253
    fi
245 254

  
246
  if "$MYSQL_CONFIG" | grep -- '--include' > /dev/null ; then
247
    MYSQL_INCLUDE=`"$MYSQL_CONFIG" --include | sed s/\'//g`
248
  else
249
    MYSQL_INCLUDE=`"$MYSQL_CONFIG" --cflags | sed s/\'//g`
250
  fi
251
  MYSQL_LIBS=`"$MYSQL_CONFIG" --libs | sed s/\'//g`
255
    if "$MYSQL_CONFIG" | grep -- '--include' > /dev/null ; then
256
      MYSQL_CFLAGS=`"$MYSQL_CONFIG" --include | sed s/\'//g`
257
    else
258
      MYSQL_CFLAGS=`"$MYSQL_CONFIG" --cflags | sed s/\'//g`
259
    fi
260
    MYSQL_LIBS=`"$MYSQL_CONFIG" --libs | sed s/\'//g`
261
  ])
252 262

  
253 263
  AC_MSG_CHECKING([for MySQL includes at])
254
  AC_MSG_RESULT([$MYSQL_INCLUDE])
264
  AC_MSG_RESULT([$MYSQL_CFLAGS])
255 265

  
256 266
  AC_MSG_CHECKING([for MySQL libraries at])
257 267
  AC_MSG_RESULT([$MYSQL_LIBS])
258 268

  
259 269
  AC_DEFINE([HAVE_MYSQL], [1], [mysql support])
260
fi
270
])
261 271
AM_CONDITIONAL([BUILD_WITH_MYSQL], [test "$WITH_MYSQL" != no])
262 272

  
263 273
AC_SUBST([MYSQL_LIBS])
264
AC_SUBST([MYSQL_INCLUDE])
274
AC_SUBST([MYSQL_CFLAGS])
265 275

  
266 276
dnl Checks for pgsql
267 277
AC_MSG_NOTICE([----------------------------------------])
268
-- lighttpd-1.4.52.orig/src/Makefile.am
278
++ lighttpd-1.4.52/src/Makefile.am
......
178 178
mod_mysql_vhost_la_SOURCES = mod_mysql_vhost.c
179 179
mod_mysql_vhost_la_LDFLAGS = $(common_module_ldflags)
180 180
mod_mysql_vhost_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
181
mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_INCLUDE)
181
mod_mysql_vhost_la_CPPFLAGS = $(MYSQL_CFLAGS)
182 182
endif
183 183

  
184 184
if BUILD_WITH_MYSQL
......
186 186
mod_vhostdb_mysql_la_SOURCES = mod_vhostdb_mysql.c
187 187
mod_vhostdb_mysql_la_LDFLAGS = $(common_module_ldflags)
188 188
mod_vhostdb_mysql_la_LIBADD = $(MYSQL_LIBS) $(common_libadd)
189
mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
189
mod_vhostdb_mysql_la_CPPFLAGS = $(MYSQL_CFLAGS)
190 190
endif
191 191

  
192 192
if BUILD_WITH_PGSQL
......
356 356
mod_authn_mysql_la_SOURCES = mod_authn_mysql.c
357 357
mod_authn_mysql_la_LDFLAGS = $(common_module_ldflags)
358 358
mod_authn_mysql_la_LIBADD = $(CRYPT_LIB) $(MYSQL_LIBS) $(common_libadd)
359
mod_authn_mysql_la_CPPFLAGS = $(MYSQL_INCLUDE)
359
mod_authn_mysql_la_CPPFLAGS = $(MYSQL_CFLAGS)
360 360
endif
361 361

  
362 362
if BUILD_WITH_SASL
......
498 498
endif
499 499
if BUILD_WITH_MYSQL
500 500
lighttpd_SOURCES += mod_authn_mysql.c mod_mysql_vhost.c mod_vhostdb_mysql.c
501
lighttpd_CPPFLAGS += $(MYSQL_INCLUDE)
501
lighttpd_CPPFLAGS += $(MYSQL_CFLAGS)
502 502
lighttpd_LDADD += $(MYSQL_LIBS)
503 503
endif
504 504
if BUILD_WITH_PGSQL