]> rtime.felk.cvut.cz Git - orte.git/blob - configure.in
OCERA SF CVS tree of ORTE framework updated to
[orte.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 #
3 # $Id: configure.in,v 1.3 2004/02/11 00:38:24 ppisa Exp $
4
5 # autoconf requirement
6
7 AC_PREREQ([2.56])
8
9 AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz])
10 AC_CONFIG_AUX_DIR(admin)
11
12 #Check for CPU / vendor / OS
13 AC_CANONICAL_HOST
14 AC_CANONICAL_TARGET
15 AM_CONFIG_HEADER(orte/include/config.h)
16 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
17 # Activate maintainer mode
18 AM_MAINTAINER_MODE
19
20 DS_LINUX()
21
22 ###############################
23 # Package info
24 ORTE_MAJOR_VERSION=0
25 ORTE_MINOR_VERSION=2
26 ORTE_MICRO_VERSION=0
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)
32
33
34 ###############################
35 # target
36 WIN='no'
37 UNIX='no'
38 case "$target" in
39   *-cygwin* | *-mingw*)
40     CFLAGS="$CFLAGS"
41     WIN='yes'
42     AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
43     ;;
44   *)
45     # Assume Unix.
46     if test -z ${CONFIG_ORTE_RT} -a ${CONFIG_ORTE_KERNEL} ; then
47       UNIX='yes'
48       AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
49     fi
50     ;;
51 esac
52 AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
53 AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
54
55 ###############################
56 # modules
57 moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
58 modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
59 modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
60 AC_SUBST(moduledir)
61 AC_SUBST(modulePROGRAMS_INSTALL)
62
63 ###############################
64 # Checks for programs.
65 AC_PROG_CC
66 AC_PROG_RANLIB
67
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])
73 fi
74
75 ###############################
76 # enable GNU source
77 AH_VERBATIM([_GNU_SOURCE],[
78 #ifndef _GNU_SOURCE
79   #define _GNU_SOURCE
80 #endif
81 ]) 
82
83 ###############################
84 # CFLAGS
85 CFLAGS="$CFLAGS -Wall"
86 if test ${USE_RTLINUX} == 'yes' ; then
87   CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
88 else
89   if test ${USE_RTAI} == 'yes' ; then
90     CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
91   else
92     if test -n ${CONFIG_ORTE_KERNEL} ; then
93       CFLAGS="$CFLAGS $LINUX_CFLAGS"
94     fi
95   fi
96 fi
97
98 ###############################
99 # Checks for header files.
100 # user space
101 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
102     AC_HEADER_STDC
103     AC_CHECK_HEADERS([\
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],,,[[]])
108 fi
109 # win32
110 if test ${WIN} == 'yes' ; then
111     AC_CHECK_HEADERS([\
112     winsock2.h ws2tcpip.h windows.h],,,[[]])
113 fi
114 # kernel
115 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
116     AC_CHECK_HEADERS([\
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>
123     #endif
124     ])
125 fi
126 # RTLinux
127 if test ${USE_RTLINUX} == 'yes' ; then
128     AC_CHECK_HEADERS([\
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],,,[
132     #ifdef HAVE_UDP_H
133       #include <udp.h>
134     #endif
135     #ifdef HAVE_NIC_H
136       #include <nic.h>
137     #endif
138     ])
139 fi
140 # RTAI
141 if test ${USE_RTAI} == 'yes' ; then
142     AC_CHECK_HEADERS([\
143     rtnet.h],,,[[]])
144 fi
145
146 ###############################
147 # includes
148 INCLUDES='-I$(top_srcdir)/orte/include'
149 AC_SUBST(INCLUDES)
150
151 ###############################
152 # Checks for typedefs, structures, and compiler characteristics.
153 AC_C_BIGENDIAN
154 AC_C_CONST
155 AC_C_INLINE
156
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])
162 fi
163
164 AC_CONFIG_FILES([Makefile
165                  orte/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])
174
175
176 AC_OUTPUT([
177 modtool
178 ])
179 chmod +x modtool
180
181
182 # ======================================================================
183 #               generate orte/include/orte_config.h
184 # ======================================================================
185
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])
192 else
193         mv orte/include/orte_config.h.new orte/include/orte_config.h
194 fi
195
196 echo \
197 "------------------------------------------------------------------------
198 Configuration ORTE:
199
200   Source code location:       ${srcdir}
201   Compiler:                   ${CC}
202   Compiler flags:             ${CFLAGS}
203   Host System Type:           ${host}
204   
205   See config.h for further configuration information.
206 ------------------------------------------------------------------------"
207