cleaned up to no longer link with an SSL library. Added options
[platform/upstream/libsoup.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2
3 # Require autoconf 2.12
4 AC_PREREQ(2.12)
5
6 # Initialize autoconf
7 AC_INIT(configure.in)
8
9 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)
10 SOUP_MAJOR_VERSION=0
11 SOUP_MINOR_VERSION=1
12 SOUP_MICRO_VERSION=9
13 SOUP_INTERFACE_AGE=0
14 SOUP_BINARY_AGE=0
15 SOUP_VERSION=$SOUP_MAJOR_VERSION.$SOUP_MINOR_VERSION.$SOUP_MICRO_VERSION
16 VERSION=$SOUP_VERSION
17 PACKAGE=soup
18 AC_DIVERT_POP()
19
20 LT_RELEASE=$SOUP_VERSION
21 LT_CURRENT=$SOUP_INTERFACE_AGE
22 LT_REVISION=$SOUP_BINARY_AGE
23 LT_AGE=`expr $SOUP_BINARY_AGE - $SOUP_INTERFACE_AGE`
24
25 AC_SUBST(SOUP_MAJOR_VERSION)
26 AC_SUBST(SOUP_MINOR_VERSION)
27 AC_SUBST(SOUP_MICRO_VERSION)
28 AC_SUBST(SOUP_VERSION)
29 AC_SUBST(LT_RELEASE)
30 AC_SUBST(LT_CURRENT)
31 AC_SUBST(LT_REVISION)
32 AC_SUBST(LT_AGE)
33
34 # Specify a configuration file
35 AM_CONFIG_HEADER(config.h)
36
37 # Initialize automake
38 AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
39
40 # Initialize maintainer mode
41 AM_MAINTAINER_MODE
42
43
44 # ****************************************
45 # Set debugging flags
46
47 # Figure out debugging default, prior to $ac_help setup
48 AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
49 if test `expr $SOUP_MINOR_VERSION \% 2` = 1 ; then
50         debug_default=yes
51 else
52         debug_default=minimum
53 fi
54 AC_DIVERT_POP()
55
56 # Declare --enable-* args and collect ac_help strings
57 AC_ARG_ENABLE(debug, [  --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
58
59 # Set the debug flags
60 AC_MSG_CHECKING(for --enable-debug)
61 if test "x$enable_debug" = "xyes"; then
62   test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
63   SOUP_DEBUG_FLAGS="-DG_ENABLE_DEBUG"
64   AC_MSG_RESULT(yes)
65 else
66   if test "x$enable_debug" = "xno"; then
67     SOUP_DEBUG_FLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
68     AC_MSG_RESULT(no)
69   fi
70 fi
71
72 AC_SUBST(SOUP_DEBUG_FLAGS)
73
74
75 # ****************************************
76 # Check for programs
77
78 AC_PROG_CC
79 AM_PROG_CC_STDC
80 AC_PROG_INSTALL
81
82 # Use an many warnings as possible
83 changequote(,)
84 if test "x$GCC" = "xyes"; then
85   case " $CFLAGS " in
86   *[\ \ ]-Wall[\ \      ]*) ;;
87   *) CFLAGS="$CFLAGS -Wall" ;;
88   esac
89
90   if test "x$enable_ansi" = "xyes"; then
91     case " $CFLAGS " in
92     *[\ \       ]-ansi[\ \      ]*) ;;
93     *) CFLAGS="$CFLAGS -ansi" ;;
94     esac
95
96     case " $CFLAGS " in
97     *[\ \       ]-pedantic[\ \  ]*) ;;
98     *) CFLAGS="$CFLAGS -pedantic" ;;
99     esac
100   fi
101 fi
102 changequote([,])
103
104 # Use reentrant functions
105 CFLAGS="$CFLAGS -D_REENTRANT"
106
107 # Set STDC_HEADERS
108 AC_HEADER_STDC
109
110 # Initialize libtool
111 AM_PROG_LIBTOOL
112
113
114 # ****************************************
115 # Check for libraries
116
117 # Need GLIB
118 AM_PATH_GLIB(1.2.0,
119             [LIBS="$LIBS $GLIB_LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS"],
120             AC_MSG_ERROR(Cannot find GLIB: Is glib-config in path?),
121             gmodule)
122
123 #GLIB_CFLAGS=`glib-config --cflags glib gmodule`
124 #GLIB_LIBS=`glib-config --libs glib gmodule`
125
126 #AC_SUBST(GLIB_CFLAGS)
127 #AC_SUBST(GLIB_LIBS)
128
129
130 # Need GNET
131 AM_PATH_GNET(1.0.0,
132              [LIBS="$LIBS $GNET_LIBS" CFLAGS="$CFLAGS $GNET_CFLAGS"],
133              AC_MSG_ERROR(Cannot find GNET: Is gnet-config in path?))
134
135 #GNET_CFLAGS=`gnet-config --cflags gnet`
136 #GNET_LIBS=`gnet-config --libs gnet`
137
138 #AC_SUBST(GNET_CFLAGS)
139 #AC_SUBST(GNET_LIBS)
140
141
142 # Need gnome-xml 1
143 AC_PATH_PROG(XML_CONFIG,xml-config,no)
144 if test x$XML_CONFIG = xno; then
145         AC_MSG_ERROR(Cannot find xml-config)
146 fi
147 XML_LIBS=`xml-config --libs`
148 XML_CFLAGS=`xml-config --cflags`
149
150 LIBS="$LIBS $XML_LIBS"
151 CFLAGS="$CFLAGS $XML_CFLAGS"
152
153 AC_SUBST(XML_LIBS)
154 AC_SUBST(XML_CFLAGS)
155
156
157 # Need popt
158 # FIXME: Remove ubiquitous support, use $POPT_LIBS and $POPT_CFLAGS instead
159 AC_CHECK_LIB(popt, poptGetContext,, AC_MSG_ERROR([popt is required]))
160
161
162 # Need in.h and tcp.h for setting of TCP_NODELAY
163 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h)
164
165
166 # Check for OpenSSL
167 AC_ARG_ENABLE(ssl, 
168 [  --enable-ssl             turn on Secure Sockets Layer support [default=yes]
169                            ([=no] will override --with-ssl)],,enable_ssl=yes)
170
171 AC_ARG_WITH(nspr-includes,
172 [  --with-nspr-includes     Specify location of Netscape Portable Runtime headers],[
173 CFLAGS="$CFLAGS -I$withval"
174 nspr_inc_prefix=$withval
175 ])
176
177 AC_ARG_WITH(nspr-libs,
178 [  --with-nspr-libs         Specify location of Netscape Portable Runtime libs],[
179 nspr_prefix=$withval
180 ])
181
182 AC_ARG_WITH(nss-includes,
183 [  --with-nss-includes      Specify location of NSS header files],[
184 CFLAGS="$CFLAGS -I$withval"
185 nss_inc_prefix=$withval
186 ])
187
188 AC_ARG_WITH(nss-libs,
189 [  --with-nss-libs          Specify location of NSS libs],[
190 nss_prefix=$withval
191 ])
192
193
194 AC_ARG_WITH(openssl-includes,
195 [  --with-openssl-includes  Specify location of OpenSSL header files],[
196 CFLAGS="$CFLAGS -I$withval"
197 openssl_inc_prefix=$withval
198 ])
199
200 AC_ARG_WITH(openssl-libs,
201 [  --with-openssl-libs      Specify location of OpenSSL libs],[
202 openssl_prefix=$withval
203 ])
204
205 if test "x$enable_ssl" = xyes; then
206         save_CPPFLAGS="$CPPFLAGS"
207         CPPFLAGS="$CPPFLAGS -I$openssl_inc_prefix -I$nspr_inc_prefix -I$nss_inc_prefix"
208         AC_CHECK_HEADERS(openssl/ssl.h)
209         AC_CHECK_HEADERS(openssl/err.h)
210         AC_CHECK_HEADERS(prtypes.h)
211         AC_CHECK_HEADERS(security/ssl.h)
212         AC_CHECK_HEADERS(security/pk11func.h)
213         CPPFLAGS="$save_CPPFLAGS"
214 fi
215
216 # Set PACKAGE_SOURCE_DIR in config.h.
217 packagesrcdir=`cd $srcdir && pwd`
218 AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
219
220 # If gcc is the compiler, compile with lots of warnings
221 if test "x$GCC" = "xyes"; then
222         CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations "
223 fi
224
225 #       doc/Makefile
226
227 AC_OUTPUT([
228         soup-config
229         soup.pc
230         soup.spec
231         soupConf.sh
232         Makefile
233         src/Makefile
234         src/soup-core/Makefile
235         src/soup-wsdl/Makefile
236         tests/Makefile
237         ],
238         [chmod +x soup-config])