~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_canonical.m4

This will now require someone to do a --plugin-add in order to have csv,
archive, or blackhole running.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
 
dnl This file is free software; Sun Microsystems, Inc.
 
1
dnl  Copyright (C) 2009 Sun Microsystems
 
2
dnl This file is free software; Sun Microsystems
3
3
dnl gives unlimited permission to copy and/or distribute it,
4
4
dnl with or without modifications, as long as this notice is preserved.
5
5
 
6
6
dnl Which version of the canonical setup we're using
7
 
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.171])
 
7
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.150])
8
8
 
9
9
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
10
10
  AC_ARG_ENABLE([fat-binaries],
23
23
  ])
24
24
])
25
25
 
26
 
AC_DEFUN([PANDORA_BLOCK_BAD_OPTIONS],[
27
 
  AS_IF([test "x${prefix}" = "x"],[
28
 
    AC_MSG_ERROR([--prefix requires an argument])
29
 
  ])
30
 
])
31
 
 
32
26
dnl The standard setup for how we build Pandora projects
33
27
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
34
28
  AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
38
32
  m4_define([PCT_REQUIRE_CXX],[no])
39
33
  m4_define([PCT_FORCE_GCC42],[no])
40
34
  m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
41
 
  m4_define([PCT_NO_VC_CHANGELOG],[no])
42
35
  m4_define([PCT_VERSION_FROM_VC],[no])
43
36
  m4_define([PCT_USE_VISIBILITY],[yes])
44
37
  m4_foreach([pct_arg],[$*],[
59
52
        m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
60
53
        m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
61
54
      ],
62
 
      [no-vc-changelog], [
63
 
        m4_undefine([PCT_NO_VC_CHANGELOG])
64
 
        m4_define([PCT_NO_VC_CHANGELOG],[yes])
65
 
      ],
66
55
      [version-from-vc], [
67
56
        m4_undefine([PCT_VERSION_FROM_VC])
68
57
        m4_define([PCT_VERSION_FROM_VC],[yes])
77
66
    AC_CONFIG_HEADERS([config.h])
78
67
  ])
79
68
 
80
 
  PANDORA_BLOCK_BAD_OPTIONS
81
 
 
82
69
  # We need to prevent canonical target
83
70
  # from injecting -O2 into CFLAGS - but we won't modify anything if we have
84
71
  # set CFLAGS on the command line, since that should take ultimate precedence
109
96
  ])
110
97
  AC_REQUIRE([PANDORA_64BIT])
111
98
 
112
 
  m4_if(PCT_NO_VC_CHANGELOG,yes,[
113
 
    vc_changelog=no
114
 
  ],[
115
 
    vc_changelog=yes
116
 
  ])
117
99
  m4_if(PCT_VERSION_FROM_VC,yes,[
118
100
    PANDORA_VC_VERSION
119
101
  ],[
120
102
    PANDORA_TEST_VC_DIR
121
 
 
122
 
    changequote(<<, >>)dnl
123
 
    PANDORA_RELEASE_ID=`echo $VERSION | sed 's/[^0-9]//g'`
124
 
    changequote([, ])dnl
125
 
 
126
 
    PANDORA_RELEASE_COMMENT=""
127
 
    AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"],
128
 
                       [Version of the software])
129
 
 
130
 
    AC_SUBST(PANDORA_RELEASE_COMMENT)
131
 
    AC_SUBST(PANDORA_RELEASE_VERSION)
132
 
    AC_SUBST(PANDORA_RELEASE_ID)
133
103
  ])
134
104
  PANDORA_VERSION
135
105
 
153
123
    AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
154
124
      AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
155
125
    ])
 
126
 
156
127
  ])
157
 
  PANDORA_CXX_CSTDINT
158
 
  PANDORA_CXX_CINTTYPES
159
128
  
160
129
  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
161
130
    gl_INIT
211
180
    AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
212
181
  ])
213
182
 
214
 
  AC_CACHE_CHECK([if system defines RUSAGE_THREAD], [ac_cv_rusage_thread],[
215
 
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
216
 
      [[
217
 
#include <sys/time.h>
218
 
#include <sys/resource.h>
219
 
      ]],[[
220
 
      int x= RUSAGE_THREAD;
221
 
      ]])
222
 
    ],[
223
 
      ac_cv_rusage_thread=yes
224
 
    ],[
225
 
      ac_cv_rusage_thread=no
226
 
    ])
227
 
  ])
228
 
  AS_IF([test "$ac_cv_rusage_thread" = "no"],[
229
 
    AC_DEFINE([RUSAGE_THREAD], [RUSAGE_SELF],
230
 
      [Define if system doesn't define])
231
 
  ])
232
 
 
233
183
  AC_CHECK_LIBM
234
184
  dnl Bug on FreeBSD - LIBM check doesn't set the damn variable
235
185
  AC_SUBST([LIBM])
254
204
 
255
205
  PANDORA_HAVE_GCC_ATOMICS
256
206
 
 
207
  save_CFLAGS="${CFLAGS}"
 
208
  CFLAGS="${CFLAGS} -Werror"
 
209
  PANDORA_CHECK_VISIBILITY
 
210
  CFLAGS="${save_CFLAGS}"
257
211
  m4_if(PCT_USE_VISIBILITY,[yes],[
258
212
    PANDORA_ENABLE_VISIBILITY
259
 
    ],[
260
 
    PANDORA_CHECK_VISIBILITY
261
213
  ])
262
214
 
263
215
  PANDORA_HEADER_ASSERT
272
224
  AC_CHECK_PROGS([DOXYGEN], [doxygen])
273
225
  AC_CHECK_PROGS([PERL], [perl])
274
226
  AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
275
 
  AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])
276
 
  AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])
277
 
 
278
227
  AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
279
 
  AS_IF([test "x${SPHINXBUILD}" != "x:"],[
280
 
    AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
281
 
    
282
 
    ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
283
 
    AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
284
 
          [ac_cv_recent_sphinx=no])
285
 
    rm -rf conftest.d
286
 
    ])
287
 
  ])
288
228
 
289
229
  AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"])
290
230
  AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"])
291
 
  AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"])
292
231
 
293
232
  m4_if(m4_substr(m4_esyscmd(test -d po && echo 0),0,1),0, [
294
233
    AM_PO_SUBDIRS
355
294
#endif
356
295
 
357
296
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
358
 
# define HAVE_ULONG 1
359
297
typedef unsigned long int ulong;
360
298
#endif
361
299
 
377
315
#define get_socket_errno() errno
378
316
#endif
379
317
 
380
 
#if defined(__cplusplus)
381
 
# if defined(DEBUG)
382
 
#  include <cassert>
383
 
#  include <cstddef>
384
 
# endif
385
 
template<typename To, typename From>
386
 
inline To implicit_cast(From const &f) {
387
 
  return f;
388
 
}
389
 
template<typename To, typename From>     // use like this: down_cast<T*>(foo);
390
 
inline To down_cast(From* f) {                   // so we only accept pointers
391
 
  // Ensures that To is a sub-type of From *.  This test is here only
392
 
  // for compile-time type checking, and has no overhead in an
393
 
  // optimized build at run-time, as it will be optimized away
394
 
  // completely.
395
 
  if (false) {
396
 
    implicit_cast<From*, To>(0);
397
 
  }
398
 
 
399
 
#if defined(DEBUG)
400
 
  assert(f == NULL || dynamic_cast<To>(f) != NULL);  // RTTI: debug mode only!
401
 
#endif
402
 
  return static_cast<To>(f);
403
 
}
404
 
#endif /* defined(__cplusplus) */
405
 
 
406
318
#endif /* __CONFIG_H__ */
407
319
  ])
408
320