configure.ac 6.78 KB
Newer Older
1
AC_PREREQ(2.60)
2
AC_INIT(PolyORB-HI/C, 1.0w, taste-dev@lists.tuxfamily.org)
3
4
5
6
7
8
9
AC_CONFIG_SRCDIR(src)
AC_CONFIG_AUX_DIR(support)

AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([1.9 tar-pax] foreign)
AM_CONFIG_HEADER(include/po_hi_config.h)

10
11
12
13
14
AH_TOP([
#ifndef HAVE_PO_HI_CONFIG_H
#define HAVE_PO_HI_CONFIG_H
])

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
AC_PROG_CC
AC_LANG_C
AC_PROG_INSTALL

## We need some external programs in order to build
## PolyORB-HI-C and its documentation.

AC_CHECK_PROG(MV, mv, mv)
AC_CHECK_PROG(RM, rm, rm)
AC_CHECK_PROG(CP, cp, cp)
AC_CHECK_PROG(GREP, grep, grep)
AC_CHECK_PROG(CHMOD, chmod, chmod)
AC_CHECK_PROG(TEX, tex, tex)
AC_CHECK_PROG(BIBTEX, bibtex, bibtex)

AC_HEADER_STDBOOL

AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long int)
AC_CHECK_SIZEOF(unsigned long int)
AC_CHECK_SIZEOF(short int)
AC_CHECK_SIZEOF(unsigned short int)

AC_CHECK_FUNC(clock_gettime, AC_DEFINE(HAVE_CLOCK_GETTIME, [], [Check if the system supports the clock_gettime function]),)

AC_C_BIGENDIAN

47
48
49
50
AH_BOTTOM([
#endif /* ! HAVE_PO_HI_CONFIG_H */
])

51
52
53
54
##################################################
# Set CFLAGS and LDFLAGS for the native platform #
##################################################

55
CFLAGS="-Wall -O"
yoogx's avatar
yoogx committed
56
NATIVE_CFLAGS=""
57
58
59
60
61
NATIVE_LDFLAGS=""
SIMULINK_LDFLAGS=""

case ${host_os} in
	*darwin*)
yoogx's avatar
yoogx committed
62
		NATIVE_CFLAGS="${NATIVE_CFLAGS} -DPOSIX -DNEED_CLOCK_GETTIME"
63
64
65
66
67
		NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lpthread"
		;;
	*solaris*10*)
		NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lrt"
		;;
jdelange's avatar
jdelange committed
68
	*freebsd*)
yoogx's avatar
yoogx committed
69
		NATIVE_CFLAGS="${NATIVE_CFLAGS} -DPOSIX -D_GNU_SOURCE"
jdelange's avatar
jdelange committed
70
71
72
		NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lpthread -lrt"
		SIMULINK_LDFLAGS="-lm"
		;;
73
	*cygwin*)
yoogx's avatar
yoogx committed
74
75
76
77
		NATIVE_CFLAGS="${NATIVE_CFLAGS} -D_GNU_SOURCE"
		NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lpthread -lwsock32"
		SIMULINK_LDFLAGS="-lm"
		;;
78
	*)
yoogx's avatar
yoogx committed
79
		NATIVE_CFLAGS="${NATIVE_CFLAGS} -DPOSIX -D_POSIX_SOURCE -D_GNU_SOURCE"
80
81
82
83
84
85
		NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lpthread -lrt"
		SIMULINK_LDFLAGS="-lm"
		;;
esac

AC_CHECK_LIB(socket, socket, [NATIVE_LDFLAGS="${NATIVE_LDFLAGS} -lsocket"])
jdelange's avatar
jdelange committed
86

87
88
89
90
91
92
93
94
95
96
97
98
AC_SUBST(NATIVE_CFLAGS)
AC_SUBST(NATIVE_LDFLAGS)
AC_SUBST(SIMULINK_LDFLAGS)

##########################################
# Check for Ocarina
##########################################

AM_PATH_OCARINA(1.1, ,AC_MSG_ERROR([Ocarina 1.1 or later is not installed on you
r system]))

AC_ARG_ENABLE(debug,
julien.delange's avatar
julien.delange committed
99
100
101
102
103
104
105
106
  [  --enable-debug[=level] specify debugging level.
                            Values are:
                             * critical - runtime errors that will imply a failure
                             * warning  - runtime errors that do not crash the system
                             * debug    - useful for debugging purpose
                             * info     - ALL informations about the system],
  [ case ${enableval} in
	info)
107
      AC_DEFINE_UNQUOTED(__PO_HI_DEBUG_LEVEL, 12, "Debug level - show ALL potential informations.")
julien.delange's avatar
julien.delange committed
108
109
		;;
	debug)
110
      AC_DEFINE_UNQUOTED(__PO_HI_DEBUG_LEVEL, 10, "Warning - information that can show errors but are not so important")
julien.delange's avatar
julien.delange committed
111
112
		;;
	warning)
jdelange's avatar
jdelange committed
113
114
115
      AC_DEFINE_UNQUOTED(__PO_HI_DEBUG_LEVEL, 6, "Warning - Errors that will imply a minor error at run-tine")
		;;
	critical)
julien.delange's avatar
julien.delange committed
116
117
118
119
120
121
      AC_DEFINE_UNQUOTED(__PO_HI_DEBUG_LEVEL, 4, "Critical - Errors that will imply a fault or a crash")
		;;
	*)
      AC_DEFINE_UNQUOTED(__PO_HI_DEBUG_LEVEL, 0, "None - Do not print anything")
		;;
   esac])
122
123
124
125
126

AC_ARG_ENABLE(giop,
  [  --enable-giop           Use the GIOP protocol],
  [ AC_DEFINE([__PO_HI_USE_GIOP], [], ["Enable the GIOP protocol"])])

127
128
HAS_LUA_=

jdelange's avatar
jdelange committed
129
130
AC_ARG_ENABLE(lua,
  [  --enable-lua            Use the LUA script engine],
131
132
133
134
135
136
137
  [ AC_DEFINE([__PO_HI_USE_LUA], [], ["Enable the LUA script engine"])
if [[ "$enableval" = "yes" ]]; then
        HAS_LUA_=true
fi])

AC_SUBST(HAS_LUA_)
AM_CONDITIONAL(HAS_LUA, [test ! "x$HAS_LUA_" = "x"])
jdelange's avatar
jdelange committed
138

139
140
141
142
143
144
145
146
147
148
149
############################################
# Set the value corresponding to cygpath -u
############################################

if test x"$CYGPATH_W" = x"echo"; then
   CYGPATH_U="echo"
else
   CYGPATH_U="cygpath -u"
fi
AC_SUBST(CYGPATH_U)

150
151
152
153
154
155
##########################################
# Build documentation
##########################################

AC_CHECK_PROGS(TEXI2HTML, texi2html)

156
DOC_TARGETS=
157
158
159
160

AC_ARG_ENABLE(doc,
[  --enable-doc            Build documentation [default=no]],
[if [[ "$enableval" = "yes" ]]; then
161
        DOC_TARGETS=docs
162
163
164
fi],
[])

165
AC_SUBST(DOC_TARGETS)
166

yoogx's avatar
yoogx committed
167
168
169
170
###############################################################
# Use of BOOST
###############################################################

171
172
#BOOST_REQUIRE([1.55.0],[echo])
AX_BOOST_BASE([1.55.0], [], [])
yoogx's avatar
yoogx committed
173

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
###############################################################
# Force the installation prefix to be equal to the Ocarina one
###############################################################

prefix='$(OCARINA_PREFIX)'

##########################################
# Output generated files
##########################################

dnl Important! One file per line, nothing before
dnl or after except whitespace! This section
dnl may, one day, be edited automatically to remove
dnl some entries.

AC_OUTPUT([
190
191
192
193
194
	Makefile
	doc/Makefile
	src/Makefile
	src/drivers/Makefile
	src/drivers/configuration/Makefile
195
196
        src/monitoring/Makefile
        src/monitoring/cheddar_scheduling/Makefile
197
        src/simulator/Makefile
198
199
200
	include/Makefile
	include/drivers/Makefile
	include/drivers/configuration/Makefile
201
        include/monitoring/Makefile
202
        include/simulator/Makefile
203
204
205
206
207
208
209
210
	examples/Makefile
	examples/aadlv1/Makefile
	examples/aadlv1/d3.1.3-1/Makefile
	examples/aadlv1/ping/Makefile
	examples/aadlv1/flight-mgmt/Makefile
	examples/aadlv1/rma/Makefile
	examples/aadlv1/sunseeker/Makefile
	examples/aadlv2/Makefile
211
	examples/aadlv2/cpp/Makefile
212
	examples/aadlv2/d3.1.3-1/Makefile
213
	examples/aadlv2/import/Makefile
214
	examples/aadlv2/ping/Makefile
jdelange's avatar
jdelange committed
215
	examples/aadlv2/lua/Makefile
216
217
	examples/aadlv2/producer-consumer/Makefile
	examples/aadlv2/flight-mgmt/Makefile
jdelange's avatar
jdelange committed
218
	examples/aadlv2/monitor/Makefile
jdelange's avatar
jdelange committed
219
	examples/aadlv2/packet-store/Makefile
jdelange's avatar
jdelange committed
220
	examples/aadlv2/file-store/Makefile
221
222
223
224
	examples/aadlv2/rma/Makefile
	examples/aadlv2/some-types/Makefile
	examples/aadlv2/some-types-stdint/Makefile
	examples/aadlv2/sunseeker/Makefile
225
	tools/Makefile
226
227
228
229
230
231
	tools/check-symbols/Makefile
	tools/check-symbols/examples/Makefile
	tools/check-symbols/examples/malloc/Makefile
	tools/check-symbols/examples/strings/Makefile
	tools/check-symbols/src/Makefile
	share/Makefile
232
233
234
	share/lua/Makefile
	share/lua/libs/Makefile
	share/lua/include/Makefile
235
236
237
238
239
	share/cheddar/Makefile
	share/models/Makefile
	share/ocarina/Makefile
	share/tsim/Makefile
	share/make/Makefile
240
	share/utils/Makefile
241
	share/make/Makefile.common
242
243
244
245
	share/make/Makefile.native
	share/config/Makefile
	share/config/spif-rtems/Makefile
	share/config/leon-rtems/Makefile
julien.delange's avatar
julien.delange committed
246
	share/config/nds-rtems/Makefile
julien.delange's avatar
julien.delange committed
247
	share/config/gumstix-rtems/Makefile
248
249
	support/Makefile
])