File: configure.ac

package info (click to toggle)
libopensync-plugin-syncml 0.22-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,476 kB
  • ctags: 106
  • sloc: sh: 8,767; ansic: 1,146; makefile: 75
file content (100 lines) | stat: -rw-r--r-- 3,073 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.58)
AC_INIT([OpenSync SyncML Plugin], 0.22, [], [libopensync-plugin-syncml])
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_SRCDIR(src/syncml_plugin.c)
AC_CONFIG_HEADER(config.h)

export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/lib/pkgconfig:$prefix/lib/pkgconfig:/usr/local/lib/pkgconfig
pkg_modules="opensync-1.0 glib-2.0 libsyncml-1.0 >= 0.4.0 libxml-2.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL

OPENSYNC_CONFIGDIR=$(pkg-config --variable=configdir opensync-1.0)
OPENSYNC_PLUGINDIR=$(pkg-config --variable=plugindir opensync-1.0)
OPENSYNC_FORMATSDIR=$(pkg-config --variable=formatsdir opensync-1.0)
OPENSYNC_HEADERDIR=$(pkg-config --variable=headerdir opensync-1.0)

AC_SUBST(OPENSYNC_CONFIGDIR) ## This is the place where you can install the default configuration files of your plugin
AC_SUBST(OPENSYNC_PLUGINDIR) ## This is the dir where you plugin will be installed
AC_SUBST(OPENSYNC_FORMATSDIR) ## Here are format plugins installed (if any)
AC_SUBST(OPENSYNC_HEADERDIR) ## Here are the headers that a user interface may need (if any)


#### Check for libsoup ####
AC_ARG_ENABLE(http, AC_HELP_STRING([--disable-http],[disable http support]),enable_http=$enableval, enable_http=auto)

if test x$enable_http != xno; then
	PKG_CHECK_MODULES(LIBSOUP, libsoup-2.2 >= 2.2.91, HAVE_LIBSOUP=yes, HAVE_LIBSOUP=no)
	if test "x${HAVE_LIBSOUP}" = "xyes"; then
		AC_SUBST(LIBSOUP_CFLAGS)
		AC_SUBST(LIBSOUP_LIBS)
		ENABLE_HTTP=yes
		AC_SUBST(ENABLE_HTTP)
		AC_DEFINE(ENABLE_HTTP,1,[Http support])
	else
		AC_MSG_ERROR("Libsoup not found")
	fi
else
	ENABLE_HTTP=no
fi
AM_CONDITIONAL(ENABLE_HTTP, test x$HAVE_LIBSOUP = xyes)


#### Check for openobex ####
AC_ARG_ENABLE(obex, AS_HELP_STRING([--disable-obex],[diable obex support]),enable_obex=$enableval, enable_obex=auto)

if test x$enable_obex != xno; then
	PKG_CHECK_MODULES(LIBOPENOBEX, openobex >= 1.1, HAVE_OPENOBEX=yes, HAVE_OPENOBEX=no)
	if test "x${HAVE_OPENOBEX}" = "xyes"; then
                AC_SUBST(LIBOPENOBEX_CFLAGS)
                AC_SUBST(LIBOPENOBEX_LIBS)
                ENABLE_OBEX=yes
                AC_SUBST(ENABLE_OBEX)
                AC_DEFINE(ENABLE_OBEX,1,[Obex support])
	else
                AC_MSG_ERROR("OpenObex not found")
	fi
else
	ENABLE_OBEX=no
fi
AM_CONDITIONAL(ENABLE_OBEX, test x$HAVE_OPENOBEX = xyes)


#### plausibility check ####
if test "x$ENABLE_HTTP" != "xyes"; then
	if test "x$ENABLE_OBEX" != "xyes"; then
		AC_MSG_ERROR("No transport protocol activated. Please enable http and/or obex support.")
	fi
fi


AC_OUTPUT([
Makefile
src/Makefile
])


echo
echo =========================
echo supported transports:
if test "x$ENABLE_HTTP" = "xyes"; then
    echo http support is ENABLED.
else
    echo http support is DISABLED.
fi
if test "x$ENABLE_OBEX" = "xyes"; then
    echo obex support is ENABLED.
else
    echo obex support is DISABLED.
fi
echo =========================