- moved Interface implementation to usbwrap.cc file
[barry.git] / configure.ac
blob2e6a1c12c39ea213d6431fbee566f2240ed28f2c
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT([barry], [0.8], [barry-devel@lists.sourceforge.net])
6 #AM_CONFIG_HEADER(config.h)
7 AC_CONFIG_SRCDIR([src/barry.h])
8 AC_CONFIG_HEADERS([config.h:config.h.in])
9 AM_INIT_AUTOMAKE
11 # Checks for programs.
12 AC_PROG_CC
13 AC_PROG_CXX
14 AC_PROG_MAKE_SET
15 AC_PROG_LIBTOOL
17 AC_LANG([C++])
19 # generates LIBUSB_CFLAGS and LIBUSB_LIBS for us
20 PKG_CHECK_MODULES([LIBUSB], [libusb],
21         [],
22         [echo "ERROR: Libusb not found automatically... build may fail if you don't specify --with-libusb";LIBUSB_CFLAGS="-I/usr/include" LIBUSB_LIBS="-lusb"])
24 AC_ARG_WITH(libusb,
25         [  --with-libusb=<path>    root path of libusb installation],
26         [LIBUSB_CFLAGS="-I$with_libusb/include"
27          LIBUSB_LIBS="-L$with_libusb/lib -lusb"],
28         [])
30 AC_ARG_WITH(boost,
31         AC_HELP_STRING(--with-boost[=path],
32                 [root path of boost installation (no arg defaults to 'yes' and uses system path]),
33         use_boost=$withval,  use_boost=no ) 
35 if test x"$use_boost" != "xyes" ; then
36         if test x"$use_boost" != "xno" ; then
37                 BOOST_LIB_PATH=$use_boost/lib
38                 BOOST_INC_PATH=$use_boost/include
39                 BOOST_ENABLED="true"
40         fi
41 else
42         BOOST_LIB_PATH="/usr/lib"
43         BOOST_INC_PATH="/usr/include"
44         BOOST_ENABLED="true"    
47 PKG_CHECK_MODULES([OPENSSL], [openssl])
49 pkgconfigdir=${libdir}/pkgconfig
50 AC_SUBST(pkgconfigdir)
52 AC_SUBST(BOOST_LIB_PATH)
53 AC_SUBST(BOOST_INC_PATH)
54 AC_SUBST(LIBUSB_CFLAGS)
55 AC_SUBST(LIBUSB_LIBS)
57 AM_CONDITIONAL([WITH_BOOST], [test "$BOOST_ENABLED" = "true"])
59 # Checks for libraries.
60 #AC_CHECK_LIB([IOKit], [main])
61 AC_CHECK_LIB([pthread], [main])
62 #AC_CHECK_LIB([libusb], [libusb_init])
64 # Checks for header files.
65 AC_HEADER_DIRENT
66 AC_HEADER_STDC
67 AC_CHECK_HEADERS([assert.h stdint.h time.h])
69 # Checks for typedefs, structures, and compiler characteristics.
70 #AC_TYPE_SIZE_T
71 AC_HEADER_TIME
72 AC_STRUCT_TM
74 # Checks for library functions.
75 AC_FUNC_CLOSEDIR_VOID
76 AC_PROG_GCC_TRADITIONAL
77 AC_FUNC_MALLOC
78 AC_FUNC_MKTIME
79 AC_FUNC_REALLOC
80 AC_FUNC_SELECT_ARGTYPES
81 AC_FUNC_STAT
82 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
83 AC_C_BIGENDIAN
85 AC_CONFIG_FILES([Makefile
86                  src/Makefile
87                  tools/Makefile
88                  examples/Makefile
89                  man/Makefile
90                  libbarry-0.pc])
91 AC_OUTPUT