File: configure.ac

package info (click to toggle)
u3-tool 0.3-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 688 kB
  • ctags: 278
  • sloc: sh: 3,789; ansic: 2,191; makefile: 12
file content (72 lines) | stat: -rw-r--r-- 1,994 bytes parent folder | download | duplicates (4)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(u3-tool, 0.3, daviedev@users.sourceforge.net)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_INSTALL

# Parse arguments
AC_ARG_ENABLE([libusb],
     [  --enable-libusb    Force using libUSB subsystem instead of platform specific],
     [case "${enableval}" in
       yes) force_libusb=true ;;
       no)  force_libusb=false ;;
       *) AC_MSG_ERROR([bad value ${enableval} for --enable-libusb]) ;;
     esac],[force_libusb=false])

# Determine subsystem
AS_IF([test x$force_libusb = xtrue],
	[ subsystem=libusb ],
	[ AS_CASE([$host_os],
		[linux*], [subsystem=sg],
		[mingw32], [subsystem=spt],
		[subsystem=libusb])]
	)

AS_IF([test x$subsystem = xlibusb ], [ AC_DEFINE([SUBSYS_LIBUSB], [1], [Use libusb subsystem]) ])
AS_IF([test x$subsystem = xsg ], [ AC_DEFINE([SUBSYS_SG], [1], [Use sg subsystem]) ])
AS_IF([test x$subsystem = xspt ], [ AC_DEFINE([SUBSYS_SPT], [1], [Use spt subsystem]) ])

# Checks for libraries.
#FIXME: PKG_CHECK_MODULES not provided on MinGW
#AS_IF([ test x$subsystem = xlibusb ],
#	[ PKG_CHECK_MODULES([LIBUSB], [libusb],
#		[  ],
#		[ AC_MSG_FAILURE([libusb is required but not found.]) ])
#	])

# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([arpa/inet.h fcntl.h stdint.h stdlib.h string.h sys/ioctl.h termios.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_CHECK_FUNCS([memset regcomp strdup strerror strtoul])

AC_CONFIG_FILES([Makefile
                 doc/Makefile
                 src/Makefile])
AC_OUTPUT

echo ""
echo "Subsystem:     ${subsystem}"
echo ""