aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@flameeyes.eu>2012-07-04 15:57:04 -0700
committerHolger Hans Peter Freyther <zecke@selfish.org>2012-07-08 16:51:35 +0200
commit432e5a6c2f5e453b7dcafecb7c9ff816029345a6 (patch)
tree52c4cde49e28780be47bf852ef9f45f6a459fe0b /configure.ac
parent201a024b67c44477225a94c6e0ce99df5c8c8134 (diff)
build: update autotools to modern standards.
This includes removing AC_CANONICAL_BUILD/AC_CANONICAL_TARGET (weren't used), renaming configure.in to configure.ac (required for automake 1.13 coming up), moving automake options to configure.ac (removes use of AM_INIT_AUTOMAKE with two parameters, which is also gone with automake 1.13). Also remove empty files and declare the system foreign, not gnu (NEWS and AUTHORS are not used), avoid re-declaring in the distributed files the conditional sources (automake takes care of that), and don't use -Werror (as it would fail to build with GCC 4.6 and 4.7). Signed-off-by: Diego Elio Pettenò <flameeyes@flameeyes.eu>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e16b1ed
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,43 @@
+AC_INIT([sam7utils], [0.2.1], [konkers@konkers.net])
+
+AC_CANONICAL_HOST
+
+AM_INIT_AUTOMAKE(foreign)
+AM_CONFIG_HEADER(config.h)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+case "${host}" in
+ *-*-darwin* )
+ LIBS="$LIBS -framework IOKIT -framework CoreFoundation"
+ have_iokit="true"
+ ;;
+ *-*-cygwin* )
+ LIBS="$LIBS -lsetupapi"
+ have_win32="true"
+ ;;
+ * )
+ have_posix="true"
+ AC_CHECK_LIB(usb,usb_init,have_libusb="true";LIBS="$LIBS -lusb")
+
+ ;;
+esac
+
+
+AC_HEADER_STDC
+
+AC_CHECK_LIB(readline, readline,,AC_MSG_ERROR(readline not found))
+AC_CHECK_LIB(curses, tgoto,,AC_MSG_ERROR(curses not found))
+AC_CHECK_HEADERS(stdint.h,,AC_MSG_WARN(can't find stdint.h))
+AC_CHECK_HEADERS(ctype.h,,)
+AC_CHECK_HEADERS(endian.h,,)
+
+
+AM_CONDITIONAL([HAVE_IOKIT], [test x$have_iokit = xtrue])
+AM_CONDITIONAL([HAVE_WIN32], [test x$have_win32 = xtrue])
+AM_CONDITIONAL([HAVE_POSIX], [test x$have_posix = xtrue])
+AM_CONDITIONAL([HAVE_LIBUSB],[test x$have_libusb = xtrue])
+
+AC_OUTPUT(Makefile)