~drizzle-trunk/drizzle/development

1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
1
dnl  Copyright (C) 2009 Sun Microsystems, Inc.
2
dnl This file is free software; Sun Microsystems, Inc.
1085.1.4 by Monty Taylor
pandora-build v1
3
dnl gives unlimited permission to copy and/or distribute it,
4
dnl with or without modifications, as long as this notice is preserved.
5
6
dnl Which version of the canonical setup we're using
2221.1.6 by Monty Taylor
Updated pandora-build files to version 0.175
7
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.175])
1085.1.4 by Monty Taylor
pandora-build v1
8
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
9
AC_DEFUN([PANDORA_MSG_ERROR],[
10
  AS_IF([test "x${pandora_cv_skip_requires}" != "xno"],[
11
    AC_MSG_ERROR($1)
12
  ],[
13
    AC_MSG_WARN($1)
14
  ])
15
])
16
1085.1.4 by Monty Taylor
pandora-build v1
17
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
1259.2.2 by Monty Taylor
Added option for OSX Fat Binaries.
18
  AC_ARG_ENABLE([fat-binaries],
19
    [AS_HELP_STRING([--enable-fat-binaries],
20
      [Enable fat binary support on OSX @<:@default=off@:>@])],
21
    [ac_enable_fat_binaries="$enableval"],
22
    [ac_enable_fat_binaries="no"])
23
1085.1.4 by Monty Taylor
pandora-build v1
24
  dnl Force dependency tracking on for Sun Studio builds
25
  AS_IF([test "x${enable_dependency_tracking}" = "x"],[
26
    enable_dependency_tracking=yes
27
  ])
1259.2.2 by Monty Taylor
Added option for OSX Fat Binaries.
28
  dnl If we're building OSX Fat Binaries, we have to turn off -M options
29
  AS_IF([test "x${ac_enable_fat_binaries}" = "xyes"],[
30
    enable_dependency_tracking=no
31
  ])
1085.1.4 by Monty Taylor
pandora-build v1
32
])
33
1776.2.1 by Monty Taylor
Updated pandora-build files to version 0.155
34
AC_DEFUN([PANDORA_BLOCK_BAD_OPTIONS],[
35
  AS_IF([test "x${prefix}" = "x"],[
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
36
    PANDORA_MSG_ERROR([--prefix requires an argument])
1776.2.1 by Monty Taylor
Updated pandora-build files to version 0.155
37
  ])
38
])
39
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
40
dnl The standard setup for how we build Pandora projects
41
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
1085.1.4 by Monty Taylor
pandora-build v1
42
  AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
1085.1.7 by Monty Taylor
pandora-build r0.7
43
  ifdef([m4_define],,[define([m4_define],   defn([define]))])
44
  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
45
  m4_define([PCT_ALL_ARGS],[$*])
1085.1.4 by Monty Taylor
pandora-build v1
46
  m4_define([PCT_REQUIRE_CXX],[no])
1085.1.7 by Monty Taylor
pandora-build r0.7
47
  m4_define([PCT_FORCE_GCC42],[no])
1273.12.3 by Monty Taylor
pandora-build v0.104
48
  m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
1992.6.9 by Monty Taylor
Updated pandora-build files to version 0.165
49
  m4_define([PCT_NO_VC_CHANGELOG],[no])
1192.3.47 by Monty Taylor
pandora-build v0.79
50
  m4_define([PCT_VERSION_FROM_VC],[no])
1192.3.46 by Monty Taylor
pandora-build v0.76
51
  m4_define([PCT_USE_VISIBILITY],[yes])
1085.3.4 by Monty Taylor
pandora-build v0.8
52
  m4_foreach([pct_arg],[$*],[
1085.1.4 by Monty Taylor
pandora-build v1
53
    m4_case(pct_arg,
54
      [require-cxx], [
55
        m4_undefine([PCT_REQUIRE_CXX])
56
        m4_define([PCT_REQUIRE_CXX],[yes])
57
      ],
1085.1.7 by Monty Taylor
pandora-build r0.7
58
      [force-gcc42], [
59
        m4_undefine([PCT_FORCE_GCC42])
60
        m4_define([PCT_FORCE_GCC42],[yes])
1126.6.1 by Monty Taylor
pandora-build v0.58
61
      ],
1192.3.46 by Monty Taylor
pandora-build v0.76
62
      [skip-visibility], [
63
        m4_undefine([PCT_USE_VISIBILITY])
64
        m4_define([PCT_USE_VISIBILITY],[no])
65
      ],
1273.12.3 by Monty Taylor
pandora-build v0.104
66
      [dont-suppress-include], [
67
        m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
68
        m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
69
      ],
1992.6.9 by Monty Taylor
Updated pandora-build files to version 0.165
70
      [no-vc-changelog], [
71
        m4_undefine([PCT_NO_VC_CHANGELOG])
72
        m4_define([PCT_NO_VC_CHANGELOG],[yes])
73
      ],
1192.3.47 by Monty Taylor
pandora-build v0.79
74
      [version-from-vc], [
75
        m4_undefine([PCT_VERSION_FROM_VC])
76
        m4_define([PCT_VERSION_FROM_VC],[yes])
1085.1.4 by Monty Taylor
pandora-build v1
77
    ])
78
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
79
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
80
  AC_CONFIG_MACRO_DIR([m4])
81
1273.12.8 by Monty Taylor
Fixed m4 on solaris. Urg.
82
  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
83
    AC_CONFIG_HEADERS([src/config.h])
84
  ],[
85
    AC_CONFIG_HEADERS([config.h])
86
  ])
87
1776.2.1 by Monty Taylor
Updated pandora-build files to version 0.155
88
  PANDORA_BLOCK_BAD_OPTIONS
89
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
90
  # We need to prevent canonical target
91
  # from injecting -O2 into CFLAGS - but we won't modify anything if we have
92
  # set CFLAGS on the command line, since that should take ultimate precedence
93
  AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
94
        [CFLAGS=""])
95
  AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
96
        [CXXFLAGS=""])
97
  
98
  AC_CANONICAL_TARGET
99
  
1273.12.3 by Monty Taylor
pandora-build v0.104
100
  m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[
1716.1.1 by Monty Taylor
Added files to the tarball that should be there. Removed some that shouldn't
101
    AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar)
1273.12.3 by Monty Taylor
pandora-build v0.104
102
  ],[
1716.1.1 by Monty Taylor
Added files to the tarball that should be there. Removed some that shouldn't
103
    AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability nostdinc subdir-objects foreign tar-ustar)
1273.12.3 by Monty Taylor
pandora-build v0.104
104
  ])
105
1093.9.24 by Monty Taylor
Added support for automake 1.11 and silent build rules.
106
  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
1085.1.4 by Monty Taylor
pandora-build v1
107
1273.12.8 by Monty Taylor
Fixed m4 on solaris. Urg.
108
  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
109
    gl_EARLY
1702.2.1 by Monty Taylor
Removed gnulib and the last usage of normal getopt.
110
  ],[
111
    PANDORA_EXTENSIONS 
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
112
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
113
  
114
  AC_REQUIRE([AC_PROG_CC])
1530.5.5 by Monty Taylor
Made sure we order tests in the right way - we want to make sure that we upgrade the gcc version before we test for C++0x support.
115
  m4_if(PCT_FORCE_GCC42, [yes], [
116
    AC_REQUIRE([PANDORA_ENSURE_GCC_VERSION])
117
  ])
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
118
  AC_REQUIRE([PANDORA_64BIT])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
119
1992.6.9 by Monty Taylor
Updated pandora-build files to version 0.165
120
  m4_if(PCT_NO_VC_CHANGELOG,yes,[
121
    vc_changelog=no
122
  ],[
123
    vc_changelog=yes
124
  ])
1192.3.47 by Monty Taylor
pandora-build v0.79
125
  m4_if(PCT_VERSION_FROM_VC,yes,[
2183.1.2 by Monty Taylor
A slew of tiny meaningless changes.
126
    PANDORA_VC_INFO_HEADER
1273.23.5 by Monty Taylor
Merged in changes fixing VC detection.
127
  ],[
128
    PANDORA_TEST_VC_DIR
1843.2.1 by Monty Taylor
Updated pandora-build files to version 0.161
129
130
    changequote(<<, >>)dnl
131
    PANDORA_RELEASE_ID=`echo $VERSION | sed 's/[^0-9]//g'`
132
    changequote([, ])dnl
133
134
    PANDORA_RELEASE_COMMENT=""
135
    AC_DEFINE_UNQUOTED([PANDORA_RELEASE_VERSION],["$VERSION"],
136
                       [Version of the software])
137
138
    AC_SUBST(PANDORA_RELEASE_COMMENT)
139
    AC_SUBST(PANDORA_RELEASE_VERSION)
140
    AC_SUBST(PANDORA_RELEASE_ID)
1192.3.47 by Monty Taylor
pandora-build v0.79
141
  ])
142
  PANDORA_VERSION
143
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
144
  dnl Once we can use a modern autoconf, we can use this
145
  dnl AC_PROG_CC_C99
1093.7.6 by Monty Taylor
pandora-build v0.34
146
  AC_REQUIRE([AC_PROG_CXX])
1093.9.23 by Monty Taylor
pandora-build v0.49
147
  PANDORA_EXTENSIONS
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
148
  AM_PROG_CC_C_O
149
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
150
1093.2.2 by mordred
pandora-build v0.18
151
1099.1.12 by Monty Taylor
Rearranged two orderings.
152
  PANDORA_PLATFORM
153
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
154
  PANDORA_LIBTOOL
155
1085.1.4 by Monty Taylor
pandora-build v1
156
  dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
157
  dnl so we check c++98 features and fail if we don't have them, mainly
158
  dnl for that reason
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
159
  PANDORA_CHECK_CXX_STANDARD
1085.1.4 by Monty Taylor
pandora-build v1
160
  m4_if(PCT_REQUIRE_CXX, [yes], [
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
161
    AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
162
      PANDORA_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
163
    ])
164
  ])
1775.1.2 by Monty Taylor
Updated pandora-build files to version 0.153
165
  PANDORA_CXX_CSTDINT
166
  PANDORA_CXX_CINTTYPES
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
167
  
1273.12.8 by Monty Taylor
Fixed m4 on solaris. Urg.
168
  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
1126.6.1 by Monty Taylor
pandora-build v0.58
169
    gl_INIT
170
    AC_CONFIG_LIBOBJ_DIR([gnulib])
171
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
172
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
173
  PANDORA_CHECK_C_VERSION
174
  PANDORA_CHECK_CXX_VERSION
175
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
176
  AC_C_BIGENDIAN
177
  AC_C_CONST
178
  AC_C_INLINE
179
  AC_C_VOLATILE
1093.2.2 by mordred
pandora-build v0.18
180
  AC_C_RESTRICT
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
181
182
  AC_HEADER_TIME
1273.12.3 by Monty Taylor
pandora-build v0.104
183
  AC_STRUCT_TM
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
184
  AC_TYPE_SIZE_T
1085.1.4 by Monty Taylor
pandora-build v1
185
  AC_SYS_LARGEFILE
1273.12.3 by Monty Taylor
pandora-build v0.104
186
  PANDORA_CLOCK_GETTIME
1085.1.4 by Monty Taylor
pandora-build v1
187
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
188
  AC_CHECK_HEADERS(sys/socket.h)
189
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
190
  # off_t is not a builtin type
191
  AC_CHECK_SIZEOF(off_t, 4)
192
  AS_IF([test "$ac_cv_sizeof_off_t" -eq 0],[
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
193
    PANDORA_MSG_ERROR("${PACKAGE} needs an off_t type.")
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
194
  ])
195
196
  AC_CHECK_SIZEOF(size_t)
197
  AS_IF([test "$ac_cv_sizeof_size_t" -eq 0],[
2221.1.8 by Monty Taylor
Adds ability to just build libdrizzle without needing all of the rest of the
198
    PANDORA_MSG_ERROR("${PACKAGE} needs an size_t type.")
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
199
  ])
200
201
  AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
202
  AC_CHECK_SIZEOF(long long)
203
  AC_DEFINE_UNQUOTED([SIZEOF_LONG_LONG],[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
204
  AC_CACHE_CHECK([if time_t is unsigned], [ac_cv_time_t_unsigned],[
205
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
206
      [[
207
#include <time.h>
208
      ]],
209
      [[
210
      int array[(((time_t)-1) > 0) ? 1 : -1];
211
      ]])
212
    ],[
213
      ac_cv_time_t_unsigned=yes
214
    ],[
215
      ac_cv_time_t_unsigned=no
216
    ])
217
  ])
218
  AS_IF([test "$ac_cv_time_t_unsigned" = "yes"],[
219
    AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
220
  ])
221
1955.3.1 by Monty Taylor
Removed the need for getrusage.h by doing a define check and an AC_DEFINE in
222
  AC_CACHE_CHECK([if system defines RUSAGE_THREAD], [ac_cv_rusage_thread],[
223
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
224
      [[
225
#include <sys/time.h>
226
#include <sys/resource.h>
227
      ]],[[
228
      int x= RUSAGE_THREAD;
229
      ]])
230
    ],[
231
      ac_cv_rusage_thread=yes
232
    ],[
233
      ac_cv_rusage_thread=no
234
    ])
235
  ])
236
  AS_IF([test "$ac_cv_rusage_thread" = "no"],[
237
    AC_DEFINE([RUSAGE_THREAD], [RUSAGE_SELF],
238
      [Define if system doesn't define])
239
  ])
240
1241.12.5 by Monty Taylor
Replace hand-rolled libm check with the standard autoconf one.
241
  AC_CHECK_LIBM
1643.1.12 by Monty Taylor
Updated pandora-build files to version 0.136
242
  dnl Bug on FreeBSD - LIBM check doesn't set the damn variable
243
  AC_SUBST([LIBM])
1192.3.46 by Monty Taylor
pandora-build v0.76
244
  
245
  AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
246
  AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
247
248
249
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
250
  PANDORA_OPTIMIZE
1085.1.7 by Monty Taylor
pandora-build r0.7
251
1192.3.28 by Monty Taylor
pandora-build v0.72 - Moved remaining hard-coded tests into pandora-build
252
  AC_LANG_PUSH(C++)
253
  # Test whether madvise() is declared in C++ code -- it is not on some
254
  # systems, such as Solaris
255
  AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
256
  #if HAVE_SYS_MMAN_H
257
  #include <sys/types.h>
258
  #include <sys/mman.h>
259
  #endif
260
  ]])
261
  AC_LANG_POP()
262
263
  PANDORA_HAVE_GCC_ATOMICS
264
1192.3.46 by Monty Taylor
pandora-build v0.76
265
  m4_if(PCT_USE_VISIBILITY,[yes],[
1724.1.1 by Monty Taylor
Rearranged how we set -fvisibility, allowing us to turn it on on a
266
    PANDORA_ENABLE_VISIBILITY
1992.6.9 by Monty Taylor
Updated pandora-build files to version 0.165
267
    ],[
268
    PANDORA_CHECK_VISIBILITY
1192.3.46 by Monty Taylor
pandora-build v0.76
269
  ])
1090.3.5 by Monty Taylor
pandora-build v0.12
270
271
  PANDORA_HEADER_ASSERT
1085.1.7 by Monty Taylor
pandora-build r0.7
272
1085.1.4 by Monty Taylor
pandora-build v1
273
  PANDORA_WARNINGS(PCT_ALL_ARGS)
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
274
275
  PANDORA_ENABLE_DTRACE
276
1093.2.1 by Monty Taylor
pandora-build v0.16
277
  AC_LIB_PREFIX
278
  PANDORA_HAVE_BETTER_MALLOC
2221.1.3 by Monty Taylor
Updated pandora-build files to version 0.173
279
  PANDORA_WITH_VALGRIND
1093.2.1 by Monty Taylor
pandora-build v0.16
280
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
281
  AC_CHECK_PROGS([DOXYGEN], [doxygen])
282
  AC_CHECK_PROGS([PERL], [perl])
1273.12.9 by Monty Taylor
Merged up latest pandora-build.
283
  AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
1823.5.1 by Monty Taylor
Updated pandora-build files to version 0.157
284
  AC_CHECK_PROGS([LCOV], [lcov], [echo lcov not found])
285
  AC_CHECK_PROGS([LCOV_GENHTML], [genhtml], [echo genhtml not found])
286
1731.5.2 by Monty Taylor
Added sphinx to the build.
287
  AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
1800.2.1 by Monty Taylor
Made sure that sphinx-build can handle man builder.
288
  AS_IF([test "x${SPHINXBUILD}" != "x:"],[
289
    AC_CACHE_CHECK([if sphinx is new enough],[ac_cv_recent_sphinx],[
290
    
291
    ${SPHINXBUILD} -Q -C -b man -d conftest.d . . >/dev/null 2>&1
292
    AS_IF([test $? -eq 0],[ac_cv_recent_sphinx=yes],
293
          [ac_cv_recent_sphinx=no])
294
    rm -rf conftest.d
295
    ])
296
  ])
1273.12.9 by Monty Taylor
Merged up latest pandora-build.
297
298
  AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"])
1731.5.2 by Monty Taylor
Added sphinx to the build.
299
  AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"])
1800.1.8 by Monty Taylor
Fixed a typo.
300
  AM_CONDITIONAL(HAVE_RECENT_SPHINX,[test "x${ac_cv_recent_sphinx}" = "xyes"])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
301
1667.4.10 by Monty Taylor
Updated pandora-build files to version 0.138
302
  m4_if(m4_substr(m4_esyscmd(test -d po && echo 0),0,1),0, [
303
    AM_PO_SUBDIRS
304
    IT_PROG_INTLTOOL([0.35],[no-xml])
1667.4.12 by Monty Taylor
Fixed gettext on solaris.
305
    
1667.4.10 by Monty Taylor
Updated pandora-build files to version 0.138
306
    GETTEXT_PACKAGE=$PACKAGE
1677.1.1 by Monty Taylor
Fixed the solaris intltool issue.
307
    AC_CHECK_LIB(intl, libintl_gettext)
1667.4.10 by Monty Taylor
Updated pandora-build files to version 0.138
308
    AC_SUBST([GETTEXT_PACKAGE])
1719.1.1 by Monty Taylor
_actually_ make OSX work with no intltool. Sorry.
309
    AS_IF([test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"],
1719.1.2 by Monty Taylor
Ok. FFS.
310
          [AC_DEFINE([ENABLE_NLS],[1],[Turn on language support])
311
           AC_CONFIG_FILES([po/Makefile.in])
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
312
      ])
1667.4.10 by Monty Taylor
Updated pandora-build files to version 0.138
313
  ])
1719.1.2 by Monty Taylor
Ok. FFS.
314
  AM_CONDITIONAL(BUILD_PO,[test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"])
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
315
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
316
  AS_IF([test "x${gl_LIBOBJS}" != "x"],[
317
    AS_IF([test "$GCC" = "yes"],[
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
318
      AM_CPPFLAGS="-isystem \${top_srcdir}/gnulib -isystem \${top_builddir}/gnulib ${AM_CPPFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
319
    ],[
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
320
    AM_CPPFLAGS="-I\${top_srcdir}/gnulib -I\${top_builddir}/gnulib ${AM_CPPFLAGS}"
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
321
    ])
322
  ])
1273.12.8 by Monty Taylor
Fixed m4 on solaris. Urg.
323
  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
1126.6.1 by Monty Taylor
pandora-build v0.58
324
    AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
1273.12.1 by Monty Taylor
pandora-build v0.100 - Fixes several bugs found by cb1kenobi. Add several thoughts from folks at LCA.
325
  ],[
326
    AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${AM_CPPFLAGS}"
1126.6.1 by Monty Taylor
pandora-build v0.58
327
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
328
1093.9.14 by Monty Taylor
pandora-build v0.43 Added -pipe to CFLAGS
329
  PANDORA_USE_PIPE
330
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
331
  AH_TOP([
332
#ifndef __CONFIG_H__
333
#define __CONFIG_H__
334
1720.1.7 by Monty Taylor
Fixed the ICC missing header and the new config.h foo.
335
/* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */
336
#if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H)
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
337
#error "You should include config.h as your first include file"
338
#endif
339
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
340
#include <config/top.h>
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
341
])
342
  mkdir -p config
343
  cat > config/top.h.stamp <<EOF_CONFIG_TOP
344
345
#if defined(i386) && !defined(__i386__)
346
#define __i386__
347
#endif
348
349
#if defined(_FILE_OFFSET_BITS)
350
# undef _FILE_OFFSET_BITS
351
#endif
352
EOF_CONFIG_TOP
353
354
  diff config/top.h.stamp config/top.h >/dev/null 2>&1 || mv config/top.h.stamp config/top.h
355
  rm -f config/top.h.stamp
356
357
  AH_BOTTOM([
358
#if defined(__cplusplus)
359
# include CSTDINT_H
360
# include CINTTYPES_H
361
#else
362
# include <stdint.h>
363
# include <inttypes.h>
364
#endif
365
366
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
1992.6.9 by Monty Taylor
Updated pandora-build files to version 0.165
367
# define HAVE_ULONG 1
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
368
typedef unsigned long int ulong;
369
#endif
370
371
/* To hide the platform differences between MS Windows and Unix, I am
372
 * going to use the Microsoft way and #define the Microsoft-specific
373
 * functions to the unix way. Microsoft use a separate subsystem for sockets,
374
 * but Unix normally just use a filedescriptor on the same functions. It is
375
 * a lot easier to map back to the unix way with macros than going the other
376
 * way without side effect ;-)
377
 */
378
#ifdef TARGET_OS_WINDOWS
379
#define random() rand()
380
#define srandom(a) srand(a)
381
#define get_socket_errno() WSAGetLastError()
382
#else
383
#define INVALID_SOCKET -1
384
#define SOCKET_ERROR -1
385
#define closesocket(a) close(a)
386
#define get_socket_errno() errno
387
#endif
388
1929.1.39 by Monty Taylor
Added implicit_cast<> and down_cast<> to the code.
389
#if defined(__cplusplus)
1929.1.41 by Monty Taylor
Added one more thing to the header to make down_cast work on debug builds.
390
# if defined(DEBUG)
391
#  include <cassert>
392
#  include <cstddef>
393
# endif
1929.1.39 by Monty Taylor
Added implicit_cast<> and down_cast<> to the code.
394
template<typename To, typename From>
395
inline To implicit_cast(From const &f) {
396
  return f;
397
}
398
template<typename To, typename From>     // use like this: down_cast<T*>(foo);
399
inline To down_cast(From* f) {                   // so we only accept pointers
400
  // Ensures that To is a sub-type of From *.  This test is here only
401
  // for compile-time type checking, and has no overhead in an
402
  // optimized build at run-time, as it will be optimized away
403
  // completely.
404
  if (false) {
405
    implicit_cast<From*, To>(0);
406
  }
407
408
#if defined(DEBUG)
409
  assert(f == NULL || dynamic_cast<To>(f) != NULL);  // RTTI: debug mode only!
410
#endif
411
  return static_cast<To>(f);
412
}
413
#endif /* defined(__cplusplus) */
414
1720.1.5 by Monty Taylor
Added libdrizzle to the tree.
415
#endif /* __CONFIG_H__ */
416
  ])
1093.9.14 by Monty Taylor
pandora-build v0.43 Added -pipe to CFLAGS
417
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
418
  AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
419
  AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
420
421
  AC_SUBST([AM_CFLAGS])
422
  AC_SUBST([AM_CXXFLAGS])
423
  AC_SUBST([AM_CPPFLAGS])
1259.2.2 by Monty Taylor
Added option for OSX Fat Binaries.
424
  AC_SUBST([AM_LDFLAGS])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
425
426
])