1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(src/orb/orbit_types.h) |
---|
3 | |
---|
4 | AC_PREREQ(2.12) # required version of autoconf |
---|
5 | |
---|
6 | # (From GTK+) |
---|
7 | # Making releases: |
---|
8 | # ORBIT_MICRO_VERSION += 1; |
---|
9 | # ORBIT_INTERFACE_AGE += 1; |
---|
10 | # ORBIT_BINARY_AGE += 1; |
---|
11 | # if any functions have been added, set ORBIT_INTERFACE_AGE to 0. |
---|
12 | # if backwards compatibility has been broken, |
---|
13 | # set ORBIT_BINARY_AGE and ORBIT_INTERFACE_AGE to 0. |
---|
14 | # |
---|
15 | ########## |
---|
16 | # Screw the above, just play with the numbers until they match the |
---|
17 | # package version number. As soon as libtool lets us specify |
---|
18 | # sonames we'll start using that for binary compat, but until then |
---|
19 | # caveat user :) |
---|
20 | |
---|
21 | ORBIT_MAJOR_VERSION=0 |
---|
22 | ORBIT_MINOR_VERSION=5 |
---|
23 | ORBIT_MICRO_VERSION=4 |
---|
24 | ORBIT_INTERFACE_AGE=0 |
---|
25 | ORBIT_BINARY_AGE=0 |
---|
26 | ORBIT_VERSION=$ORBIT_MAJOR_VERSION.$ORBIT_MINOR_VERSION.$ORBIT_MICRO_VERSION |
---|
27 | AC_SUBST(ORBIT_MAJOR_VERSION) |
---|
28 | AC_SUBST(ORBIT_MINOR_VERSION) |
---|
29 | AC_SUBST(ORBIT_MICRO_VERSION) |
---|
30 | AC_SUBST(ORBIT_VERSION) |
---|
31 | |
---|
32 | # libtool versioning |
---|
33 | #LT_RELEASE=$ORBIT_MAJOR_VERSION.$ORBIT_MINOR_VERSION |
---|
34 | #LT_CURRENT=`expr $ORBIT_MICRO_VERSION - $ORBIT_INTERFACE_AGE` |
---|
35 | #LT_REVISION=$ORBIT_INTERFACE_AGE |
---|
36 | #LT_AGE=`expr $ORBIT_BINARY_AGE - $ORBIT_INTERFACE_AGE` |
---|
37 | LT_RELEASE=$ORBIT_VERSION |
---|
38 | LT_CURRENT=$ORBIT_MINOR_VERSION |
---|
39 | LT_REVISION=$ORBIT_MICRO_VERSION |
---|
40 | LT_AGE=$ORBIT_MINOR_VERSION |
---|
41 | AC_SUBST(LT_RELEASE) |
---|
42 | AC_SUBST(LT_CURRENT) |
---|
43 | AC_SUBST(LT_REVISION) |
---|
44 | AC_SUBST(LT_AGE) |
---|
45 | |
---|
46 | # Increment this every time a feature is added in the .idl compiler |
---|
47 | # that needs help from the main libraries. |
---|
48 | ORBIT_SERIAL=9 |
---|
49 | AC_SUBST(ORBIT_SERIAL) |
---|
50 | |
---|
51 | # For automake. |
---|
52 | VERSION=$ORBIT_VERSION |
---|
53 | PACKAGE=ORBit |
---|
54 | |
---|
55 | AM_CONFIG_HEADER(config.h) |
---|
56 | |
---|
57 | dnl Initialize automake stuff |
---|
58 | AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) |
---|
59 | |
---|
60 | AM_PROG_LIBTOOL |
---|
61 | AM_MAINTAINER_MODE |
---|
62 | |
---|
63 | if test x$enable_static != xyes ; then |
---|
64 | AC_MSG_ERROR([Static linking is required for a working ORBit.]) |
---|
65 | exit 1 |
---|
66 | fi |
---|
67 | |
---|
68 | dnl Checks for programs. |
---|
69 | AC_PROG_CC |
---|
70 | AC_PROG_INSTALL |
---|
71 | |
---|
72 | dnl Handle indent variations |
---|
73 | dnl default is "sopwith indent", use "--enable-indent=kr" for "kr"appy indent. |
---|
74 | AC_ARG_ENABLE(indent, [ --disable-indent do not indent output code], use_indent=$enableval, use_indent=yes) |
---|
75 | |
---|
76 | AC_MSG_CHECKING([for indentation command to pipe generated c-files through]) |
---|
77 | for test_indent in "$use_indent" "indent -" cat; do |
---|
78 | case "$test_indent" in |
---|
79 | yes) |
---|
80 | INDENT_COMMAND="indent -npro -bad -bap -bc -sob -br -ce -cli2 -npcs -di1 -psl -i3 -lp -st" |
---|
81 | ;; |
---|
82 | no) |
---|
83 | INDENT_COMMAND=cat |
---|
84 | ;; |
---|
85 | kr) |
---|
86 | INDENT_COMMAND="indent -npro -kr -i8 -bad -fca -sc -sob -psl" |
---|
87 | ;; |
---|
88 | *) |
---|
89 | INDENT_COMMAND="$test_indent" |
---|
90 | esac |
---|
91 | |
---|
92 | if echo 2>/dev/null | $INDENT_COMMAND 2>/dev/null 1>&2 ; then |
---|
93 | break |
---|
94 | fi |
---|
95 | done |
---|
96 | AC_MSG_RESULT($INDENT_COMMAND) |
---|
97 | AC_DEFINE_UNQUOTED(INDENT_COMMAND,"$INDENT_COMMAND") |
---|
98 | |
---|
99 | dnl Checks for libraries. |
---|
100 | |
---|
101 | # Make sure that we have glib>=1.1.16 |
---|
102 | AM_PATH_GLIB(1.2.1,, |
---|
103 | AC_MSG_ERROR([ |
---|
104 | *** GLIB 1.2.1 or better is required. The latest version of GLIB |
---|
105 | *** is always available from ftp://ftp.gtk.org/.])) |
---|
106 | |
---|
107 | GMODULE_CFLAGS=`glib-config --cflags gmodule` |
---|
108 | AC_SUBST(GMODULE_CFLAGS) |
---|
109 | GMODULE_LIBS=`glib-config --libs gmodule` |
---|
110 | AC_SUBST(GMODULE_LIBS) |
---|
111 | |
---|
112 | AC_PROG_YACC |
---|
113 | AM_PROG_LEX |
---|
114 | AC_PROG_AWK |
---|
115 | |
---|
116 | dnl Checks for header files. |
---|
117 | AC_HEADER_STDC |
---|
118 | 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) |
---|
119 | AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h tcpd.h) |
---|
120 | |
---|
121 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
122 | AC_C_CONST |
---|
123 | AC_C_INLINE |
---|
124 | AC_TYPE_SIZE_T |
---|
125 | |
---|
126 | dnl Checks for library functions. |
---|
127 | AC_FUNC_VPRINTF |
---|
128 | AC_FUNC_ALLOCA |
---|
129 | if test $ac_cv_header_alloca_h = yes; then |
---|
130 | ORBIT_HAVE_ALLOCA_H=1 |
---|
131 | else |
---|
132 | ORBIT_HAVE_ALLOCA_H=0 |
---|
133 | fi |
---|
134 | |
---|
135 | AC_SUBST(ORBIT_HAVE_ALLOCA_H) |
---|
136 | AC_CHECK_FUNCS(poll basename) |
---|
137 | AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)]) |
---|
138 | AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)]) |
---|
139 | |
---|
140 | # AC_CHECK_TYPE doesn't work here. |
---|
141 | AC_MSG_CHECKING([for socklen_t]) |
---|
142 | AC_TRY_COMPILE( |
---|
143 | [#include <sys/types.h> |
---|
144 | #include <sys/socket.h>], |
---|
145 | [socklen_t len;], |
---|
146 | [AC_MSG_RESULT(yes)], |
---|
147 | [AC_DEFINE(socklen_t, size_t) |
---|
148 | AC_MSG_RESULT(no)]) |
---|
149 | |
---|
150 | # This is a hack. This is a bad hack in order to work around libtool not letting us |
---|
151 | # link a .a (libwrap.a) into a libtool library (libIIOP.la) for internal use by that |
---|
152 | # libtool library. |
---|
153 | |
---|
154 | # Modified to prefer shared libwrap by Adam Powell |
---|
155 | |
---|
156 | AC_MSG_CHECKING("whether to use TCP wrappers") |
---|
157 | LIBWRAP_PATH="" |
---|
158 | LIB_WRAP="" |
---|
159 | for I in $LDFLAGS $LIBS -L/usr/lib; do |
---|
160 | case "$I" in |
---|
161 | -L*) |
---|
162 | THEFILE="`echo $I | sed -e 's,^-L,,'`" |
---|
163 | echo "From $I, checking in dir $THEFILE for libwrap.so" 1>&5 |
---|
164 | if test -f $THEFILE/libwrap.so; then |
---|
165 | LIB_WRAP=-lwrap |
---|
166 | echo "Found $THEFILE/libwrap.so" 1>&5 |
---|
167 | break |
---|
168 | else |
---|
169 | echo "From $I, checking in dir $THEFILE for libwrap.a" 1>&5 |
---|
170 | if test -f $THEFILE/libwrap.a; then |
---|
171 | LIBWRAP_PATH=$THEFILE/libwrap.a |
---|
172 | echo "Found $LIBWRAP_PATH" 1>&5 |
---|
173 | break |
---|
174 | fi |
---|
175 | fi |
---|
176 | esac |
---|
177 | done |
---|
178 | if test -n "$LIBWRAP_PATH" || test -n "$LIB_WRAP"; then |
---|
179 | AC_MSG_RESULT(yes) |
---|
180 | else |
---|
181 | AC_MSG_RESULT(no) |
---|
182 | fi |
---|
183 | |
---|
184 | if test -n "$LIBWRAP_PATH"; then |
---|
185 | nm $LIBWRAP_PATH | grep 'T setenv' && LIBWRAP_PATH="" |
---|
186 | if test -z "$LIBWRAP_PATH"; then |
---|
187 | echo "*********************************************************" |
---|
188 | echo " You have a broken TCP wrappers library (setenv included)" |
---|
189 | echo " Please get the latest TCP wrappers package from your OS" |
---|
190 | echo " vendor, or recompile TCP wrappers to not include a" |
---|
191 | echo " setenv() implementation." |
---|
192 | echo |
---|
193 | echo "Not using TCP wrappers after all." |
---|
194 | echo "*********************************************************" |
---|
195 | fi |
---|
196 | fi |
---|
197 | |
---|
198 | dnl find out if we need -lnsl or whatever |
---|
199 | LIB_NSL= |
---|
200 | if test -n "$LIBWRAP_PATH"; then |
---|
201 | AC_MSG_CHECKING(whether -lwrap requires -lnsl) |
---|
202 | ORIG_LIBS="$LIBS" |
---|
203 | LIBS="$LIBWRAP_PATH $LIB_WRAP $LIBS" |
---|
204 | AC_TRY_LINK([ |
---|
205 | extern int hosts_access; |
---|
206 | int allow_severity, deny_severity; |
---|
207 | ], [return hosts_access;], ,[ |
---|
208 | dnl try with -lnsl |
---|
209 | OLD_LIBS="$LIBS" |
---|
210 | LIBS="$LIBS -lnsl" |
---|
211 | AC_TRY_LINK([ |
---|
212 | extern int hosts_access; |
---|
213 | int allow_severity, deny_severity; |
---|
214 | ], [return hosts_access;], LIB_NSL="-lnsl", |
---|
215 | LIBWRAP_PATH="") |
---|
216 | LIBS="$OLD_LIBS" |
---|
217 | ]) |
---|
218 | LIBS="$ORIG_LIBS" |
---|
219 | if test -n "$LIB_NSL"; then |
---|
220 | AC_MSG_RESULT(yes) |
---|
221 | LIBS="$LIBS $LIB_NSL" |
---|
222 | else |
---|
223 | AC_MSG_RESULT(no) |
---|
224 | fi |
---|
225 | fi |
---|
226 | |
---|
227 | AC_SUBST(LIBWRAP_PATH) |
---|
228 | AC_SUBST(LIB_WRAP) |
---|
229 | AM_CONDITIONAL(HAVE_HOSTS_ACCESS, test -n "$LIBWRAP_PATH") |
---|
230 | if test -n "$LIBWRAP_PATH"; then |
---|
231 | AC_DEFINE(HAVE_HOSTS_ACCESS) |
---|
232 | fi |
---|
233 | |
---|
234 | AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)]) |
---|
235 | if test x$ac_cv_func_inet_aton = xno && test x$ac_cv_lib_resolv_inet_aton = xno |
---|
236 | then : |
---|
237 | else |
---|
238 | AC_DEFINE(HAVE_INET_ATON) |
---|
239 | fi |
---|
240 | |
---|
241 | dnl This generates warnings from autoconf... |
---|
242 | AC_C_BIGENDIAN |
---|
243 | |
---|
244 | AC_TRY_RUN([ |
---|
245 | #include <fcntl.h> |
---|
246 | #include <sys/uio.h> |
---|
247 | #define NIOVECS 50 |
---|
248 | int main(int argc, char *argv[]) |
---|
249 | { |
---|
250 | char dumbuf[20] = "\n"; |
---|
251 | struct iovec iovecs[NIOVECS]; |
---|
252 | int i,fd; |
---|
253 | |
---|
254 | for(i = 0; i < NIOVECS; i++) { |
---|
255 | iovecs[i].iov_base = dumbuf; |
---|
256 | iovecs[i].iov_len = 1; |
---|
257 | } |
---|
258 | |
---|
259 | fd=open("/dev/null", O_WRONLY); |
---|
260 | if(fd==-1) |
---|
261 | return(1); |
---|
262 | |
---|
263 | if(writev(fd, iovecs, NIOVECS) < 0) |
---|
264 | return 1; |
---|
265 | |
---|
266 | close(fd); |
---|
267 | return 0; |
---|
268 | } |
---|
269 | ], , AC_DEFINE(HAVE_LIMITED_WRITEV), AC_DEFINE(HAVE_LIMITED_WRITEV)) |
---|
270 | AC_SUBST(HAVE_LIMITED_WRITEV) |
---|
271 | |
---|
272 | ####################### |
---|
273 | # type alignment test # |
---|
274 | ####################### |
---|
275 | |
---|
276 | AC_DEFUN(AC_CHECK_ALIGNOF, |
---|
277 | [changequote(<<, >>)dnl |
---|
278 | dnl The name to #define. |
---|
279 | define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl |
---|
280 | dnl The cache variable name. |
---|
281 | define(<<AC_CV_NAME>>, translit(ac_cv_alignof_$1, [ *], [_p]))dnl |
---|
282 | changequote([, ])dnl |
---|
283 | AC_MSG_CHECKING(alignment of $1) |
---|
284 | align_save_libs="$LIBS" |
---|
285 | LIBS="$GLIB_LIBS $LIBS" |
---|
286 | AC_CACHE_VAL(AC_CV_NAME, |
---|
287 | [AC_TRY_RUN([ |
---|
288 | #include <stdio.h> |
---|
289 | #include "$srcdir/src/ORBitutil/basic_types.h" |
---|
290 | typedef struct {char s1;} CORBA_struct; |
---|
291 | typedef void *CORBA_pointer; |
---|
292 | struct test {char s1; $1 s2;}; |
---|
293 | main() |
---|
294 | { |
---|
295 | FILE *f=fopen("conftestval", "w"); |
---|
296 | if (!f) exit(1); |
---|
297 | fprintf(f, "%d\n", &(((struct test*)0)->s2)); |
---|
298 | exit(0); |
---|
299 | }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, AC_CV_NAME=0)])dnl |
---|
300 | AC_MSG_RESULT($AC_CV_NAME) |
---|
301 | LIBS="$align_save_libs" |
---|
302 | AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) |
---|
303 | undefine([AC_TYPE_NAME])dnl |
---|
304 | undefine([AC_CV_NAME])dnl |
---|
305 | ]) |
---|
306 | |
---|
307 | orig_CPPFLAGS=$CPPFLAGS |
---|
308 | CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS" |
---|
309 | AC_CHECK_ALIGNOF(CORBA_short) |
---|
310 | AC_CHECK_ALIGNOF(CORBA_long) |
---|
311 | AC_CHECK_ALIGNOF(CORBA_unsigned_short) |
---|
312 | AC_CHECK_ALIGNOF(CORBA_unsigned_long) |
---|
313 | AC_CHECK_ALIGNOF(CORBA_float) |
---|
314 | AC_CHECK_ALIGNOF(CORBA_double) |
---|
315 | AC_CHECK_ALIGNOF(CORBA_char) |
---|
316 | AC_CHECK_ALIGNOF(CORBA_boolean) |
---|
317 | AC_CHECK_ALIGNOF(CORBA_octet) |
---|
318 | AC_CHECK_ALIGNOF(CORBA_long_double) |
---|
319 | AC_CHECK_ALIGNOF(CORBA_wchar) |
---|
320 | AC_CHECK_ALIGNOF(CORBA_long_long) |
---|
321 | AC_CHECK_ALIGNOF(CORBA_unsigned_long_long) |
---|
322 | AC_CHECK_ALIGNOF(CORBA_struct) |
---|
323 | AC_CHECK_ALIGNOF(CORBA_pointer) |
---|
324 | CPPFLAGS=$orig_CPPFLAGS |
---|
325 | |
---|
326 | AC_CONFIG_SUBDIRS(libIDL) |
---|
327 | AC_CONFIG_SUBDIRS(popt) |
---|
328 | |
---|
329 | AC_SUBST(pkglibdir) |
---|
330 | |
---|
331 | AC_OUTPUT(Makefile |
---|
332 | orbit-config |
---|
333 | src/Makefile |
---|
334 | src/ORBitutil/Makefile |
---|
335 | src/ORBitutil/orbit-os-config.h |
---|
336 | src/IIOP/Makefile |
---|
337 | src/orb/orbit.h |
---|
338 | src/orb/Makefile |
---|
339 | src/orbit-idl-compiler/Makefile |
---|
340 | src/orbit-idl-compiler/backends/Makefile |
---|
341 | src/orbit-idl-compiler/backends/c/Makefile |
---|
342 | src/services/Makefile |
---|
343 | src/services/name/Makefile |
---|
344 | src/services/event/Makefile |
---|
345 | src/daemons/Makefile |
---|
346 | src/daemons/interface_repository/Makefile |
---|
347 | test/Makefile |
---|
348 | test/idl/Makefile |
---|
349 | test/test-poa/Makefile |
---|
350 | ORBit.pc |
---|
351 | ORBit.spec) |
---|