Merge lp:~mordred/libdrizzle/pandora-build into lp:~drizzle-trunk/libdrizzle/classic
- pandora-build
- Merge into classic
Proposed by
Monty Taylor
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~mordred/libdrizzle/pandora-build |
Merge into: | lp:~drizzle-trunk/libdrizzle/classic |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~mordred/libdrizzle/pandora-build |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Eric Day | Pending | ||
Review via email: mp+8595@code.launchpad.net |
This proposal supersedes a proposal from 2009-07-08.
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote : Posted in a previous version of this proposal | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'config/autorun.sh' |
2 | --- config/autorun.sh 2009-03-27 20:08:10 +0000 |
3 | +++ config/autorun.sh 2009-07-08 20:55:16 +0000 |
4 | @@ -1,86 +1,77 @@ |
5 | -#!/usr/bin/env bash |
6 | +#!/bin/sh |
7 | # Taken from lighthttpd server (BSD). Thanks Jan! |
8 | # Run this to generate all the initial makefiles, etc. |
9 | |
10 | die() { echo "$@"; exit 1; } |
11 | |
12 | -# ACLOCAL=${ACLOCAL:-aclocal} |
13 | -ACLOCAL_FLAGS="-I m4" |
14 | -# AUTOHEADER=${AUTOHEADER:-autoheader} |
15 | -# AUTOMAKE=${AUTOMAKE:-automake} |
16 | # --add-missing instructs automake to install missing auxiliary files |
17 | -# --copy tells it to make copies and not symlinks |
18 | +# and --force to overwrite them if they already exist |
19 | AUTOMAKE_FLAGS="--add-missing --copy --force" |
20 | -# AUTOCONF=${AUTOCONF:-autoconf} |
21 | +ACLOCAL_FLAGS="-I m4" |
22 | |
23 | ARGV0=$0 |
24 | ARGS="$@" |
25 | |
26 | - |
27 | run() { |
28 | echo "$ARGV0: running \`$@' $ARGS" |
29 | $@ $ARGS |
30 | } |
31 | |
32 | -## jump out if one of the programs returns 'false' |
33 | -set -e |
34 | - |
35 | +# Try to locate a program by using which, and verify that the file is an |
36 | +# executable |
37 | +locate_binary() { |
38 | + for f in $@ |
39 | + do |
40 | + file=`which $f 2>/dev/null | grep -v '^no '` |
41 | + if test -n "$file" -a -x "$file"; then |
42 | + echo $file |
43 | + return 0 |
44 | + fi |
45 | + done |
46 | + |
47 | + echo "" |
48 | + return 1 |
49 | +} |
50 | + |
51 | +# Try to detect the supported binaries if the user didn't |
52 | +# override that by pushing the environment variable |
53 | if test x$ACLOCAL = x; then |
54 | - if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then |
55 | - ACLOCAL=aclocal-1.10 |
56 | - elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then |
57 | - ACLOCAL=aclocal110 |
58 | - elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then |
59 | - ACLOCAL=aclocal |
60 | - else |
61 | - echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1 |
62 | + ACLOCAL=`locate_binary aclocal-1.10 aclocal-1.9 aclocal19 aclocal` |
63 | + if test x$ACLOCAL = x; then |
64 | + die "Did not find a supported aclocal" |
65 | fi |
66 | fi |
67 | |
68 | if test x$AUTOMAKE = x; then |
69 | - if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then |
70 | - AUTOMAKE=automake-1.10 |
71 | - elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then |
72 | - AUTOMAKE=automake110 |
73 | - elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then |
74 | - AUTOMAKE=automake |
75 | - else |
76 | - echo "automake 1.10.x wasn't found, exiting"; exit 1 |
77 | + AUTOMAKE=`locate_binary automake-1.10 automake-1.9 automake19 automake` |
78 | + if test x$AUTOMAKE = x; then |
79 | + die "Did not find a supported automake" |
80 | fi |
81 | fi |
82 | |
83 | - |
84 | -## macosx has autoconf-2.59 and autoconf-2.60 |
85 | if test x$AUTOCONF = x; then |
86 | - if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then |
87 | - AUTOCONF=autoconf-2.59 |
88 | - elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then |
89 | - AUTOCONF=autoconf259 |
90 | - elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then |
91 | - AUTOCONF=autoconf |
92 | - else |
93 | - echo "autoconf 2.59+ wasn't found, exiting"; exit 1 |
94 | + AUTOCONF=`locate_binary autoconf-2.59 autoconf259 autoconf` |
95 | + if test x$AUTOCONF = x; then |
96 | + die "Did not find a supported autoconf" |
97 | fi |
98 | fi |
99 | |
100 | if test x$AUTOHEADER = x; then |
101 | - if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then |
102 | - AUTOHEADER=autoheader-2.59 |
103 | - elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then |
104 | - AUTOHEADER=autoheader259 |
105 | - elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then |
106 | - AUTOHEADER=autoheader |
107 | - else |
108 | - echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1 |
109 | + AUTOHEADER=`locate_binary autoheader-2.59 autoheader259 autoheader` |
110 | + if test x$AUTOHEADER = x; then |
111 | + die "Did not find a supported autoheader" |
112 | fi |
113 | fi |
114 | |
115 | - |
116 | run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal" |
117 | run $AUTOHEADER || die "Can't execute autoheader" |
118 | run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake" |
119 | run $AUTOCONF || die "Can't execute autoconf" |
120 | -echo -n "Automade with: " |
121 | -$AUTOMAKE --version | head -1 |
122 | -echo -n "Configured with: " |
123 | -$AUTOCONF --version | head -1 |
124 | + |
125 | +echo "---" |
126 | +echo "Configured with the following tools:" |
127 | +echo " * `$ACLOCAL --version | head -1`" |
128 | +echo " * `$AUTOHEADER --version | head -1`" |
129 | +echo " * `$AUTOMAKE --version | head -1`" |
130 | +echo " * `$AUTOCONF --version | head -1`" |
131 | +echo "---" |
132 | |
133 | === modified file 'configure.ac' |
134 | --- configure.ac 2009-07-02 00:24:20 +0000 |
135 | +++ configure.ac 2009-07-08 08:07:56 +0000 |
136 | @@ -12,6 +12,9 @@ |
137 | AC_CONFIG_HEADER([config.h]) |
138 | AC_CONFIG_MACRO_DIR([m4]) |
139 | |
140 | +PANDORA_CANONICAL_TARGET(ignore-shared-ptr) |
141 | + |
142 | + |
143 | LIBDRIZZLE_LIBRARY_VERSION=0:4:0 |
144 | # | | | |
145 | # +------+ | +---+ |
146 | @@ -27,43 +30,6 @@ |
147 | # changed |
148 | AC_SUBST(LIBDRIZZLE_LIBRARY_VERSION) |
149 | |
150 | -AC_CANONICAL_TARGET |
151 | - |
152 | -AM_INIT_AUTOMAKE(-Wall -Werror subdir-objects) |
153 | - |
154 | -if test "x${enable_dependency_tracking}" = "x" |
155 | -then |
156 | - enable_dependency_tracking=yes |
157 | -fi |
158 | - |
159 | -if test -d "${srcdir}/.bzr" |
160 | -then |
161 | - building_from_bzr=yes |
162 | -else |
163 | - building_from_bzr=no |
164 | -fi |
165 | - |
166 | -AC_PROG_CXX |
167 | - |
168 | -ACX_USE_SYSTEM_EXTENSIONS |
169 | - |
170 | -AC_PROG_CPP |
171 | -AM_PROG_CC_C_O |
172 | - |
173 | -FORCE_MAC_GCC42 |
174 | -dnl Once we can use a modern autoconf, we can use this |
175 | -dnl AC_PROG_CC_C99 |
176 | - |
177 | - |
178 | -AC_C_BIGENDIAN |
179 | -AC_C_CONST |
180 | -AC_HEADER_TIME |
181 | -AC_TYPE_SIZE_T |
182 | -AC_FUNC_MALLOC |
183 | -AC_FUNC_REALLOC |
184 | - |
185 | - |
186 | -AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) |
187 | |
188 | # The port should be constant for a LONG time |
189 | DRIZZLE_TCP_PORT_DEFAULT=4427 |
190 | @@ -71,83 +37,14 @@ |
191 | |
192 | AC_DEFINE([LICENSE],[BSD],[libdrizzle is distributed under the BSD license]) |
193 | |
194 | -# We use libtool |
195 | -LT_INIT |
196 | -LT_LANG(C) |
197 | - |
198 | -AC_MSG_CHECKING("C Compiler version") |
199 | -if test "$GCC" = "yes" |
200 | -then |
201 | - CC_VERSION=`$CC --version | sed 1q` |
202 | -elif test "$SUNCC" = "yes" |
203 | -then |
204 | - CC_VERSION=`$CC -V 2>&1 | sed 1q` |
205 | -else |
206 | - CC_VERSION="" |
207 | -fi |
208 | -AC_MSG_RESULT("$CC_VERSION") |
209 | -AC_SUBST(CC_VERSION) |
210 | - |
211 | # libdrizzle versioning when linked with GNU ld. |
212 | -if test "$lt_cv_prog_gnu_ld" = "yes" |
213 | -then |
214 | - LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver" |
215 | -fi |
216 | +AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[ |
217 | + LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libdrizzle/libdrizzle.ver" |
218 | +]) |
219 | AC_SUBST(LD_VERSION_SCRIPT) |
220 | |
221 | -gl_VISIBILITY |
222 | - |
223 | -# Build optimized or debug version ? |
224 | -# First check for gcc and g++ |
225 | -if test "$GCC" = "yes" |
226 | -then |
227 | - dnl Once we can use a modern autoconf, we can replace the std=gnu99 here |
228 | - dnl with using AC_CC_STD_C99 above |
229 | - CC="${CC} -std=gnu99" |
230 | - |
231 | - DEBUG_CFLAGS="-O0" |
232 | - DEBUG_CXXFLAGS="-O0" |
233 | - |
234 | -fi |
235 | -if test "$SUNCC" = "yes" |
236 | -then |
237 | - dnl Once we can use a modern autoconf, we can replace the -xc99=all here |
238 | - dnl with using AC_CC_STD_C99 above |
239 | - CC="${CC} -xc99=all" |
240 | - |
241 | - AM_CFLAGS="-g -mt ${AM_CFLAGS}" |
242 | - AM_CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${CXXFLAGS}" |
243 | - |
244 | - OPTIMIZE_FLAGS="-xO4 -xlibmil -xdepend -xbuiltin" |
245 | - OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst" |
246 | - OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}" |
247 | - |
248 | -fi |
249 | - |
250 | -ENABLE_64BIT |
251 | - |
252 | AC_LIB_PREFIX |
253 | |
254 | -#-------------------------------------------------------------------- |
255 | -# Check for tcmalloc |
256 | -#-------------------------------------------------------------------- |
257 | - |
258 | -AC_ARG_ENABLE([tcmalloc], |
259 | - [AS_HELP_STRING([--enable-tcmalloc], |
260 | - [Enable linking with tcmalloc @<:@default=off@:>@])], |
261 | - [ac_enable_tcmalloc="$enableval"], |
262 | - [ac_enable_tcmalloc="no"]) |
263 | - |
264 | -if test "x$ac_enable_tcmalloc" != "xno" |
265 | -then |
266 | - AC_CHECK_LIB(tcmalloc,malloc,[],[]) |
267 | -fi |
268 | - |
269 | -if test "x$ac_cv_lib_tcmalloc_malloc" != "xyes" |
270 | -then |
271 | - AC_CHECK_LIB(mtmalloc,malloc,[],[]) |
272 | -fi |
273 | - |
274 | AC_LIB_HAVE_LINKFLAGS(sqlite3,, |
275 | [ |
276 | #include <stdio.h> |
277 | @@ -160,9 +57,6 @@ |
278 | |
279 | AM_CONDITIONAL(HAVE_LIBSQLITE3, test x$ac_cv_libsqlite3 = xyes) |
280 | |
281 | -ENABLE_DTRACE |
282 | - |
283 | - |
284 | AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)]) |
285 | AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)]) |
286 | # This may get things to compile even if bind-8 is installed |
287 | @@ -173,203 +67,6 @@ |
288 | AC_CHECK_HEADERS(arpa/inet.h netdb.h netinet/in.h sys/param.h sys/socket.h fcntl.h netinet/tcp.h sys/uio.h) |
289 | |
290 | |
291 | - |
292 | -dnl TODO: Remove this define once we are using 2.61 across the board. |
293 | -# AX_HEADER_ASSERT |
294 | -# ---------------- |
295 | -# Check whether to enable assertions. |
296 | -AC_DEFUN([AX_HEADER_ASSERT], |
297 | -[ |
298 | - AC_MSG_CHECKING([whether to enable assertions]) |
299 | - AC_ARG_ENABLE([assert], |
300 | - [AS_HELP_STRING([--disable-assert], |
301 | - [Turn off assertions])], |
302 | - [ac_cv_assert="no"], |
303 | - [ac_cv_assert="yes"]) |
304 | - AC_MSG_RESULT([$ac_cv_assert]) |
305 | -]) |
306 | -AX_HEADER_ASSERT |
307 | - |
308 | - |
309 | -AC_ARG_WITH([debug], |
310 | - [AS_HELP_STRING([--with-debug], |
311 | - [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], |
312 | - [with_debug=$withval], |
313 | - [with_debug=no]) |
314 | -if test "$with_debug" = "yes" |
315 | -then |
316 | - # Debugging. No optimization. |
317 | - AM_CFLAGS="${DEBUG_CFLAGS} -DDEBUG ${AM_CFLAGS}" |
318 | - AM_CXXFLAGS="${DEBUG_CXXFLAGS} -DDEBUG ${AM_CXXFLAGS}" |
319 | -else |
320 | - # Optimized version. No debug |
321 | - AM_CFLAGS="${OPTIMIZE_CFLAGS} ${AM_CFLAGS}" |
322 | - AM_CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${AM_CXXFLAGS}" |
323 | -fi |
324 | - |
325 | -AC_ARG_ENABLE([profiling], |
326 | - [AS_HELP_STRING([--enable-profiling], |
327 | - [Toggle profiling @<:@default=off@:>@])], |
328 | - [ac_profiling="$enableval"], |
329 | - [ac_profiling="no"]) |
330 | - |
331 | -AC_ARG_ENABLE([coverage], |
332 | - [AS_HELP_STRING([--enable-coverage], |
333 | - [Toggle coverage @<:@default=off@:>@])], |
334 | - [ac_coverage="$enableval"], |
335 | - [ac_coverage="no"]) |
336 | - |
337 | -if test "$GCC" = "yes" |
338 | -then |
339 | - |
340 | - AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option], |
341 | - [ac_cv_safe_to_use_fdiagnostics_show_option_], |
342 | - [save_CFLAGS="$CFLAGS" |
343 | - CFLAGS="-fdiagnostics-show-option ${CFLAGS}" |
344 | - AC_COMPILE_IFELSE( |
345 | - [AC_LANG_PROGRAM([],[])], |
346 | - [ac_cv_safe_to_use_fdiagnostics_show_option_=yes], |
347 | - [ac_cv_safe_to_use_fdiagnostics_show_option_=no]) |
348 | - CFLAGS="$save_CFLAGS"]) |
349 | - |
350 | - AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"], |
351 | - [ |
352 | - F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option" |
353 | - ]) |
354 | - |
355 | - AC_CACHE_CHECK([whether it is safe to use -Wconversion], |
356 | - [ac_cv_safe_to_use_wconversion_], |
357 | - [save_CFLAGS="$CFLAGS" |
358 | - CFLAGS="-Werror -Wconversion ${CFLAGS}" |
359 | - AC_COMPILE_IFELSE( |
360 | - [AC_LANG_PROGRAM([[ |
361 | -#include <stdbool.h> |
362 | -void foo(bool a) |
363 | -{ |
364 | - (void)a; |
365 | -} |
366 | - ]],[[ |
367 | -foo(0); |
368 | - ]])], |
369 | - [ac_cv_safe_to_use_wconversion_=yes], |
370 | - [ac_cv_safe_to_use_wconversion_=no]) |
371 | - CFLAGS="$save_CFLAGS"]) |
372 | - |
373 | - AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"], |
374 | - [W_CONVERSION="-Wconversion" |
375 | - AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons], |
376 | - [ac_cv_safe_to_use_Wconversion_], |
377 | - [save_CFLAGS="$CFLAGS" |
378 | - CFLAGS="-Werror -Wconversion ${CFLAGS}" |
379 | - AC_COMPILE_IFELSE( |
380 | - [AC_LANG_PROGRAM( |
381 | - [[ |
382 | -#include <netinet/in.h> |
383 | - ]],[[ |
384 | -uint16_t x= htons(80); |
385 | - ]])], |
386 | - [ac_cv_safe_to_use_Wconversion_=yes], |
387 | - [ac_cv_safe_to_use_Wconversion_=no]) |
388 | - CFLAGS="$save_CFLAGS"]) |
389 | - |
390 | - AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"], |
391 | - [ |
392 | - NO_CONVERSION="-Wno-conversion" |
393 | - ]) |
394 | - ]) |
395 | - |
396 | - AS_IF([test "$ac_profiling" = "yes"], |
397 | - [CC_PROFILING="-pg"]) |
398 | - |
399 | - AS_IF([test "$ac_coverage" = "yes"], |
400 | - [CC_COVERAGE="-fprofile-arcs -ftest-coverage"]) |
401 | - |
402 | - AS_IF([test "$building_from_bzr" = "yes"], |
403 | - [W_FAIL="-Werror"]) |
404 | - |
405 | - BASE_WARNINGS="-pedantic -Wall -Wextra ${W_FAIL} -Wundef -Wshadow -Wmissing-declarations -Wstrict-aliasing -Wformat=2 ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${W_CONVERSION}" |
406 | - CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wswitch-default -Wswitch-enum -Wcast-align" |
407 | - CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wold-style-cast -Weffc++ -Wno-long-long" |
408 | - |
409 | - AC_CACHE_CHECK([whether it is safe to use -Wlogical-op], |
410 | - [ac_cv_safe_to_use_Wlogical_op_], |
411 | - [save_CFLAGS="$CFLAGS" |
412 | - CFLAGS="-Wlogical-op" |
413 | - AC_COMPILE_IFELSE([ |
414 | - AC_LANG_PROGRAM( |
415 | - [[ |
416 | -#include <stdio> |
417 | - ]], [[]]) |
418 | - ], |
419 | - [ac_cv_safe_to_use_Wlogical_op_=yes], |
420 | - [ac_cv_safe_to_use_Wlogical_op_=no]) |
421 | - CFLAGS="$save_CFLAGS"]) |
422 | - AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"], |
423 | - [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"]) |
424 | - |
425 | - AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++], |
426 | - [ac_cv_safe_to_use_Wredundant_decls_], |
427 | - [AC_LANG_PUSH(C++) |
428 | - save_CXXFLAGS="${CXXFLAGS}" |
429 | - CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls" |
430 | - AC_COMPILE_IFELSE( |
431 | - [AC_LANG_PROGRAM([ |
432 | -template <typename E> struct C { void foo(); }; |
433 | -template <typename E> void C<E>::foo() { } |
434 | -template <> void C<int>::foo(); |
435 | - AC_INCLUDES_DEFAULT])], |
436 | - [ac_cv_safe_to_use_Wredundant_decls_=yes], |
437 | - [ac_cv_safe_to_use_Wredundant_decls_=no]) |
438 | - CXXFLAGS="${save_CXXFLAGS}" |
439 | - AC_LANG_POP()]) |
440 | - AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"], |
441 | - [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"], |
442 | - [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"]) |
443 | - |
444 | - NO_REDUNDANT_DECLS="-Wno-redundant-decls" |
445 | -fi |
446 | -if test "$SUNCC" = "yes" |
447 | -then |
448 | - |
449 | - AS_IF([test "$ac_profiling" = "yes"], |
450 | - [CC_PROFILING="-xinstrument=datarace"]) |
451 | - |
452 | - AS_IF([test "$building_from_bzr" = "yes"], |
453 | - [W_FAIL="-errwarn=%all"]) |
454 | - |
455 | - AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable], |
456 | - [ac_cv_paste_result], |
457 | - [ |
458 | - save_CFLAGS="${CFLAGS}" |
459 | - CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}" |
460 | - AC_COMPILE_IFELSE( |
461 | - [AC_LANG_PROGRAM([ |
462 | - AC_INCLUDES_DEFAULT |
463 | - ],[ |
464 | - int x= 0;])], |
465 | - [ac_cv_paste_result=yes], |
466 | - [ac_cv_paste_result=no]) |
467 | - CFLAGS="${save_CFLAGS}" |
468 | - ]) |
469 | - AS_IF([test $ac_cv_paste_result = yes], |
470 | - [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"]) |
471 | - |
472 | - |
473 | - CC_WARNINGS="-v -errtags=yes ${W_FAIL} -erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}" |
474 | - CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${W_FAIL}" |
475 | -fi |
476 | - |
477 | -AC_SUBST(NO_CONVERSION) |
478 | -AC_SUBST(NO_REDUNDANT_DECLS) |
479 | - |
480 | -AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" |
481 | -AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNING} ${CC_PROFILING} ${CC_COVERAGE}" |
482 | - |
483 | -AC_SUBST([AM_CFLAGS]) |
484 | -AC_SUBST([AM_CXXFLAGS]) |
485 | - |
486 | -AC_CHECK_PROGS([DOXYGEN], [doxygen]) |
487 | - |
488 | AC_CONFIG_FILES(Makefile support/libdrizzle.spec support/libdrizzle.pc) |
489 | |
490 | AC_OUTPUT |
491 | @@ -385,6 +82,6 @@ |
492 | echo " * Debug enabled: $with_debug" |
493 | echo " * Profiling enabled: $ac_profiling" |
494 | echo " * Coverage enabled: $ac_coverage" |
495 | -echo " * Warnings as failure: $building_from_bzr" |
496 | +echo " * Warnings as errors: $ac_cv_warnings_as_errors" |
497 | echo "" |
498 | echo "---" |
499 | |
500 | === modified file 'examples/client.c' |
501 | --- examples/client.c 2009-05-28 17:22:31 +0000 |
502 | +++ examples/client.c 2009-07-08 21:13:41 +0000 |
503 | @@ -8,6 +8,8 @@ |
504 | * the COPYING file in this directory for full text. |
505 | */ |
506 | |
507 | +#include "config.h" |
508 | + |
509 | #include <errno.h> |
510 | #include <stdbool.h> |
511 | #include <stdint.h> |
512 | |
513 | === modified file 'examples/pipe_query.c' |
514 | --- examples/pipe_query.c 2009-03-31 04:17:03 +0000 |
515 | +++ examples/pipe_query.c 2009-07-08 21:13:41 +0000 |
516 | @@ -8,6 +8,8 @@ |
517 | * the COPYING file in this directory for full text. |
518 | */ |
519 | |
520 | +#include "config.h" |
521 | + |
522 | #include <errno.h> |
523 | #include <stdio.h> |
524 | #include <stdlib.h> |
525 | |
526 | === modified file 'examples/proxy.c' |
527 | --- examples/proxy.c 2009-05-26 22:19:02 +0000 |
528 | +++ examples/proxy.c 2009-07-08 21:13:41 +0000 |
529 | @@ -8,6 +8,8 @@ |
530 | * the COPYING file in this directory for full text. |
531 | */ |
532 | |
533 | +#include "config.h" |
534 | + |
535 | #include <errno.h> |
536 | #include <stdio.h> |
537 | #include <stdlib.h> |
538 | |
539 | === modified file 'examples/server.c' |
540 | --- examples/server.c 2009-06-30 08:17:45 +0000 |
541 | +++ examples/server.c 2009-07-08 21:13:41 +0000 |
542 | @@ -8,6 +8,8 @@ |
543 | * the COPYING file in this directory for full text. |
544 | */ |
545 | |
546 | +#include "config.h" |
547 | + |
548 | #include <errno.h> |
549 | #include <stdio.h> |
550 | #include <stdlib.h> |
551 | |
552 | === modified file 'examples/simple.c' |
553 | --- examples/simple.c 2009-05-28 17:22:31 +0000 |
554 | +++ examples/simple.c 2009-07-08 20:53:17 +0000 |
555 | @@ -15,7 +15,7 @@ |
556 | |
557 | int main(int argc, char *argv[]) |
558 | { |
559 | - char *query= "SELECT table_schema,table_name FROM tables"; |
560 | + const char *query= "SELECT table_schema,table_name FROM tables"; |
561 | drizzle_con_st con; |
562 | drizzle_result_st result; |
563 | drizzle_return_t ret; |
564 | |
565 | === modified file 'examples/simple_multi.c' |
566 | --- examples/simple_multi.c 2009-05-28 17:22:31 +0000 |
567 | +++ examples/simple_multi.c 2009-07-08 20:53:17 +0000 |
568 | @@ -17,7 +17,7 @@ |
569 | |
570 | int main(int argc, char *argv[]) |
571 | { |
572 | - char *query= "SELECT table_schema,table_name FROM tables"; |
573 | + const char *query= "SELECT table_schema,table_name FROM tables"; |
574 | drizzle_st drizzle; |
575 | drizzle_con_st con[SIMPLE_MULTI_COUNT]; |
576 | drizzle_result_st result[SIMPLE_MULTI_COUNT]; |
577 | |
578 | === modified file 'libdrizzle/visibility.h' |
579 | --- libdrizzle/visibility.h 2009-06-20 20:20:05 +0000 |
580 | +++ libdrizzle/visibility.h 2009-07-08 20:45:57 +0000 |
581 | @@ -30,6 +30,9 @@ |
582 | # if defined(HAVE_VISIBILITY) |
583 | # define DRIZZLE_API __attribute__ ((visibility("default"))) |
584 | # define DRIZZLE_LOCAL __attribute__ ((visibility("hidden"))) |
585 | +# elif defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550) |
586 | +# define DRIZZLE_API __global |
587 | +# define DRIZZLE_API __hidden |
588 | # elif defined(_MSC_VER) |
589 | # define DRIZZLE_API extern __declspec(dllexport) |
590 | # define DRIZZLE_LOCAL |
591 | |
592 | === added file 'm4/ac_cxx_compile_stdcxx_0x.m4' |
593 | --- m4/ac_cxx_compile_stdcxx_0x.m4 1970-01-01 00:00:00 +0000 |
594 | +++ m4/ac_cxx_compile_stdcxx_0x.m4 2009-07-08 07:18:46 +0000 |
595 | @@ -0,0 +1,103 @@ |
596 | +# =========================================================================== |
597 | +# http://autoconf-archive.cryp.to/ac_cxx_compile_stdcxx_0x.html |
598 | +# =========================================================================== |
599 | +# |
600 | +# SYNOPSIS |
601 | +# |
602 | +# AC_CXX_COMPILE_STDCXX_0X |
603 | +# |
604 | +# DESCRIPTION |
605 | +# |
606 | +# Check for baseline language coverage in the compiler for the C++0x |
607 | +# standard. |
608 | +# |
609 | +# LICENSE |
610 | +# |
611 | +# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com> |
612 | +# |
613 | +# Copying and distribution of this file, with or without modification, are |
614 | +# permitted in any medium without royalty provided the copyright notice |
615 | +# and this notice are preserved. |
616 | + |
617 | +AC_DEFUN([AC_CXX_COMPILE_STDCXX_0X], [ |
618 | + AC_CACHE_CHECK(if g++ supports C++0x features without additional flags, |
619 | + ac_cv_cxx_compile_cxx0x_native, |
620 | + [AC_LANG_SAVE |
621 | + AC_LANG_CPLUSPLUS |
622 | + AC_TRY_COMPILE([ |
623 | + template <typename T> |
624 | + struct check |
625 | + { |
626 | + static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
627 | + }; |
628 | + |
629 | + typedef check<check<bool>> right_angle_brackets; |
630 | + |
631 | + int a; |
632 | + decltype(a) b; |
633 | + |
634 | + typedef check<int> check_type; |
635 | + check_type c; |
636 | + check_type&& cr = c;],, |
637 | + ac_cv_cxx_compile_cxx0x_native=yes, ac_cv_cxx_compile_cxx0x_native=no) |
638 | + AC_LANG_RESTORE |
639 | + ]) |
640 | + |
641 | + AC_CACHE_CHECK(if g++ supports C++0x features with -std=c++0x, |
642 | + ac_cv_cxx_compile_cxx0x_cxx, |
643 | + [AC_LANG_SAVE |
644 | + AC_LANG_CPLUSPLUS |
645 | + ac_save_CXXFLAGS="$CXXFLAGS" |
646 | + CXXFLAGS="$CXXFLAGS -std=c++0x" |
647 | + AC_TRY_COMPILE([ |
648 | + template <typename T> |
649 | + struct check |
650 | + { |
651 | + static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
652 | + }; |
653 | + |
654 | + typedef check<check<bool>> right_angle_brackets; |
655 | + |
656 | + int a; |
657 | + decltype(a) b; |
658 | + |
659 | + typedef check<int> check_type; |
660 | + check_type c; |
661 | + check_type&& cr = c;],, |
662 | + ac_cv_cxx_compile_cxx0x_cxx=yes, ac_cv_cxx_compile_cxx0x_cxx=no) |
663 | + CXXFLAGS="$ac_save_CXXFLAGS" |
664 | + AC_LANG_RESTORE |
665 | + ]) |
666 | + |
667 | + AC_CACHE_CHECK(if g++ supports C++0x features with -std=gnu++0x, |
668 | + ac_cv_cxx_compile_cxx0x_gxx, |
669 | + [AC_LANG_SAVE |
670 | + AC_LANG_CPLUSPLUS |
671 | + ac_save_CXXFLAGS="$CXXFLAGS" |
672 | + CXXFLAGS="$CXXFLAGS -std=gnu++0x" |
673 | + AC_TRY_COMPILE([ |
674 | + template <typename T> |
675 | + struct check |
676 | + { |
677 | + static_assert(sizeof(int) <= sizeof(T), "not big enough"); |
678 | + }; |
679 | + |
680 | + typedef check<check<bool>> right_angle_brackets; |
681 | + |
682 | + int a; |
683 | + decltype(a) b; |
684 | + |
685 | + typedef check<int> check_type; |
686 | + check_type c; |
687 | + check_type&& cr = c;],, |
688 | + ac_cv_cxx_compile_cxx0x_gxx=yes, ac_cv_cxx_compile_cxx0x_gxx=no) |
689 | + CXXFLAGS="$ac_save_CXXFLAGS" |
690 | + AC_LANG_RESTORE |
691 | + ]) |
692 | + |
693 | + if test "$ac_cv_cxx_compile_cxx0x_native" = yes || |
694 | + test "$ac_cv_cxx_compile_cxx0x_cxx" = yes || |
695 | + test "$ac_cv_cxx_compile_cxx0x_gxx" = yes; then |
696 | + AC_DEFINE(HAVE_STDCXX_0X,,[Define if g++ supports C++0x features. ]) |
697 | + fi |
698 | +]) |
699 | |
700 | === added file 'm4/ac_cxx_header_stdcxx_98.m4' |
701 | --- m4/ac_cxx_header_stdcxx_98.m4 1970-01-01 00:00:00 +0000 |
702 | +++ m4/ac_cxx_header_stdcxx_98.m4 2009-07-08 07:18:46 +0000 |
703 | @@ -0,0 +1,67 @@ |
704 | +dnl Copyright © 2008 Benjamin Kosnik <bkoz@redhat.com> |
705 | + |
706 | +dnl Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. |
707 | + |
708 | + |
709 | +AC_DEFUN([AC_CXX_HEADER_STDCXX_98], [ |
710 | + AC_CACHE_CHECK(for ISO C++ 98 include files, |
711 | + ac_cv_cxx_stdcxx_98, |
712 | + [AC_LANG_PUSH(C++) |
713 | + AC_TRY_COMPILE([ |
714 | + #include <cassert> |
715 | + #include <cctype> |
716 | + #include <cerrno> |
717 | + #include <cfloat> |
718 | + #include <ciso646> |
719 | + #include <climits> |
720 | + #include <clocale> |
721 | + #include <cmath> |
722 | + #include <csetjmp> |
723 | + #include <csignal> |
724 | + #include <cstdarg> |
725 | + #include <cstddef> |
726 | + #include <cstdio> |
727 | + #include <cstdlib> |
728 | + #include <cstring> |
729 | + #include <ctime> |
730 | + |
731 | + #include <algorithm> |
732 | + #include <bitset> |
733 | + #include <complex> |
734 | + #include <deque> |
735 | + #include <exception> |
736 | + #include <fstream> |
737 | + #include <functional> |
738 | + #include <iomanip> |
739 | + #include <ios> |
740 | + #include <iosfwd> |
741 | + #include <iostream> |
742 | + #include <istream> |
743 | + #include <iterator> |
744 | + #include <limits> |
745 | + #include <list> |
746 | + #include <locale> |
747 | + #include <map> |
748 | + #include <memory> |
749 | + #include <new> |
750 | + #include <numeric> |
751 | + #include <ostream> |
752 | + #include <queue> |
753 | + #include <set> |
754 | + #include <sstream> |
755 | + #include <stack> |
756 | + #include <stdexcept> |
757 | + #include <streambuf> |
758 | + #include <string> |
759 | + #include <typeinfo> |
760 | + #include <utility> |
761 | + #include <valarray> |
762 | + #include <vector> |
763 | + ],, |
764 | + ac_cv_cxx_stdcxx_98=yes, ac_cv_cxx_stdcxx_98=no) |
765 | + AC_LANG_POP() |
766 | + ]) |
767 | + if test "$ac_cv_cxx_stdcxx_98" = yes; then |
768 | + AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ]) |
769 | + fi |
770 | +]) |
771 | |
772 | === modified file 'm4/extensions.m4' |
773 | --- m4/extensions.m4 2009-05-28 02:22:15 +0000 |
774 | +++ m4/extensions.m4 2009-07-08 07:18:46 +0000 |
775 | @@ -1,37 +1,94 @@ |
776 | -dnl Provide AC_USE_SYSTEM_EXTENSIONS for old autoconf machines. |
777 | -AC_DEFUN([ACX_USE_SYSTEM_EXTENSIONS],[ |
778 | - ifdef([AC_USE_SYSTEM_EXTENSIONS],[ |
779 | - AC_USE_SYSTEM_EXTENSIONS |
780 | - ],[ |
781 | - AC_BEFORE([$0], [AC_COMPILE_IFELSE]) |
782 | - AC_BEFORE([$0], [AC_RUN_IFELSE]) |
783 | - |
784 | - AC_REQUIRE([AC_GNU_SOURCE]) |
785 | - AC_REQUIRE([AC_AIX]) |
786 | - AC_REQUIRE([AC_MINIX]) |
787 | - |
788 | - AH_VERBATIM([__EXTENSIONS__], |
789 | -[/* Enable extensions on Solaris. */ |
790 | -#ifndef __EXTENSIONS__ |
791 | -# undef __EXTENSIONS__ |
792 | -#endif |
793 | +# serial 6 -*- Autoconf -*- |
794 | +# Enable extensions on systems that normally disable them. |
795 | + |
796 | +# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. |
797 | +# This file is free software; the Free Software Foundation |
798 | +# gives unlimited permission to copy and/or distribute it, |
799 | +# with or without modifications, as long as this notice is preserved. |
800 | + |
801 | +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS |
802 | +# Autoconf. Perhaps we can remove this once we can assume Autoconf |
803 | +# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly |
804 | +# enough in this area it's likely we'll need to redefine |
805 | +# AC_USE_SYSTEM_EXTENSIONS for quite some time. |
806 | + |
807 | +# AC_USE_SYSTEM_EXTENSIONS |
808 | +# ------------------------ |
809 | +# Enable extensions on systems that normally disable them, |
810 | +# typically due to standards-conformance issues. |
811 | +# Remember that #undef in AH_VERBATIM gets replaced with #define by |
812 | +# AC_DEFINE. The goal here is to define all known feature-enabling |
813 | +# macros, then, if reports of conflicts are made, disable macros that |
814 | +# cause problems on some platforms (such as __EXTENSIONS__). |
815 | +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], |
816 | +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl |
817 | +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl |
818 | + |
819 | + AC_REQUIRE([AC_CANONICAL_HOST]) |
820 | + |
821 | + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=]) |
822 | + if test "$MINIX" = yes; then |
823 | + AC_DEFINE([_POSIX_SOURCE], [1], |
824 | + [Define to 1 if you need to in order for `stat' and other |
825 | + things to work.]) |
826 | + AC_DEFINE([_POSIX_1_SOURCE], [2], |
827 | + [Define to 2 if the system does not provide POSIX.1 features |
828 | + except with this defined.]) |
829 | + AC_DEFINE([_MINIX], [1], |
830 | + [Define to 1 if on MINIX.]) |
831 | + fi |
832 | + |
833 | + dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to 500, |
834 | + dnl regardless of whether the flags -Ae or _D_HPUX_SOURCE=1 are already |
835 | + dnl provided. |
836 | + case "$host_os" in |
837 | + hpux*) |
838 | + AC_DEFINE([_XOPEN_SOURCE], [500], |
839 | + [Define to 500 only on HP-UX.]) |
840 | + ;; |
841 | + esac |
842 | + |
843 | + AH_VERBATIM([__EXTENSIONS__], |
844 | +[/* Enable extensions on AIX 3, Interix. */ |
845 | +#ifndef _ALL_SOURCE |
846 | +# undef _ALL_SOURCE |
847 | +#endif |
848 | +/* Enable GNU extensions on systems that have them. */ |
849 | +#ifndef _GNU_SOURCE |
850 | +# undef _GNU_SOURCE |
851 | +#endif |
852 | +/* Enable threading extensions on Solaris. */ |
853 | #ifndef _POSIX_PTHREAD_SEMANTICS |
854 | # undef _POSIX_PTHREAD_SEMANTICS |
855 | #endif |
856 | +/* Enable extensions on HP NonStop. */ |
857 | #ifndef _TANDEM_SOURCE |
858 | # undef _TANDEM_SOURCE |
859 | -#endif]) |
860 | - AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], |
861 | - [ac_cv_safe_to_define___extensions__], |
862 | - [AC_COMPILE_IFELSE( |
863 | - [AC_LANG_PROGRAM([ |
864 | -# define __EXTENSIONS__ 1 |
865 | - AC_INCLUDES_DEFAULT])], |
866 | - [ac_cv_safe_to_define___extensions__=yes], |
867 | - [ac_cv_safe_to_define___extensions__=no])]) |
868 | - test $ac_cv_safe_to_define___extensions__ = yes && |
869 | - AC_DEFINE([__EXTENSIONS__]) |
870 | - AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
871 | - AC_DEFINE([_TANDEM_SOURCE]) |
872 | - ]) |
873 | +#endif |
874 | +/* Enable general extensions on Solaris. */ |
875 | +#ifndef __EXTENSIONS__ |
876 | +# undef __EXTENSIONS__ |
877 | +#endif |
878 | ]) |
879 | + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__], |
880 | + [ac_cv_safe_to_define___extensions__], |
881 | + [AC_COMPILE_IFELSE( |
882 | + [AC_LANG_PROGRAM([[ |
883 | +# define __EXTENSIONS__ 1 |
884 | + ]AC_INCLUDES_DEFAULT])], |
885 | + [ac_cv_safe_to_define___extensions__=yes], |
886 | + [ac_cv_safe_to_define___extensions__=no])]) |
887 | + test $ac_cv_safe_to_define___extensions__ = yes && |
888 | + AC_DEFINE([__EXTENSIONS__]) |
889 | + AC_DEFINE([_ALL_SOURCE]) |
890 | + AC_DEFINE([_GNU_SOURCE]) |
891 | + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS]) |
892 | + AC_DEFINE([_TANDEM_SOURCE]) |
893 | +])# AC_USE_SYSTEM_EXTENSIONS |
894 | + |
895 | +# gl_USE_SYSTEM_EXTENSIONS |
896 | +# ------------------------ |
897 | +# Enable extensions on systems that normally disable them, |
898 | +# typically due to standards-conformance issues. |
899 | +AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], |
900 | + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) |
901 | |
902 | === renamed file 'm4/64bit.m4' => 'm4/pandora_64bit.m4' |
903 | --- m4/64bit.m4 2009-07-02 00:24:20 +0000 |
904 | +++ m4/pandora_64bit.m4 2009-07-10 17:20:53 +0000 |
905 | @@ -1,36 +1,53 @@ |
906 | -dnl --------------------------------------------------------------------------- |
907 | -dnl Macro: ENABLE_64BIT |
908 | -dnl --------------------------------------------------------------------------- |
909 | -AC_DEFUN([ENABLE_64BIT],[ |
910 | +dnl Copyright (C) 2009 Sun Microsystems |
911 | +dnl This file is free software; Sun Microsystems |
912 | +dnl gives unlimited permission to copy and/or distribute it, |
913 | +dnl with or without modifications, as long as this notice is preserved. |
914 | + |
915 | +dnl --------------------------------------------------------------------------- |
916 | +dnl Macro: PANDORA_64BIT |
917 | +dnl --------------------------------------------------------------------------- |
918 | +AC_DEFUN([PANDORA_64BIT],[ |
919 | + |
920 | + AC_ARG_ENABLE([64bit],[ |
921 | + AS_HELP_STRING([--disable-64bit], |
922 | + [Build 64 bit binary @<:@default=on@:>@])], |
923 | + [ac_enable_64bit="$enableval"], |
924 | + [ac_enable_64bit="yes"]) |
925 | |
926 | AC_CHECK_PROGS(ISAINFO, [isainfo], [no]) |
927 | AS_IF([test "x$ISAINFO" != "xno"], |
928 | [isainfo_b=`${ISAINFO} -b`], |
929 | [isainfo_b="x"]) |
930 | |
931 | - AS_IF([test "$isainfo_b" != "x"], |
932 | - [AC_ARG_ENABLE([64bit], |
933 | - [AS_HELP_STRING([--disable-64bit], |
934 | - [Build 64 bit binary @<:@default=on@:>@])], |
935 | - [ac_enable_64bit="$enableval"], |
936 | - [ac_enable_64bit="yes"])]) |
937 | - |
938 | - AS_IF([test "x$ac_enable_64bit" = "xyes"],[ |
939 | - if test "x$libdir" = "x\${exec_prefix}/lib" ; then |
940 | - # The user hasn't overridden the default libdir, so we'll |
941 | - # the dir suffix to match solaris 32/64-bit policy |
942 | - isainfo_k=`${ISAINFO} -k` |
943 | - libdir="${libdir}/${isainfo_k}" |
944 | - fi |
945 | - CPPFLAGS="-m64 ${CPPFLAGS}" |
946 | - LDFLAGS="-m64 ${LDFLAGS}" |
947 | - if test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes" |
948 | - then |
949 | - AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}" |
950 | - AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}" |
951 | - fi |
952 | - ]) |
953 | + AS_IF([test "$isainfo_b" != "x"],[ |
954 | + |
955 | + isainfo_k=`${ISAINFO} -k` |
956 | + DTRACEFLAGS="${DTRACEFLAGS} -${isainfo_k}" |
957 | + |
958 | + AS_IF([test "x${ac_cv_env_CPPFLAGS_set}" = "x"],[ |
959 | + CPPFLAGS="-I/usr/local ${CPPFLAGS}" |
960 | + ]) |
961 | + |
962 | + AS_IF([test "x${ac_cv_env_LDFLAGS_set}" = "x"],[ |
963 | + LDFLAGS="-L/usr/local/lib/${isainfo_k} ${LDFLAGS}" |
964 | + ]) |
965 | + |
966 | + AS_IF([test "x$ac_enable_64bit" = "xyes"],[ |
967 | + AS_IF([test "x$libdir" = "x\${exec_prefix}/lib"],[ |
968 | + dnl The user hasn't overridden the default libdir, so we'll |
969 | + dnl the dir suffix to match solaris 32/64-bit policy |
970 | + libdir="${libdir}/${isainfo_k}" |
971 | + ]) |
972 | + |
973 | + CPPFLAGS="-m64 ${CPPFLAGS}" |
974 | + LDFLAGS="-m64 ${LDFLAGS}" |
975 | + AS_IF([test "$target_cpu" = "sparc" -a "x$SUNCC" = "xyes"],[ |
976 | + AM_CFLAGS="-xmemalign=8s ${AM_CFLAGS}" |
977 | + AM_CXXFLAGS="-xmemalign=8s ${AM_CXXFLAGS}" |
978 | + ]) |
979 | + ]) |
980 | + ]) |
981 | ]) |
982 | dnl --------------------------------------------------------------------------- |
983 | -dnl End Macro: ENABLE_64BIT |
984 | +dnl End Macro: PANDORA_64BIT |
985 | dnl --------------------------------------------------------------------------- |
986 | |
987 | === added file 'm4/pandora_canonical.m4' |
988 | --- m4/pandora_canonical.m4 1970-01-01 00:00:00 +0000 |
989 | +++ m4/pandora_canonical.m4 2009-07-10 17:20:53 +0000 |
990 | @@ -0,0 +1,144 @@ |
991 | +dnl Copyright (C) 2009 Sun Microsystems |
992 | +dnl This file is free software; Sun Microsystems |
993 | +dnl gives unlimited permission to copy and/or distribute it, |
994 | +dnl with or without modifications, as long as this notice is preserved. |
995 | + |
996 | +dnl Which version of the canonical setup we're using |
997 | +AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.11]) |
998 | + |
999 | +AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[ |
1000 | + dnl Force dependency tracking on for Sun Studio builds |
1001 | + AS_IF([test "x${enable_dependency_tracking}" = "x"],[ |
1002 | + enable_dependency_tracking=yes |
1003 | + ]) |
1004 | +]) |
1005 | + |
1006 | +dnl The standard setup for how we build Pandora projects |
1007 | +AC_DEFUN([PANDORA_CANONICAL_TARGET],[ |
1008 | + AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING]) |
1009 | + ifdef([m4_define],,[define([m4_define], defn([define]))]) |
1010 | + ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))]) |
1011 | + m4_define([PCT_ALL_ARGS],[$*]) |
1012 | + m4_define([PCT_USE_GNULIB],[no]) |
1013 | + m4_define([PCT_REQUIRE_CXX],[no]) |
1014 | + m4_define([PCT_IGNORE_SHARED_PTR],[no]) |
1015 | + m4_define([PCT_FORCE_GCC42],[no]) |
1016 | + m4_foreach([pct_arg],[$*],[ |
1017 | + m4_case(pct_arg, |
1018 | + [use-gnulib], [ |
1019 | + m4_undefine([PCT_USE_GNULIB]) |
1020 | + m4_define([PCT_USE_GNULIB],[yes]) |
1021 | + ], |
1022 | + [require-cxx], [ |
1023 | + m4_undefine([PCT_REQUIRE_CXX]) |
1024 | + m4_define([PCT_REQUIRE_CXX],[yes]) |
1025 | + ], |
1026 | + [ignore-shared-ptr], [ |
1027 | + m4_undefine([PCT_IGNORE_SHARED_PTR]) |
1028 | + m4_define([PCT_IGNORE_SHARED_PTR],[yes]) |
1029 | + ], |
1030 | + [force-gcc42], [ |
1031 | + m4_undefine([PCT_FORCE_GCC42]) |
1032 | + m4_define([PCT_FORCE_GCC42],[yes]) |
1033 | + ]) |
1034 | + ]) |
1035 | + |
1036 | + # We need to prevent canonical target |
1037 | + # from injecting -O2 into CFLAGS - but we won't modify anything if we have |
1038 | + # set CFLAGS on the command line, since that should take ultimate precedence |
1039 | + AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"], |
1040 | + [CFLAGS=""]) |
1041 | + AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"], |
1042 | + [CXXFLAGS=""]) |
1043 | + |
1044 | + AC_CANONICAL_TARGET |
1045 | + |
1046 | + AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects) |
1047 | + |
1048 | + m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ]) |
1049 | + |
1050 | + AC_REQUIRE([AC_PROG_CC]) |
1051 | + AC_REQUIRE([PANDORA_MAC_GCC42]) |
1052 | + |
1053 | + dnl Once we can use a modern autoconf, we can use this |
1054 | + dnl AC_PROG_CC_C99 |
1055 | + AC_PROG_CXX |
1056 | + AC_PROG_CPP |
1057 | + AM_PROG_CC_C_O |
1058 | + |
1059 | + gl_USE_SYSTEM_EXTENSIONS |
1060 | + m4_if(PCT_FORCE_GCC42, [yes], [ |
1061 | + AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION) |
1062 | + ]) |
1063 | + |
1064 | + |
1065 | + PANDORA_LIBTOOL |
1066 | + |
1067 | + dnl autoconf doesn't automatically provide a fail-if-no-C++ macro |
1068 | + dnl so we check c++98 features and fail if we don't have them, mainly |
1069 | + dnl for that reason |
1070 | + PANDORA_CHECK_CXX_STANDARD |
1071 | + m4_if(PCT_REQUIRE_CXX, [yes], [ |
1072 | + AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[ |
1073 | + AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98]) |
1074 | + ]) |
1075 | + ]) |
1076 | + |
1077 | + PANDORA_SHARED_PTR |
1078 | + m4_if(PCT_IGNORE_SHARED_PTR, [no], [ |
1079 | + AS_IF([test "$ac_cv_shared_ptr_namespace" = "missing"],[ |
1080 | + AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.]) |
1081 | + ]) |
1082 | + ]) |
1083 | + |
1084 | + m4_if(PCT_USE_GNULIB, [yes], [gl_INIT]) |
1085 | + |
1086 | + AC_C_BIGENDIAN |
1087 | + AC_C_CONST |
1088 | + AC_C_INLINE |
1089 | + AC_C_VOLATILE |
1090 | + |
1091 | + AC_HEADER_TIME |
1092 | + AC_TYPE_SIZE_T |
1093 | + AC_FUNC_MALLOC |
1094 | + AC_FUNC_REALLOC |
1095 | + |
1096 | + |
1097 | + AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) |
1098 | + |
1099 | + AC_SYS_LARGEFILE |
1100 | + |
1101 | + |
1102 | + PANDORA_CHECK_C_VERSION |
1103 | + PANDORA_CHECK_CXX_VERSION |
1104 | + |
1105 | + PANDORA_OPTIMIZE |
1106 | + PANDORA_64BIT |
1107 | + |
1108 | + gl_VISIBILITY |
1109 | + |
1110 | + PANDORA_WARNINGS(PCT_ALL_ARGS) |
1111 | + |
1112 | + PANDORA_ENABLE_DTRACE |
1113 | + PANDORA_HEADER_ASSERT |
1114 | + |
1115 | + AC_CHECK_PROGS([DOXYGEN], [doxygen]) |
1116 | + AC_CHECK_PROGS([PERL], [perl]) |
1117 | + |
1118 | + AS_IF([test "x${gl_LIBOBJS}" != "x"],[ |
1119 | + AS_IF([test "$GCC" = "yes"],[ |
1120 | + AM_CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${AM_CPPFLAGS}" |
1121 | + ],[ |
1122 | + AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}" |
1123 | + ]) |
1124 | + ]) |
1125 | + |
1126 | + AM_CPPFLAGS="-I\${top_srcdir} -I\${top_builddir} ${AM_CPPFLAGS}" |
1127 | + AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" |
1128 | + AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}" |
1129 | + |
1130 | + AC_SUBST([AM_CFLAGS]) |
1131 | + AC_SUBST([AM_CXXFLAGS]) |
1132 | + AC_SUBST([AM_CPPFLAGS]) |
1133 | + |
1134 | +]) |
1135 | |
1136 | === added file 'm4/pandora_check_compiler_version.m4' |
1137 | --- m4/pandora_check_compiler_version.m4 1970-01-01 00:00:00 +0000 |
1138 | +++ m4/pandora_check_compiler_version.m4 2009-07-08 07:18:46 +0000 |
1139 | @@ -0,0 +1,37 @@ |
1140 | +dnl Copyright (C) 2009 Sun Microsystems |
1141 | +dnl This file is free software; Sun Microsystems |
1142 | +dnl gives unlimited permission to copy and/or distribute it, |
1143 | +dnl with or without modifications, as long as this notice is preserved. |
1144 | + |
1145 | + |
1146 | +AC_DEFUN([PANDORA_CHECK_C_VERSION],[ |
1147 | + |
1148 | + dnl Print version of C compiler |
1149 | + AC_MSG_CHECKING("C Compiler version--$GCC") |
1150 | + AS_IF([test "$GCC" = "yes"],[ |
1151 | + CC_VERSION=`$CC --version | sed 1q` |
1152 | + ],[AS_IF([test "$SUNCC" = "yes"],[ |
1153 | + CC_VERSION=`$CC -V 2>&1 | sed 1q` |
1154 | + ],[ |
1155 | + CC_VERSION="" |
1156 | + ]) |
1157 | + ]) |
1158 | + AC_MSG_RESULT("$CC_VERSION") |
1159 | + AC_SUBST(CC_VERSION) |
1160 | +]) |
1161 | + |
1162 | + |
1163 | +AC_DEFUN([PANDORA_CHECK_CXX_VERSION], [ |
1164 | + dnl Print version of CXX compiler |
1165 | + AC_MSG_CHECKING("C++ Compiler version") |
1166 | + AS_IF([test "$GCC" = "yes"],[ |
1167 | + CXX_VERSION=`$CXX --version | sed 1q` |
1168 | + ],[AS_IF([test "$SUNCC" = "yes"],[ |
1169 | + CXX_VERSION=`$CXX -V 2>&1 | sed 1q` |
1170 | + ],[ |
1171 | + CXX_VERSION="" |
1172 | + ]) |
1173 | + ]) |
1174 | + AC_MSG_RESULT("$CXX_VERSION") |
1175 | + AC_SUBST(CXX_VERSION) |
1176 | +]) |
1177 | |
1178 | === added file 'm4/pandora_check_cxx_standard.m4' |
1179 | --- m4/pandora_check_cxx_standard.m4 1970-01-01 00:00:00 +0000 |
1180 | +++ m4/pandora_check_cxx_standard.m4 2009-07-08 07:18:46 +0000 |
1181 | @@ -0,0 +1,16 @@ |
1182 | +dnl Copyright (C) 2009 Sun Microsystems |
1183 | +dnl This file is free software; Sun Microsystems |
1184 | +dnl gives unlimited permission to copy and/or distribute it, |
1185 | +dnl with or without modifications, as long as this notice is preserved. |
1186 | + |
1187 | +AC_DEFUN([PANDORA_CHECK_CXX_STANDARD],[ |
1188 | + AC_REQUIRE([AC_CXX_COMPILE_STDCXX_0X]) |
1189 | + AS_IF([test "$GCC" = "yes"], |
1190 | + [AS_IF([test "$ac_cv_cxx_compile_cxx0x_native" = "yes"],[], |
1191 | + [AS_IF([test "$ac_cv_cxx_compile_cxx0x_gxx" = "yes"], |
1192 | + [CXXFLAGS="-std=gnu++0x ${CXXFLAGS}"], |
1193 | + [CXXFLAGS="-std=gnu++98"]) |
1194 | + ]) |
1195 | + ]) |
1196 | + AC_CXX_HEADER_STDCXX_98 |
1197 | +]) |
1198 | |
1199 | === renamed file 'm4/dtrace.m4' => 'm4/pandora_enable_dtrace.m4' |
1200 | --- m4/dtrace.m4 2009-06-20 16:40:44 +0000 |
1201 | +++ m4/pandora_enable_dtrace.m4 2009-07-08 07:18:46 +0000 |
1202 | @@ -1,23 +1,41 @@ |
1203 | -dnl --------------------------------------------------------------------------- |
1204 | -dnl Macro: ENABLE_DTRACE |
1205 | -dnl --------------------------------------------------------------------------- |
1206 | -AC_DEFUN([ENABLE_DTRACE],[ |
1207 | +dnl Copyright (C) 2009 Sun Microsystems |
1208 | +dnl This file is free software; Sun Microsystems |
1209 | +dnl gives unlimited permission to copy and/or distribute it, |
1210 | +dnl with or without modifications, as long as this notice is preserved. |
1211 | + |
1212 | +dnl --------------------------------------------------------------------------- |
1213 | +dnl Macro: PANDORA_ENABLE_DTRACE |
1214 | +dnl --------------------------------------------------------------------------- |
1215 | +AC_DEFUN([PANDORA_ENABLE_DTRACE],[ |
1216 | AC_ARG_ENABLE([dtrace], |
1217 | [AS_HELP_STRING([--enable-dtrace], |
1218 | [Build with support for the DTRACE. @<:@default=off@:>@])], |
1219 | - [ |
1220 | + [ac_cv_enable_dtrace="yes"], |
1221 | + [ac_cv_enable_dtrace="no"]) |
1222 | + |
1223 | + AS_IF([test "$ac_cv_enable_dtrace" = "yes"],[ |
1224 | + AC_CHECK_PROGS([DTRACE], [dtrace]) |
1225 | + AS_IF([test "x$ac_cv_prog_DTRACE" = "xdtrace"],[ |
1226 | AC_DEFINE([HAVE_DTRACE], [1], [Enables DTRACE Support]) |
1227 | - AC_DEFINE([_DTRACE_VERSION], [1], [DTRACE Version to Use]) |
1228 | - AC_CHECK_PROGS(DTRACE, dtrace) |
1229 | - ac_cv_enable_dtrace="yes" |
1230 | - AC_SUBST(DTRACEFLAGS) |
1231 | - AC_SUBST(HAVE_DTRACE) |
1232 | - ], |
1233 | - [ |
1234 | - ac_cv_enable_dtrace="no" |
1235 | - ]) |
1236 | -AM_CONDITIONAL([HAVE_DTRACE], [ test "$ac_cv_enable_dtrace" = "yes" ]) |
1237 | + dnl DTrace on MacOSX does not use -G option |
1238 | + cat >conftest.d <<_ACEOF |
1239 | +provider Example { |
1240 | + probe increment(int); |
1241 | +}; |
1242 | +_ACEOF |
1243 | + $DTRACE -G -o conftest.d.o -s conftest.d 2>/dev/zero |
1244 | + AS_IF([test $? -eq 0],[ac_cv_dtrace_needs_objects=yes]) |
1245 | + rm -f conftest.d.o conftest.d |
1246 | + |
1247 | + AC_SUBST(DTRACEFLAGS) dnl TODO: test for -G on OSX |
1248 | + ac_cv_have_dtrace=yes |
1249 | + ])]) |
1250 | + |
1251 | +AM_CONDITIONAL([HAVE_DTRACE], [test "x$ac_cv_have_dtrace" = "xyes"]) |
1252 | +AM_CONDITIONAL([DTRACE_NEEDS_OBJECTS], |
1253 | + [test "x$ac_cv_dtrace_needs_objects" = "xyes"]) |
1254 | + |
1255 | ]) |
1256 | dnl --------------------------------------------------------------------------- |
1257 | -dnl End Macro: ENABLE_DTRACE |
1258 | +dnl End Macro: PANDORA_ENABLE_DTRACE |
1259 | dnl --------------------------------------------------------------------------- |
1260 | |
1261 | === renamed file 'm4/check_gcc_version.m4' => 'm4/pandora_ensure_gcc_version.m4' |
1262 | --- m4/check_gcc_version.m4 2009-06-20 16:48:41 +0000 |
1263 | +++ m4/pandora_ensure_gcc_version.m4 2009-07-08 07:18:46 +0000 |
1264 | @@ -1,7 +1,12 @@ |
1265 | -AC_DEFUN([FORCE_MAC_GCC42], |
1266 | +dnl Copyright (C) 2009 Sun Microsystems |
1267 | +dnl This file is free software; Sun Microsystems |
1268 | +dnl gives unlimited permission to copy and/or distribute it, |
1269 | +dnl with or without modifications, as long as this notice is preserved. |
1270 | + |
1271 | +dnl If the user is on a Mac and didn't ask for a specific compiler |
1272 | +dnl You're gonna get 4.2. |
1273 | +AC_DEFUN([PANDORA_MAC_GCC42], |
1274 | [AS_IF([test "$GCC" = "yes"],[ |
1275 | - dnl If you're on a Mac, and you didn't ask for a specific compiler |
1276 | - dnl You're gonna get 4.2. |
1277 | AS_IF([test "$host_vendor" = "apple" -a "x${ac_cv_env_CC_set}" = "x"],[ |
1278 | AS_IF([test -f /usr/bin/gcc-4.2], |
1279 | [ |
1280 | @@ -13,8 +18,9 @@ |
1281 | ]) |
1282 | ]) |
1283 | |
1284 | -AC_DEFUN([CHECK_GCC_VERSION],[ |
1285 | - AC_REQUIRE([FORCE_MAC_GCC42]) |
1286 | +dnl |
1287 | +AC_DEFUN([PANDORA_ENSURE_GCC_VERSION],[ |
1288 | + AC_REQUIRE([PANDORA_MAC_GCC42]) |
1289 | AC_CACHE_CHECK([if GCC is recent enough], [ac_cv_gcc_recent], |
1290 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
1291 | #if !defined(__GNUC__) || (__GNUC__ < 4) || ((__GNUC__ >= 4) && (__GNUC_MINOR__ < 1)) |
1292 | @@ -25,6 +31,6 @@ |
1293 | [ac_cv_gcc_recent=no])]) |
1294 | AS_IF([test "$ac_cv_gcc_recent" = "no" -a "$host_vendor" = "apple"], |
1295 | AC_MSG_ERROR([Your version of GCC is too old. At least version 4.2 is required on OSX. You may need to install a version of XCode >= 3.1.2])) |
1296 | - AS_IF([test "$drizzle_cv_gcc_recent" = "no"], |
1297 | + AS_IF([test "$ac_cv_gcc_recent" = "no"], |
1298 | AC_MSG_ERROR([Your version of GCC is too old. At least version 4.1 is required])) |
1299 | ]) |
1300 | |
1301 | === added file 'm4/pandora_header_assert.m4' |
1302 | --- m4/pandora_header_assert.m4 1970-01-01 00:00:00 +0000 |
1303 | +++ m4/pandora_header_assert.m4 2009-07-08 07:18:46 +0000 |
1304 | @@ -0,0 +1,23 @@ |
1305 | +dnl Copyright (C) 2009 Sun Microsystems |
1306 | +dnl This file is free software; Sun Microsystems |
1307 | +dnl gives unlimited permission to copy and/or distribute it, |
1308 | +dnl with or without modifications, as long as this notice is preserved. |
1309 | + |
1310 | +dnl PANDORA_HEADER_ASSERT |
1311 | +dnl ---------------- |
1312 | +dnl Check whether to enable assertions. |
1313 | +AC_DEFUN([PANDORA_HEADER_ASSERT], |
1314 | +[ |
1315 | + AC_MSG_CHECKING([whether to enable assertions]) |
1316 | + AC_ARG_ENABLE([assert], |
1317 | + [AS_HELP_STRING([--disable-assert], |
1318 | + [Turn off assertions])], |
1319 | + [ac_cv_assert="no"], |
1320 | + [ac_cv_assert="yes"]) |
1321 | + AC_MSG_RESULT([$ac_cv_assert]) |
1322 | + |
1323 | + AS_IF([test "$ac_cv_assert" = "yes"], |
1324 | + [AC_CHECK_HEADERS(assert.h)], |
1325 | + [AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])]) |
1326 | +]) |
1327 | + |
1328 | |
1329 | === added file 'm4/pandora_libtool.m4' |
1330 | --- m4/pandora_libtool.m4 1970-01-01 00:00:00 +0000 |
1331 | +++ m4/pandora_libtool.m4 2009-07-08 07:18:46 +0000 |
1332 | @@ -0,0 +1,15 @@ |
1333 | +dnl Copyright (C) 2009 Sun Microsystems |
1334 | +dnl This file is free software; Sun Microsystems |
1335 | +dnl gives unlimited permission to copy and/or distribute it, |
1336 | +dnl with or without modifications, as long as this notice is preserved. |
1337 | + |
1338 | +AC_DEFUN([PANDORA_LIBTOOL],[ |
1339 | + AC_REQUIRE([AC_PROG_LIBTOOL]) |
1340 | + dnl By requiring AC_PROG_LIBTOOL, we should force the macro system to read |
1341 | + dnl libtool.m4, where in 2.2 AC_PROG_LIBTOOL is an alias for LT_INIT |
1342 | + dnl Then, if we're on 2.2, we should have LT_LANG, so we'll call it. |
1343 | + m4_ifdef([LT_LANG],[ |
1344 | + LT_LANG(C) |
1345 | + LT_LANG(C++) |
1346 | + ]) |
1347 | +]) |
1348 | |
1349 | === added file 'm4/pandora_optimize.m4' |
1350 | --- m4/pandora_optimize.m4 1970-01-01 00:00:00 +0000 |
1351 | +++ m4/pandora_optimize.m4 2009-07-09 18:27:48 +0000 |
1352 | @@ -0,0 +1,67 @@ |
1353 | +dnl Copyright (C) 2009 Sun Microsystems |
1354 | +dnl This file is free software; Sun Microsystems |
1355 | +dnl gives unlimited permission to copy and/or distribute it, |
1356 | +dnl with or without modifications, as long as this notice is preserved. |
1357 | + |
1358 | +AC_DEFUN([PANDORA_OPTIMIZE],[ |
1359 | + dnl Build optimized or debug version ? |
1360 | + dnl First check for gcc and g++ |
1361 | + AS_IF([test "$GCC" = "yes"],[ |
1362 | + |
1363 | + AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux]) |
1364 | + |
1365 | + dnl The following is required for portable results of floating point |
1366 | + dnl calculations on PowerPC. The same must also be done for IA-64, but |
1367 | + dnl this options is missing in the IA-64 gcc backend. |
1368 | + case "$target_cpu" in |
1369 | + *ppc* | *powerpc*) |
1370 | + AM_CFLAGS="-mno-fused-madd ${AM_CFLAGS}" |
1371 | + AM_CXXFLAGS="-mno-fused-madd ${AM_CXXFLAGS}" |
1372 | + ;; |
1373 | + esac |
1374 | + |
1375 | + dnl Once we can use a modern autoconf, we can replace the std=gnu99 here |
1376 | + dnl with using AC_CC_STD_C99 above |
1377 | + CC="${CC} -std=gnu99" |
1378 | + |
1379 | + AM_CPPFLAGS="-ggdb3 ${AM_CPPFLAGS}" |
1380 | + |
1381 | + DEBUG_CFLAGS="-O0" |
1382 | + DEBUG_CXXFLAGS="-O0" |
1383 | + |
1384 | + OPTIMIZE_CFLAGS="-O3" |
1385 | + OPTIMIZE_CXXFLAGS="-O3" |
1386 | + ]) |
1387 | + AS_IF([test "$SUNCC" = "yes"],[ |
1388 | + dnl Once we can use a modern autoconf, we can replace the -xc99=all here |
1389 | + dnl with using AC_CC_STD_C99 above |
1390 | + CC="${CC} -xc99=all" |
1391 | + CXX="${CXX} -xlang=c99" |
1392 | + |
1393 | + AM_CFLAGS="-g -mt -xstrconst -Xa ${AM_CFLAGS}" |
1394 | + AM_CXXFLAGS="-mt -compat=5 -library=stlport4 -template=no%extdef ${AM_CXXFLAGS}" |
1395 | + |
1396 | + DEBUG_CXXFLAGS="-g" |
1397 | + |
1398 | + dnl TODO: Make a test for -xO4 usability here |
1399 | + OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend -xbuiltin" |
1400 | + OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS}" |
1401 | + OPTIMIZE_CXXFLAGS="-g0 ${OPTIMIZE_FLAGS}" |
1402 | + |
1403 | + ]) |
1404 | + |
1405 | + AC_ARG_WITH([debug], |
1406 | + [AS_HELP_STRING([--with-debug], |
1407 | + [Add debug code/turns off optimizations (yes|no) @<:@default=no@:>@])], |
1408 | + [with_debug=$withval], |
1409 | + [with_debug=no]) |
1410 | + AS_IF([test "$with_debug" = "yes"],[ |
1411 | + # Debugging. No optimization. |
1412 | + AM_CFLAGS="${AM_CFLAGS} ${DEBUG_CFLAGS} -DDEBUG" |
1413 | + AM_CXXFLAGS="${AM_CXXFLAGS} ${DEBUG_CXXFLAGS} -DDEBUG" |
1414 | + ],[ |
1415 | + # Optimized version. No debug |
1416 | + AM_CFLAGS="${AM_CFLAGS} ${OPTIMIZE_CFLAGS}" |
1417 | + AM_CXXFLAGS="${AM_CXXFLAGS} ${OPTIMIZE_CXXFLAGS}" |
1418 | + ]) |
1419 | +]) |
1420 | |
1421 | === added file 'm4/pandora_shared_ptr.m4' |
1422 | --- m4/pandora_shared_ptr.m4 1970-01-01 00:00:00 +0000 |
1423 | +++ m4/pandora_shared_ptr.m4 2009-07-08 07:18:46 +0000 |
1424 | @@ -0,0 +1,56 @@ |
1425 | +dnl Copyright (C) 2009 Sun Microsystems |
1426 | +dnl This file is free software; Sun Microsystems |
1427 | +dnl gives unlimited permission to copy and/or distribute it, |
1428 | +dnl with or without modifications, as long as this notice is preserved. |
1429 | + |
1430 | +dnl We check two things: where is the memory include file, and in what |
1431 | +dnl namespace does shared_ptr reside. |
1432 | +dnl We include AC_COMPILE_IFELSE for all the combinations we've seen in the |
1433 | +dnl wild: |
1434 | +dnl |
1435 | +dnl GCC 4.3: namespace: std:: #include <memory> |
1436 | +dnl GCC 4.2: namespace: tr1:: #include <tr1/memory> |
1437 | +dnl GCC 4.2: namespace: boost:: #include <boost/shared_ptr.hpp> |
1438 | +dnl |
1439 | +dnl We define one of HAVE_HAVE_TR1_SHARED_PTR or HAVE_BOOST_SHARED_PTR |
1440 | +dnl depending on location, and SHARED_PTR_NAMESPACE to be the namespace in |
1441 | +dnl which shared_ptr is defined. |
1442 | +dnl |
1443 | + |
1444 | +AC_DEFUN([PANDORA_SHARED_PTR],[ |
1445 | + AC_REQUIRE([PANDORA_CHECK_CXX_STANDARD]) |
1446 | + AC_LANG_PUSH(C++) |
1447 | + AC_CHECK_HEADERS(memory tr1/memory boost/shared_ptr.hpp) |
1448 | + AC_CACHE_CHECK([the location of shared_ptr header file], |
1449 | + [ac_cv_shared_ptr_h],[ |
1450 | + for namespace in std tr1 std::tr1 boost |
1451 | + do |
1452 | + AC_COMPILE_IFELSE( |
1453 | + [AC_LANG_PROGRAM([[ |
1454 | +#if defined(HAVE_MEMORY) |
1455 | +# include <memory> |
1456 | +#endif |
1457 | +#if defined(HAVE_TR1_MEMORY) |
1458 | +# include <tr1/memory> |
1459 | +#endif |
1460 | +#if defined(HAVE_BOOST_SHARED_PTR_HPP) |
1461 | +# include <boost/shared_ptr.hpp> |
1462 | +#endif |
1463 | +#include <string> |
1464 | + |
1465 | +using $namespace::shared_ptr; |
1466 | +using namespace std; |
1467 | + ]],[[ |
1468 | +shared_ptr<string> test_ptr(new string("test string")); |
1469 | + ]])], |
1470 | + [ |
1471 | + ac_cv_shared_ptr_namespace="${namespace}" |
1472 | + break |
1473 | + ],[ac_cv_shared_ptr_namespace=missing]) |
1474 | + done |
1475 | + ]) |
1476 | + AC_DEFINE_UNQUOTED([SHARED_PTR_NAMESPACE], |
1477 | + ${ac_cv_shared_ptr_namespace}, |
1478 | + [The namespace in which SHARED_PTR can be found]) |
1479 | + AC_LANG_POP() |
1480 | +]) |
1481 | |
1482 | === added file 'm4/pandora_vc_build.m4' |
1483 | --- m4/pandora_vc_build.m4 1970-01-01 00:00:00 +0000 |
1484 | +++ m4/pandora_vc_build.m4 2009-07-08 07:18:46 +0000 |
1485 | @@ -0,0 +1,32 @@ |
1486 | +dnl Copyright (C) 2009 Sun Microsystems |
1487 | +dnl This file is free software; Sun Microsystems |
1488 | +dnl gives unlimited permission to copy and/or distribute it, |
1489 | +dnl with or without modifications, as long as this notice is preserved. |
1490 | + |
1491 | +AC_DEFUN([PANDORA_BUILDING_FROM_VC],[ |
1492 | + |
1493 | + ac_cv_building_from_vc=no |
1494 | + |
1495 | + AS_IF([test -d "${srcdir}/.bzr"],[ |
1496 | + ac_cv_building_from_bzr=yes |
1497 | + ac_cv_building_from_vc=yes |
1498 | + ],[ |
1499 | + ac_cv_building_from_bzr=no |
1500 | + ]) |
1501 | + |
1502 | + AS_IF([test -d "${srcdir}/.svn"],[ |
1503 | + ac_cv_building_from_svn=yes |
1504 | + ac_cv_building_from_vc=yes |
1505 | + ],[ |
1506 | + ac_cv_building_from_svn=no |
1507 | + ]) |
1508 | + |
1509 | + AS_IF([test -d "${srcdir}/.hg"],[ |
1510 | + ac_cv_building_from_hg=yes |
1511 | + ac_cv_building_from_vc=yes |
1512 | + ],[ |
1513 | + ac_cv_building_from_hg=no |
1514 | + ]) |
1515 | + |
1516 | +]) |
1517 | + |
1518 | |
1519 | === added file 'm4/pandora_warnings.m4' |
1520 | --- m4/pandora_warnings.m4 1970-01-01 00:00:00 +0000 |
1521 | +++ m4/pandora_warnings.m4 2009-07-10 17:20:53 +0000 |
1522 | @@ -0,0 +1,248 @@ |
1523 | +dnl Copyright (C) 2009 Sun Microsystems |
1524 | +dnl This file is free software; Sun Microsystems |
1525 | +dnl gives unlimited permission to copy and/or distribute it, |
1526 | +dnl with or without modifications, as long as this notice is preserved. |
1527 | + |
1528 | +dnl AC_PANDORA_WARNINGS([less-warnings|warnings-always-on]) |
1529 | +dnl less-warnings turn on a limited set of warnings |
1530 | +dnl warnings-always-on always set warnings=error regardless of tarball/vc |
1531 | + |
1532 | +dnl @TODO: remove less-warnings option as soon as Drizzle is clean enough to |
1533 | +dnl allow it |
1534 | + |
1535 | +AC_DEFUN([PANDORA_WARNINGS],[ |
1536 | + m4_define([PW_LESS_WARNINGS],[no]) |
1537 | + m4_define([PW_WARN_ALWAYS_ON],[no]) |
1538 | + ifdef([m4_define],,[define([m4_define], defn([define]))]) |
1539 | + ifdef([m4_undefine],,[define([m4_undefine], defn([undefine]))]) |
1540 | + m4_foreach([pw_arg],[$*],[ |
1541 | + m4_case(pw_arg, |
1542 | + [less-warnings],[ |
1543 | + m4_undefine([PW_LESS_WARNINGS]) |
1544 | + m4_define([PW_LESS_WARNINGS],[yes]) |
1545 | + ], |
1546 | + [warnings-always-on],[ |
1547 | + m4_undefine([PW_WARN_ALWAYS_ON]) |
1548 | + m4_define([PW_WARN_ALWAYS_ON],[yes]) |
1549 | + ]) |
1550 | + ]) |
1551 | + |
1552 | + AC_REQUIRE([PANDORA_BUILDING_FROM_VC]) |
1553 | + m4_if(PW_WARN_ALWAYS_ON, [yes], |
1554 | + [ac_cv_warnings_as_errors=yes], |
1555 | + AS_IF([test "$ac_cv_building_from_vc" = "yes"], |
1556 | + [ac_cv_warnings_as_errors=yes], |
1557 | + [ac_cv_warnings_as_errors=no])) |
1558 | + |
1559 | + AC_ARG_ENABLE([profiling], |
1560 | + [AS_HELP_STRING([--enable-profiling], |
1561 | + [Toggle profiling @<:@default=off@:>@])], |
1562 | + [ac_profiling="$enableval"], |
1563 | + [ac_profiling="no"]) |
1564 | + |
1565 | + AC_ARG_ENABLE([coverage], |
1566 | + [AS_HELP_STRING([--enable-coverage], |
1567 | + [Toggle coverage @<:@default=off@:>@])], |
1568 | + [ac_coverage="$enableval"], |
1569 | + [ac_coverage="no"]) |
1570 | + |
1571 | + AS_IF([test "$GCC" = "yes"],[ |
1572 | + |
1573 | + AS_IF([test "$ac_profiling" = "yes"],[ |
1574 | + CC_PROFILING="-pg" |
1575 | + save_LIBS="${LIBS}" |
1576 | + LIBS="" |
1577 | + AC_CHECK_LIB(c_p, read) |
1578 | + LIBC_P="${LIBS}" |
1579 | + LIBS="${save_LIBS}" |
1580 | + AC_SUBST(LIBC_P) |
1581 | + ],[ |
1582 | + CC_PROFILING=" " |
1583 | + ]) |
1584 | + |
1585 | + AS_IF([test "$ac_coverage" = "yes"], |
1586 | + [CC_COVERAGE="-fprofile-arcs -ftest-coverage"]) |
1587 | + |
1588 | + AS_IF([test "$ac_cv_warnings_as_errors" = "yes"], |
1589 | + [W_FAIL="-Werror"]) |
1590 | + |
1591 | + AC_CACHE_CHECK([whether it is safe to use -fdiagnostics-show-option], |
1592 | + [ac_cv_safe_to_use_fdiagnostics_show_option_], |
1593 | + [save_CFLAGS="$CFLAGS" |
1594 | + CFLAGS="-fdiagnostics-show-option ${AM_CFLAGS}" |
1595 | + AC_COMPILE_IFELSE( |
1596 | + [AC_LANG_PROGRAM([],[])], |
1597 | + [ac_cv_safe_to_use_fdiagnostics_show_option_=yes], |
1598 | + [ac_cv_safe_to_use_fdiagnostics_show_option_=no]) |
1599 | + CFLAGS="$save_CFLAGS"]) |
1600 | + |
1601 | + AS_IF([test "$ac_cv_safe_to_use_fdiagnostics_show_option_" = "yes"], |
1602 | + [ |
1603 | + F_DIAGNOSTICS_SHOW_OPTION="-fdiagnostics-show-option" |
1604 | + ]) |
1605 | + |
1606 | + AC_CACHE_CHECK([whether it is safe to use -Wconversion], |
1607 | + [ac_cv_safe_to_use_wconversion_], |
1608 | + [save_CFLAGS="$CFLAGS" |
1609 | + dnl Use -Werror here instead of ${W_FAIL} so that we don't spew |
1610 | + dnl conversion warnings to all the tarball folks |
1611 | + CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}" |
1612 | + AC_COMPILE_IFELSE( |
1613 | + [AC_LANG_PROGRAM([[ |
1614 | +#include <stdbool.h> |
1615 | +void foo(bool a) |
1616 | +{ |
1617 | + (void)a; |
1618 | +} |
1619 | + ]],[[ |
1620 | +foo(0); |
1621 | + ]])], |
1622 | + [ac_cv_safe_to_use_wconversion_=yes], |
1623 | + [ac_cv_safe_to_use_wconversion_=no]) |
1624 | + CFLAGS="$save_CFLAGS"]) |
1625 | + |
1626 | + AS_IF([test "$ac_cv_safe_to_use_wconversion_" = "yes"], |
1627 | + [W_CONVERSION="-Wconversion" |
1628 | + AC_CACHE_CHECK([whether it is safe to use -Wconversion with htons], |
1629 | + [ac_cv_safe_to_use_Wconversion_], |
1630 | + [save_CFLAGS="$CFLAGS" |
1631 | + dnl Use -Werror here instead of ${W_FAIL} so that we don't spew |
1632 | + dnl conversion warnings to all the tarball folks |
1633 | + CFLAGS="-Wconversion -Werror -pedantic ${AM_CFLAGS}" |
1634 | + AC_COMPILE_IFELSE( |
1635 | + [AC_LANG_PROGRAM( |
1636 | + [[ |
1637 | +#include <netinet/in.h> |
1638 | + ]],[[ |
1639 | +uint16_t x= htons(80); |
1640 | + ]])], |
1641 | + [ac_cv_safe_to_use_Wconversion_=yes], |
1642 | + [ac_cv_safe_to_use_Wconversion_=no]) |
1643 | + CFLAGS="$save_CFLAGS"]) |
1644 | + |
1645 | + AS_IF([test "$ac_cv_safe_to_use_Wconversion_" = "no"], |
1646 | + [NO_CONVERSION="-Wno-conversion"]) |
1647 | + ]) |
1648 | + |
1649 | + NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing" |
1650 | + NO_SHADOW="-Wno-shadow" |
1651 | + |
1652 | + m4_if(PW_LESS_WARNINGS,[no],[ |
1653 | + BASE_WARNINGS_FULL="-Wformat=2 ${W_CONVERSION} -Wstrict-aliasing -Wuninitialized -Wparentheses -Wsequence-point" |
1654 | + CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings" |
1655 | + CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast" |
1656 | + ],[ |
1657 | + BASE_WARNINGS_FULL="-Wformat ${NO_STRICT_ALIASING}" |
1658 | + ]) |
1659 | + |
1660 | + BASE_WARNINGS="${W_FAIL} -pedantic -Wall -Wextra -Wundef -Wshadow ${F_DIAGNOSTICS_SHOW_OPTION} ${CFLAG_VISIBILITY} ${BASE_WARNINGS_FULL}" |
1661 | + CC_WARNINGS="${BASE_WARNINGS} -Wstrict-prototypes -Wmissing-prototypes -Wredundant-decls -Wmissing-declarations -Wcast-align ${CC_WARNINGS_FULL}" |
1662 | + CXX_WARNINGS="${BASE_WARNINGS} -Woverloaded-virtual -Wnon-virtual-dtor -Wctor-dtor-privacy -Wno-long-long ${CXX_WARNINGS_FULL}" |
1663 | + |
1664 | + AC_CACHE_CHECK([whether it is safe to use -Wmissing-declarations from C++], |
1665 | + [ac_cv_safe_to_use_Wmissing_declarations_], |
1666 | + [AC_LANG_PUSH(C++) |
1667 | + save_CXXFLAGS="$CXXFLAGS" |
1668 | + CXXFLAGS="-Werror -pedantic -Wmissing-declarations ${AM_CXXFLAGS}" |
1669 | + AC_COMPILE_IFELSE([ |
1670 | + AC_LANG_PROGRAM( |
1671 | + [[ |
1672 | +#include <stdio.h> |
1673 | + ]], [[]]) |
1674 | + ], |
1675 | + [ac_cv_safe_to_use_Wmissing_declarations_=yes], |
1676 | + [ac_cv_safe_to_use_Wmissing_declarations_=no]) |
1677 | + CXXFLAGS="$save_CXXFLAGS" |
1678 | + AC_LANG_POP() |
1679 | + ]) |
1680 | + AS_IF([test "$ac_cv_safe_to_use_Wmissing_declarations_" = "yes"], |
1681 | + [CXX_WARNINGS="${CXX_WARNINGS} -Wmissing-declarations"]) |
1682 | + |
1683 | + AC_CACHE_CHECK([whether it is safe to use -Wlogical-op], |
1684 | + [ac_cv_safe_to_use_Wlogical_op_], |
1685 | + [save_CFLAGS="$CFLAGS" |
1686 | + CFLAGS="${W_FAIL} -pedantic -Wlogical-op ${AM_CFLAGS}" |
1687 | + AC_COMPILE_IFELSE([ |
1688 | + AC_LANG_PROGRAM( |
1689 | + [[ |
1690 | +#include <stdio.h> |
1691 | + ]], [[]]) |
1692 | + ], |
1693 | + [ac_cv_safe_to_use_Wlogical_op_=yes], |
1694 | + [ac_cv_safe_to_use_Wlogical_op_=no]) |
1695 | + CFLAGS="$save_CFLAGS"]) |
1696 | + AS_IF([test "$ac_cv_safe_to_use_Wlogical_op_" = "yes"], |
1697 | + [CC_WARNINGS="${CC_WARNINGS} -Wlogical-op"]) |
1698 | + |
1699 | + AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls from C++], |
1700 | + [ac_cv_safe_to_use_Wredundant_decls_], |
1701 | + [AC_LANG_PUSH(C++) |
1702 | + save_CXXFLAGS="${CXXFLAGS}" |
1703 | + CXXFLAGS="${W_FAIL} -pedantic -Wredundant-decls ${AM_CXXFLAGS}" |
1704 | + AC_COMPILE_IFELSE( |
1705 | + [AC_LANG_PROGRAM([ |
1706 | +template <typename E> struct C { void foo(); }; |
1707 | +template <typename E> void C<E>::foo() { } |
1708 | +template <> void C<int>::foo(); |
1709 | + AC_INCLUDES_DEFAULT])], |
1710 | + [ac_cv_safe_to_use_Wredundant_decls_=yes], |
1711 | + [ac_cv_safe_to_use_Wredundant_decls_=no]) |
1712 | + CXXFLAGS="${save_CXXFLAGS}" |
1713 | + AC_LANG_POP()]) |
1714 | + AS_IF([test "$ac_cv_safe_to_use_Wredundant_decls_" = "yes"], |
1715 | + [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"], |
1716 | + [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"]) |
1717 | + |
1718 | + NO_REDUNDANT_DECLS="-Wno-redundant-decls" |
1719 | + PROTOSKIP_WARNINGS="-Wno-effc++ -Wno-shadow" |
1720 | + |
1721 | + ]) |
1722 | + |
1723 | + AS_IF([test "$SUNCC" = "yes"],[ |
1724 | + |
1725 | + AS_IF([test "$ac_profiling" = "yes"], |
1726 | + [CC_PROFILING="-xinstrument=datarace"]) |
1727 | + |
1728 | + AS_IF([test "$ac_cv_warnings_as_errors" = "yes"], |
1729 | + [W_FAIL="-errwarn=%all"]) |
1730 | + |
1731 | + AC_CACHE_CHECK([whether E_PASTE_RESULT_NOT_TOKEN is usable], |
1732 | + [ac_cv_paste_result], |
1733 | + [ |
1734 | + save_CFLAGS="${CFLAGS}" |
1735 | + CFLAGS="-errwarn=%all -erroff=E_PASTE_RESULT_NOT_TOKEN ${CFLAGS}" |
1736 | + AC_COMPILE_IFELSE( |
1737 | + [AC_LANG_PROGRAM([ |
1738 | + AC_INCLUDES_DEFAULT |
1739 | + ],[ |
1740 | + int x= 0;])], |
1741 | + [ac_cv_paste_result=yes], |
1742 | + [ac_cv_paste_result=no]) |
1743 | + CFLAGS="${save_CFLAGS}" |
1744 | + ]) |
1745 | + AS_IF([test $ac_cv_paste_result = yes], |
1746 | + [W_PASTE_RESULT=",E_PASTE_RESULT_NOT_TOKEN"]) |
1747 | + |
1748 | + |
1749 | + m4_if(PW_LESS_WARNINGS, [no],[ |
1750 | + CC_WARNINGS_FULL="-erroff=E_INTEGER_OVERFLOW_DETECTED${W_PASTE_RESULT}" |
1751 | + ],[ |
1752 | + CC_WARNINGS_FULL="-erroff=E_ATTRIBUTE_NOT_VAR" |
1753 | + CXX_WARNINGS_FULL="-erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn,inllargeint" |
1754 | + ]) |
1755 | + |
1756 | + CC_WARNINGS="-v -errtags=yes ${W_FAIL} ${CC_WARNINGS_FULL}" |
1757 | + CXX_WARNINGS="+w +w2 -xwe -xport64 -errtags=yes ${CXX_WARNINGS_FULL} ${W_FAIL}" |
1758 | + PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn" |
1759 | + NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED" |
1760 | + |
1761 | + ]) |
1762 | + |
1763 | + AC_SUBST(NO_CONVERSION) |
1764 | + AC_SUBST(NO_REDUNDANT_DECLS) |
1765 | + AC_SUBST(NO_UNREACHED) |
1766 | + AC_SUBST(NO_SHADOW) |
1767 | + AC_SUBST(NO_STRICT_ALIASING) |
1768 | + AC_SUBST(PROTOSKIP_WARNINGS) |
1769 | + |
1770 | +]) |
Migrated build files to using the pandora-build files (lp:pandora-build) Eventually, I hope to remove these from the tree altogether and introduce pandora-build as a build-depend, but we're not there yet. For now, they are copied in.
Additionally, cleaned up some warnings and merged in Trond's updated config/autorun.sh and Sun Studio support to visibility.h.