Barry version 0.18.2
[barry.git] / opensync-plugin / configure.ac
blobc8dc224e77f3b669dc2e8c6594983faed0648403
1 dnl Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.61)
4 AC_INIT([Barry OpenSync Plugin], [0.18.2], [barry-devel@lists.sourceforge.net])
5 AC_CONFIG_SRCDIR(src/barry_sync.cc)
6 AC_CONFIG_HEADER(config.h)
7 AC_CONFIG_AUX_DIR([.])
8 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE(foreign)
11 AC_ISC_POSIX
12 AC_PROG_CC
13 AM_PROG_CC_STDC
14 AC_HEADER_STDC
15 AC_PROG_CXX
16 AC_DISABLE_STATIC
17 AC_PROG_LIBTOOL
19 AX_C_CHECK_FLAG([-fvisibility=hidden], [], [],
20         [HAVE_C_GCCVISIBILITY=1],
21         [HAVE_C_GCCVISIBILITY=0])
22 AX_CXX_CHECK_FLAG([-fvisibility=hidden], [], [],
23         [HAVE_CXX_GCCVISIBILITY=1],
24         [HAVE_CXX_GCCVISIBILITY=0])
25 AM_CONDITIONAL([WITH_GCCVISIBILITY], [test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"])
27 AC_LANG([C++])
29 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
30 PKG_CHECK_MODULES([OPENSYNC2X], [opensync-1.0])
31 PKG_CHECK_MODULES([BARRY], [libbarry-18])
32 PKG_CHECK_MODULES([BARRYSYNC], [libbarrysync-18])
34 # Carry the special tree build environment variables from parent configure,
35 # just in case user is doing a complete tree build with --enable-opensync-plugin
36 AC_SUBST(TREE_BUILD_CXXFLAGS)
37 AC_SUBST(TREE_BUILD_LDFLAGS)
39 OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir opensync-1.0)
40 OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir opensync-1.0)
41 OPENSYNC_FORMATSDIR=$(pkg-config --variable=formatsdir opensync-1.0)
42 OPENSYNC_HEADERDIR=$(pkg-config --variable=headerdir opensync-1.0)
44 AC_SUBST(OPENSYNC_CONFIGDIR) ## This is the place where you can install the default configuration files of your plugin
45 AC_SUBST(OPENSYNC_PLUGINDIR) ## This is the dir where you plugin will be installed
46 AC_SUBST(OPENSYNC_FORMATSDIR) ## Here are format plugins installed (if any)
47 AC_SUBST(OPENSYNC_HEADERDIR) ## Here are the headers that a user interface may need (if any)
49 AC_OUTPUT([
50 Makefile
51 src/Makefile
55 # Add a special hack at the end, to let the user disable RPATH if he wants.
57 # http://wiki.debian.org/RpathIssue
58 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
59 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
61 AC_ARG_ENABLE([rpathhack],
62         [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
63         [
64 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
65 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
66 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
67         ],
68         [])