source: trunk/ORBit2-2.14.0/configure.in@ 124

Last change on this file since 124 was 92, checked in by cinc, 19 years ago

Orbit2 modified for use with NOM

File size: 11.7 KB
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(configure.in)
3
4# Process this file with autoconf to produce a configure script.
5# require autoconf 2.54
6AC_PREREQ(2.54)
7
8# Before making a release, the LT_VERSION string should be modified.
9# The string is of the form C:R:A.
10# - If interfaces have been changed or added, but binary compatibility has
11# been preserved, change to C+1:0:A+1
12# - If binary compatibility has been broken (eg removed or changed interfaces)
13# change to C+1:0:0
14# - If the interface is the same as the previous version, change to C:R+1:A
15
16LT_VERSION=1:0:1
17AC_SUBST(LT_VERSION)
18
19ORBIT_MAJOR_VERSION=2
20ORBIT_MINOR_VERSION=14
21ORBIT_MICRO_VERSION=0
22ORBIT_VERSION=$ORBIT_MAJOR_VERSION.$ORBIT_MINOR_VERSION.$ORBIT_MICRO_VERSION
23AC_SUBST(ORBIT_MAJOR_VERSION)
24AC_SUBST(ORBIT_MINOR_VERSION)
25AC_SUBST(ORBIT_MICRO_VERSION)
26AC_SUBST(ORBIT_VERSION)
27
28# Increment this every time a feature is added in the .idl compiler
29# that needs help from the main libraries.
30ORBIT_SERIAL=20
31AC_SUBST(ORBIT_SERIAL)
32
33# For automake.
34
35AM_CONFIG_HEADER(config.h)
36
37dnl Initialize automake stuff
38AM_INIT_AUTOMAKE(ORBit2, $ORBIT_VERSION, no-define)
39
40AC_CANONICAL_HOST
41AC_MSG_CHECKING([for Win32])
42case "$host" in
43 *-*-mingw*)
44 os_win32=yes
45 LIBM=
46 MINGW_LDFLAGS="-Wl,--enable-runtime-pseudo-reloc"
47 ;;
48 *)
49 os_win32=no
50 LIBM=-lm
51 MINGW_LDFLAGS=
52 ;;
53esac
54AC_MSG_RESULT([$os_win32])
55
56AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"])
57
58AC_SUBST(LIBM)
59AC_SUBST(MINGW_LDFLAGS)
60LDFLAGS="$MINGW_LDFLAGS $LDFLAGS"
61
62if test "$os_win32" = "yes"; then
63 if test x$enable_static = xyes -o x$enable_static = x; then
64 AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.])
65 enable_static=no
66 fi
67 if test x$enable_shared = xno; then
68 AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.])
69 fi
70 enable_shared=yes
71fi
72
73dnl Checks for programs.
74AC_PROG_CC
75AC_PROG_INSTALL
76
77AC_LIBTOOL_DLOPEN
78AC_LIBTOOL_WIN32_DLL
79AM_PROG_LIBTOOL
80AM_MAINTAINER_MODE
81
82dnl Useful for automating stuff
83AC_CACHE_CHECK([for aclocal flags], ac_cv_orbit_aclocal_flags,[
84 ac_cv_orbit_aclocal_flags="$ACLOCAL_FLAGS"
85])
86ACLOCAL="$ACLOCAL $ac_cv_orbit_aclocal_flags"
87
88AC_ARG_ENABLE(http, [--enable-http enables http connections],, enable_http=no)
89AM_CONDITIONAL(ENABLE_HTTP, test x"$enable_http" = xyes)
90if test x"$enable_http" = xyes ; then
91 AC_DEFINE(ENABLE_HTTP, 1, [Define if HTTP connections are available])
92fi
93dnl --enable-compile-warnings
94AC_ARG_ENABLE(compile-warnings, [ --enable-compile-warnings=[no/yes] Turn on compiler warnings.], [enable_compile_warnings="$enableval"],[enable_compile_warnings="yes"])
95
96dnl --enable-debug=(yes|minimum|no)
97AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=minimum)
98if test "$enable_debug" = "yes"; then
99 ORBIT_DEBUG_CFLAGS="-DG_ENABLE_DEBUG"
100else
101 if test "x$enable_debug" = "xno"; then
102 ORBIT_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS"
103 else
104 ORBIT_DEBUG_CFLAGS=""
105 fi
106fi
107AC_SUBST(ORBIT_DEBUG_CFLAGS)
108
109AC_ARG_ENABLE(purify, [ --enable-purify be clean for memory debuggers], enable_purify=yes, enable_purify=no)
110if test z$enable_purify = zyes; then
111 AC_DEFINE(ORBIT_PURIFY, 1, [defined if purify is enabled])
112fi
113
114AC_PROG_AWK
115
116GLIB_REQUIRED=2.6.0
117LIBIDL_REQUIRED=0.8.2
118AC_SUBST(GLIB_REQUIRED)
119AC_SUBST(LIBIDL_REQUIRED)
120
121dnl Check for pkg-config version; want >= 0.14.0 because of -pthread bug
122AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
123if test "$PKG_CONFIG" = "no" ; then
124 echo "*** The pkg-config script could not be found. Make sure it is"
125 echo "*** in your path, or set the PKG_CONFIG environment variable"
126 echo "*** to the full path to pkg-config."
127 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
128 AC_MSG_ERROR(You need to install pkg-config or set the PKG_CONFIG environment variable to build ORBit2)
129fi
130xPKG_CONFIG_MIN_VERSION=0.14.0
131AC_MSG_CHECKING([for pkg-config >= $xPKG_CONFIG_MIN_VERSION])
132if $PKG_CONFIG --atleast-pkgconfig-version $xPKG_CONFIG_MIN_VERSION; then
133 AC_MSG_RESULT(found)
134else
135 AC_MSG_ERROR(You need at least version $xPKG_CONFIG_MIN_VERSION of pkg-config)
136fi
137
138LOCAL_LINC_LIBS='$(top_builddir)/linc2/src/liblinc.la'
139LOCAL_LINC_CFLAGS='-I$(top_srcdir)/linc2/include -I$(top_builddir)/linc2/include'
140AC_SUBST(LOCAL_LINC_LIBS)
141AC_SUBST(LOCAL_LINC_CFLAGS)
142
143dnl Checks for libraries.
144PKG_CHECK_MODULES(ORBIT, \
145 glib-2.0 >= $GLIB_REQUIRED \
146 gobject-2.0 >= $GLIB_REQUIRED \
147 gthread-2.0 >= $GLIB_REQUIRED \
148 gmodule-2.0 >= $GLIB_REQUIRED)
149AC_SUBST(ORBIT_LIBS)
150AC_SUBST(ORBIT_CFLAGS)
151
152PKG_CHECK_MODULES(ORBIT_IDL, \
153 libIDL-2.0 >= $LIBIDL_REQUIRED \
154 glib-2.0 >= $GLIB_REQUIRED \
155 gobject-2.0 >= $GLIB_REQUIRED \
156 gmodule-2.0 >= $GLIB_REQUIRED)
157AC_SUBST(ORBIT_IDL_LIBS)
158AC_SUBST(ORBIT_IDL_CFLAGS)
159
160PKG_CHECK_MODULES(ORBIT_NAME,
161 glib-2.0 >= $GLIB_REQUIRED \
162 gobject-2.0 >= $GLIB_REQUIRED \
163 gthread-2.0 >= $GLIB_REQUIRED \
164 gmodule-2.0 >= $GLIB_REQUIRED)
165AC_SUBST(ORBIT_NAME_LIBS)
166AC_SUBST(ORBIT_NAME_CFLAGS)
167
168dnl Checks for header files.
169AC_HEADER_STDC
170AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h)
171AC_CHECK_HEADERS(sys/machine.h sys/isa_defs.h sys/poll.h sys/select.h)
172AC_CHECK_HEADERS(sys/time.h netinet/in.h sys/socket.h arpa/inet.h)
173AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
174AC_CHECK_HEADERS(sys/un.h openssl/ssl.h sys/uio.h syslog.h)
175AC_CHECK_HEADERS(sys/wait.h netdb.h)
176AC_CHECK_HEADERS(utime.h sys/utime.h)
177AC_CHECK_HEADERS([linux/socket.h])
178AC_CHECK_HEADERS(sys/sockio.h)
179
180if test "$os_win32" = "yes"; then
181 AC_CHECK_HEADERS(winsock2.h)
182 if test $ac_cv_header_winsock2_h = yes; then
183 dnl If we have <winsock2.h>, assume we find the functions
184 dnl in -lws2_32.
185 LIBS="-lws2_32 $LIBS"
186 fi
187fi
188
189if test $ac_cv_header_openssl_ssl_h = yes; then
190 HAVE_ORBIT_SSL_SUPPORT=1
191fi
192AC_SUBST(HAVE_ORBIT_SSL_SUPPORT)
193
194dnl Checks for typedefs, structures, and compiler characteristics.
195AC_C_CONST
196AC_C_INLINE
197AC_TYPE_SIZE_T
198
199dnl Checks for library functions.
200AC_FUNC_VPRINTF
201
202AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
203AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
204AC_CHECK_FUNC(sigaction)
205AC_CHECK_FUNC(syslog)
206
207AC_CHECK_LIB(popt, poptStrippedArgv, POPT_LIBS=-lpopt, AC_MSG_ERROR([You must have popt version 1.5 or greater installed.]))
208AC_SUBST(POPT_LIBS)
209AC_CHECK_HEADER(popt.h,,AC_MSG_ERROR([Failed to find popt.h - you may have to adjust your environment]))
210
211dnl This generates warnings from autoconf...
212AC_C_BIGENDIAN
213
214
215dnl
216dnl So many people with broken linking setups asked about this
217dnl it turned out to be necessary to check for this.
218dnl
219dofus_save_libs="$LIBS"
220LIBS="$ORBIT_LIBS $LIBS"
221AC_TRY_RUN([ #include <stdio.h>
222 main ()
223 {
224 return 0;
225 } ],,
226 AC_MSG_ERROR([
227Linking is badly borked on your system. Please ensure your library path is correct
228Check config.log for details - check near the end of the log above 'failed program was'
229Alternatively ensure that your /etc/ld.so.conf (and/or LD_LIBRARY_PATH) includes the
230prefix you're compiling on: '${prefix}' ]))
231LIBS="$dofus_save_libs"
232
233orig_CPPFLAGS=$CPPFLAGS
234CPPFLAGS="$CPPFLAGS $ORBIT_CFLAGS"
235AC_CHECK_ALIGNOF(CORBA_octet)
236AC_CHECK_ALIGNOF(CORBA_boolean)
237AC_CHECK_ALIGNOF(CORBA_char)
238AC_CHECK_ALIGNOF(CORBA_wchar)
239AC_CHECK_ALIGNOF(CORBA_short)
240AC_CHECK_ALIGNOF(CORBA_long)
241AC_CHECK_ALIGNOF(CORBA_long_long)
242AC_CHECK_ALIGNOF(CORBA_float)
243AC_CHECK_ALIGNOF(CORBA_double)
244AC_CHECK_ALIGNOF(CORBA_long_double)
245AC_CHECK_ALIGNOF(CORBA_struct)
246AC_CHECK_ALIGNOF(CORBA_pointer)
247CPPFLAGS=$orig_CPPFLAGS
248
249if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then
250 WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations"
251else
252 WARN_CFLAGS=
253fi
254
255AC_MSG_CHECKING(what warning flags to pass to the C compiler)
256AC_MSG_RESULT($WARN_CFLAGS)
257AC_SUBST(WARN_CFLAGS)
258
259AC_SUBST(pkglibdir)
260
261DISABLE_DEPRECATED_CFLAGS=" \
262 -DG_DISABLE_DEPRECATED"
263AC_SUBST(DISABLE_DEPRECATED_CFLAGS)
264
265
266dnl
267dnl --------- start linc bits ---------
268dnl
269
270dnl Checks for libraries.
271PKG_CHECK_MODULES(LINC, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED)
272AC_SUBST(LINC_LIBS)
273AC_SUBST(LINC_CFLAGS)
274
275LINC_SSL_SUPPORT=0
276AC_SUBST(LINC_SSL_SUPPORT)
277AC_SUBST(SSL_LIBS)
278AC_SUBST(SSL_CFLAGS)
279
280dnl Checks for header files.
281AC_HEADER_STDC
282AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h sys/poll.h)
283AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h)
284AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h sys/un.h)
285AC_CHECK_HEADERS(arpa/nameser.h resolv.h)
286dnl AC_CHECK_HEADERS(linux/irda.h)
287
288dnl Checks for library functions.
289AC_CHECK_FUNCS(poll basename)
290AC_CHECK_FUNC(res_init,,[AC_CHECK_LIB(resolv,res_init)])
291AC_CHECK_LIB(resolv,res_9_init)
292AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
293AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
294AC_CHECK_FUNC(getaddrinfo,,[AC_CHECK_LIB(nsl,getaddrinfo)])
295if test x"$ac_cv_func_getaddrinfo" = "xyes" ; then
296 AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo() is available])
297fi
298AC_CHECK_FUNC(getnameinfo,,[AC_CHECK_LIB(nsl,getnameinfo)])
299if test x"$ac_cv_func_getnameinfo" = "xyes" ; then
300 AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo() is available])
301fi
302have_inet_pton=no
303AC_CHECK_FUNC(inet_pton,,)
304if test x"$ac_cv_func_inet_pton" = "xyes" ; then
305 have_inet_pton=yes
306 AC_DEFINE(HAVE_INET_PTON, 1, [Define if inet_pton() is available])
307fi
308
309# AC_CHECK_TYPE doesn't work here.
310AC_MSG_CHECKING([for socklen_t])
311AC_TRY_COMPILE(
312 [#ifdef _WIN32
313#include <ws2tcpip.h>
314#else
315#include <sys/types.h>
316#include <sys/socket.h>
317#endif],
318 [socklen_t len;],
319 [AC_MSG_RESULT(yes)],
320 [AC_DEFINE(socklen_t, size_t, [Define socklen_t to be of type size_t])
321 AC_MSG_RESULT(no)])
322
323# Blatantly stolen from configure.in in the sample code from
324# "UNIX Network Programming, Volume 1" by W. Richard Stevens
325AC_CACHE_CHECK(if sockaddr has sa_len member,
326ac_cv_sockaddr_has_sa_len,
327 AC_TRY_COMPILE([
328# include <sys/types.h>
329# include <sys/socket.h>],
330 [unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)],
331 ac_cv_sockaddr_has_sa_len=yes,
332 ac_cv_sockaddr_has_sa_len=no))
333if test x"$ac_cv_sockaddr_has_sa_len" = "xyes" ; then
334 AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if sockaddr has sa_len member])
335fi
336
337dnl
338dnl --------- end linc bits ---------
339dnl
340
341dnl
342dnl --------- set additional gcc flags to catch errors ---------
343dnl
344CFLAGS="-Werror-implicit-function-declaration -std=gnu89 $CFLAGS"
345AC_SUBST(CFLAGS)
346
347
348dnl ----- gtk-doc ------
349GTK_DOC_CHECK([1.0])
350
351
352AC_OUTPUT([
353Makefile
354orbit2-config
355ORBit-2.0.pc
356ORBit-CosNaming-2.0.pc
357ORBit-imodule-2.0.pc
358ORBit.spec
359orbit2-zip
360src/Makefile
361src/idl-compiler/Makefile
362src/idl-compiler/ORBit-idl-2.0.pc
363src/idl/Makefile
364src/idl/CORBA/Makefile
365src/idl/CORBA_PIDL/Makefile
366src/idl/interop/Makefile
367src/idl/misc/Makefile
368src/orb/Makefile
369src/orb/include/Makefile
370src/orb/util/Makefile
371src/orb/GIOP/Makefile
372src/orb/orb-core/Makefile
373src/orb/dynamic/Makefile
374src/orb/poa/Makefile
375src/services/Makefile
376src/services/name/Makefile
377src/services/imodule/Makefile
378include/Makefile
379include/orbit/Makefile
380include/orbit/orbit-config.h
381include/orbit/GIOP/Makefile
382include/orbit/util/Makefile
383include/orbit/orb-core/Makefile
384include/orbit/poa/Makefile
385include/orbit/dynamic/Makefile
386test/Makefile
387test/everything/Makefile
388test/inhibit/Makefile
389test/poa/Makefile
390docs/Makefile
391docs/devel/Makefile
392docs/internals/Makefile
393docs/api/Makefile
394
395linc2/Makefile
396linc2/src/Makefile
397linc2/test/Makefile
398linc2/include/Makefile
399linc2/include/linc/Makefile
400linc2/include/linc/linc-config.h
401])
402
403echo "ORBit configuration:
404
405 Source code location: ${srcdir}
406 Compiler: ${CC}
407
408 Purify cleanliness: ${enable_purify}
409
410 This is the Development branch of ORBit2, if
411you want something more stable checkout -r gnome-2-10.
412"
Note: See TracBrowser for help on using the repository browser.