source: trunk/third/libsoup/configure.in @ 21519

Revision 21519, 6.8 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21518, which included commits to RCS files with non-trunk default branches.
RevLine 
[19534]1dnl *******************************************
2dnl *** Initialize automake and set version ***
3dnl *******************************************
4
[21107]5AC_PREREQ(2.53)
[21518]6AC_INIT(libsoup, 2.2.2)
[21107]7AC_CONFIG_SRCDIR(libsoup-2.2.pc.in)
8AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
[19534]9
10AM_CONFIG_HEADER(config.h)
11AM_MAINTAINER_MODE
12AC_PROG_MAKE_SET
13
[21107]14SOUP_API_VERSION=2.2
15AC_SUBST(SOUP_API_VERSION)
16
[19534]17# Increment on interface addition. Reset on removal.
18SOUP_AGE=0
19
20# Increment on interface add, remove, or change.
[21107]21SOUP_CURRENT=7
[19534]22
23# Increment on source change. Reset when CURRENT changes.
24SOUP_REVISION=0
25
26AC_SUBST(SOUP_CURRENT)
27AC_SUBST(SOUP_REVISION)
28AC_SUBST(SOUP_AGE)
29
30dnl ***************************
31dnl *** Set debugging flags ***
32dnl ***************************
33
34debug_default=minimum
35
36# Declare --enable-* args and collect ac_help strings
37AC_ARG_ENABLE(debug,
38              [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,
39              enable_debug=$debug_default)
40
41# Set the debug flags
42if test "x$enable_debug" = "xyes"; then
43        test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
44        SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
45else
46        if test "x$enable_debug" = "xno"; then
47                SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
48        fi
49fi
50
51AC_SUBST(SOUP_DEBUG_FLAGS)
52
53
54dnl ***************************
55dnl *** Checks for programs ***
56dnl ***************************
57
58AC_PROG_CC
59AM_PROG_CC_STDC
60AC_PROG_INSTALL
61
62# Set STDC_HEADERS
63AC_HEADER_STDC
64
65# Initialize libtool
66AM_PROG_LIBTOOL
67
68# This isn't a program, but it doesn't fit anywhere else...
69AC_FUNC_ALLOCA
70
71dnl ***********************
72dnl *** Checks for glib ***
73dnl ***********************
74
[21107]75AM_PATH_GLIB_2_0(2.0.0,,,gobject gthread)
[19534]76
[21107]77PKG_CHECK_MODULES(XML, libxml-2.0)
78AC_SUBST(XML_CFLAGS)
79AC_SUBST(XML_LIBS)
80
[19534]81dnl *********************************
82dnl *** Networking library checks ***
83dnl *********************************
84
85AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
86AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, gethostbyname))
87
88AC_CHECK_FUNCS(inet_pton inet_aton)
89
90### Check if we have gethostbyname_r (if so, assume gethostbyaddr_r).
91AC_CHECK_FUNC(gethostbyname_r,
92  [
93  dnl  First check for the glibc variant of gethostbyname_r
94
95  AC_MSG_CHECKING(for glibc gethostbyname_r)
96  AC_TRY_LINK([ #include <netdb.h>],[
97          struct hostent result_buf;
98          char buf[1024];
99          struct hostent* result;
100          int h_errnop;
101
102          gethostbyname_r("localhost", &result_buf, buf, sizeof(buf),
103                          &result, &h_errnop);
104        ], [
105
106          dnl Have glibc gethostbyname_r
107
108          AC_MSG_RESULT(yes)
109          AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIBC, 1,
110                    [Define if you have a glibc-style gethostbyname_r()])
111          HAVE_GETHOSTBYNAME_R=yes
112
113        ], [
114
115  dnl  If we don't have glibc gethostbyname_r, check
116  dnl  for Solaris/Irix gethostbyname_r
117
118  AC_MSG_RESULT(no)
119  AC_MSG_CHECKING(for Solaris/Irix gethostbyname_r)
120  AC_TRY_LINK([ #include <netdb.h>],[
121          struct hostent result;
122          char buf[1024];
123          int h_errnop;
124
125          gethostbyname_r("localhost", &result, buf, sizeof(buf), &h_errnop);
126
127        ], [
128
129          dnl Have Solaris/Irix gethostbyname_r
130
131          AC_MSG_RESULT(yes)
132          AC_DEFINE(HAVE_GETHOSTBYNAME_R_SOLARIS, 1,
133                    [Define if you have a Solaris-style gethostbyname_r()])
134          HAVE_GETHOSTBYNAME_R=yes
135
136        ], [
137  dnl  If don't have Solaris/Irix gethostbyname_r, check
138  dnl  for HP-UX gethostbyname_r
139
140  AC_MSG_RESULT(no)
141  AC_MSG_CHECKING(for HP-UX gethostbyname_r)
142  AC_TRY_LINK([ #include <netdb.h>],[
143          struct hostent result;
144          char buf[1024];
145          gethostbyname_r("localhost", &result, buf);
146        ], [
147       
148          dnl Have HP-UX gethostbyname_r
149
150          AC_MSG_RESULT(yes)
151          AC_DEFINE(HAVE_GETHOSTBYNAME_R_HPUX, 1,
152                    [Define if you have an HP-UX-style gethostbyname_r()])
153          HAVE_GETHOSTBYNAME_R=yes
154
155        ]
156     )]
157  )]
158)])
159
160# If we don't have gethostbyname_r, we'll use Glib mutexes, but give a warning
161if test -z "$HAVE_GETHOSTBYNAME_R"; then
162        AC_DEFINE(HAVE_GETHOSTBYNAME_R_GLIB_MUTEX, 1,
163                  [Define if you have no gethostbyname_r()])
164        AC_MSG_WARN([You have neither Glib threads nor the function
165                    gethostbyname_r.  This means that calls to
166                    gethostbyname (called by the Soup address
167                    functions) will not be thread safe so could
168                    malfunction in programs that use threads.])
169fi
170
171AC_CACHE_CHECK(IPv6 support, soup_cv_ipv6, [
172        AC_EGREP_HEADER(sockaddr_in6, netinet/in.h, soup_cv_ipv6=yes, soup_cv_ipv6=no)
173])
174case $soup_cv_ipv6 in
175yes)
176        AC_DEFINE(HAVE_IPV6, 1, [Define if you have support for IPv6 sockets])
177        ;;
178esac
179
[21107]180dnl **********************************
181dnl *** SSL Library check (GnuTLS) ***
182dnl **********************************
[19534]183
184AC_ARG_ENABLE(ssl,
185              [  --enable-ssl             Turn on Secure Sockets Layer support [default=yes]],,
[21107]186              enable_ssl=auto)
[19534]187
188AC_ARG_ENABLE(ssl-link-static,
189              [  --enable-static-ssl      Link with SSL library statically [default=no]],
190              [enable_static_ssl=yes])
191
[21107]192AC_ARG_ENABLE(libgpg-error,
193              [  --enable-libgpg-error    Work around broken libgcrypt-config scripts],
194              enable_libgpg_error=yes, enable_libgpg_error=no)
[19534]195
[21107]196if test "$enable_ssl" != "no"; then
197        AM_PATH_LIBGNUTLS(1.0.0, have_ssl=yes, have_ssl=no)
[19534]198
[21107]199        if test "$have_ssl" != "yes"; then
200                if test "$enable_ssl" = "auto"; then
201                        AC_MSG_WARN(Disabling SSL support);
202                        enable_ssl=no;
[19534]203                else
[21107]204                        AC_MSG_ERROR(Could not configure SSL support);
[19534]205                fi
206        fi
[21107]207fi
[19534]208
[21107]209LIBGNUTLS_LIBS_STATIC=""
210if test "$enable_ssl" != "no"; then
211        AC_DEFINE(HAVE_SSL, 1, [Defined if you have SSL support])
[19534]212
[21107]213        libgpg_error_libs_static=""
214        libgpg_error_libs=""
[19534]215
[21107]216        if test "$enable_libgpg_error" = "yes"; then
217                AM_PATH_GPG_ERROR("0.4")
218                if test "$GPG_ERROR_LIBS" = ""; then
219                        AC_MSG_ERROR([libgpg-error is needed])
[19534]220                fi
[21107]221                gpg_error_prefix=$($GPG_ERROR_CONFIG --prefix)
222                libgpg_error_libs_static="$gpg_error_prefix/lib/libgpg-error.a"
223                libgpg_error_libs="$GPG_ERROR_LIBS"
[19534]224        fi
225
[21107]226        if test "$enable_static_ssl" = "yes"; then
227                gnutls_libdir=`$LIBGNUTLS_CONFIG --exec-prefix`/lib
228                LIBGNUTLS_LIBS=""
229                LIBGNUTLS_LIBS_STATIC="$gnutls_libdir/libgnutls.a $gnutls_libdir/libgcrypt.a $libgpg_error_libs_static"
230        fi
[19534]231fi
232
[21107]233AC_SUBST(LIBGNUTLS_CFLAGS)
234AC_SUBST(LIBGNUTLS_LIBS)
235AC_SUBST(LIBGNUTLS_LIBS_STATIC)
[19534]236
[21107]237dnl ***************
238dnl *** gtk-doc ***
239dnl ***************
240GTK_DOC_CHECK([1.0])
[19534]241
242
243dnl *************************************
244dnl *** Warnings to show if using GCC ***
245dnl *************************************
246
247AC_ARG_ENABLE(more-warnings,
248              [  --disable-more-warnings  Inhibit compiler warnings],
249              set_more_warnings=no)
250
251if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
252        CFLAGS="$CFLAGS \
253                -Wall -Wstrict-prototypes -Wmissing-declarations \
254                -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
255fi
256
[21107]257# Use reentrant functions (FIXME!)
[19534]258CFLAGS="$CFLAGS -D_REENTRANT"
259
260dnl *************************
261dnl *** Output Everything ***
262dnl *************************
263
264AC_OUTPUT([
[21107]265        libsoup-2.2.pc
[19534]266        Makefile
267        libsoup/Makefile
268        tests/Makefile
[21107]269        docs/Makefile
270        docs/reference/Makefile
[19534]271        ])
Note: See TracBrowser for help on using the repository browser.