- opensync plugin:
[barry.git] / configure.ac
blobb5aa9e89e662e0057779e76c67b2ceeeb46b7da1
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.59)
5 AC_INIT([barry], [0.7], [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         [  --with-boost=<path>     root path of boost installation (default=no boost)],
32         [BOOST_LIB_PATH="$with_boost/lib"
33          BOOST_INC_PATH="$with_boost/include"
34          BOOST_ENABLED="true"],
35         [BOOST_LIB_PATH="/usr/lib"
36          BOOST_INC_PATH="/usr/include"])
38 PKG_CHECK_MODULES([OPENSSL], [openssl])
40 pkgconfigdir=${libdir}/pkgconfig
41 AC_SUBST(pkgconfigdir)
43 AC_SUBST(BOOST_LIB_PATH)
44 AC_SUBST(BOOST_INC_PATH)
45 AC_SUBST(LIBUSB_CFLAGS)
46 AC_SUBST(LIBUSB_LIBS)
48 AM_CONDITIONAL([WITH_BOOST], [test "$BOOST_ENABLED" = "true"])
50 # Checks for libraries.
51 #AC_CHECK_LIB([IOKit], [main])
52 AC_CHECK_LIB([pthread], [main])
53 #AC_CHECK_LIB([libusb], [libusb_init])
55 # Checks for header files.
56 AC_HEADER_DIRENT
57 AC_HEADER_STDC
58 AC_CHECK_HEADERS([assert.h stdint.h time.h])
60 # Checks for typedefs, structures, and compiler characteristics.
61 #AC_TYPE_SIZE_T
62 AC_HEADER_TIME
63 AC_STRUCT_TM
65 # Checks for library functions.
66 AC_FUNC_CLOSEDIR_VOID
67 AC_PROG_GCC_TRADITIONAL
68 AC_FUNC_MALLOC
69 AC_FUNC_MKTIME
70 AC_FUNC_REALLOC
71 AC_FUNC_SELECT_ARGTYPES
72 AC_FUNC_STAT
73 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
74 AC_C_BIGENDIAN
76 AC_CONFIG_FILES([Makefile
77                  src/Makefile
78                  tools/Makefile
79                  examples/Makefile
80                  man/Makefile
81                  libbarry-0.pc])
82 AC_OUTPUT