configure.in           |   62 ++++++++++++++++++++++++++++++++++++++++++++++++-
 postgresql/makefile.mk |   12 ++++++++-
 set_soenv.in           |    2 +
 3 files changed, 74 insertions(+), 2 deletions(-)

New commits:
commit 227350eb5a9881f795e9ae499c732f0148e4ac38
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Dec 15 18:40:59 2011 +0100

    Introduce optional krb5&gssapi support for internal PostgreSQL
    
    Enable it by default on MacOS X

diff --git a/configure.in b/configure.in
index 354fa52..3dbbc4b 100644
--- a/configure.in
+++ b/configure.in
@@ -1592,6 +1592,25 @@ AC_ARG_WITH(lang,
     ],
 ,)
 
+# Kerberos and GSSAPI used only by PostgreSQL as of LibO 3.5
+AC_ARG_WITH(krb5,
+    AS_HELP_STRING([--with-krb5],
+        [Enable MIT Kerberos 5 support in modules that support it.
+         By default automatically enabled on platforms
+         where a good system Kerberos 5 is available.]),
+,)
+#AC_ARG_WITH(system-redland,
+#    AS_HELP_STRING([--with-system-redland],
+#        [Use redland library already on system.]),,
+#    [with_system_redland="$with_system_libs"])
+
+AC_ARG_WITH(gssapi,
+    AS_HELP_STRING([--with-gssapi],
+        [Enable GSSAPI support in modules that support it.
+         By default automatically enabled on platforms
+         where a good system GSSAPI is available.]),
+,)
+
 dnl ===================================================================
 dnl Branding
 dnl ===================================================================
@@ -5413,12 +5432,51 @@ fi
 dnl ===================================================================
 dnl Check for PostgreSQL stuff
 dnl ===================================================================
-
 if test "x$enable_ext_postgresql_sdbc" = "xyes"; then
     if test "x$enable_extension_integration" = "xyes"; then
       SCPDEFS="$SCPDEFS -DWITH_EXTENSION_POSTGRESQL"
     fi
 
+# if/when anything else than PostgreSQL uses Kerberos,
+# move this out of `test "x$enable_ext_postgresql_sdbc" = "xyes"'
+WITH_KRB5=NO
+WITH_GSSAPI=no
+case "$_os" in
+  Darwin)
+    # MacOS X has system MIT Kerberos 5 since 10.4
+    if test "$with_krb5" != "no"; then
+      WITH_KRB5=YES
+      AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' 
com_err 'com_err -lssl -lcrypto'], [],
+                    [AC_MSG_ERROR([could not find function 'com_err' required 
for Kerberos 5])])
+      AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 
-lroken'], [],
+                    [AC_MSG_ERROR([could not find function 'krb5_sendauth' 
required for Kerberos 5])])
+    fi
+    if test "$with_gssapi" != "no"; then
+      WITH_GSSAPI=YES
+      AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 
-lcrypto'], [],
+                                 [AC_MSG_ERROR([could not find function 
'gss_init_sec_context' required for GSSAPI])])
+    fi
+   ;;
+  WINNT)
+   if test "$with_krb5" = "yes" || "$with_gssapi" = "yes"; then
+      AC_MSG_ERROR([Refusing to enable MIT Kerberos 5 or GSSAPI on Microsoft 
Windows.])
+   fi
+  ;;
+  *)
+    if test "$with_krb5" = "yes"; then
+      WITH_KRB5=YES
+      AC_SEARCH_LIBS(com_err, [krb5 'krb5 -lcrypto -ldes -lasn1 -lroken' 
com_err 'com_err -lssl -lcrypto'], [],
+                    [AC_MSG_ERROR([could not find function 'com_err' required 
for Kerberos 5])])
+      AC_SEARCH_LIBS(krb5_sendauth, [krb5 'krb5 -lcrypto -ldes -lasn1 
-lroken'], [],
+                    [AC_MSG_ERROR([could not find function 'krb5_sendauth' 
required for Kerberos 5])])
+    fi
+    if test "$with_gssapi" = "yes"; then
+      WITH_GSSAPI=YES
+      AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 
-lcrypto'], [],
+                                 [AC_MSG_ERROR([could not find function 
'gss_init_sec_context' required for GSSAPI])])
+    fi
+esac
+
     AC_MSG_CHECKING([PostgreSQL C interface])
     if test "$with_system_postgresql" = "yes"; then
         AC_MSG_RESULT([external PostgreSQL])
@@ -5465,6 +5523,8 @@ if test "x$enable_ext_postgresql_sdbc" = "xyes"; then
     fi
     BUILD_POSTGRESQL_SDBC=YES
 fi
+AC_SUBST(WITH_KRB5)
+AC_SUBST(WITH_GSSAPI)
 AC_SUBST(BUILD_POSTGRESQL_SDBC)
 AC_SUBST(SYSTEM_POSTGRESQL)
 AC_SUBST(POSTGRESQL_INC)
diff --git a/postgresql/makefile.mk b/postgresql/makefile.mk
index e4e3969..1e1c4f4 100644
--- a/postgresql/makefile.mk
+++ b/postgresql/makefile.mk
@@ -60,15 +60,25 @@ CONFIGURE_DIR=.
 BUILD_DIR=src/interfaces/libpq
 
 CONFIGURE_ACTION = CPPFLAGS="$(SOLARINC)" LDFLAGS="$(SOLARLIB)" ./configure 
--without-readline --disable-shared --with-openssl
+
 .IF "$(WITH_LDAP)" == "YES"
 CONFIGURE_ACTION += --with-ldap
 .IF "$(WITH_OPENLDAP)" != "YES"
 CONFIGURE_ACTION += 
--with-includes='$(SOLARVER)$/$(INPATH)$/inc$/mozilla$/ldap' --with-mozldap
 .ENDIF
+.ENDIF # "$(WITH_LDAP)" == "YES"
+
+.IF "$(WITH_KRB5)" == "YES"
+CONFIGURE_ACTION += --with-krb5
 .ENDIF
-BUILD_ACTION = make -j$(GMAKE_MODULE_PARALLELISM) all-static-lib libpq-flags.mk
+.IF "$(WITH_GSSAPI)" == "YES"
+CONFIGURE_ACTION += --with-gssapi
 .ENDIF
 
+BUILD_ACTION = make -j$(GMAKE_MODULE_PARALLELISM) all-static-lib libpq-flags.mk
+
+.ENDIF # "$(GUI)$(COM)"=="WNTMSC"
+
 # --- Targets ------------------------------------------------------
 
 .INCLUDE : set_ext.mk
diff --git a/set_soenv.in b/set_soenv.in
index 1506366..3ea4a79 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1919,6 +1919,8 @@ ToFile( "XINERAMA_LINK",     "@XINERAMA_LINK@",    "e" );
 ToFile( "SYSTEM_REDLAND",    "@SYSTEM_REDLAND@",   "e" );
 ToFile( "REDLAND_CFLAGS",    "@REDLAND_CFLAGS@",   "e" );
 ToFile( "REDLAND_LIBS",      "@REDLAND_LIBS@",     "e" );
+ToFile( "WITH_KRB5",         "@WITH_KRB5@",        "e" );
+ToFile( "WITH_GSSAPI",       "@WITH_GSSAPI@",      "e" );
 ToFile( "BUILD_POSTGRESQL_SDBC",   "@BUILD_POSTGRESQL_SDBC@", "e" );
 ToFile( "SYSTEM_POSTGRESQL", "@SYSTEM_POSTGRESQL@", "e" );
 ToFile( "POSTGRESQL_INC",    "@POSTGRESQL_INC@",   "e" );
_______________________________________________
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to