From 688d6565fbe84cadf64cf4c8014ed5aa7299487d Mon Sep 17 00:00:00 2001 From: Jonas Danielsson Date: Mon, 10 Jun 2013 11:33:05 +0200 Subject: [PATCH] autoconf: add --with-gtk option to enable gui --- Makefile.am | 2 ++ configure.ac | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/Makefile.am b/Makefile.am index 9c99297..538db1a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/configure.ac b/configure.ac index e8923ed..53f8278 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -- 2.47.2