1 # Process this file with autoconf to produce a configure script.
3 # $Id: configure.in,v 1.8 2004/04/20 08:36:14 smolik Exp $
9 AC_INIT([orte],[0.2.2],[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 ###############################
45 AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
46 AC_DEFINE([CONFIG_ORTE_CYGWIN],[1],[Define if is target CYGWIN])
52 AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
53 AC_DEFINE([CONFIG_ORTE_MINGW],[1],[Define if is target MINGW])
54 AC_DEFINE([HAVE_GETPOT_LONG_ORTE],[1],[Define for ORTE getopt_long self implemetation])
58 if test -z ${CONFIG_ORTE_RT} -a ${CONFIG_ORTE_KERNEL} ; then
60 AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
64 AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
65 AM_CONDITIONAL(CONFIG_ORTE_CYGWIN, test x$CIGWIN = xyes)
66 AM_CONDITIONAL(CONFIG_ORTE_MINGW, test x$MINGW = xyes)
67 AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
69 ###############################
71 moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
72 modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
73 modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
75 AC_SUBST(modulePROGRAMS_INSTALL)
77 ###############################
79 CFLAGS="$CFLAGS -Wall"
80 if test ${USE_RTLINUX} == 'yes' ; then
81 CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
84 if test ${USE_RTAI} == 'yes' ; then
85 CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
87 if test -n ${CONFIG_ORTE_KERNEL} ; then
88 CFLAGS="$CFLAGS $LINUX_CFLAGS"
93 ###############################
94 # Checks for programs.
98 ###############################
99 # Checks for libraries
100 if test -z ${CONFIG_ORTE_RT} ; then
101 AC_CHECK_LIB([ws2_32], [main])
102 AC_CHECK_LIB([pthread], [main])
103 AC_CHECK_LIB([socket], [main])
104 AC_CHECK_LIB([nsl], [main])
107 ###############################
109 AH_VERBATIM([_GNU_SOURCE],[
115 ###############################
116 # Checks for header files.
118 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
121 arpa/inet.h fcntl.h stdio.h netdb.h stdlib.h \
122 string.h sys/ioctl.h sys/time.h unistd.h pthread.h \
123 sys/types.h sys/sockio.h stdarg.h byteswap.h getopt.h \
124 ctype.h signal.h stdint.h],,,[[]])
125 AC_CHECK_HEADERS([sys/socket.h], [], [],
126 [#ifdef HAVE_SYS_TYPES_H
127 #include <sys/types.h>
129 AC_CHECK_HEADERS([netinet/in.h], [], [],
130 [#ifdef HAVE_SYS_TYPES_H
131 #include <sys/types.h>
133 AC_CHECK_HEADERS([net/if.h], [], [],
134 [#ifdef HAVE_SYS_TYPES_H
135 #include <sys/types.h>
137 #ifdef HAVE_SYS_SOCKET_H
138 #include <sys/socket.h>
142 if test ${WIN} == 'yes' ; then
144 winsock2.h ws2tcpip.h windows.h],,,[[]])
147 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
149 asm/byteorder.h linux/ctype.h linux/string.h \
150 linux/module.h linux/if.h linux/socket.h \
151 linux/time.h linux/types.h],,,[[]])
152 AC_CHECK_HEADERS([linux/in.h],,,[
153 #ifdef HAVE_LINUX_SOCKET_H
154 #include <linux/socket.h>
159 if test ${USE_RTLINUX} == 'yes' ; then
162 rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
163 AC_CHECK_HEADERS([nictab.h],,,[
173 if test ${USE_RTAI} == 'yes' ; then
178 ###############################
180 INCLUDES='-I$(top_srcdir)/orte/include'
183 ###############################
184 # Checks for typedefs, structures, and compiler characteristics.
189 ###############################
190 # Checks for library functions.
191 AC_PROG_GCC_TRADITIONAL
192 if test -z ${CONFIG_ORTE_RT} ; then
193 AC_CHECK_FUNCS([strdup gethostbyname getopt_long])
196 AC_CONFIG_FILES([Makefile
198 orte/liborte/Makefile
199 orte/liborte/rtl/Makefile
200 orte/examples/Makefile
201 orte/examples/hello/Makefile
202 orte/examples/reliable/Makefile
203 orte/examples/ping/Makefile
204 orte/examples/spy/Makefile
205 orte/manager/Makefile])
214 # ======================================================================
215 # generate orte/include/orte_config.h
216 # ======================================================================
218 AC_MSG_NOTICE([creating orte/include/orte_config.h])
219 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
220 orte/include/config.h >orte/include/orte_config.h.new
221 if cmp -s orte/include/orte_config.h.new orte/include/orte_config.h; then
222 rm orte/include/orte_config.h.new
223 AC_MSG_NOTICE([orte/include/orte_config.h is unchanged])
225 mv orte/include/orte_config.h.new orte/include/orte_config.h
229 "------------------------------------------------------------------------
232 Source code location: ${srcdir}
234 Compiler flags: ${CFLAGS}
235 Host System Type: ${host}
237 See config.h for further configuration information.
238 ------------------------------------------------------------------------"