configure: Allow specifying custom CFLAGS for LDAP.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-24 18:27:17 +02:00
parent 448e9ce644
commit ae3adacdde
3 changed files with 91 additions and 41 deletions

82
configure vendored
View File

@ -627,6 +627,7 @@ LIBOBJS
WINELOADER_INSTALL WINELOADER_INSTALL
ALL_VARS_RULES ALL_VARS_RULES
LDAP_LIBS LDAP_LIBS
LDAP_CFLAGS
RT_LIBS RT_LIBS
POLL_LIBS POLL_LIBS
DL_LIBS DL_LIBS
@ -1705,7 +1706,9 @@ TIFF_LIBS
MPG123_CFLAGS MPG123_CFLAGS
MPG123_LIBS MPG123_LIBS
NETAPI_CFLAGS NETAPI_CFLAGS
NETAPI_LIBS' NETAPI_LIBS
LDAP_CFLAGS
LDAP_LIBS'
# Initialize some variables set by options. # Initialize some variables set by options.
@ -2467,6 +2470,8 @@ Some influential environment variables:
NETAPI_CFLAGS NETAPI_CFLAGS
C compiler flags for netapi, overriding pkg-config C compiler flags for netapi, overriding pkg-config
NETAPI_LIBS Linker flags for netapi, overriding pkg-config NETAPI_LIBS Linker flags for netapi, overriding pkg-config
LDAP_CFLAGS C compiler flags for openldap, overriding pkg-config
LDAP_LIBS Linker flags for openldap, overriding pkg-config
Use these variables to override the choices made by `configure' or to help Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations. it to find libraries and programs with nonstandard names/locations.
@ -6871,8 +6876,6 @@ for ac_header in \
inet/mib2.h \ inet/mib2.h \
io.h \ io.h \
kstat.h \ kstat.h \
lber.h \
ldap.h \
libproc.h \ libproc.h \
link.h \ link.h \
linux/cdrom.h \ linux/cdrom.h \
@ -15952,11 +15955,41 @@ fi
LIBS=$ac_save_LIBS LIBS=$ac_save_LIBS
LDAP_LIBS="" if test "x$with_ldap" != "xno"
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then then
ac_fn_c_check_type "$LINENO" "LDAPSortKey" "ac_cv_type_LDAPSortKey" "#include <ldap.h> if ${LDAP_CFLAGS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
LDAP_CFLAGS=`$PKG_CONFIG --cflags openldap 2>/dev/null`
fi
fi
if ${LDAP_LIBS:+false} :; then :
if ${PKG_CONFIG+:} false; then :
LDAP_LIBS=`$PKG_CONFIG --libs openldap 2>/dev/null`
fi
fi
LDAP_LIBS=${LDAP_LIBS:-"-lldap_r -llber"}
$as_echo "$as_me:${as_lineno-$LINENO}: openldap cflags: $LDAP_CFLAGS" >&5
$as_echo "$as_me:${as_lineno-$LINENO}: openldap libs: $LDAP_LIBS" >&5
ac_save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LDAP_CFLAGS"
for ac_header in ldap.h lber.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then
ac_fn_c_check_type "$LINENO" "LDAPSortKey" "ac_cv_type_LDAPSortKey" "#include <ldap.h>
" "
if test "x$ac_cv_type_LDAPSortKey" = xyes; then : if test "x$ac_cv_type_LDAPSortKey" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap_r" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_initialize in -lldap_r" >&5
@ -15965,7 +15998,7 @@ if ${ac_cv_lib_ldap_r_ldap_initialize+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_check_lib_save_LIBS=$LIBS ac_check_lib_save_LIBS=$LIBS
LIBS="-lldap_r $PTHREAD_LIBS $LIBS" LIBS="-lldap_r $PTHREAD_LIBS $LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -16002,7 +16035,7 @@ if ${ac_cv_lib_lber_ber_init+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_check_lib_save_LIBS=$LIBS ac_check_lib_save_LIBS=$LIBS
LIBS="-llber $PTHREAD_LIBS $LIBS" LIBS="-llber $PTHREAD_LIBS $LDAP_LIBS $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
@ -16036,24 +16069,29 @@ if test "x$ac_cv_lib_lber_ber_init" = xyes; then :
$as_echo "#define HAVE_LDAP 1" >>confdefs.h $as_echo "#define HAVE_LDAP 1" >>confdefs.h
LDAP_LIBS="-lldap_r -llber" else
LDAP_LIBS=""
fi fi
else
LDAP_LIBS=""
fi fi
else
LDAP_LIBS=""
fi fi
ac_wine_check_funcs_save_LIBS="$LIBS" ac_wine_check_funcs_save_LIBS="$LIBS"
LIBS="$LIBS $LDAP_LIBS $PTHREAD_LIBS" LIBS="$LIBS $LDAP_LIBS $PTHREAD_LIBS"
for ac_func in \ for ac_func in \
ldap_count_references \ ldap_count_references \
ldap_first_reference \ ldap_first_reference \
ldap_next_reference \ ldap_next_reference \
ldap_parse_reference \ ldap_parse_reference \
ldap_parse_sort_control \ ldap_parse_sort_control \
ldap_parse_sortresponse_control \ ldap_parse_sortresponse_control \
ldap_parse_vlv_control \ ldap_parse_vlv_control \
ldap_parse_vlvresponse_control ldap_parse_vlvresponse_control
do : do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -16066,6 +16104,11 @@ fi
done done
LIBS="$ac_wine_check_funcs_save_LIBS" LIBS="$ac_wine_check_funcs_save_LIBS"
fi
CPPFLAGS=$ac_save_CPPFLAGS
test -z "$LDAP_CFLAGS" || LDAP_CFLAGS=`echo " $LDAP_CFLAGS" | sed 's/ -I\([^/]\)/ -I\$(top_builddir)\/\1/g'`
test -z "$LDAP_LIBS" || LDAP_LIBS=`echo " $LDAP_LIBS" | sed 's/ -L\([^/]\)/ -L\$(top_builddir)\/\1/g'`
fi fi
if test "x$LDAP_LIBS" = "x"; then : if test "x$LDAP_LIBS" = "x"; then :
case "x$with_ldap" in case "x$with_ldap" in
@ -17853,6 +17896,7 @@ EXCESS_PRECISION_CFLAGS = $EXCESS_PRECISION_CFLAGS
DL_LIBS = $DL_LIBS DL_LIBS = $DL_LIBS
POLL_LIBS = $POLL_LIBS POLL_LIBS = $POLL_LIBS
RT_LIBS = $RT_LIBS RT_LIBS = $RT_LIBS
LDAP_CFLAGS = $LDAP_CFLAGS
LDAP_LIBS = $LDAP_LIBS LDAP_LIBS = $LDAP_LIBS
" "

View File

@ -423,8 +423,6 @@ AC_CHECK_HEADERS(\
inet/mib2.h \ inet/mib2.h \
io.h \ io.h \
kstat.h \ kstat.h \
lber.h \
ldap.h \
libproc.h \ libproc.h \
link.h \ link.h \
linux/cdrom.h \ linux/cdrom.h \
@ -2147,27 +2145,34 @@ AC_SEARCH_LIBS(clock_gettime, rt,
LIBS=$ac_save_LIBS LIBS=$ac_save_LIBS
dnl **** Check for OpenLDAP *** dnl **** Check for OpenLDAP ***
AC_SUBST(LDAP_LIBS,"") if test "x$with_ldap" != "xno"
if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
then then
AC_CHECK_TYPE(LDAPSortKey, dnl Actually there's no pkg-config support for ldap, but this way we can still override the flags
[AC_CHECK_LIB(ldap_r, ldap_initialize, WINE_PACKAGE_FLAGS(LDAP,[openldap],[-lldap_r -llber],,,
[AC_CHECK_LIB(lber, ber_init, [AC_CHECK_HEADERS([ldap.h lber.h])
[AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment]) if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
LDAP_LIBS="-lldap_r -llber"],, then
[$PTHREAD_LIBS])],, AC_CHECK_TYPE(LDAPSortKey,
[$PTHREAD_LIBS])],, [AC_CHECK_LIB(ldap_r, ldap_initialize,
[#include <ldap.h>]) [AC_CHECK_LIB(lber, ber_init,
WINE_CHECK_LIB_FUNCS(\ [AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment])],
ldap_count_references \ [LDAP_LIBS=""],
ldap_first_reference \ [$PTHREAD_LIBS $LDAP_LIBS])],
ldap_next_reference \ [LDAP_LIBS=""],
ldap_parse_reference \ [$PTHREAD_LIBS $LDAP_LIBS])],
ldap_parse_sort_control \ [LDAP_LIBS=""],
ldap_parse_sortresponse_control \ [#include <ldap.h>])
ldap_parse_vlv_control \ WINE_CHECK_LIB_FUNCS(\
ldap_parse_vlvresponse_control, ldap_count_references \
[$LDAP_LIBS $PTHREAD_LIBS]) ldap_first_reference \
ldap_next_reference \
ldap_parse_reference \
ldap_parse_sort_control \
ldap_parse_sortresponse_control \
ldap_parse_vlv_control \
ldap_parse_vlvresponse_control,
[$LDAP_LIBS $PTHREAD_LIBS])
fi])
fi fi
WINE_NOTICE_WITH(ldap,[test "x$LDAP_LIBS" = "x"], WINE_NOTICE_WITH(ldap,[test "x$LDAP_LIBS" = "x"],
[libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.]) [libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.])

View File

@ -1,6 +1,7 @@
MODULE = wldap32.dll MODULE = wldap32.dll
IMPORTLIB = wldap32 IMPORTLIB = wldap32
IMPORTS = user32 IMPORTS = user32
EXTRAINCL = $(LDAP_CFLAGS)
EXTRALIBS = $(LDAP_LIBS) EXTRALIBS = $(LDAP_LIBS)
C_SRCS = \ C_SRCS = \