source: trunk/third/ORBit/configure.in @ 15271

Revision 15271, 8.9 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15270, 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(src/orb/orbit_types.h)
3
4AC_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
21ORBIT_MAJOR_VERSION=0
22ORBIT_MINOR_VERSION=5
23ORBIT_MICRO_VERSION=4
24ORBIT_INTERFACE_AGE=0
25ORBIT_BINARY_AGE=0
26ORBIT_VERSION=$ORBIT_MAJOR_VERSION.$ORBIT_MINOR_VERSION.$ORBIT_MICRO_VERSION
27AC_SUBST(ORBIT_MAJOR_VERSION)
28AC_SUBST(ORBIT_MINOR_VERSION)
29AC_SUBST(ORBIT_MICRO_VERSION)
30AC_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`
37LT_RELEASE=$ORBIT_VERSION
38LT_CURRENT=$ORBIT_MINOR_VERSION
39LT_REVISION=$ORBIT_MICRO_VERSION
40LT_AGE=$ORBIT_MINOR_VERSION
41AC_SUBST(LT_RELEASE)
42AC_SUBST(LT_CURRENT)
43AC_SUBST(LT_REVISION)
44AC_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.
48ORBIT_SERIAL=9
49AC_SUBST(ORBIT_SERIAL)
50
51# For automake.
52VERSION=$ORBIT_VERSION
53PACKAGE=ORBit
54
55AM_CONFIG_HEADER(config.h)
56
57dnl Initialize automake stuff
58AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
59
60AM_PROG_LIBTOOL
61AM_MAINTAINER_MODE
62
63if test x$enable_static != xyes ; then
64  AC_MSG_ERROR([Static linking is required for a working ORBit.])
65  exit 1
66fi
67
68dnl Checks for programs.
69AC_PROG_CC
70AC_PROG_INSTALL
71
72dnl Handle indent variations
73dnl default is "sopwith indent", use "--enable-indent=kr" for "kr"appy indent.
74AC_ARG_ENABLE(indent, [  --disable-indent        do not indent output code], use_indent=$enableval, use_indent=yes)
75
76AC_MSG_CHECKING([for indentation command to pipe generated c-files through])
77for 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
95done
96AC_MSG_RESULT($INDENT_COMMAND)
97AC_DEFINE_UNQUOTED(INDENT_COMMAND,"$INDENT_COMMAND")
98
99dnl Checks for libraries.
100
101# Make sure that we have glib>=1.1.16
102AM_PATH_GLIB(1.2.1,,
103AC_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
107GMODULE_CFLAGS=`glib-config --cflags gmodule`
108AC_SUBST(GMODULE_CFLAGS)
109GMODULE_LIBS=`glib-config --libs gmodule`
110AC_SUBST(GMODULE_LIBS)
111
112AC_PROG_YACC
113AM_PROG_LEX
114AC_PROG_AWK
115
116dnl Checks for header files.
117AC_HEADER_STDC
118AC_CHECK_HEADERS(fcntl.h unistd.h sys/endian.h endian.h machine/endian.h sys/machine.h sys/isa_defs.h sys/poll.h)
119AC_CHECK_HEADERS(stddef.h wchar.h wcstr.h wctype.h machine/types.h tcpd.h)
120
121dnl Checks for typedefs, structures, and compiler characteristics.
122AC_C_CONST
123AC_C_INLINE
124AC_TYPE_SIZE_T
125
126dnl Checks for library functions.
127AC_FUNC_VPRINTF
128AC_FUNC_ALLOCA
129if test $ac_cv_header_alloca_h = yes; then
130        ORBIT_HAVE_ALLOCA_H=1
131else
132        ORBIT_HAVE_ALLOCA_H=0
133fi
134
135AC_SUBST(ORBIT_HAVE_ALLOCA_H)
136AC_CHECK_FUNCS(poll basename)
137AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
138AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
139
140# AC_CHECK_TYPE doesn't work here.
141AC_MSG_CHECKING([for socklen_t])
142AC_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
156AC_MSG_CHECKING("whether to use TCP wrappers")
157LIBWRAP_PATH=""
158LIB_WRAP=""
159for 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
177done
178if test -n "$LIBWRAP_PATH" || test -n "$LIB_WRAP"; then
179        AC_MSG_RESULT(yes)
180else
181        AC_MSG_RESULT(no)
182fi
183
184if 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
196fi
197
198dnl find out if we need -lnsl or whatever
199LIB_NSL=
200if 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([
205extern int hosts_access;
206int allow_severity, deny_severity;
207], [return hosts_access;], ,[
208dnl try with -lnsl
209OLD_LIBS="$LIBS"
210LIBS="$LIBS -lnsl"
211AC_TRY_LINK([
212extern int hosts_access;
213int allow_severity, deny_severity;
214], [return hosts_access;], LIB_NSL="-lnsl",
215LIBWRAP_PATH="")
216LIBS="$OLD_LIBS"
217])
218        LIBS="$ORIG_LIBS"
219if test -n "$LIB_NSL"; then
220        AC_MSG_RESULT(yes)
221        LIBS="$LIBS $LIB_NSL"
222else
223        AC_MSG_RESULT(no)
224fi
225fi
226
227AC_SUBST(LIBWRAP_PATH)
228AC_SUBST(LIB_WRAP)
229AM_CONDITIONAL(HAVE_HOSTS_ACCESS, test -n "$LIBWRAP_PATH")
230if test -n "$LIBWRAP_PATH"; then
231        AC_DEFINE(HAVE_HOSTS_ACCESS)
232fi
233
234AC_CHECK_FUNC(inet_aton,,[AC_CHECK_LIB(resolv,inet_aton)])
235if test x$ac_cv_func_inet_aton = xno && test x$ac_cv_lib_resolv_inet_aton = xno
236then :
237else
238  AC_DEFINE(HAVE_INET_ATON)
239fi
240
241dnl This generates warnings from autoconf...
242AC_C_BIGENDIAN
243
244AC_TRY_RUN([
245#include <fcntl.h>
246#include <sys/uio.h>
247#define NIOVECS 50
248int 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))
270AC_SUBST(HAVE_LIMITED_WRITEV)
271
272#######################
273# type alignment test #
274#######################
275
276AC_DEFUN(AC_CHECK_ALIGNOF,
277[changequote(<<, >>)dnl
278dnl The name to #define.
279define(<<AC_TYPE_NAME>>, translit(alignof_$1, [a-z *], [A-Z_P]))dnl
280dnl The cache variable name.
281define(<<AC_CV_NAME>>, translit(ac_cv_alignof_$1, [ *], [_p]))dnl
282changequote([, ])dnl
283AC_MSG_CHECKING(alignment of $1)
284align_save_libs="$LIBS"
285LIBS="$GLIB_LIBS $LIBS"
286AC_CACHE_VAL(AC_CV_NAME,
287[AC_TRY_RUN([
288#include <stdio.h>
289#include "$srcdir/src/ORBitutil/basic_types.h"
290typedef struct {char s1;} CORBA_struct;
291typedef void *CORBA_pointer;
292struct test {char s1; $1 s2;};
293main()
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
300AC_MSG_RESULT($AC_CV_NAME)
301LIBS="$align_save_libs"
302AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME)
303undefine([AC_TYPE_NAME])dnl
304undefine([AC_CV_NAME])dnl
305])
306
307orig_CPPFLAGS=$CPPFLAGS
308CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
309AC_CHECK_ALIGNOF(CORBA_short)
310AC_CHECK_ALIGNOF(CORBA_long)
311AC_CHECK_ALIGNOF(CORBA_unsigned_short)
312AC_CHECK_ALIGNOF(CORBA_unsigned_long)
313AC_CHECK_ALIGNOF(CORBA_float)
314AC_CHECK_ALIGNOF(CORBA_double)
315AC_CHECK_ALIGNOF(CORBA_char)
316AC_CHECK_ALIGNOF(CORBA_boolean)
317AC_CHECK_ALIGNOF(CORBA_octet)
318AC_CHECK_ALIGNOF(CORBA_long_double)
319AC_CHECK_ALIGNOF(CORBA_wchar)
320AC_CHECK_ALIGNOF(CORBA_long_long)
321AC_CHECK_ALIGNOF(CORBA_unsigned_long_long)
322AC_CHECK_ALIGNOF(CORBA_struct)
323AC_CHECK_ALIGNOF(CORBA_pointer)
324CPPFLAGS=$orig_CPPFLAGS
325
326AC_CONFIG_SUBDIRS(libIDL)
327AC_CONFIG_SUBDIRS(popt)
328
329AC_SUBST(pkglibdir)
330
331AC_OUTPUT(Makefile
332orbit-config
333src/Makefile
334src/ORBitutil/Makefile
335src/ORBitutil/orbit-os-config.h
336src/IIOP/Makefile
337src/orb/orbit.h
338src/orb/Makefile
339src/orbit-idl-compiler/Makefile
340src/orbit-idl-compiler/backends/Makefile
341src/orbit-idl-compiler/backends/c/Makefile
342src/services/Makefile
343src/services/name/Makefile
344src/services/event/Makefile
345src/daemons/Makefile
346src/daemons/interface_repository/Makefile
347test/Makefile
348test/idl/Makefile
349test/test-poa/Makefile
350ORBit.pc
351ORBit.spec)
Note: See TracBrowser for help on using the repository browser.