Align loader to 32-bit boundary
[fw/stlink] / configure.ac
index 761591a6b68b438da1cd65eb904d57bae2ff277b..203cc6bd59e507698b85d97bcd811dcc63653eda 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.61)
-AC_INIT([stlink],[0.5.1],[davem@devkitpro.org])
+AC_INIT([stlink],[0.5.6],[davem@devkitpro.org])
 AC_CONFIG_SRCDIR([src/stlink-common.c])
 AC_CONFIG_LIBOBJ_DIR([src])
 AM_INIT_AUTOMAKE([1.10])
@@ -18,8 +18,12 @@ AM_PROG_CC_C_O
 
 AC_CHECK_HEADERS(sys/mman.h)
 AC_CHECK_HEADERS(sys/poll.h)
-AC_CHECK_FUNCS(mmap)
-AC_REPLACE_FUNCS(mmap pread)
+AC_REPLACE_FUNCS(mmap)
+
+if ! hash pkg-config; then
+       echo "ERROR: pkg-config is needed..."
+       exit 1
+fi 
 
 # Checks for libraries.
 PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,,
@@ -33,8 +37,23 @@ case "${host}" in
        *-mingw32*)
                LIBS="$LIBS -lws2_32"
                CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
+               AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
+               AM_CONDITIONAL(MINGW, true)
        ;;
+       *)
+               AM_CONDITIONAL(MINGW, false)
 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