]> git.draconx.ca Git - liblbx.git/blobdiff - configure.ac
build: Split out core logic from libpng detection.
[liblbx.git] / configure.ac
index eb4ff46ad35852b96fe770c4a4ccf0a24426492a..f772576636ddb174cad8a84cd3087a43a24882a5 100644 (file)
@@ -17,15 +17,31 @@ AC_PROG_CC_C99
 gl_EARLY
 
 AC_HEADER_ASSERT
-AC_C_BIGENDIAN
-
 LT_INIT
-
 gl_INIT
-
-CHECK_LIBPNG([1.2], [have_libpng=yes], [have_libpng=no])
+PKG_PROG_PKG_CONFIG
+
+AC_ARG_ENABLE([lbximg],
+       [AS_HELP_STRING([--enable-lbximg],
+               [build the lbximg tool (requires libpng) [default=auto]])],
+       [enable_lbximg=$enableval],
+       [enable_lbximg=auto])
+
+have_libpng=no
+if test x"$enable_lbximg" = x"auto"; then
+DX_CHECK_LIBPNG([1.2], [have_libpng=yes], [have_libpng=no])
+fi
+if test x"$enable_lbximg" = x"yes"; then
+DX_CHECK_LIBPNG([1.2], [have_libpng=yes])
+fi
 AM_CONDITIONAL([BUILD_LBXIMG], [test x"$have_libpng" = x"yes"])
 
+# A horrible combination of bugs makes this necessary for GTK+ detection.
+unset POSIXLY_CORRECT
+
+AM_PATH_GTK_2_0([2.16.0], [have_gtk=yes], [have_gtk=no])
+AM_CONDITIONAL([BUILD_LBXGUI], [test x"$have_gtk" = x"yes"])
+
 AC_CONFIG_FILES([
        Makefile
        lib/Makefile