From ea524defc9cc05f5df5fbb499f086cc530020615 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 15 Jul 2005 16:39:42 +0000 Subject: [PATCH] Configure checks for OpenLDAP headers and libraries. --- configure | 151 ++++++++++++++++++++++++++++++++++++++- configure.ac | 12 ++++ dlls/wldap32/Makefile.in | 1 + include/config.h.in | 9 +++ 4 files changed, 172 insertions(+), 1 deletion(-) diff --git a/configure b/configure index cc6018c18cf..95f2587da12 100755 --- a/configure +++ b/configure @@ -311,7 +311,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS ft_devel ft_devel2 FREETYPELIBS FREETYPEINCL FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD ALLOCA LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS ft_devel ft_devel2 FREETYPELIBS FREETYPEINCL FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD ALLOCA LIBOBJS LTLIBOBJS' ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES' # Initialize some variables set by options. @@ -7108,6 +7108,8 @@ done + + @@ -7127,8 +7129,10 @@ for ac_header in \ io.h \ jack/jack.h \ jpeglib.h \ + lber.h \ lcms/lcms.h \ lcms.h \ + ldap.h \ link.h \ linux/cdrom.h \ linux/compiler.h \ @@ -9954,6 +9958,150 @@ fi fi +LDAPLIBS="" + +if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes" +then + echo "$as_me:$LINENO: checking for ldap_init in -lldap" >&5 +echo $ECHO_N "checking for ldap_init in -lldap... $ECHO_C" >&6 +if test "${ac_cv_lib_ldap_ldap_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ldap_init (); +int +main () +{ +ldap_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ldap_ldap_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ldap_ldap_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_init" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap_ldap_init" >&6 +if test $ac_cv_lib_ldap_ldap_init = yes; then + echo "$as_me:$LINENO: checking for ber_init in -llber" >&5 +echo $ECHO_N "checking for ber_init in -llber... $ECHO_C" >&6 +if test "${ac_cv_lib_lber_ber_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-llber $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char ber_init (); +int +main () +{ +ber_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_lber_ber_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_lber_ber_init=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_lber_ber_init" >&5 +echo "${ECHO_T}$ac_cv_lib_lber_ber_init" >&6 +if test $ac_cv_lib_lber_ber_init = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LDAP 1 +_ACEOF + + LDAPLIBS="-lldap -llber" +fi + +fi + +fi + echo "$as_me:$LINENO: checking for FT_Init_FreeType in -lfreetype" >&5 echo $ECHO_N "checking for FT_Init_FreeType in -lfreetype... $ECHO_C" >&6 if test "${ac_cv_lib_freetype_FT_Init_FreeType+set}" = set; then @@ -21015,6 +21163,7 @@ s,@SANELIBS@,$SANELIBS,;t t s,@SANEINCL@,$SANEINCL,;t t s,@ICULIBS@,$ICULIBS,;t t s,@LCMSLIBS@,$LCMSLIBS,;t t +s,@LDAPLIBS@,$LDAPLIBS,;t t s,@ft_devel@,$ft_devel,;t t s,@ft_devel2@,$ft_devel2,;t t s,@FREETYPELIBS@,$FREETYPELIBS,;t t diff --git a/configure.ac b/configure.ac index 41108dab9c8..d357ae34191 100644 --- a/configure.ac +++ b/configure.ac @@ -186,8 +186,10 @@ AC_CHECK_HEADERS(\ io.h \ jack/jack.h \ jpeglib.h \ + lber.h \ lcms/lcms.h \ lcms.h \ + ldap.h \ link.h \ linux/cdrom.h \ linux/compiler.h \ @@ -489,6 +491,16 @@ then LCMSLIBS="-llcms"]) fi +dnl **** Check for OpenLDAP *** +AC_SUBST(LDAPLIBS,"") +if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes" +then + AC_CHECK_LIB(ldap, ldap_init, + [AC_CHECK_LIB(lber, ber_init, + [AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment]) + LDAPLIBS="-lldap -llber"])]) +fi + dnl **** Check for FreeType 2 **** AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS) if test "$ft_lib" = "no" diff --git a/dlls/wldap32/Makefile.in b/dlls/wldap32/Makefile.in index 3079bd8fbb7..94691edbf4a 100644 --- a/dlls/wldap32/Makefile.in +++ b/dlls/wldap32/Makefile.in @@ -5,6 +5,7 @@ VPATH = @srcdir@ MODULE = wldap32.dll IMPORTLIB = libwldap32.$(IMPLIBEXT) IMPORTS = kernel32 +EXTRALIBS = @LDAPLIBS@ C_SRCS = \ main.c diff --git a/include/config.h.in b/include/config.h.in index fa3a4b9f480..824a53f5807 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -245,6 +245,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_JPEGLIB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LBER_H + /* Define if you have the LittleCMS development environment */ #undef HAVE_LCMS @@ -254,6 +257,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LCMS_LCMS_H +/* Define if you have the OpenLDAP development environment */ +#undef HAVE_LDAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_LDAP_H + /* Define if you have libaudioIO */ #undef HAVE_LIBAUDIOIO