autoconf: add --with-gtk option to enable gui
authorJonas Danielsson <jonas@threetimestwo.org>
Mon, 10 Jun 2013 09:33:05 +0000 (11:33 +0200)
committerJonas Danielsson <jonas@threetimestwo.org>
Mon, 10 Jun 2013 14:48:31 +0000 (16:48 +0200)
Makefile.am
configure.ac

index 9c99297ecc80f324ef5ba2d655d1ab138edd3010..538db1a878f0f261b938eaf80fc81f1e5e27efd9 100644 (file)
@@ -1,5 +1,7 @@
 # Makefile.am -- Process this file with automake to produce Makefile.in
 
+SUBDIRS = . $(MAYBE_GUI)
+
 AUTOMAKE_OPTIONS = subdir-objects
 
 bin_PROGRAMS = st-flash st-util st-term
index e8923ed364a65dd2952e76159aefa2377dc00207..53f827893bda37e5128344c841cf83455ac57f89 100644 (file)
@@ -34,6 +34,17 @@ case "${host}" in
                CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
        ;;
 esac
+
+MAYBE_GUI=
+AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk], [enable GTK+ gui]))
+if test "x$with_gtk" = "xyes"; then
+      PKG_CHECK_MODULES([GTK], [gtk+-3.0])
+      PKG_CHECK_MODULES([GLIB], [glib-2.0 > 2.32.0])
+      MAYBE_GUI=gui
+      AC_CONFIG_FILES([gui/Makefile])
+fi
+AC_SUBST([MAYBE_GUI])
+
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT