source: trunk/third/ORBit2/configure.in @ 20753

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