aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac42
1 files changed, 26 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 689e8c1..9d5f74d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,30 @@ AC_SUBST(SCINTILLA_CXXFLAGS)
# Necessary so we can change their default values here
AC_SUBST(AM_CPPFLAGS)
+# This cannot be done with --enable-static as it only controls
+# which kind of libraries libtool builds.
+# Also, it cannot be controlled reliably by setting LDFLAGS for
+# ./configure, as this would be used for linking the test cases
+# without libtool and libtool would ignore it.
+# It is only possible to call `make LDFLAGS="-all-static"` but
+# this is inconvenient...
+AC_ARG_ENABLE(static-executables,
+ AS_HELP_STRING([--enable-static-executables],
+ [Link in as many runtime dependencies as possible
+ statically [default=no]]),
+ [static_executables=$enableval], [static_executables=no])
+AM_CONDITIONAL(STATIC_EXECUTABLES, [test x$static_executables = xyes])
+
+# Wrapper around PKG_CHECK_MODULES(), but takes --enable-static-executables
+# into account.
+AC_DEFUN([TE_CHECK_MODULES], [
+ AS_IF([test x$static_executables = xyes], [
+ PKG_CHECK_MODULES_STATIC([$1], [$2], [$3], [$4])
+ ], [
+ PKG_CHECK_MODULES([$1], [$2], [$3], [$4])
+ ])
+])
+
# Auxiliary functions
# expand $1 and print its absolute path
@@ -135,7 +159,7 @@ AC_SUBST(DOXYGEN_HAVE_DOT)
AC_CHECK_PROG(SCITECO, sciteco, sciteco)
# Checks for libraries.
-PKG_CHECK_MODULES(LIBGLIB, [glib-2.0 >= 2.44 gmodule-2.0], [
+TE_CHECK_MODULES(LIBGLIB, [glib-2.0 >= 2.44 gmodule-2.0], [
CFLAGS="$CFLAGS $LIBGLIB_CFLAGS"
CXXFLAGS="$CXXFLAGS $LIBGLIB_CFLAGS"
LIBS="$LIBS $LIBGLIB_LIBS"
@@ -371,7 +395,7 @@ case $INTERFACE in
;;
gtk)
- PKG_CHECK_MODULES(LIBGTK, [gtk+-3.0 >= 3.24], [
+ TE_CHECK_MODULES(LIBGTK, [gtk+-3.0 >= 3.24], [
CFLAGS="$CFLAGS $LIBGTK_CFLAGS"
CXXFLAGS="$CXXFLAGS $LIBGTK_CFLAGS"
LIBS="$LIBS $LIBGTK_LIBS"
@@ -475,20 +499,6 @@ else
esac
fi
-# This cannot be done with --enable-static as it only controls
-# which kind of libraries libtool builds.
-# Also, it cannot be controlled reliably by setting LDFLAGS for
-# ./configure, as this would be used for linking the test cases
-# without libtool and libtool would ignore it.
-# It is only possible to call `make LDFLAGS="-all-static"` but
-# this is inconvenient...
-AC_ARG_ENABLE(static-executables,
- AS_HELP_STRING([--enable-static-executables],
- [Link in as many runtime dependencies as possible
- statically [default=no]]),
- [static_executables=$enableval], [static_executables=no])
-AM_CONDITIONAL(STATIC_EXECUTABLES, [test x$static_executables = xyes])
-
AC_ARG_WITH(launcher,
AS_HELP_STRING([--with-launcher=LAUNCHER],
[Use the given launcher when executing SciTECO (e.g. wine)]),