Skip to content
Snippets Groups Projects
Commit e89f8415 authored by Cy Schubert's avatar Cy Schubert
Browse files

security/krb5: Support libedit in base

Even though libedit is in base FreeBSD, the krb5 ports still depend
on devel/libedit when the LIBEDIT option is selected. This is because
./configure uses pkgconf to determine if libedit exists, ignoring
libedit in FreeBSD base. This patch adds a new LIBEDIT_BASE option
which enables LIBEDIT (LIBEDIT_BASE) without installing the
devel/libedit port.

The GNU READLINE option will remain the default for now but it is
planned to switch the default to LIBEDIT_BASE at some point. This is
to reduce the dependency on GNU software and to bring it more into
line with the planned MIT KRB5 import into FreeBSD base.
parent 0b58b7b4
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,7 @@ CONFLICTS= heimdal krb5 krb5-118 krb5-12*
CONFLICTS_BUILD= boringssl
KERBEROSV_URL= http://web.mit.edu/kerberos/
USES= compiler:c++11-lang cpe gmake gettext-runtime \
USES= autoreconf compiler:c++11-lang cpe gmake gettext-runtime \
gssapi:bootstrap,mit libtool:build localbase \
perl5 pkgconfig ssl
BROKEN_SSL= openssl30 openssl31
......@@ -45,7 +45,7 @@ CPE_PRODUCT= kerberos
OPTIONS_DEFINE= EXAMPLES NLS KRB5_PDF KRB5_HTML DNS_FOR_REALM LDAP LMDB
OPTIONS_DEFAULT= KRB5_PDF KRB5_HTML READLINE
OPTIONS_RADIO= CMD_LINE_EDITING
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT LIBEDIT_BASE
CMD_LINE_EDITING_DESC= Command line editing for kadmin and ktutil
KRB5_PDF_DESC= Install krb5 PDF documentation
KRB5_HTML_DESC= Install krb5 HTML documentation
......@@ -64,6 +64,8 @@ READLINE_USES= readline
READLINE_CONFIGURE_WITH=readline
LIBEDIT_USES= libedit
LIBEDIT_CONFIGURE_WITH= libedit
LIBEDIT_BASE_CONFIGURE_WITH= libedit
LIBEDIT_BASE_DESC= Use libedit in FreeBSD base
.if defined(KRB5_HOME)
PREFIX= ${KRB5_HOME}
......
--- configure.ac.orig 2023-08-07 11:38:21.000000000 -0700
+++ configure.ac 2023-08-09 14:49:19.833149000 -0700
@@ -1356,8 +1356,12 @@
AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
AC_MSG_NOTICE([Using libedit for readline support])
elif test "x$with_libedit" = xyes; then
- # We were explicitly asked for libedit and couldn't find it.
- AC_MSG_ERROR([Could not detect libedit with pkg-config])
+ AC_MSG_NOTICE([Using libedit in FreeBSD base])
+ AC_CHECK_LIB([edit], [main], :,
+ AC_MSG_ERROR([Could not detect libedit]))
+ AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
+ RL_CFLAGS=-DFreeBSD_BASE_EDITLINE
+ RL_LIBS='-ledit'
else
AC_MSG_NOTICE([Not using any readline support])
fi
--- util/ss/listen.c.orig 2023-08-07 11:38:21.000000000 -0700
+++ util/ss/listen.c 2023-08-09 13:09:30.816661000 -0700
@@ -15,7 +15,11 @@
#include <sys/param.h>
#if defined(HAVE_LIBEDIT)
+#if defined(FreeBSD_BASE_EDITLINE)
+#include <edit/readline/readline.h>
+#else
#include <editline/readline.h>
+#endif
#elif defined(HAVE_READLINE)
#include <readline/readline.h>
#include <readline/history.h>
......@@ -19,7 +19,7 @@ CONFLICTS= heimdal krb5 krb5-11* krb5-121
CONFLICTS_BUILD= boringssl
KERBEROSV_URL= http://web.mit.edu/kerberos/
USES= compiler:c++11-lang cpe gmake gettext-runtime \
USES= autoreconf compiler:c++11-lang cpe gmake gettext-runtime \
gssapi:bootstrap,mit libtool:build localbase \
perl5 pkgconfig ssl
USE_CSTD= gnu99
......@@ -39,7 +39,7 @@ CPE_PRODUCT= kerberos
OPTIONS_DEFINE= EXAMPLES NLS KRB5_PDF KRB5_HTML DNS_FOR_REALM LDAP LMDB
OPTIONS_DEFAULT= KRB5_PDF KRB5_HTML READLINE
OPTIONS_RADIO= CMD_LINE_EDITING
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT LIBEDIT_BASE
CMD_LINE_EDITING_DESC= Command line editing for kadmin and ktutil
KRB5_PDF_DESC= Install krb5 PDF documentation
KRB5_HTML_DESC= Install krb5 HTML documentation
......@@ -58,6 +58,8 @@ READLINE_USES= readline
READLINE_CONFIGURE_WITH=readline
LIBEDIT_USES= libedit
LIBEDIT_CONFIGURE_WITH= libedit
LIBEDIT_BASE_CONFIGURE_WITH= libedit
LIBEDIT_BASE_DESC= Use libedit in FreeBSD base
.if defined(KRB5_HOME)
PREFIX= ${KRB5_HOME}
......
--- configure.ac.orig 2023-08-07 11:38:21.000000000 -0700
+++ configure.ac 2023-08-09 14:49:19.833149000 -0700
@@ -1356,8 +1356,12 @@
AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
AC_MSG_NOTICE([Using libedit for readline support])
elif test "x$with_libedit" = xyes; then
- # We were explicitly asked for libedit and couldn't find it.
- AC_MSG_ERROR([Could not detect libedit with pkg-config])
+ AC_MSG_NOTICE([Using libedit in FreeBSD base])
+ AC_CHECK_LIB([edit], [main], :,
+ AC_MSG_ERROR([Could not detect libedit]))
+ AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
+ RL_CFLAGS=-DFreeBSD_BASE_EDITLINE
+ RL_LIBS='-ledit'
else
AC_MSG_NOTICE([Not using any readline support])
fi
--- util/ss/listen.c.orig 2023-08-07 11:38:21.000000000 -0700
+++ util/ss/listen.c 2023-08-09 13:09:30.816661000 -0700
@@ -15,7 +15,11 @@
#include <sys/param.h>
#if defined(HAVE_LIBEDIT)
+#if defined(FreeBSD_BASE_EDITLINE)
+#include <edit/readline/readline.h>
+#else
#include <editline/readline.h>
+#endif
#elif defined(HAVE_READLINE)
#include <readline/readline.h>
#include <readline/history.h>
......@@ -19,7 +19,7 @@ CONFLICTS= heimdal krb5 krb5-11* krb5-120
CONFLICTS_BUILD= boringssl
KERBEROSV_URL= http://web.mit.edu/kerberos/
USES= compiler:c++11-lang cpe gmake gettext-runtime \
USES= autoreconf compiler:c++11-lang cpe gmake gettext-runtime \
gssapi:bootstrap,mit libtool:build localbase \
perl5 pkgconfig ssl
USE_CSTD= gnu99
......@@ -39,7 +39,7 @@ CPE_PRODUCT= kerberos
OPTIONS_DEFINE= EXAMPLES NLS KRB5_PDF KRB5_HTML DNS_FOR_REALM LDAP LMDB
OPTIONS_DEFAULT= KRB5_PDF KRB5_HTML READLINE
OPTIONS_RADIO= CMD_LINE_EDITING
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT LIBEDIT_BASE
CMD_LINE_EDITING_DESC= Command line editing for kadmin and ktutil
KRB5_PDF_DESC= Install krb5 PDF documentation
KRB5_HTML_DESC= Install krb5 HTML documentation
......@@ -58,6 +58,8 @@ READLINE_USES= readline
READLINE_CONFIGURE_WITH=readline
LIBEDIT_USES= libedit
LIBEDIT_CONFIGURE_WITH= libedit
LIBEDIT_BASE_CONFIGURE_WITH= libedit
LIBEDIT_BASE_DESC= Use libedit in FreeBSD base
.if defined(KRB5_HOME)
PREFIX= ${KRB5_HOME}
......
--- configure.ac.orig 2023-08-07 11:38:21.000000000 -0700
+++ configure.ac 2023-08-09 14:49:19.833149000 -0700
@@ -1356,8 +1356,12 @@
AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
AC_MSG_NOTICE([Using libedit for readline support])
elif test "x$with_libedit" = xyes; then
- # We were explicitly asked for libedit and couldn't find it.
- AC_MSG_ERROR([Could not detect libedit with pkg-config])
+ AC_MSG_NOTICE([Using libedit in FreeBSD base])
+ AC_CHECK_LIB([edit], [main], :,
+ AC_MSG_ERROR([Could not detect libedit]))
+ AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
+ RL_CFLAGS=-DFreeBSD_BASE_EDITLINE
+ RL_LIBS='-ledit'
else
AC_MSG_NOTICE([Not using any readline support])
fi
--- util/ss/listen.c.orig 2023-08-07 11:38:21.000000000 -0700
+++ util/ss/listen.c 2023-08-09 13:09:30.816661000 -0700
@@ -15,7 +15,11 @@
#include <sys/param.h>
#if defined(HAVE_LIBEDIT)
+#if defined(FreeBSD_BASE_EDITLINE)
+#include <edit/readline/readline.h>
+#else
#include <editline/readline.h>
+#endif
#elif defined(HAVE_READLINE)
#include <readline/readline.h>
#include <readline/history.h>
......@@ -40,7 +40,7 @@ CPE_PRODUCT= kerberos
OPTIONS_DEFINE= EXAMPLES NLS DNS_FOR_REALM LDAP LMDB
OPTIONS_DEFAULT= KRB5_PDF KRB5_HTML READLINE
OPTIONS_RADIO= CMD_LINE_EDITING
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT
OPTIONS_RADIO_CMD_LINE_EDITING= READLINE LIBEDIT LIBEDIT_BASE
CMD_LINE_EDITING_DESC= Command line editing for kadmin and ktutil
DNS_FOR_REALM_DESC= Enable DNS lookups for Kerberos realm names
DNS_FOR_REALM_CONFIGURE_ENABLE= dns-for-realm
......@@ -57,6 +57,8 @@ READLINE_USES= readline
READLINE_CONFIGURE_WITH=readline
LIBEDIT_USES= libedit
LIBEDIT_CONFIGURE_WITH= libedit
LIBEDIT_BASE_CONFIGURE_WITH= libedit
LIBEDIT_BASE_DESC= Use libedit in FreeBSD base
.if defined(KRB5_HOME)
PREFIX= ${KRB5_HOME}
......
--- configure.ac.orig 2023-08-07 11:38:21.000000000 -0700
+++ configure.ac 2023-08-09 14:49:19.833149000 -0700
@@ -1356,8 +1356,12 @@
AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
AC_MSG_NOTICE([Using libedit for readline support])
elif test "x$with_libedit" = xyes; then
- # We were explicitly asked for libedit and couldn't find it.
- AC_MSG_ERROR([Could not detect libedit with pkg-config])
+ AC_MSG_NOTICE([Using libedit in FreeBSD base])
+ AC_CHECK_LIB([edit], [main], :,
+ AC_MSG_ERROR([Could not detect libedit]))
+ AC_DEFINE([HAVE_LIBEDIT], 1, [Define if building with libedit.])
+ RL_CFLAGS=-DFreeBSD_BASE_EDITLINE
+ RL_LIBS='-ledit'
else
AC_MSG_NOTICE([Not using any readline support])
fi
--- util/ss/listen.c.orig 2023-08-07 11:38:21.000000000 -0700
+++ util/ss/listen.c 2023-08-09 13:09:30.816661000 -0700
@@ -15,7 +15,11 @@
#include <sys/param.h>
#if defined(HAVE_LIBEDIT)
+#if defined(FreeBSD_BASE_EDITLINE)
+#include <edit/readline/readline.h>
+#else
#include <editline/readline.h>
+#endif
#elif defined(HAVE_READLINE)
#include <readline/readline.h>
#include <readline/history.h>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment