1 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT([Barry OpenSync Plugin], [0.19.0], [barry-devel@lists.sourceforge.net])
5 AC_CONFIG_SRCDIR(src/barry_sync.cc)
6 AC_CONFIG_HEADER(config.h)
8 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE(foreign)
11 AM_GNU_GETTEXT([external])
12 # this is the version of gettext, not barry
13 AM_GNU_GETTEXT_VERSION([0.18.1])
23 AX_C_CHECK_FLAG([-fvisibility=hidden], [], [],
24 [HAVE_C_GCCVISIBILITY=1],
25 [HAVE_C_GCCVISIBILITY=0])
26 AX_CXX_CHECK_FLAG([-fvisibility=hidden], [], [],
27 [HAVE_CXX_GCCVISIBILITY=1],
28 [HAVE_CXX_GCCVISIBILITY=0])
29 AM_CONDITIONAL([WITH_GCCVISIBILITY], [test "$HAVE_C_GCCVISIBILITY" = "1" -a "$HAVE_CXX_GCCVISIBILITY" = "1"])
33 PKG_CHECK_MODULES([GLIB2], [glib-2.0])
34 PKG_CHECK_MODULES([OPENSYNC2X], [opensync-1.0])
35 PKG_CHECK_MODULES([BARRY], [libbarry-19])
36 PKG_CHECK_MODULES([BARRYSYNC], [libbarrysync-19])
38 # Carry the special tree build environment variables from parent configure,
39 # just in case user is doing a complete tree build with --enable-opensync-plugin
40 AC_SUBST(TREE_BUILD_CXXFLAGS)
41 AC_SUBST(TREE_BUILD_LDFLAGS)
43 OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir opensync-1.0)
44 OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir opensync-1.0)
45 OPENSYNC_FORMATSDIR=$(pkg-config --variable=formatsdir opensync-1.0)
46 OPENSYNC_HEADERDIR=$(pkg-config --variable=headerdir opensync-1.0)
48 AC_SUBST(OPENSYNC_CONFIGDIR) ## This is the place where you can install the default configuration files of your plugin
49 AC_SUBST(OPENSYNC_PLUGINDIR) ## This is the dir where you plugin will be installed
50 AC_SUBST(OPENSYNC_FORMATSDIR) ## Here are format plugins installed (if any)
51 AC_SUBST(OPENSYNC_HEADERDIR) ## Here are the headers that a user interface may need (if any)
60 # Add a special hack at the end, to let the user disable RPATH if he wants.
62 # http://wiki.debian.org/RpathIssue
63 # http://lists.debian.org/debian-devel/2003/debian-devel-200306/msg00569.html
64 # http://fedoraproject.org/wiki/Packaging:Guidelines#Removing_Rpath
66 AC_ARG_ENABLE([rpathhack],
67 [AC_HELP_STRING([--enable-rpathhack], [patch libtool to remove RPATH])],
69 AC_MSG_RESULT([patching libtool to fix HIDEOUS BREAKAGE])
70 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
71 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool