2012-04-28 01:13:58 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.61)
|
2016-05-11 05:33:41 +00:00
|
|
|
AC_INIT([stlink],[1.2.0],[davem@devkitpro.org])
|
2016-05-05 12:46:42 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/common.c])
|
2012-04-28 21:55:23 +00:00
|
|
|
AC_CONFIG_LIBOBJ_DIR([src])
|
2012-04-28 01:13:58 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.10])
|
|
|
|
|
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_BUILD
|
2015-02-03 20:47:06 +00:00
|
|
|
AC_PROG_RANLIB
|
2012-04-28 01:13:58 +00:00
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
2012-04-28 21:55:23 +00:00
|
|
|
AC_CHECK_HEADERS(sys/mman.h)
|
2012-04-29 13:43:46 +00:00
|
|
|
AC_CHECK_HEADERS(sys/poll.h)
|
2012-05-16 21:15:38 +00:00
|
|
|
AC_REPLACE_FUNCS(mmap)
|
2012-04-28 21:55:23 +00:00
|
|
|
|
2015-09-03 08:32:12 +00:00
|
|
|
if ! hash pkg-config; then
|
|
|
|
echo "ERROR: pkg-config is needed..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2012-04-28 01:13:58 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
PKG_CHECK_MODULES(USB, libusb-1.0 >= 1.0.0,,
|
|
|
|
AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***]))
|
|
|
|
AC_CHECK_LIB([usbpath],[usb_path2devnum],,,-lusb)
|
|
|
|
|
|
|
|
LIBS="$LIBS $USB_LIBS"
|
|
|
|
CFLAGS="$CFLAGS $USB_CFLAGS"
|
|
|
|
|
2012-04-29 13:43:46 +00:00
|
|
|
case "${host}" in
|
|
|
|
*-mingw32*)
|
|
|
|
LIBS="$LIBS -lws2_32"
|
2012-04-29 17:49:08 +00:00
|
|
|
CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
|
2013-10-27 14:19:29 +00:00
|
|
|
AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
|
|
|
|
AM_CONDITIONAL(MINGW, true)
|
2012-04-29 13:43:46 +00:00
|
|
|
;;
|
2013-10-27 14:19:29 +00:00
|
|
|
*)
|
|
|
|
AM_CONDITIONAL(MINGW, false)
|
2012-04-29 13:43:46 +00:00
|
|
|
esac
|
2013-06-10 09:33:05 +00:00
|
|
|
|
2016-05-11 05:33:41 +00:00
|
|
|
STLINK_HAS_GUI=
|
|
|
|
AC_ARG_WITH([gtk_gui], AS_HELP_STRING([--with-gtk-gui], [enable GTK3+ gui]))
|
|
|
|
if test "x$with_gtk_gui" = "xyes"; then
|
|
|
|
PKG_CHECK_MODULES([GTK3], [gtk+-3.0])
|
2013-06-10 09:33:05 +00:00
|
|
|
PKG_CHECK_MODULES([GLIB], [glib-2.0 > 2.32.0])
|
2016-05-11 05:33:41 +00:00
|
|
|
STLINK_HAS_GUI=src/tools/gui
|
|
|
|
AC_CONFIG_FILES([src/tools/gui/Makefile])
|
2013-06-10 09:33:05 +00:00
|
|
|
fi
|
2016-05-11 05:33:41 +00:00
|
|
|
AC_SUBST([STLINK_HAS_GUI])
|
2013-06-10 09:33:05 +00:00
|
|
|
|
2012-04-28 01:13:58 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
|
|
|
|