configure.ac: drop auto-detection of features
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 4 Apr 2017 01:10:29 +0000 (11:10 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 4 Apr 2017 01:10:29 +0000 (11:10 +1000)
During the work with meson I realised auto-detection is not a good solution.
Our dependencies should be well-defined for what is considered 'normal' and
explicitly defined for any deviation from that normal build.

The normal build includes docs, tools, tests, etc. because we expect
developers to find errors in any of those. A distribution build may exclude
some of these bits, but it should be explicitly specified by the distribution
rather than having our build system guess what's not needed.

This patch drops any auto-detection of features and replaces it with a hard
yes/no.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
configure.ac

index 55dd8ef..61a964c 100644 (file)
@@ -105,51 +105,41 @@ AC_SUBST(UDEV_DIR)
 ################################
 AC_ARG_ENABLE([documentation],
              [AC_HELP_STRING([--enable-documentation],
-                             [Enable building the documentation (default=auto)])],
+                             [Enable building the documentation (default=yes)])],
              [build_documentation="$enableval"],
-             [build_documentation="auto"])
+             [build_documentation="yes"])
 
-if test "x$build_documentation" = "xyes" -o "x$build_documentation" = "xauto"; then
+if test "x$build_documentation" = "xyes"; then
        AC_PATH_PROG(DOXYGEN, doxygen)
        if test "x$DOXYGEN" = "x"; then
-               if test "x$build_documentation" = "xyes"; then
-                       AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
-               fi
-       else
-               AC_MSG_CHECKING([for compatible doxygen version])
-               doxygen_version=`$DOXYGEN --version`
-               AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
-                                  [AC_MSG_RESULT([no])
-                                   DOXYGEN=""],
-                                  [AC_MSG_RESULT([yes])],
-                                  [AC_MSG_RESULT([yes])])
-               if test "x$DOXYGEN" = "x" -a "x$build_documentation" = "xyes"; then
-                       AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 1.6+ required for documentation build. Install required doxygen version or disable the documentation using --disable-documentation])
-               fi
+               AC_MSG_ERROR([Documentation build requested but doxygen not found. Install doxygen or disable the documentation using --disable-documentation])
+       fi
+
+       AC_MSG_CHECKING([for compatible doxygen version])
+       doxygen_version=`$DOXYGEN --version`
+       AS_VERSION_COMPARE([$doxygen_version], [1.6.0],
+                          [AC_MSG_RESULT([no])
+                           DOXYGEN=""],
+                          [AC_MSG_RESULT([yes])],
+                          [AC_MSG_RESULT([yes])])
+       if test "x$DOXYGEN" = "x"; then
+               AC_MSG_ERROR([Doxygen $doxygen_version too old. Doxygen 1.6+ required for documentation build. Install required doxygen version or disable the documentation using --disable-documentation])
        fi
 
        AC_PATH_PROG(DOT, dot)
        if test "x$DOT" = "x"; then
-               if test "x$build_documentation" = "xyes"; then
-                       AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
-               fi
-       else
-               AC_MSG_CHECKING([for compatible dot version])
-               dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'`
-               AS_VERSION_COMPARE([$dot_version], [2.26.0],
-                                  [AC_MSG_RESULT([no])
-                                   DOT=""],
-                                  [AC_MSG_RESULT([yes])],
-                                  [AC_MSG_RESULT([yes])])
-               if test "x$DOT" = "x" -a "x$build_documentation" = "xyes"; then
-                       AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])
-               fi
+               AC_MSG_ERROR([Documentation build requested but graphviz's dot not found. Install graphviz or disable the documentation using --disable-documentation])
        fi
 
-       if test "x$DOXYGEN" != "x" -a "x$DOT" != "x"; then
-               build_documentation="yes"
-       else
-               build_documentation="no"
+       AC_MSG_CHECKING([for compatible dot version])
+       dot_version=`$DOT -V 2>&1|$GREP -oP '(?<=version\W)@<:@0-9.@:>@*(?=\W(.*))'`
+       AS_VERSION_COMPARE([$dot_version], [2.26.0],
+                          [AC_MSG_RESULT([no])
+                           DOT=""],
+                          [AC_MSG_RESULT([yes])],
+                          [AC_MSG_RESULT([yes])])
+       if test "x$DOT" = "x"; then
+               AC_MSG_ERROR([Graphviz dot $dot_version too old. Graphviz 2.26+ required for documentation build. Install required graphviz version or disable the documentation using --disable-documentation])
        fi
 fi
 
@@ -157,14 +147,10 @@ fi
 # enable/disable event gui debugging tool #
 ###########################################
 AC_ARG_ENABLE(event-gui,
-             AS_HELP_STRING([--enable-event-gui], [Build the GUI event viewer (default=auto)]),
+             AS_HELP_STRING([--enable-event-gui], [Build the GUI event viewer (default=yes)]),
              [build_eventgui="$enableval"],
-             [build_eventgui="auto"])
-PKG_CHECK_EXISTS([cairo glib-2.0 gtk+-3.0], [HAVE_GUILIBS="yes"], [HAVE_GUILIBS="no"])
+             [build_eventgui="yes"])
 
-if test "x$build_eventgui" = "xauto"; then
-       build_eventgui="$HAVE_GUILIBS"
-fi
 if test "x$build_eventgui" = "xyes"; then
        PKG_CHECK_MODULES(CAIRO, [cairo])
        PKG_CHECK_MODULES(GTK, [glib-2.0 gtk+-3.0])
@@ -174,36 +160,24 @@ fi
 # enable/disable tests #
 ########################
 AC_ARG_ENABLE(tests,
-             AS_HELP_STRING([--enable-tests], [Build the tests (default=auto)]),
+             AS_HELP_STRING([--enable-tests], [Build the tests (default=yes)]),
              [build_tests="$enableval"],
-             [build_tests="auto"])
+             [build_tests="yes"])
 
-PKG_CHECK_MODULES(CHECK, [check >= 0.9.10], [HAVE_CHECK="yes"], [HAVE_CHECK="no"])
 
-if test "x$build_tests" = "xauto"; then
-       build_tests="$HAVE_CHECK"
-fi
 if test "x$build_tests" = "xyes"; then
-       if test "x$HAVE_CHECK" = "xno"; then
-               AC_MSG_ERROR([Cannot build tests, check is missing])
-       fi
+       PKG_CHECK_MODULES(CHECK, [check >= 0.9.10])
 
        AC_PATH_PROG(VALGRIND, [valgrind])
 
        AC_ARG_WITH(libunwind,
                    AS_HELP_STRING([--without-libunwind],[Do not use libunwind]))
 
-       AS_IF([test "x$with_libunwind" != "xno"],
-               [PKG_CHECK_MODULES(LIBUNWIND,
-                         [libunwind],
-                         [HAVE_LIBUNWIND=yes],
-                         [HAVE_LIBUNWIND=no])],
-               [HAVE_LIBUNWIND=no])
-
-       AS_IF([test "x$HAVE_LIBUNWIND" = "xyes"],
-               [AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])],
-               [AS_IF([test "x$with_libunwind" = "xyes"],
-                       [AC_MSG_ERROR([libunwind requested but not found])])])
+       if test "x$with_libunwind" != "xno"; then
+               PKG_CHECK_MODULES(LIBUNWIND, [libunwind])
+               AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
+               HAVE_LIBUNWIND="yes"
+       fi
 
        AC_PATH_PROG(ADDR2LINE, [addr2line])
        if test "x$ADDR2LINE" != "x"; then