aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: e16b1ed5521d7ea29af12681c066dce3ecf2c8db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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)