1 # Process this file with autoconf to produce a configure script.
3 # $Id: configure.in,v 1.3 2004/02/11 00:38:24 ppisa Exp $
9 AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz])
10 AC_CONFIG_AUX_DIR(admin)
12 #Check for CPU / vendor / OS
15 AM_CONFIG_HEADER(orte/include/config.h)
16 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
17 # Activate maintainer mode
22 ###############################
27 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
28 AC_SUBST(ORTE_MAJOR_VERSION)
29 AC_SUBST(ORTE_MINOR_VERSION)
30 AC_SUBST(ORTE_MICRO_VERSION)
31 AC_SUBST(ORTE_VERSION)
34 ###############################
42 AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
46 if test -z ${CONFIG_ORTE_RT} -a ${CONFIG_ORTE_KERNEL} ; then
48 AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
52 AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
53 AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
55 ###############################
57 moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
58 modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
59 modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
61 AC_SUBST(modulePROGRAMS_INSTALL)
63 ###############################
64 # Checks for programs.
68 ###############################
69 # Checks for libraries (not for RT)
70 if test -z ${CONFIG_ORTE_RT} ; then
71 AC_CHECK_LIB([ws2_32], [main])
72 AC_CHECK_LIB([pthread], [main])
75 ###############################
77 AH_VERBATIM([_GNU_SOURCE],[
83 ###############################
85 CFLAGS="$CFLAGS -Wall"
86 if test ${USE_RTLINUX} == 'yes' ; then
87 CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
89 if test ${USE_RTAI} == 'yes' ; then
90 CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
92 if test -n ${CONFIG_ORTE_KERNEL} ; then
93 CFLAGS="$CFLAGS $LINUX_CFLAGS"
98 ###############################
99 # Checks for header files.
101 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
104 arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
105 string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
106 stdarg.h sys/types.h net/if.h byteswap.h getopt.h \
107 ctype.h semaphore.h signal.h],,,[[]])
110 if test ${WIN} == 'yes' ; then
112 winsock2.h ws2tcpip.h windows.h],,,[[]])
115 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
117 asm/byteorder.h linux/ctype.h linux/string.h \
118 linux/module.h linux/if.h linux/socket.h \
119 linux/time.h linux/types.h],,,[[]])
120 AC_CHECK_HEADERS([linux/in.h],,,[
121 #ifdef HAVE_LINUX_SOCKET_H
122 #include <linux/socket.h>
127 if test ${USE_RTLINUX} == 'yes' ; then
129 string.h pthread.h semaphore.h \
130 rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
131 AC_CHECK_HEADERS([nictab.h],,,[
141 if test ${USE_RTAI} == 'yes' ; then
146 ###############################
148 INCLUDES='-I$(top_srcdir)/orte/include'
151 ###############################
152 # Checks for typedefs, structures, and compiler characteristics.
157 ###############################
158 # Checks for library functions.
159 AC_PROG_GCC_TRADITIONAL
160 if test -z ${CONFIG_ORTE_RT} ; then
161 AC_CHECK_FUNCS([strdup gethostbyname])
164 AC_CONFIG_FILES([Makefile
166 orte/liborte/Makefile
167 orte/liborte/rtl/Makefile
168 orte/examples/Makefile
169 orte/examples/hello/Makefile
170 orte/examples/reliable/Makefile
171 orte/examples/ping/Makefile
172 orte/examples/spy/Makefile
173 orte/manager/Makefile])
182 # ======================================================================
183 # generate orte/include/orte_config.h
184 # ======================================================================
186 AC_MSG_NOTICE([creating orte/include/orte_config.h])
187 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
188 orte/include/config.h >orte/include/orte_config.h.new
189 if cmp -s orte/include/orte_config.h.new orte/include/orte_config.h; then
190 rm orte/include/orte_config.h.new
191 AC_MSG_NOTICE([orte/include/orte_config.h is unchanged])
193 mv orte/include/orte_config.h.new orte/include/orte_config.h
197 "------------------------------------------------------------------------
200 Source code location: ${srcdir}
202 Compiler flags: ${CFLAGS}
203 Host System Type: ${host}
205 See config.h for further configuration information.
206 ------------------------------------------------------------------------"