2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([barry], [0.15], [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 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([dist-bzip2])
12 AC_USE_SYSTEM_EXTENSIONS
15 # Checks for programs.
22 AX_C_CHECK_FLAG([-fvisibility=hidden], [], [],
23 [HAVE_C_GCCVISIBILITY=1],
24 [HAVE_C_GCCVISIBILITY=0])
25 AX_CXX_CHECK_FLAG([-fvisibility=hidden], [], [],
26 [HAVE_CXX_GCCVISIBILITY=1],
27 [HAVE_CXX_GCCVISIBILITY=0])
28 AM_CONDITIONAL([WITH_GCCVISIBILITY], [test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"])
33 # Checks for libraries.
36 # generates LIBUSB_CFLAGS and LIBUSB_LIBS for us
37 PKG_CHECK_MODULES([LIBUSB], [libusb],
39 [echo "ERROR: Libusb not found automatically... build may fail if you don't specify --with-libusb";LIBUSB_CFLAGS="-I/usr/include" LIBUSB_LIBS="-lusb"])
42 [ --with-libusb=<path> root path of libusb installation],
43 [LIBUSB_CFLAGS="-I$with_libusb/include"
44 LIBUSB_LIBS="-L$with_libusb/lib -lusb"],
48 AC_HELP_STRING(--with-boost[=path],
49 [root path of boost installation (no arg defaults to 'yes' and uses system paths)]),
50 use_boost=$withval, use_boost=no )
52 if test x"$use_boost" != "xyes" ; then
53 if test x"$use_boost" != "xno" ; then
54 BOOST_LIB_PATH=$use_boost/lib
55 BOOST_INC_PATH=$use_boost/include
64 #PKG_CHECK_MODULES([OPENSSL], [openssl])
66 PKG_CHECK_MODULES([FUSE], [fuse >= 2.5],
68 [echo "FUSE library not found, skipping fuse module."; FUSE_FOUND=0]
71 pkgconfigdir=${libdir}/pkgconfig
72 AC_SUBST(pkgconfigdir)
74 AC_SUBST(BOOST_LIB_PATH)
75 AC_SUBST(BOOST_INC_PATH)
76 AC_SUBST(LIBUSB_CFLAGS)
79 AM_CONDITIONAL([WITH_BOOST], [test "$BOOST_ENABLED" = "true"])
80 AM_CONDITIONAL([WITH_BOOST_PATHS], [test -n "$BOOST_LIB_PATH"])
81 AM_CONDITIONAL([WITH_FUSE], [test "$FUSE_FOUND" = "1"])
83 #AC_CHECK_LIB([IOKit], [main])
84 #AC_CHECK_LIB([libusb], [libusb_init])
85 AC_CHECK_LIB([pthread], [main])
88 AC_HELP_STRING(--with-zlib, [force usage of zlib, and halt if not available]),
89 force_zlib=$withval, force_zlib=no )
91 AC_CHECK_LIB([z], [crc32],
93 AC_DEFINE([HAVE_ZLIB], [1], [Use crc32 when generating packed .cod files])
94 AC_ARG_VAR([ZLIB_LIBS], [Linker options for zlib])
98 echo "*****************************************************************"
99 echo "WARNING: zlib not found... packed .cod files will fail crc checks"
100 echo "*****************************************************************"
101 AC_ARG_VAR([ZLIB_LIBS], [Linker options for zlib])
103 if test "x$force_zlib" != xno ; then
104 AC_MSG_FAILURE([--with-zlib specified, but zlib not found])
113 # Checks for header files.
117 AC_CHECK_HEADERS([assert.h stdint.h time.h])
120 # Checks for typedefs, structures, and compiler characteristics.
127 # Checks for library functions.
130 # checks that are buggy and need a C compiler only
132 # AC_FUNC_STRNLEN changes linker options for us, and depends on a src/strnlen.c
134 if test $ac_cv_func_strnlen_working = yes ; then
135 AC_DEFINE([HAVE_WORKING_STRNLEN], 1,
136 [Define to 1 if a working strnlen exists.])
138 if test $ac_cv_func_strnlen_working = no ; then
139 AC_DEFINE([HAVE_WORKING_STRNLEN], 0,
140 [Define to 1 if a working strnlen exists, 0 if not.])
143 # checks that work with C++
145 AC_FUNC_CLOSEDIR_VOID
146 AC_PROG_GCC_TRADITIONAL
150 AC_FUNC_SELECT_ARGTYPES
153 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
156 AC_CONFIG_FILES([Makefile
166 AC_ARG_ENABLE([gui], [AC_HELP_STRING([--enable-gui], [build the gui])])
167 if test "$enable_gui" = yes; then
168 AC_CONFIG_SUBDIRS([gui])
170 AC_ARG_ENABLE([opensync-plugin], [AC_HELP_STRING([--enable-opensync-plugin], [build the opensync plugin])])
171 if test "$enable_opensync_plugin" = yes; then
172 AC_CONFIG_SUBDIRS([opensync-plugin])
174 AC_ARG_ENABLE([opensync-plugin-4x], [AC_HELP_STRING([--enable-opensync-plugin-4x], [build the opensync 0.4x plugin])])
175 if test "$enable_opensync_plugin_4x" = yes; then
176 AC_CONFIG_SUBDIRS([opensync-plugin-0.4x])
178 if test "$enable_gui" = yes || test "$enable_opensync_plugin" = yes || test "$enable_opensync_plugin_4x" = yes; then
179 export TREE_BUILD_CXXFLAGS="-I`pwd`"
180 export TREE_BUILD_LDFLAGS="-L`pwd`/src"
181 export PKG_CONFIG_PATH="`pwd`:$PKG_CONFIG_PATH"