1 # Process this file with autoconf to produce a configure script.
3 # $Id: configure.in,v 1.15 2008/10/07 21:19:01 smolik Exp $
9 AC_INIT([orte],[0.3.3],[orte@rtime.felk.cvut.cz],[],[http://orte.sf.net])
10 AC_CONFIG_AUX_DIR(admin)
12 ###############################
19 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
20 AC_SUBST(ORTE_MAJOR_VERSION)
21 AC_SUBST(ORTE_MINOR_VERSION)
22 AC_SUBST(ORTE_MICRO_VERSION)
23 AC_SUBST(ORTE_VERSION)
24 AC_SUBST(ORTE_INTERFACE_AGE)
25 AC_SUBST(ORTE_BINARY_AGE)
27 ORTE_MICRO_VERSION_NUM=`echo $ORTE_MICRO_VERSION | sed 's/[[a-zA-Z]]//g'`
28 LT_RELEASE=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION
29 LT_CURRENT=`expr $ORTE_MICRO_VERSION_NUM - $ORTE_INTERFACE_AGE`
30 LT_REVISION=$ORTE_INTERFACE_AGE
31 LT_AGE=`expr $ORTE_BINARY_AGE - $ORTE_INTERFACE_AGE`
40 echo "ORTE version $PACKAGE_VERSION"
44 #Check for CPU / vendor / OS
47 AC_CONFIG_HEADER(orte/include/orte/orte_config.h)
48 AM_INIT_AUTOMAKE(no-define)
51 # Activate maintainer mode
56 ###############################
67 AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
68 AC_DEFINE([CONFIG_ORTE_CYGWIN],[1],[Define if is target CYGWIN])
74 AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
75 AC_DEFINE([CONFIG_ORTE_MINGW],[1],[Define if is target MINGW])
76 AC_DEFINE([HAVE_GETPOT_LONG_ORTE],[1],[Define for ORTE getopt_long self implemetation])
80 if test -z "${CONFIG_ORTE_RT}" -a "${CONFIG_ORTE_KERNEL}" ; then
82 AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
86 AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
87 AM_CONDITIONAL(CONFIG_ORTE_CYGWIN, test x$CIGWIN = xyes)
88 AM_CONDITIONAL(CONFIG_ORTE_MINGW, test x$MINGW = xyes)
89 AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
91 ###############################
93 moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
94 modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
95 modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
97 AC_SUBST(modulePROGRAMS_INSTALL)
99 ###############################
101 CFLAGS="$CFLAGS -Wall"
102 if test ${USE_RTLINUX} == 'yes' ; then
103 CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
106 if test ${USE_RTAI} == 'yes' ; then
107 CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
109 if test -n "${CONFIG_ORTE_KERNEL}" ; then
110 CFLAGS="$CFLAGS $LINUX_CFLAGS"
115 ###############################
116 # Checks for programs.
122 ###############################
123 # Checks for ability to compile ORTE_IDL
126 ###############################
127 # Checks for ability to compile JORTE
130 ###############################
131 # Checks for libraries and init libtools
132 if test -z "${CONFIG_ORTE_RT}" ; then
133 AC_CHECK_LIB([ws2_32], [main])
134 AC_CHECK_LIB([socket], [main])
135 AC_CHECK_LIB([nsl], [main])
136 dnl Check for pthreads
137 AC_CHECK_LIB(pthread, pthread_create, ,
138 AC_CHECK_LIB(c_r, pthread_create, ,
139 if test ${MINGW} == 'yes' ; then
140 INTERNAL_PTHREAD_LIBS=' -L$(top_srcdir)/orte/contrib/win_pthread/ -lpthread'
141 AC_MSG_NOTICE([Using internal version of pthreads!!!])
143 AC_MSG_ERROR([Can't compile without pthreads!!!])
149 ###############################
151 AH_VERBATIM([_GNU_SOURCE],[
157 ###############################
158 # Checks for header files.
160 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
163 arpa/inet.h fcntl.h stdio.h netdb.h stdlib.h \
164 string.h sys/ioctl.h sys/stat.h sys/time.h unistd.h pthread.h \
165 sys/types.h sys/sockio.h stdarg.h byteswap.h getopt.h \
166 ctype.h signal.h stdint.h errno.h],,,[[]])
167 AC_CHECK_HEADERS([sys/socket.h], [], [],
168 [#ifdef HAVE_SYS_TYPES_H
169 #include <sys/types.h>
171 AC_CHECK_HEADERS([netinet/in.h], [], [],
172 [#ifdef HAVE_SYS_TYPES_H
173 #include <sys/types.h>
175 AC_CHECK_HEADERS([net/if.h], [], [],
176 [#ifdef HAVE_SYS_TYPES_H
177 #include <sys/types.h>
179 #ifdef HAVE_SYS_SOCKET_H
180 #include <sys/socket.h>
184 if test ${WIN} == 'yes' ; then
186 winsock2.h ws2tcpip.h windows.h w32api/windows.h],,,[[]])
187 AC_CHECK_FUNCS([gettimeofday])
190 if test "${CONFIG_ORTE_KERNEL}" == 'yes' ; then
192 asm/byteorder.h linux/ctype.h linux/string.h \
193 linux/module.h linux/if.h linux/socket.h \
194 linux/time.h linux/types.h],,,[[]])
195 AC_CHECK_HEADERS([linux/in.h],,,[
196 #ifdef HAVE_LINUX_SOCKET_H
197 #include <linux/socket.h>
202 if test ${USE_RTLINUX} == 'yes' ; then
205 rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
206 AC_CHECK_HEADERS([nictab.h],,,[
214 AC_CHECK_HEADERS([onetd.h],,,[
215 #ifdef HAVE_LINUX_IF_H
216 #include <linux/if.h>
218 #ifdef HAVE_LINUX_IN_H
219 #include <linux/in.h>
221 #ifdef HAVE_PTHREAD_H
227 if test ${USE_RTAI} == 'yes' ; then
232 ###############################
234 INCLUDES='-I$(top_srcdir)/orte/include -I$(top_builddir)/orte/include'
237 ###############################
238 # Checks for typedefs, structures, and compiler characteristics.
240 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,[#ifdef HAVE_SYS_TYPES_H
241 #include <sys/types.h>
243 #ifdef HAVE_SYS_SOCKET_H
244 #include <sys/socket.h>
246 #ifdef HAVE_WINSOCK2_H
247 #include <winsock2.h>
251 AC_CHECK_HEADERS([ifaddrs.h],,,[#ifdef HAVE_SYS_TYPES_H
252 #include <sys/types.h>
255 ###############################
256 # Endianness support attempts to allow build with same configure
257 # for both cases on recent systems
260 AC_CHECK_HEADERS([endian.h sys/param.h], [], [],[])
262 if test "$ac_cv_header_sys_param_h" == 'yes' ; then
263 AC_MSG_CHECKING([whether BYTE_ORDER defined in sys/param.h])
264 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/param.h>], [
265 unsigned int a=BYTE_ORDER;
266 unsigned int b=BIG_ENDIAN;
267 unsigned int c=LITTLE_ENDIAN;])],
268 [AC_MSG_RESULT([yes])
269 need_endian_test=no],[AC_MSG_RESULT([no])])
271 if test "$need_endian_test" == 'yes' ; then
272 AC_MSG_CHECKING([whether __BYTE_ORDER defined in sys/param.h])
273 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/param.h>], [
274 unsigned int a=__BYTE_ORDER;
275 unsigned int b=__BIG_ENDIAN;
276 unsigned int c=__LITTLE_ENDIAN;])],
277 [AC_MSG_RESULT([yes])
278 need_endian_test=no],[AC_MSG_RESULT([no])])
281 if test "$ac_cv_header_endian_h" == 'yes' ; then
282 if test "$need_endian_test" == 'yes' ; then
283 AC_MSG_CHECKING([whether endian can be determined from endian.h])
284 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <endian.h>], [
285 unsigned int a=__BYTE_ORDER;
286 unsigned int b=__BIG_ENDIAN;
287 unsigned int c=__LITTLE_ENDIAN;])],
288 [AC_MSG_RESULT([yes])
289 need_endian_test=no],[AC_MSG_RESULT([no])])
293 if test "$need_endian_test" == 'yes' ; then
298 #if defined(HAVE_ENDIAN_H) || defined(HAVE_SYS_PARAM_H)
299 #ifdef HAVE_SYS_PARAM_H
300 #include <sys/param.h>
302 #if defined(HAVE_ENDIAN_H) && !defined(BYTE_ORDER) && !defined(__BYTE_ORDER)
305 #if defined(__BYTE_ORDER)
306 #if __BYTE_ORDER == __BIG_ENDIAN
307 #define WORDS_BIGENDIAN 1
309 #elif defined(BYTE_ORDER)
310 #if BYTE_ORDER == BIG_ENDIAN
311 #define WORDS_BIGENDIAN 1
320 ###############################
321 # Checks for library functions.
322 AC_PROG_GCC_TRADITIONAL
323 if test -z "${CONFIG_ORTE_RT}" ; then
324 AC_CHECK_FUNCS([gethostbyname getopt_long sigwaitinfo])
327 AC_CONFIG_FILES([Makefile
329 orte/liborte/Makefile
330 orte/liborte/rtl/Makefile
331 orte/examples/Makefile
332 orte/examples/hello/Makefile
333 orte/examples/multicast/Makefile
334 orte/examples/reliable/Makefile
335 orte/examples/ping/Makefile
336 orte/examples/spy/Makefile
337 orte/examples/schneider/Makefile
338 orte/examples/mpo/Makefile
339 orte/idl-compiler/Makefile
340 orte/libjorte/Makefile
341 orte/manager/Makefile])
343 LIBS="$LIBS$INTERNAL_PTHREAD_LIBS"
351 # ======================================================================
352 # generate orte/include/orte/orte_config.h
353 # ======================================================================
355 AC_MSG_NOTICE([fixing orte/include/orte/orte_config.h])
356 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
357 orte/include/orte/orte_config.h >orte/include/orte/orte_config.h.new
358 if cmp -s orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h; then
359 rm orte/include/orte/orte_config.h.new
360 AC_MSG_NOTICE([orte/include/orte/orte_config.h is unchanged])
362 mv orte/include/orte/orte_config.h.new orte/include/orte/orte_config.h
366 "------------------------------------------------------------------------
369 Source code location: ${srcdir}
371 Compiler flags: ${CFLAGS}
372 Host System Type: ${host}
374 See orte_config.h for future configuration information.
379 ------------------------------------------------------------------------"