]> rtime.felk.cvut.cz Git - orte.git/blob - configure.in
*** empty log message ***
[orte.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 #
3 # $Id: configure.in,v 1.4 2004/02/15 22:23:51 smolik 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 # CFLAGS
65 CFLAGS="$CFLAGS -Wall"
66 if test ${USE_RTLINUX} == 'yes' ; then
67   CFLAGS="$CFLAGS $RTLINUX_CFLAGS"
68   CC="$RTLINUX_CC"
69 else
70   if test ${USE_RTAI} == 'yes' ; then
71     CFLAGS="$CFLAGS $RTAI_CFLAGS $LINUX_CFLAGS"
72   else
73     if test -n ${CONFIG_ORTE_KERNEL} ; then
74       CFLAGS="$CFLAGS $LINUX_CFLAGS"
75     fi
76   fi
77 fi
78
79 ###############################
80 # Checks for programs.
81 AC_PROG_CC
82 AC_PROG_RANLIB
83
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])
89 fi
90
91 ###############################
92 # enable GNU source
93 AH_VERBATIM([_GNU_SOURCE],[
94 #ifndef _GNU_SOURCE
95   #define _GNU_SOURCE
96 #endif
97 ]) 
98
99 ###############################
100 # Checks for header files.
101 # user space
102 if test ${UNIX} == 'yes' -o ${WIN} == 'yes' ; then
103     AC_HEADER_STDC
104     AC_CHECK_HEADERS([\
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],,,[[]])
109 fi
110 # win32
111 if test ${WIN} == 'yes' ; then
112     AC_CHECK_HEADERS([\
113     winsock2.h ws2tcpip.h windows.h],,,[[]])
114 fi
115 # kernel
116 if test ${CONFIG_ORTE_KERNEL} == 'yes' ; then
117     AC_CHECK_HEADERS([\
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>
124     #endif
125     ])
126 fi
127 # RTLinux
128 if test ${USE_RTLINUX} == 'yes' ; then
129     AC_CHECK_HEADERS([\
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],,,[
133     #ifdef HAVE_UDP_H
134       #include <udp.h>
135     #endif
136     #ifdef HAVE_NIC_H
137       #include <nic.h>
138     #endif
139     ])
140 fi
141 # RTAI
142 if test ${USE_RTAI} == 'yes' ; then
143     AC_CHECK_HEADERS([\
144     rtnet.h],,,[[]])
145 fi
146
147 ###############################
148 # includes
149 INCLUDES='-I$(top_srcdir)/orte/include'
150 AC_SUBST(INCLUDES)
151
152 ###############################
153 # Checks for typedefs, structures, and compiler characteristics.
154 AC_C_BIGENDIAN
155 AC_C_CONST
156 AC_C_INLINE
157
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])
163 fi
164
165 AC_CONFIG_FILES([Makefile
166                  orte/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])
175
176
177 AC_OUTPUT([
178 modtool
179 ])
180 chmod +x modtool
181
182
183 # ======================================================================
184 #               generate orte/include/orte_config.h
185 # ======================================================================
186
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])
193 else
194         mv orte/include/orte_config.h.new orte/include/orte_config.h
195 fi
196
197 echo \
198 "------------------------------------------------------------------------
199 Configuration ORTE:
200
201   Source code location:       ${srcdir}
202   Compiler:                   ${CC}
203   Compiler flags:             ${CFLAGS}
204   Host System Type:           ${host}
205   
206   See config.h for further configuration information.
207 ------------------------------------------------------------------------"
208