1 # Process this file with autoconf to produce a configure script.
3 # $Id: configure.in,v 1.4 2004/02/15 22:23:51 smolik 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 ###############################
65 CFLAGS="$CFLAGS -Wall"
66 if test ${USE_RTLINUX} == 'yes' ; then
67 CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
70 if test ${USE_RTAI} == 'yes' ; then
71 CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
73 if test -n ${CONFIG_ORTE_KERNEL} ; then
74 CFLAGS="$CFLAGS $LINUX_CFLAGS"
79 ###############################
80 # Checks for programs.
84 ###############################
85 # Checks for libraries (not for RT)
86 if test -z ${CONFIG_ORTE_RT} ; then
87 AC_CHECK_LIB([ws2_32], [main])
88 AC_CHECK_LIB([pthread], [main])
91 ###############################
93 AH_VERBATIM([_GNU_SOURCE],[
99 ###############################
100 # Checks for header files.
102 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
105 arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
106 string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
107 stdarg.h sys/types.h net/if.h byteswap.h getopt.h \
108 ctype.h semaphore.h signal.h],,,[[]])
111 if test ${WIN} == 'yes' ; then
113 winsock2.h ws2tcpip.h windows.h],,,[[]])
116 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
118 asm/byteorder.h linux/ctype.h linux/string.h \
119 linux/module.h linux/if.h linux/socket.h \
120 linux/time.h linux/types.h],,,[[]])
121 AC_CHECK_HEADERS([linux/in.h],,,[
122 #ifdef HAVE_LINUX_SOCKET_H
123 #include <linux/socket.h>
128 if test ${USE_RTLINUX} == 'yes' ; then
130 string.h pthread.h semaphore.h \
131 rtl.h rtl_malloc.h udp.h nic.h time.h],,,[[]])
132 AC_CHECK_HEADERS([nictab.h],,,[
142 if test ${USE_RTAI} == 'yes' ; then
147 ###############################
149 INCLUDES='-I$(top_srcdir)/orte/include'
152 ###############################
153 # Checks for typedefs, structures, and compiler characteristics.
158 ###############################
159 # Checks for library functions.
160 AC_PROG_GCC_TRADITIONAL
161 if test -z ${CONFIG_ORTE_RT} ; then
162 AC_CHECK_FUNCS([strdup gethostbyname])
165 AC_CONFIG_FILES([Makefile
167 orte/liborte/Makefile
168 orte/liborte/rtl/Makefile
169 orte/examples/Makefile
170 orte/examples/hello/Makefile
171 orte/examples/reliable/Makefile
172 orte/examples/ping/Makefile
173 orte/examples/spy/Makefile
174 orte/manager/Makefile])
183 # ======================================================================
184 # generate orte/include/orte_config.h
185 # ======================================================================
187 AC_MSG_NOTICE([creating orte/include/orte_config.h])
188 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
189 orte/include/config.h >orte/include/orte_config.h.new
190 if cmp -s orte/include/orte_config.h.new orte/include/orte_config.h; then
191 rm orte/include/orte_config.h.new
192 AC_MSG_NOTICE([orte/include/orte_config.h is unchanged])
194 mv orte/include/orte_config.h.new orte/include/orte_config.h
198 "------------------------------------------------------------------------
201 Source code location: ${srcdir}
203 Compiler flags: ${CFLAGS}
204 Host System Type: ${host}
206 See config.h for further configuration information.
207 ------------------------------------------------------------------------"