Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into ac-harden-sqlite-detection
  • Loading branch information
Erlend E. Aasland
Erlend E. Aasland committed Apr 5, 2022
commit 64b3d69c16eb80dacf19959bf0985fe6250bb419
15 changes: 14 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

103 changes: 71 additions & 32 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3635,38 +3635,77 @@ AC_ARG_ENABLE([loadable-sqlite-extensions],
]
)

# Check for --with-tcltk-includes=path and --with-tcltk-libs=path
AC_SUBST(TCLTK_INCLUDES)
AC_SUBST(TCLTK_LIBS)
AC_MSG_CHECKING(for --with-tcltk-includes)
AC_ARG_WITH(tcltk-includes,
AS_HELP_STRING([--with-tcltk-includes='-I...'], [override search for Tcl and Tk include files]),
[],
[with_tcltk_includes="default"])
AC_MSG_RESULT($with_tcltk_includes)
AC_MSG_CHECKING(for --with-tcltk-libs)
AC_ARG_WITH(tcltk-libs,
AS_HELP_STRING([--with-tcltk-libs='-L...'], [override search for Tcl and Tk libs]),
[],
[with_tcltk_libs="default"])
AC_MSG_RESULT($with_tcltk_libs)
if test "x$with_tcltk_includes" = xdefault || test "x$with_tcltk_libs" = xdefault
then
if test "x$with_tcltk_includes" != "x$with_tcltk_libs"
then
AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
fi
if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists tcl tk; then
TCLTK_INCLUDES="`"$PKG_CONFIG" tcl tk --cflags-only-I 2>/dev/null`"
TCLTK_LIBS="`"$PKG_CONFIG" tcl tk --libs 2>/dev/null`"
else
TCLTK_INCLUDES=""
TCLTK_LIBS=""
fi
else
TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs"
fi
dnl
dnl Detect Tcl/Tk. Use pkg-config if available.
dnl
found_tcltk=no
for _QUERY in \
"tcl >= 8.5.12 tk >= 8.5.12" \
"tcl8.6 tk8.6" \
"tcl86 tk86" \
"tcl8.5 >= 8.5.12 tk8.5 >= 8.5.12" \
"tcl85 >= 8.5.12 tk85 >= 8.5.12" \
; do
PKG_CHECK_EXISTS([$_QUERY], [
PKG_CHECK_MODULES([TCLTK], [$_QUERY], [found_tcltk=yes], [found_tcltk=no])
])
AS_VAR_IF([found_tcltk], [yes], [break])
done

AS_VAR_IF([found_tcltk], [no], [
TCLTK_CFLAGS=${TCLTK_CFLAGS-""}
TCLTK_LIBS=${TCLTK_LIBS-""}
])

dnl FreeBSD has an X11 dependency which is not implicitly resolved.
AS_CASE([$ac_sys_system],
[FreeBSD*], [
PKG_CHECK_EXISTS([x11], [
PKG_CHECK_MODULES([X11], [x11], [
TCLTK_CFLAGS="$TCLTK_CFLAGS $X11_CFLAGS"
TCLTK_LIBS="$TCLTK_LIBS $X11_LIBS"
])
])
]
)

WITH_SAVE_ENV([
CPPFLAGS="$TCLTK_CFLAGS $CFLAGS"
LIBS="$TCLTK_LIBS $LDFLAGS"

AC_LINK_IFELSE([
AC_LANG_PROGRAM([
#include <tcl.h>
#include <tk.h>
#if defined(TK_HEX_VERSION)
# if TK_HEX_VERSION < 0x0805020c
# error "Tk older than 8.5.12 not supported"
# endif
#endif
#if (TCL_MAJOR_VERSION < 8) || \
((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION < 5)) || \
((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION == 5) && (TCL_RELEASE_SERIAL < 12))
# error "Tcl older than 8.5.12 not supported"
#endif
#if (TK_MAJOR_VERSION < 8) || \
((TK_MAJOR_VERSION == 8) && (TK_MINOR_VERSION < 5)) || \
((TK_MAJOR_VERSION == 8) && (TK_MINOR_VERSION == 5) && (TK_RELEASE_SERIAL < 12))
# error "Tk older than 8.5.12 not supported"
#endif
], [
void *x1 = Tcl_Init;
void *x2 = Tk_Init;
])
], [
have_tcltk=yes
dnl The X11/xlib.h file bundled in the Tk sources can cause function
dnl prototype warnings from the compiler. Since we cannot easily fix
dnl that, suppress the warnings here instead.
AS_VAR_APPEND([TCLTK_CFLAGS], [" -Wno-strict-prototypes -DWITH_APPINIT=1"])
], [
have_tcltk=no
])
])

dnl check for _gdbmmodule dependencies
dnl NOTE: gdbm does not provide a pkgconf file.
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.