]> rtime.felk.cvut.cz Git - orte.git/blob - configure.in
Update of ORTE. Configured to compile for Linux out of box.
[orte.git] / configure.in
1 # Process this file with autoconf to produce a configure script.
2 #
3 # $Id: configure.in,v 1.2 2004/01/17 18:16:35 ppisa Exp $
4
5 # autoconf requirement
6 AC_PREREQ([2.57])
7
8 AC_INIT([orte],[0.2.0],[petr.smolik@wo.cz])
9 AC_CONFIG_AUX_DIR(admin)
10
11 #Check for CPU / vendor / OS
12 AC_CANONICAL_HOST
13 AC_CANONICAL_TARGET
14 AM_CONFIG_HEADER(orte/include/config.h)
15 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
16 # Activate maintainer mode
17 AM_MAINTAINER_MODE
18
19 DS_LINUX()
20
21 ###############################
22 # Package info
23 ORTE_MAJOR_VERSION=0
24 ORTE_MINOR_VERSION=2
25 ORTE_MICRO_VERSION=0
26 ORTE_VERSION=$ORTE_MAJOR_VERSION.$ORTE_MINOR_VERSION.$ORTE_MICRO_VERSION
27 AC_SUBST(ORTE_MAJOR_VERSION)
28 AC_SUBST(ORTE_MINOR_VERSION)
29 AC_SUBST(ORTE_MICRO_VERSION)
30 AC_SUBST(ORTE_VERSION)
31
32
33 ###############################
34 # modules
35 moduledir="\$(libdir)/modules/\$(LINUX_KERNELRELEASE)/orte"
36 modulePROGRAMS_INSTALL="\$(top_builddir)/modtool --install"
37 modulePROGRAMS_UNINSTALL="\$(top_builddir)/modtool --uninstall"
38 AC_SUBST(moduledir)
39 AC_SUBST(modulePROGRAMS_INSTALL)
40
41 ###############################
42 # Checks for programs.
43 AC_PROG_CC
44 AC_PROG_RANLIB
45
46 ###############################
47 # Checks for libraries (no for RT)
48 if test -z ${CONFIG_ORTE_RT} ; then
49 AC_CHECK_LIB([ws2_32], [main])
50 AC_CHECK_LIB([pthread], [main])
51 fi
52
53 ###############################
54 # Checks for header files.
55 if test -z ${CONFIG_ORTE_RT} ; then
56 AC_HEADER_STDC
57 AC_CHECK_HEADERS(
58 [arpa/inet.h fcntl.h stdio.h netdb.h netinet/in.h stdlib.h \
59 string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h pthread.h \
60 stdarg.h getopt.h sys/types.h net/if.h byteswap.h signal.h errno.h \
61 ctype.h sys/stat.h winsock2.h ws2tcpip.h])
62 fi
63 ###############################
64 # includes
65 case "$target" in
66   *-cygwin* | *-mingw*)
67     INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/win32'
68     WIN='yes'
69     AC_DEFINE([CONFIG_ORTE_WIN],[1],[Define if is target windows])
70     ;;
71   *)
72     # Assume Unix.
73     if test ${USE_RTLINUX} == "yes" ; then
74       INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/rtl -I$(top_srcdir)/orte/contrib/RTL_UDP/include'
75     elif test ${USE_RTAI} == "yes" ; then
76       INCLUDES='-I$(top_srcdir)/orte/include -I$(top_srcdir)/orte/include/rtai'
77     else
78       INCLUDES='-I$(top_srcdir)/orte/include'
79       UNIX='yes'
80       AC_DEFINE([CONFIG_ORTE_UNIX],[1],[Define if is target a unix system])
81     fi
82     ;;
83 esac
84 AC_SUBST(INCLUDES)
85 AM_CONDITIONAL(CONFIG_ORTE_WIN, test x$WIN = xyes)
86 AM_CONDITIONAL(CONFIG_ORTE_UNIX, test x$UNIX = xyes)
87
88 ###############################
89 # Checks for typedefs, structures, and compiler characteristics.
90 AC_C_BIGENDIAN
91 AC_C_CONST
92 AC_C_INLINE
93 AC_TYPE_PID_T
94 AC_TYPE_SIZE_T
95
96 ###############################
97 # Checks for library functions.
98 AC_PROG_GCC_TRADITIONAL
99 AC_CHECK_FUNCS([strdup])
100
101 ###############################
102 # Add obsolute directory for header files
103 CFLAGS="$CFLAGS -Wall"
104
105 AC_CONFIG_FILES([Makefile
106                  orte/Makefile
107                  orte/liborte/Makefile
108                  orte/liborte/rtl/Makefile
109                  orte/examples/Makefile
110                  orte/examples/hello/Makefile
111                  orte/examples/reliable/Makefile
112                  orte/examples/ORTEPing/Makefile
113                  orte/examples/ORTESpy/Makefile
114                  orte/manager/Makefile])
115
116
117
118 AC_OUTPUT([
119 modtool
120 ])
121 chmod +x modtool
122
123
124 # ======================================================================
125 #               generate orte/include/orte_config.h
126 # ======================================================================
127
128 AC_MSG_NOTICE([creating orte/include/orte_config.h])
129 sed -e "s/ PACKAGE/ ORTE_PACKAGE/" -e "s/ VERSION/ ORTE_VERSION/" \
130     orte/include/config.h >orte/include/orte_config.h.new
131 if cmp -s orte/include/orte_config.h.new orte/include/orte_config.h; then
132         rm orte/include/orte_config.h.new
133         AC_MSG_NOTICE([orte/include/orte_config.h is unchanged])
134 else
135         mv orte/include/orte_config.h.new orte/include/orte_config.h
136 fi
137
138 echo \
139 "------------------------------------------------------------------------
140 Configuration ORTE:
141
142   Source code location:       ${srcdir}
143   Compiler:                   ${CC}
144   Compiler flags:             ${CFLAGS}
145   Host System Type:           ${host}
146   
147   See config.h for further configuration information.
148 ------------------------------------------------------------------------"
149