1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(configure.in) |
---|
3 | |
---|
4 | AC_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 | |
---|
14 | LT_VERSION=0:0:0 |
---|
15 | AC_SUBST(LT_VERSION) |
---|
16 | |
---|
17 | ORBIT_MAJOR_VERSION=2 |
---|
18 | ORBIT_MINOR_VERSION=12 |
---|
19 | ORBIT_MICRO_VERSION=0 |
---|
20 | ORBIT_VERSION=$ORBIT_MAJOR_VERSION.$ORBIT_MINOR_VERSION.$ORBIT_MICRO_VERSION |
---|
21 | AC_SUBST(ORBIT_MAJOR_VERSION) |
---|
22 | AC_SUBST(ORBIT_MINOR_VERSION) |
---|
23 | AC_SUBST(ORBIT_MICRO_VERSION) |
---|
24 | AC_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. |
---|
28 | ORBIT_SERIAL=20 |
---|
29 | AC_SUBST(ORBIT_SERIAL) |
---|
30 | |
---|
31 | # For automake. |
---|
32 | |
---|
33 | AM_CONFIG_HEADER(config.h) |
---|
34 | |
---|
35 | dnl Initialize automake stuff |
---|
36 | AM_INIT_AUTOMAKE(ORBit2, $ORBIT_VERSION, no-define) |
---|
37 | |
---|
38 | dnl Checks for programs. |
---|
39 | AC_PROG_CC |
---|
40 | AC_PROG_INSTALL |
---|
41 | |
---|
42 | AC_LIBTOOL_DLOPEN |
---|
43 | AC_LIBTOOL_WIN32_DLL |
---|
44 | AM_PROG_LIBTOOL |
---|
45 | AM_MAINTAINER_MODE |
---|
46 | |
---|
47 | dnl Useful for automating stuff |
---|
48 | AC_CACHE_CHECK([for aclocal flags], ac_cv_orbit_aclocal_flags,[ |
---|
49 | ac_cv_orbit_aclocal_flags="$ACLOCAL_FLAGS" |
---|
50 | ]) |
---|
51 | ACLOCAL="$ACLOCAL $ac_cv_orbit_aclocal_flags" |
---|
52 | |
---|
53 | AC_ARG_ENABLE(http, [--enable-http enables http connections],, enable_http=no) |
---|
54 | AM_CONDITIONAL(ENABLE_HTTP, test x"$enable_http" = xyes) |
---|
55 | if test x"$enable_http" = xyes ; then |
---|
56 | AC_DEFINE(ENABLE_HTTP, 1, [Define if HTTP connections are available]) |
---|
57 | fi |
---|
58 | dnl --enable-comile-warnings |
---|
59 | AC_ARG_ENABLE(compile-warnings, [ --enable-compile-warnings=[no/yes] Turn on compiler warnings.], [enable_compile_warnings="$enableval"],[enable_compile_warnings="yes"]) |
---|
60 | |
---|
61 | dnl --enable-debug=(yes|minimum|no) |
---|
62 | AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes] turn on debugging [default=no]],,enable_debug=minimum) |
---|
63 | if test "$enable_debug" = "yes"; then |
---|
64 | ORBIT_DEBUG_CFLAGS="-DG_ENABLE_DEBUG" |
---|
65 | else |
---|
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 |
---|
71 | fi |
---|
72 | AC_SUBST(ORBIT_DEBUG_CFLAGS) |
---|
73 | |
---|
74 | dnl Handle indent variations |
---|
75 | dnl default is "sopwith indent", use "--enable-indent=kr" for "kr"appy indent. |
---|
76 | AC_ARG_ENABLE(indent, [ --disable-indent do not indent output code], use_indent=$enableval, use_indent=yes) |
---|
77 | |
---|
78 | AC_MSG_CHECKING([for indentation command to pipe generated c-files through]) |
---|
79 | for 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 |
---|
97 | done |
---|
98 | AC_MSG_RESULT($INDENT_COMMAND) |
---|
99 | AC_DEFINE_UNQUOTED(INDENT_COMMAND,"$INDENT_COMMAND", |
---|
100 | [command used for indentation]) |
---|
101 | |
---|
102 | |
---|
103 | AC_ARG_ENABLE(purify, [ --enable-purify be clean for memory debuggers], enable_purify=yes, enable_purify=no) |
---|
104 | if test z$enable_purify = zyes; then |
---|
105 | AC_DEFINE(ORBIT_PURIFY, 1, [defined if purify is enabled]) |
---|
106 | fi |
---|
107 | |
---|
108 | AC_PROG_AWK |
---|
109 | |
---|
110 | GLIB_REQUIRED=2.0.0 |
---|
111 | LIBIDL_REQUIRED=0.7.4 |
---|
112 | AC_SUBST(GLIB_REQUIRED) |
---|
113 | AC_SUBST(LIBIDL_REQUIRED) |
---|
114 | |
---|
115 | dnl Check for pkg-config version; want >= 0.14.0 because of -pthread bug |
---|
116 | AC_PATH_PROG(PKG_CONFIG, pkg-config, no) |
---|
117 | if 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) |
---|
123 | fi |
---|
124 | PKG_CONFIG_MIN_VERSION=0.14.0 |
---|
125 | AC_MSG_CHECKING([for pkg-config >= $PKG_CONFIG_MIN_VERSION]) |
---|
126 | if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then |
---|
127 | AC_MSG_RESULT(found) |
---|
128 | else |
---|
129 | AC_MSG_ERROR(You need at least version $PKG_CONFIG_MIN_VERSION of pkg-config) |
---|
130 | fi |
---|
131 | |
---|
132 | LOCAL_LINC_LIBS='$(top_builddir)/linc2/src/liblinc.la' |
---|
133 | LOCAL_LINC_CFLAGS='-I$(top_srcdir)/linc2/include -I$(top_builddir)/linc2/include' |
---|
134 | AC_SUBST(LOCAL_LINC_LIBS) |
---|
135 | AC_SUBST(LOCAL_LINC_CFLAGS) |
---|
136 | |
---|
137 | dnl Checks for libraries. |
---|
138 | PKG_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) |
---|
143 | AC_SUBST(ORBIT_LIBS) |
---|
144 | AC_SUBST(ORBIT_CFLAGS) |
---|
145 | |
---|
146 | PKG_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) |
---|
151 | AC_SUBST(ORBIT_IDL_LIBS) |
---|
152 | AC_SUBST(ORBIT_IDL_CFLAGS) |
---|
153 | |
---|
154 | PKG_CHECK_MODULES(ORBIT_NAME, glib-2.0 >= $GLIB_REQUIRED) |
---|
155 | AC_SUBST(ORBIT_NAME_LIBS) |
---|
156 | AC_SUBST(ORBIT_NAME_CFLAGS) |
---|
157 | |
---|
158 | dnl Checks for header files. |
---|
159 | AC_HEADER_STDC |
---|
160 | AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h) |
---|
161 | AC_CHECK_HEADERS(sys/machine.h sys/isa_defs.h sys/poll.h sys/select.h) |
---|
162 | AC_CHECK_HEADERS(sys/time.h netinet/in.h sys/socket.h arpa/inet.h) |
---|
163 | AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h) |
---|
164 | AC_CHECK_HEADERS(netinet/in.h sys/un.h openssl/ssl.h) |
---|
165 | AC_CHECK_HEADERS([linux/socket.h]) |
---|
166 | |
---|
167 | |
---|
168 | if test $ac_cv_header_openssl_ssl_h = yes; then |
---|
169 | HAVE_ORBIT_SSL_SUPPORT=1 |
---|
170 | fi |
---|
171 | AC_SUBST(HAVE_ORBIT_SSL_SUPPORT) |
---|
172 | |
---|
173 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
174 | AC_C_CONST |
---|
175 | AC_C_INLINE |
---|
176 | AC_TYPE_SIZE_T |
---|
177 | |
---|
178 | dnl Checks for library functions. |
---|
179 | AC_FUNC_VPRINTF |
---|
180 | |
---|
181 | AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)]) |
---|
182 | AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) |
---|
183 | |
---|
184 | AC_CHECK_LIB(popt, poptStrippedArgv, POPT_LIBS=-lpopt, AC_MSG_ERROR([You must have popt version 1.5 or greater installed.])) |
---|
185 | AC_SUBST(POPT_LIBS) |
---|
186 | AC_CHECK_HEADER(popt.h,,AC_MSG_ERROR([Failed to find popt.h - you may have to adjust your environment])) |
---|
187 | |
---|
188 | dnl This generates warnings from autoconf... |
---|
189 | AC_C_BIGENDIAN |
---|
190 | |
---|
191 | |
---|
192 | dnl |
---|
193 | dnl So many people with broken linking setups asked about this |
---|
194 | dnl it turned out to be necessary to check for this. |
---|
195 | dnl |
---|
196 | dofus_save_libs="$LIBS" |
---|
197 | LIBS="$ORBIT_LIBS $LIBS" |
---|
198 | AC_TRY_RUN([ #include <stdio.h> |
---|
199 | main () |
---|
200 | { |
---|
201 | return 0; |
---|
202 | } ],, |
---|
203 | AC_MSG_ERROR([ |
---|
204 | Linking is badly borked on your system. Please ensure your library path is correct |
---|
205 | Check config.log for details - check near the end of the log above 'failed program was' |
---|
206 | Alternatively ensure that your /etc/ld.so.conf (and/or LD_LIBRARY_PATH) includes the |
---|
207 | prefix you're compiling on: '${prefix}' ])) |
---|
208 | LIBS="$dofus_save_libs" |
---|
209 | |
---|
210 | orig_CPPFLAGS=$CPPFLAGS |
---|
211 | CPPFLAGS="$CPPFLAGS $ORBIT_CFLAGS" |
---|
212 | AC_CHECK_ALIGNOF(CORBA_octet) |
---|
213 | AC_CHECK_ALIGNOF(CORBA_boolean) |
---|
214 | AC_CHECK_ALIGNOF(CORBA_char) |
---|
215 | AC_CHECK_ALIGNOF(CORBA_wchar) |
---|
216 | AC_CHECK_ALIGNOF(CORBA_short) |
---|
217 | AC_CHECK_ALIGNOF(CORBA_long) |
---|
218 | AC_CHECK_ALIGNOF(CORBA_long_long) |
---|
219 | AC_CHECK_ALIGNOF(CORBA_float) |
---|
220 | AC_CHECK_ALIGNOF(CORBA_double) |
---|
221 | AC_CHECK_ALIGNOF(CORBA_long_double) |
---|
222 | AC_CHECK_ALIGNOF(CORBA_struct) |
---|
223 | AC_CHECK_ALIGNOF(CORBA_pointer) |
---|
224 | CPPFLAGS=$orig_CPPFLAGS |
---|
225 | |
---|
226 | if test "x$GCC" = "xyes" -a "x$enable_compile_warnings" != "xno"; then |
---|
227 | WARN_CFLAGS="-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations" |
---|
228 | else |
---|
229 | WARN_CFLAGS= |
---|
230 | fi |
---|
231 | |
---|
232 | AC_MSG_CHECKING(what warning flags to pass to the C compiler) |
---|
233 | AC_MSG_RESULT($WARN_CFLAGS) |
---|
234 | AC_SUBST(WARN_CFLAGS) |
---|
235 | |
---|
236 | AC_SUBST(pkglibdir) |
---|
237 | |
---|
238 | DISABLE_DEPRECATED_CFLAGS=" \ |
---|
239 | -DG_DISABLE_DEPRECATED" |
---|
240 | AC_SUBST(DISABLE_DEPRECATED_CFLAGS) |
---|
241 | |
---|
242 | |
---|
243 | dnl |
---|
244 | dnl --------- start linc bits --------- |
---|
245 | dnl |
---|
246 | |
---|
247 | dnl Checks for libraries. |
---|
248 | PKG_CHECK_MODULES(LINC, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gthread-2.0 >= $GLIB_REQUIRED) |
---|
249 | AC_SUBST(LINC_LIBS) |
---|
250 | AC_SUBST(LINC_CFLAGS) |
---|
251 | |
---|
252 | LINC_SSL_SUPPORT=0 |
---|
253 | AC_SUBST(LINC_SSL_SUPPORT) |
---|
254 | AC_SUBST(SSL_LIBS) |
---|
255 | AC_SUBST(SSL_CFLAGS) |
---|
256 | |
---|
257 | dnl Checks for header files. |
---|
258 | AC_HEADER_STDC |
---|
259 | AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h sys/poll.h) |
---|
260 | AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h) |
---|
261 | AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h sys/un.h) |
---|
262 | AC_CHECK_HEADERS(arpa/nameser.h resolv.h) |
---|
263 | dnl AC_CHECK_HEADERS(linux/irda.h) |
---|
264 | |
---|
265 | dnl Checks for library functions. |
---|
266 | AC_CHECK_FUNCS(poll basename) |
---|
267 | AC_CHECK_FUNC(res_init,,[AC_CHECK_LIB(resolv,res_init)]) |
---|
268 | AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)]) |
---|
269 | AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) |
---|
270 | AC_CHECK_FUNC(getaddrinfo,,[AC_CHECK_LIB(nsl,getaddrinfo)]) |
---|
271 | if test x"$ac_cv_func_getaddrinfo" = "xyes" ; then |
---|
272 | AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if getaddrinfo() is available]) |
---|
273 | fi |
---|
274 | AC_CHECK_FUNC(getnameinfo,,[AC_CHECK_LIB(nsl,getnameinfo)]) |
---|
275 | if test x"$ac_cv_func_getnameinfo" = "xyes" ; then |
---|
276 | AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo() is available]) |
---|
277 | fi |
---|
278 | have_inet_pton=no |
---|
279 | AC_CHECK_FUNC(inet_pton,,) |
---|
280 | if 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]) |
---|
283 | fi |
---|
284 | |
---|
285 | # AC_CHECK_TYPE doesn't work here. |
---|
286 | AC_MSG_CHECKING([for socklen_t]) |
---|
287 | AC_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 |
---|
297 | AC_CACHE_CHECK(if sockaddr has sa_len member, |
---|
298 | ac_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)) |
---|
305 | if 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]) |
---|
307 | fi |
---|
308 | |
---|
309 | dnl |
---|
310 | dnl --------- end linc bits --------- |
---|
311 | dnl |
---|
312 | |
---|
313 | |
---|
314 | dnl ----- gtk-doc ------ |
---|
315 | GTK_DOC_CHECK([1.0]) |
---|
316 | |
---|
317 | |
---|
318 | AC_OUTPUT([ |
---|
319 | Makefile |
---|
320 | orbit2-config |
---|
321 | ORBit-2.0.pc |
---|
322 | ORBit-CosNaming-2.0.pc |
---|
323 | ORBit-imodule-2.0.pc |
---|
324 | ORBit.spec |
---|
325 | src/Makefile |
---|
326 | src/idl-compiler/Makefile |
---|
327 | src/idl-compiler/ORBit-idl-2.0.pc |
---|
328 | src/idl/Makefile |
---|
329 | src/idl/CORBA/Makefile |
---|
330 | src/idl/CORBA_PIDL/Makefile |
---|
331 | src/idl/interop/Makefile |
---|
332 | src/idl/misc/Makefile |
---|
333 | src/orb/Makefile |
---|
334 | src/orb/include/Makefile |
---|
335 | src/orb/util/Makefile |
---|
336 | src/orb/GIOP/Makefile |
---|
337 | src/orb/orb-core/Makefile |
---|
338 | src/orb/dynamic/Makefile |
---|
339 | src/orb/poa/Makefile |
---|
340 | src/services/Makefile |
---|
341 | src/services/name/Makefile |
---|
342 | src/services/imodule/Makefile |
---|
343 | include/Makefile |
---|
344 | include/orbit/Makefile |
---|
345 | include/orbit/orbit-config.h |
---|
346 | include/orbit/GIOP/Makefile |
---|
347 | include/orbit/util/Makefile |
---|
348 | include/orbit/orb-core/Makefile |
---|
349 | include/orbit/poa/Makefile |
---|
350 | include/orbit/dynamic/Makefile |
---|
351 | test/Makefile |
---|
352 | test/everything/Makefile |
---|
353 | test/inhibit/Makefile |
---|
354 | test/poa/Makefile |
---|
355 | docs/Makefile |
---|
356 | docs/devel/Makefile |
---|
357 | docs/internals/Makefile |
---|
358 | docs/api/Makefile |
---|
359 | |
---|
360 | linc2/Makefile |
---|
361 | linc2/src/Makefile |
---|
362 | linc2/test/Makefile |
---|
363 | linc2/include/Makefile |
---|
364 | linc2/include/linc/Makefile |
---|
365 | linc2/include/linc/linc-config.h |
---|
366 | ]) |
---|
367 | |
---|
368 | echo "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 |
---|
376 | you want something more stable checkout -r gnome-2-6. |
---|
377 | " |
---|