From: Jonas Danielsson Date: Mon, 10 Jun 2013 09:33:05 +0000 (+0200) Subject: autoconf: add --with-gtk option to enable gui X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=688d6565fbe84cadf64cf4c8014ed5aa7299487d;p=fw%2Fstlink autoconf: add --with-gtk option to enable gui --- 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