1#                                               -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3
4AC_PREREQ(2.59)
5AC_INIT([dfu-util],[0.11],[http://sourceforge.net/p/dfu-util/tickets/],,[http://dfu-util.sourceforge.net])
6AC_CONFIG_AUX_DIR(m4)
7AM_INIT_AUTOMAKE([foreign])
8AC_CONFIG_HEADERS([config.h])
9
10# Test for new silent rules and enable only if they are available
11m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12
13# Checks for programs.
14AC_PROG_CC
15
16# Checks for libraries.
17# On FreeBSD the libusb-1.0 is called libusb and resides in system location
18AC_CHECK_LIB([usb], [libusb_init],, [native_libusb=no],)
19AS_IF([test x$native_libusb = xno], [
20    PKG_CHECK_MODULES([USB], [libusb-1.0 >= 1.0.0],,
21        AC_MSG_ERROR([*** Required libusb-1.0 >= 1.0.0 not installed ***]))
22])
23
24LIBS="$LIBS $USB_LIBS"
25CFLAGS="$CFLAGS $USB_CFLAGS"
26
27# Checks for header files.
28AC_HEADER_STDC
29AC_CHECK_HEADERS([windows.h sysexits.h unistd.h])
30
31# Checks for typedefs, structures, and compiler characteristics.
32AC_C_CONST
33AC_TYPE_SIZE_T
34
35# Checks for library functions.
36AC_FUNC_MEMCMP
37AC_CHECK_FUNCS([nanosleep err])
38
39# Checks how to do large files
40AC_SYS_LARGEFILE
41
42AC_CONFIG_FILES(Makefile src/Makefile doc/Makefile)
43AC_OUTPUT
44