diff --git a/configure b/configure index d1f21b8a08529c..ec4b7febdb4e2f 100755 --- a/configure +++ b/configure @@ -819,6 +819,8 @@ DFLAGS DTRACE GDBM_LIBS GDBM_CFLAGS +X11_LIBS +X11_CFLAGS TCLTK_LIBS TCLTK_CFLAGS LIBSQLITE3_LIBS @@ -1075,6 +1077,8 @@ LIBSQLITE3_CFLAGS LIBSQLITE3_LIBS TCLTK_CFLAGS TCLTK_LIBS +X11_CFLAGS +X11_LIBS GDBM_CFLAGS GDBM_LIBS ZLIB_CFLAGS @@ -1875,6 +1879,8 @@ Some influential environment variables: TCLTK_CFLAGS C compiler flags for TCLTK, overriding pkg-config TCLTK_LIBS linker flags for TCLTK, overriding pkg-config + X11_CFLAGS C compiler flags for X11, overriding pkg-config + X11_LIBS linker flags for X11, overriding pkg-config GDBM_CFLAGS C compiler flags for gdbm GDBM_LIBS additional linker flags for gdbm ZLIB_CFLAGS C compiler flags for ZLIB, overriding pkg-config @@ -12365,6 +12371,109 @@ if test "x$found_tcltk" = xno; then : fi +case $ac_sys_system in #( + FreeBSD*) : + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11" >&5 +$as_echo_n "checking for X11... " >&6; } + +if test -n "$X11_CFLAGS"; then + pkg_cv_X11_CFLAGS="$X11_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$X11_LIBS"; then + pkg_cv_X11_LIBS="$X11_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11" 2>&1` + else + X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$X11_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (x11) were not met: + +$X11_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables X11_CFLAGS +and X11_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables X11_CFLAGS +and X11_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + X11_CFLAGS=$pkg_cv_X11_CFLAGS + X11_LIBS=$pkg_cv_X11_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + TCLTK_CFLAGS="$TCLTK_CFLAGS $X11_CFLAGS" + TCLTK_LIBS="$TCLTK_LIBS $X11_LIBS" + +fi + + ;; #( + *) : + ;; +esac + save_CFLAGS=$CFLAGS save_CPPFLAGS=$CPPFLAGS save_LDFLAGS=$LDFLAGS diff --git a/configure.ac b/configure.ac index 61be89645d30a8..e7d595b3b4907d 100644 --- a/configure.ac +++ b/configure.ac @@ -3519,6 +3519,16 @@ AS_VAR_IF([found_tcltk], [no], [ TCLTK_LIBS=${TCLTK_LIBS-""} ]) +dnl FreeBSD has an X11 dependency which is not implicitly resolved. +AS_CASE([$ac_sys_system], + [FreeBSD*], [ + 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"