Kaydet (Commit) 227350eb authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

Introduce optional krb5&gssapi support for internal PostgreSQL

Enable it by default on MacOS X
üst 6a8f6c4b
...@@ -1592,6 +1592,25 @@ AC_ARG_WITH(lang, ...@@ -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 ===================================================================
dnl Branding dnl Branding
dnl =================================================================== dnl ===================================================================
...@@ -5413,12 +5432,51 @@ fi ...@@ -5413,12 +5432,51 @@ fi
dnl =================================================================== dnl ===================================================================
dnl Check for PostgreSQL stuff dnl Check for PostgreSQL stuff
dnl =================================================================== dnl ===================================================================
if test "x$enable_ext_postgresql_sdbc" = "xyes"; then if test "x$enable_ext_postgresql_sdbc" = "xyes"; then
if test "x$enable_extension_integration" = "xyes"; then if test "x$enable_extension_integration" = "xyes"; then
SCPDEFS="$SCPDEFS -DWITH_EXTENSION_POSTGRESQL" SCPDEFS="$SCPDEFS -DWITH_EXTENSION_POSTGRESQL"
fi 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]) AC_MSG_CHECKING([PostgreSQL C interface])
if test "$with_system_postgresql" = "yes"; then if test "$with_system_postgresql" = "yes"; then
AC_MSG_RESULT([external PostgreSQL]) AC_MSG_RESULT([external PostgreSQL])
...@@ -5465,6 +5523,8 @@ if test "x$enable_ext_postgresql_sdbc" = "xyes"; then ...@@ -5465,6 +5523,8 @@ if test "x$enable_ext_postgresql_sdbc" = "xyes"; then
fi fi
BUILD_POSTGRESQL_SDBC=YES BUILD_POSTGRESQL_SDBC=YES
fi fi
AC_SUBST(WITH_KRB5)
AC_SUBST(WITH_GSSAPI)
AC_SUBST(BUILD_POSTGRESQL_SDBC) AC_SUBST(BUILD_POSTGRESQL_SDBC)
AC_SUBST(SYSTEM_POSTGRESQL) AC_SUBST(SYSTEM_POSTGRESQL)
AC_SUBST(POSTGRESQL_INC) AC_SUBST(POSTGRESQL_INC)
......
...@@ -60,15 +60,25 @@ CONFIGURE_DIR=. ...@@ -60,15 +60,25 @@ CONFIGURE_DIR=.
BUILD_DIR=src/interfaces/libpq BUILD_DIR=src/interfaces/libpq
CONFIGURE_ACTION = CPPFLAGS="$(SOLARINC)" LDFLAGS="$(SOLARLIB)" ./configure --without-readline --disable-shared --with-openssl CONFIGURE_ACTION = CPPFLAGS="$(SOLARINC)" LDFLAGS="$(SOLARLIB)" ./configure --without-readline --disable-shared --with-openssl
.IF "$(WITH_LDAP)" == "YES" .IF "$(WITH_LDAP)" == "YES"
CONFIGURE_ACTION += --with-ldap CONFIGURE_ACTION += --with-ldap
.IF "$(WITH_OPENLDAP)" != "YES" .IF "$(WITH_OPENLDAP)" != "YES"
CONFIGURE_ACTION += --with-includes='$(SOLARVER)$/$(INPATH)$/inc$/mozilla$/ldap' --with-mozldap CONFIGURE_ACTION += --with-includes='$(SOLARVER)$/$(INPATH)$/inc$/mozilla$/ldap' --with-mozldap
.ENDIF .ENDIF
.ENDIF # "$(WITH_LDAP)" == "YES"
.IF "$(WITH_KRB5)" == "YES"
CONFIGURE_ACTION += --with-krb5
.ENDIF .ENDIF
BUILD_ACTION = make -j$(GMAKE_MODULE_PARALLELISM) all-static-lib libpq-flags.mk .IF "$(WITH_GSSAPI)" == "YES"
CONFIGURE_ACTION += --with-gssapi
.ENDIF .ENDIF
BUILD_ACTION = make -j$(GMAKE_MODULE_PARALLELISM) all-static-lib libpq-flags.mk
.ENDIF # "$(GUI)$(COM)"=="WNTMSC"
# --- Targets ------------------------------------------------------ # --- Targets ------------------------------------------------------
.INCLUDE : set_ext.mk .INCLUDE : set_ext.mk
......
...@@ -1919,6 +1919,8 @@ ToFile( "XINERAMA_LINK", "@XINERAMA_LINK@", "e" ); ...@@ -1919,6 +1919,8 @@ ToFile( "XINERAMA_LINK", "@XINERAMA_LINK@", "e" );
ToFile( "SYSTEM_REDLAND", "@SYSTEM_REDLAND@", "e" ); ToFile( "SYSTEM_REDLAND", "@SYSTEM_REDLAND@", "e" );
ToFile( "REDLAND_CFLAGS", "@REDLAND_CFLAGS@", "e" ); ToFile( "REDLAND_CFLAGS", "@REDLAND_CFLAGS@", "e" );
ToFile( "REDLAND_LIBS", "@REDLAND_LIBS@", "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( "BUILD_POSTGRESQL_SDBC", "@BUILD_POSTGRESQL_SDBC@", "e" );
ToFile( "SYSTEM_POSTGRESQL", "@SYSTEM_POSTGRESQL@", "e" ); ToFile( "SYSTEM_POSTGRESQL", "@SYSTEM_POSTGRESQL@", "e" );
ToFile( "POSTGRESQL_INC", "@POSTGRESQL_INC@", "e" ); ToFile( "POSTGRESQL_INC", "@POSTGRESQL_INC@", "e" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment