First version about Phone Call Logs parser
[barry.git] / configure.ac
blob1fdbc83b492007164a579e822fb002647d52d819
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
4 AC_PREREQ(2.61)
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.
17 AC_PROG_CC
18 AC_PROG_CXX
19 AC_PROG_MAKE_SET
20 AC_PROG_LIBTOOL
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"])
30 AC_LANG([C++])
33 # Checks for libraries.
36 # generates LIBUSB_CFLAGS and LIBUSB_LIBS for us
37 PKG_CHECK_MODULES([LIBUSB], [libusb],
38         [],
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"])
41 AC_ARG_WITH(libusb,
42         [  --with-libusb=<path>    root path of libusb installation],
43         [LIBUSB_CFLAGS="-I$with_libusb/include"
44          LIBUSB_LIBS="-L$with_libusb/lib -lusb"],
45         [])
47 AC_ARG_WITH(boost,
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
56                 BOOST_ENABLED="true"
57         fi
58 else
59         BOOST_LIB_PATH=""
60         BOOST_INC_PATH=""
61         BOOST_ENABLED="true"
64 #PKG_CHECK_MODULES([OPENSSL], [openssl])
66 PKG_CHECK_MODULES([FUSE], [fuse >= 2.5],
67         [FUSE_FOUND=1],
68         [echo "FUSE library not found, skipping fuse module."; FUSE_FOUND=0]
69         )
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)
77 AC_SUBST(LIBUSB_LIBS)
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])
87 AC_ARG_WITH(zlib,
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],
92         [
93                 AC_DEFINE([HAVE_ZLIB], [1], [Use crc32 when generating packed .cod files])
94                 AC_ARG_VAR([ZLIB_LIBS], [Linker options for zlib])
95                 ZLIB_LIBS="-lz"
96         ],
97         [
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])
102                 ZLIB_LIBS=""
103                 if test "x$force_zlib" != xno ; then
104                         AC_MSG_FAILURE([--with-zlib specified, but zlib not found])
105                 fi
106         ]
107         )
109 AM_ICONV
113 # Checks for header files.
115 AC_HEADER_DIRENT
116 AC_HEADER_STDC
117 AC_CHECK_HEADERS([assert.h stdint.h time.h])
120 # Checks for typedefs, structures, and compiler characteristics.
122 #AC_TYPE_SIZE_T
123 AC_HEADER_TIME
124 AC_STRUCT_TM
127 # Checks for library functions.
130 # checks that are buggy and need a C compiler only
131 AC_LANG([C])
132 # AC_FUNC_STRNLEN changes linker options for us, and depends on a src/strnlen.c
133 AC_FUNC_STRNLEN
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++
144 AC_LANG([C++])
145 AC_FUNC_CLOSEDIR_VOID
146 AC_PROG_GCC_TRADITIONAL
147 #AC_FUNC_MALLOC
148 #AC_FUNC_MKTIME
149 #AC_FUNC_REALLOC
150 AC_FUNC_SELECT_ARGTYPES
151 #AC_FUNC_STAT
153 AC_CHECK_FUNCS([bzero gettimeofday memset select strcasecmp strchr strerror strtol strtoul])
154 AC_C_BIGENDIAN
156 AC_CONFIG_FILES([Makefile
157                  src/Makefile
158                  tools/Makefile
159                  examples/Makefile
160                  man/Makefile
161                  libbarry-0.pc])
164 # nested packages
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"
184 AC_OUTPUT