1 | # evolution/acinclude.m4 |
---|
2 | # shared configure.in hacks between Evolution and Connector |
---|
3 | |
---|
4 | |
---|
5 | # EVO_PURIFY_SUPPORT |
---|
6 | # Add --enable-purify. If the user turns it on, subst PURIFY and set |
---|
7 | # the automake conditional ENABLE_PURIFY |
---|
8 | AC_DEFUN([EVO_PURIFY_SUPPORT], [ |
---|
9 | AC_ARG_ENABLE(purify, |
---|
10 | [ --enable-purify=[no/yes] Enable support for building executables with Purify.],,enable_purify=no) |
---|
11 | AC_PATH_PROG(PURIFY, purify, impure) |
---|
12 | AC_ARG_WITH(purify-options, [ --with-purify-options=OPTIONS Options passed to the purify command line (defaults to PURIFYOPTIONS variable).]) |
---|
13 | if test "x$with_purify_options" = "xno"; then |
---|
14 | with_purify_options="-always-use-cache-dir=yes -cache-dir=/gnome/lib/purify" |
---|
15 | fi |
---|
16 | if test "x$PURIFYOPTIONS" = "x"; then |
---|
17 | PURIFYOPTIONS=$with_purify_options |
---|
18 | fi |
---|
19 | AC_SUBST(PURIFY) |
---|
20 | AM_CONDITIONAL(ENABLE_PURIFY, test "x$enable_purify" = "xyes" -a "x$PURIFY" != "ximpure") |
---|
21 | PURIFY="$PURIFY $PURIFYOPTIONS" |
---|
22 | ]) |
---|
23 | |
---|
24 | |
---|
25 | # EVO_LDAP_CHECK(default) |
---|
26 | # Add --with-openldap and --with-static-ldap options. --with-openldap |
---|
27 | # defaults to the given value if not specified. If LDAP support is |
---|
28 | # configured, HAVE_LDAP will be defined and the automake conditional |
---|
29 | # ENABLE_LDAP will be set. LDAP_CFLAGS and LDAP_LIBS will be set |
---|
30 | # appropriately. |
---|
31 | AC_DEFUN([EVO_LDAP_CHECK], [ |
---|
32 | default="$1" |
---|
33 | |
---|
34 | AC_ARG_WITH(openldap, [ --with-openldap=[no/yes/PREFIX] Enable LDAP support in evolution]) |
---|
35 | AC_ARG_WITH(static-ldap, [ --with-static-ldap=[no/yes] Link LDAP support statically into evolution ]) |
---|
36 | AC_CACHE_CHECK([for OpenLDAP], ac_cv_with_openldap, ac_cv_with_openldap="${with_openldap:=$default}") |
---|
37 | case $ac_cv_with_openldap in |
---|
38 | no|"") |
---|
39 | with_openldap=no |
---|
40 | ;; |
---|
41 | yes) |
---|
42 | with_openldap=/usr |
---|
43 | ;; |
---|
44 | *) |
---|
45 | with_openldap=$ac_cv_with_openldap |
---|
46 | LDAP_CFLAGS="-I$ac_cv_with_openldap/include" |
---|
47 | LDAP_LDFLAGS="-L$ac_cv_with_openldap/lib" |
---|
48 | ;; |
---|
49 | esac |
---|
50 | |
---|
51 | if test "$with_openldap" != no; then |
---|
52 | AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support]) |
---|
53 | |
---|
54 | case $with_static_ldap in |
---|
55 | no|"") |
---|
56 | with_static_ldap=no |
---|
57 | ;; |
---|
58 | *) |
---|
59 | with_static_ldap=yes |
---|
60 | ;; |
---|
61 | esac |
---|
62 | |
---|
63 | AC_CACHE_CHECK(if OpenLDAP is version 2.x, ac_cv_openldap_version2, [ |
---|
64 | CPPFLAGS_save="$CPPFLAGS" |
---|
65 | CPPFLAGS="$CPPFLAGS $LDAP_CFLAGS" |
---|
66 | AC_EGREP_CPP(yes, [ |
---|
67 | #include "ldap.h" |
---|
68 | #if LDAP_VENDOR_VERSION > 20000 |
---|
69 | yes |
---|
70 | #endif |
---|
71 | ], ac_cv_openldap_version2=yes, ac_cv_openldap_version2=no) |
---|
72 | CPPFLAGS="$CPPFLAGS_save" |
---|
73 | ]) |
---|
74 | if test "$ac_cv_openldap_version2" = no; then |
---|
75 | AC_MSG_ERROR(evolution requires OpenLDAP version >= 2) |
---|
76 | fi |
---|
77 | |
---|
78 | AC_CHECK_LIB(resolv, res_query, LDAP_LIBS="-lresolv") |
---|
79 | AC_CHECK_LIB(socket, bind, LDAP_LIBS="$LDAP_LIBS -lsocket") |
---|
80 | AC_CHECK_LIB(nsl, gethostbyaddr, LDAP_LIBS="$LDAP_LIBS -lnsl") |
---|
81 | AC_CHECK_LIB(lber, ber_get_tag, [ |
---|
82 | if test "$with_static_ldap" = "yes"; then |
---|
83 | LDAP_LIBS="$with_openldap/lib/liblber.a $LDAP_LIBS" |
---|
84 | |
---|
85 | # libldap might depend on OpenSSL... We need to pull |
---|
86 | # in the dependency libs explicitly here since we're |
---|
87 | # not using libtool for the configure test. |
---|
88 | if test -f $with_openldap/lib/libldap.la; then |
---|
89 | LDAP_LIBS="`. $with_openldap/lib/libldap.la; echo $dependency_libs` $LDAP_LIBS" |
---|
90 | fi |
---|
91 | else |
---|
92 | LDAP_LIBS="-llber $LDAP_LIBS" |
---|
93 | fi |
---|
94 | AC_CHECK_LIB(ldap, ldap_open, [ |
---|
95 | if test $with_static_ldap = "yes"; then |
---|
96 | LDAP_LIBS="$with_openldap/lib/libldap.a $LDAP_LIBS" |
---|
97 | else |
---|
98 | LDAP_LIBS="-lldap $LDAP_LIBS" |
---|
99 | fi], |
---|
100 | LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS) |
---|
101 | LDAP_LIBS="$LDAP_LDFLAGS $LDAP_LIBS" |
---|
102 | ], LDAP_LIBS="", $LDAP_LDFLAGS $LDAP_LIBS) |
---|
103 | |
---|
104 | if test -z "$LDAP_LIBS"; then |
---|
105 | AC_MSG_ERROR(could not find OpenLDAP libraries) |
---|
106 | fi |
---|
107 | |
---|
108 | AC_SUBST(LDAP_CFLAGS) |
---|
109 | AC_SUBST(LDAP_LIBS) |
---|
110 | fi |
---|
111 | AM_CONDITIONAL(ENABLE_LDAP, test $with_openldap != no) |
---|
112 | ]) |
---|
113 | |
---|
114 | |
---|
115 | # EVO_PTHREAD_CHECK |
---|
116 | AC_DEFUN([EVO_PTHREAD_CHECK],[ |
---|
117 | PTHREAD_LIB="" |
---|
118 | AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread", |
---|
119 | [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads", |
---|
120 | [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r", |
---|
121 | [AC_CHECK_LIB(pthread, __pthread_attr_init_system, PTHREAD_LIB="-lpthread", |
---|
122 | [AC_CHECK_FUNC(pthread_create)] |
---|
123 | )] |
---|
124 | )] |
---|
125 | )] |
---|
126 | ) |
---|
127 | AC_SUBST(PTHREAD_LIB) |
---|
128 | AC_PROVIDE([EVO_PTHREAD_CHECK]) |
---|
129 | ]) |
---|
130 | dnl -*- mode: autoconf -*- |
---|
131 | |
---|
132 | # serial 1 |
---|
133 | |
---|
134 | dnl Usage: |
---|
135 | dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) |
---|
136 | AC_DEFUN([GTK_DOC_CHECK], |
---|
137 | [ |
---|
138 | AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first |
---|
139 | AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first |
---|
140 | dnl for overriding the documentation installation directory |
---|
141 | AC_ARG_WITH(html-dir, |
---|
142 | AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, |
---|
143 | [with_html_dir='${datadir}/gtk-doc/html']) |
---|
144 | HTML_DIR="$with_html_dir" |
---|
145 | AC_SUBST(HTML_DIR) |
---|
146 | |
---|
147 | dnl enable/disable documentation building |
---|
148 | AC_ARG_ENABLE(gtk-doc, |
---|
149 | AC_HELP_STRING([--enable-gtk-doc], |
---|
150 | [use gtk-doc to build documentation [default=no]]),, |
---|
151 | enable_gtk_doc=no) |
---|
152 | |
---|
153 | have_gtk_doc=no |
---|
154 | if test -z "$PKG_CONFIG"; then |
---|
155 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
---|
156 | fi |
---|
157 | if test "$PKG_CONFIG" != "no" && $PKG_CONFIG --exists gtk-doc; then |
---|
158 | have_gtk_doc=yes |
---|
159 | fi |
---|
160 | |
---|
161 | dnl do we want to do a version check? |
---|
162 | ifelse([$1],[],, |
---|
163 | [gtk_doc_min_version=$1 |
---|
164 | if test "$have_gtk_doc" = yes; then |
---|
165 | AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version]) |
---|
166 | if $PKG_CONFIG --atleast-version $gtk_doc_min_version gtk-doc; then |
---|
167 | AC_MSG_RESULT(yes) |
---|
168 | else |
---|
169 | AC_MSG_RESULT(no) |
---|
170 | have_gtk_doc=no |
---|
171 | fi |
---|
172 | fi |
---|
173 | ]) |
---|
174 | if test x$enable_gtk_doc = xyes; then |
---|
175 | if test "$have_gtk_doc" != yes; then |
---|
176 | enable_gtk_doc=no |
---|
177 | fi |
---|
178 | fi |
---|
179 | |
---|
180 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
181 | AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, test -n "$LIBTOOL") |
---|
182 | ]) |
---|