~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/pandora_canonical.m4

  • Committer: Stewart Smith
  • Date: 2008-11-21 16:06:07 UTC
  • mto: This revision was merged to the branch mainline in revision 593.
  • Revision ID: stewart@flamingspork.com-20081121160607-n6gdlt013spuo54r
remove mysql_frm_type
and fix engines to return correct value from delete_table when table doesn't exist.
(it should be ENOENT).

Also fix up some tests that manipulated frm files by hand. These tests are no longer valid and will need to be rewritten in the not too distant future.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl  Copyright (C) 2009 Sun Microsystems
2
 
dnl This file is free software; Sun Microsystems
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
7
 
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.155])
8
 
 
9
 
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
10
 
  AC_ARG_ENABLE([fat-binaries],
11
 
    [AS_HELP_STRING([--enable-fat-binaries],
12
 
      [Enable fat binary support on OSX @<:@default=off@:>@])],
13
 
    [ac_enable_fat_binaries="$enableval"],
14
 
    [ac_enable_fat_binaries="no"])
15
 
 
16
 
  dnl Force dependency tracking on for Sun Studio builds
17
 
  AS_IF([test "x${enable_dependency_tracking}" = "x"],[
18
 
    enable_dependency_tracking=yes
19
 
  ])
20
 
  dnl If we're building OSX Fat Binaries, we have to turn off -M options
21
 
  AS_IF([test "x${ac_enable_fat_binaries}" = "xyes"],[
22
 
    enable_dependency_tracking=no
23
 
  ])
24
 
])
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
 
dnl The standard setup for how we build Pandora projects
33
 
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
34
 
  AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
35
 
  ifdef([m4_define],,[define([m4_define],   defn([define]))])
36
 
  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
37
 
  m4_define([PCT_ALL_ARGS],[$*])
38
 
  m4_define([PCT_REQUIRE_CXX],[no])
39
 
  m4_define([PCT_FORCE_GCC42],[no])
40
 
  m4_define([PCT_DONT_SUPPRESS_INCLUDE],[no])
41
 
  m4_define([PCT_VERSION_FROM_VC],[no])
42
 
  m4_define([PCT_USE_VISIBILITY],[yes])
43
 
  m4_foreach([pct_arg],[$*],[
44
 
    m4_case(pct_arg,
45
 
      [require-cxx], [
46
 
        m4_undefine([PCT_REQUIRE_CXX])
47
 
        m4_define([PCT_REQUIRE_CXX],[yes])
48
 
      ],
49
 
      [force-gcc42], [
50
 
        m4_undefine([PCT_FORCE_GCC42])
51
 
        m4_define([PCT_FORCE_GCC42],[yes])
52
 
      ],
53
 
      [skip-visibility], [
54
 
        m4_undefine([PCT_USE_VISIBILITY])
55
 
        m4_define([PCT_USE_VISIBILITY],[no])
56
 
      ],
57
 
      [dont-suppress-include], [
58
 
        m4_undefine([PCT_DONT_SUPPRESS_INCLUDE])
59
 
        m4_define([PCT_DONT_SUPPRESS_INCLUDE],[yes])
60
 
      ],
61
 
      [version-from-vc], [
62
 
        m4_undefine([PCT_VERSION_FROM_VC])
63
 
        m4_define([PCT_VERSION_FROM_VC],[yes])
64
 
    ])
65
 
  ])
66
 
 
67
 
  AC_CONFIG_MACRO_DIR([m4])
68
 
 
69
 
  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
70
 
    AC_CONFIG_HEADERS([src/config.h])
71
 
  ],[
72
 
    AC_CONFIG_HEADERS([config.h])
73
 
  ])
74
 
 
75
 
  PANDORA_BLOCK_BAD_OPTIONS
76
 
 
77
 
  # We need to prevent canonical target
78
 
  # from injecting -O2 into CFLAGS - but we won't modify anything if we have
79
 
  # set CFLAGS on the command line, since that should take ultimate precedence
80
 
  AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
81
 
        [CFLAGS=""])
82
 
  AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
83
 
        [CXXFLAGS=""])
84
 
  
85
 
  AC_CANONICAL_TARGET
86
 
  
87
 
  m4_if(PCT_DONT_SUPRESS_INCLUDE,yes,[
88
 
    AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability subdir-objects foreign tar-ustar)
89
 
  ],[
90
 
    AM_INIT_AUTOMAKE(-Wall -Werror -Wno-portability nostdinc subdir-objects foreign tar-ustar)
91
 
  ])
92
 
 
93
 
  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
94
 
 
95
 
  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
96
 
    gl_EARLY
97
 
  ],[
98
 
    PANDORA_EXTENSIONS 
99
 
  ])
100
 
  
101
 
  AC_REQUIRE([AC_PROG_CC])
102
 
  m4_if(PCT_FORCE_GCC42, [yes], [
103
 
    AC_REQUIRE([PANDORA_ENSURE_GCC_VERSION])
104
 
  ])
105
 
  AC_REQUIRE([PANDORA_64BIT])
106
 
 
107
 
  m4_if(PCT_VERSION_FROM_VC,yes,[
108
 
    PANDORA_VC_VERSION
109
 
  ],[
110
 
    PANDORA_TEST_VC_DIR
111
 
  ])
112
 
  PANDORA_VERSION
113
 
 
114
 
  dnl Once we can use a modern autoconf, we can use this
115
 
  dnl AC_PROG_CC_C99
116
 
  AC_REQUIRE([AC_PROG_CXX])
117
 
  PANDORA_EXTENSIONS
118
 
  AM_PROG_CC_C_O
119
 
 
120
 
 
121
 
 
122
 
  PANDORA_PLATFORM
123
 
 
124
 
  PANDORA_LIBTOOL
125
 
 
126
 
  dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
127
 
  dnl so we check c++98 features and fail if we don't have them, mainly
128
 
  dnl for that reason
129
 
  PANDORA_CHECK_CXX_STANDARD
130
 
  m4_if(PCT_REQUIRE_CXX, [yes], [
131
 
    AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
132
 
      AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
133
 
    ])
134
 
  ])
135
 
  PANDORA_CXX_CSTDINT
136
 
  PANDORA_CXX_CINTTYPES
137
 
  
138
 
  m4_if(m4_substr(m4_esyscmd(test -d gnulib && echo 0),0,1),0,[
139
 
    gl_INIT
140
 
    AC_CONFIG_LIBOBJ_DIR([gnulib])
141
 
  ])
142
 
 
143
 
  PANDORA_CHECK_C_VERSION
144
 
  PANDORA_CHECK_CXX_VERSION
145
 
 
146
 
  AC_C_BIGENDIAN
147
 
  AC_C_CONST
148
 
  AC_C_INLINE
149
 
  AC_C_VOLATILE
150
 
  AC_C_RESTRICT
151
 
 
152
 
  AC_HEADER_TIME
153
 
  AC_STRUCT_TM
154
 
  AC_TYPE_SIZE_T
155
 
  AC_SYS_LARGEFILE
156
 
  PANDORA_CLOCK_GETTIME
157
 
 
158
 
  AC_CHECK_HEADERS(sys/socket.h)
159
 
 
160
 
  # off_t is not a builtin type
161
 
  AC_CHECK_SIZEOF(off_t, 4)
162
 
  AS_IF([test "$ac_cv_sizeof_off_t" -eq 0],[
163
 
    AC_MSG_ERROR("${PACKAGE} needs an off_t type.")
164
 
  ])
165
 
 
166
 
  AC_CHECK_SIZEOF(size_t)
167
 
  AS_IF([test "$ac_cv_sizeof_size_t" -eq 0],[
168
 
    AC_MSG_ERROR("${PACKAGE} needs an size_t type.")
169
 
  ])
170
 
 
171
 
  AC_DEFINE_UNQUOTED([SIZEOF_SIZE_T],[$ac_cv_sizeof_size_t],[Size of size_t as computed by sizeof()])
172
 
  AC_CHECK_SIZEOF(long long)
173
 
  AC_DEFINE_UNQUOTED([SIZEOF_LONG_LONG],[$ac_cv_sizeof_long_long],[Size of long long as computed by sizeof()])
174
 
  AC_CACHE_CHECK([if time_t is unsigned], [ac_cv_time_t_unsigned],[
175
 
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
176
 
      [[
177
 
#include <time.h>
178
 
      ]],
179
 
      [[
180
 
      int array[(((time_t)-1) > 0) ? 1 : -1];
181
 
      ]])
182
 
    ],[
183
 
      ac_cv_time_t_unsigned=yes
184
 
    ],[
185
 
      ac_cv_time_t_unsigned=no
186
 
    ])
187
 
  ])
188
 
  AS_IF([test "$ac_cv_time_t_unsigned" = "yes"],[
189
 
    AC_DEFINE([TIME_T_UNSIGNED], 1, [Define to 1 if time_t is unsigned])
190
 
  ])
191
 
 
192
 
  AC_CHECK_LIBM
193
 
  dnl Bug on FreeBSD - LIBM check doesn't set the damn variable
194
 
  AC_SUBST([LIBM])
195
 
  
196
 
  AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
197
 
  AC_CHECK_FUNC(bind, [], [AC_CHECK_LIB(bind, bind)])
198
 
 
199
 
 
200
 
 
201
 
  PANDORA_OPTIMIZE
202
 
 
203
 
  AC_LANG_PUSH(C++)
204
 
  # Test whether madvise() is declared in C++ code -- it is not on some
205
 
  # systems, such as Solaris
206
 
  AC_CHECK_DECLS([madvise], [], [], [AC_INCLUDES_DEFAULT[
207
 
  #if HAVE_SYS_MMAN_H
208
 
  #include <sys/types.h>
209
 
  #include <sys/mman.h>
210
 
  #endif
211
 
  ]])
212
 
  AC_LANG_POP()
213
 
 
214
 
  PANDORA_HAVE_GCC_ATOMICS
215
 
 
216
 
  save_CFLAGS="${CFLAGS}"
217
 
  CFLAGS="${CFLAGS} -Werror"
218
 
  PANDORA_CHECK_VISIBILITY
219
 
  CFLAGS="${save_CFLAGS}"
220
 
  m4_if(PCT_USE_VISIBILITY,[yes],[
221
 
    PANDORA_ENABLE_VISIBILITY
222
 
  ])
223
 
 
224
 
  PANDORA_HEADER_ASSERT
225
 
 
226
 
  PANDORA_WARNINGS(PCT_ALL_ARGS)
227
 
 
228
 
  PANDORA_ENABLE_DTRACE
229
 
 
230
 
  AC_LIB_PREFIX
231
 
  PANDORA_HAVE_BETTER_MALLOC
232
 
 
233
 
  AC_CHECK_PROGS([DOXYGEN], [doxygen])
234
 
  AC_CHECK_PROGS([PERL], [perl])
235
 
  AC_CHECK_PROGS([DPKG_GENSYMBOLS], [dpkg-gensymbols], [:])
236
 
  AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build], [:])
237
 
 
238
 
  AM_CONDITIONAL(HAVE_DPKG_GENSYMBOLS,[test "x${DPKG_GENSYMBOLS}" != "x:"])
239
 
  AM_CONDITIONAL(HAVE_SPHINX,[test "x${SPHINXBUILD}" != "x:"])
240
 
 
241
 
  m4_if(m4_substr(m4_esyscmd(test -d po && echo 0),0,1),0, [
242
 
    AM_PO_SUBDIRS
243
 
    IT_PROG_INTLTOOL([0.35],[no-xml])
244
 
    
245
 
    GETTEXT_PACKAGE=$PACKAGE
246
 
    AC_CHECK_LIB(intl, libintl_gettext)
247
 
    AC_SUBST([GETTEXT_PACKAGE])
248
 
    AS_IF([test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"],
249
 
          [AC_DEFINE([ENABLE_NLS],[1],[Turn on language support])
250
 
           AC_CONFIG_FILES([po/Makefile.in])
251
 
      ])
252
 
  ])
253
 
  AM_CONDITIONAL(BUILD_PO,[test "x${USE_NLS}" = "xyes" -a "x${pandora_have_intltool}" = "xyes"])
254
 
 
255
 
  AS_IF([test "x${gl_LIBOBJS}" != "x"],[
256
 
    AS_IF([test "$GCC" = "yes"],[
257
 
      AM_CPPFLAGS="-isystem \${top_srcdir}/gnulib -isystem \${top_builddir}/gnulib ${AM_CPPFLAGS}"
258
 
    ],[
259
 
    AM_CPPFLAGS="-I\${top_srcdir}/gnulib -I\${top_builddir}/gnulib ${AM_CPPFLAGS}"
260
 
    ])
261
 
  ])
262
 
  m4_if(m4_substr(m4_esyscmd(test -d src && echo 0),0,1),0,[
263
 
    AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
264
 
  ],[
265
 
    AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${AM_CPPFLAGS}"
266
 
  ])
267
 
 
268
 
  PANDORA_USE_PIPE
269
 
 
270
 
  AH_TOP([
271
 
#ifndef __CONFIG_H__
272
 
#define __CONFIG_H__
273
 
 
274
 
/* _SYS_FEATURE_TESTS_H is Solaris, _FEATURES_H is GCC */
275
 
#if defined( _SYS_FEATURE_TESTS_H) || defined(_FEATURES_H)
276
 
#error "You should include config.h as your first include file"
277
 
#endif
278
 
 
279
 
#include "config/top.h"
280
 
])
281
 
  mkdir -p config
282
 
  cat > config/top.h.stamp <<EOF_CONFIG_TOP
283
 
 
284
 
#if defined(i386) && !defined(__i386__)
285
 
#define __i386__
286
 
#endif
287
 
 
288
 
#if defined(_FILE_OFFSET_BITS)
289
 
# undef _FILE_OFFSET_BITS
290
 
#endif
291
 
EOF_CONFIG_TOP
292
 
 
293
 
  diff config/top.h.stamp config/top.h >/dev/null 2>&1 || mv config/top.h.stamp config/top.h
294
 
  rm -f config/top.h.stamp
295
 
 
296
 
  AH_BOTTOM([
297
 
#if defined(__cplusplus)
298
 
# include CSTDINT_H
299
 
# include CINTTYPES_H
300
 
#else
301
 
# include <stdint.h>
302
 
# include <inttypes.h>
303
 
#endif
304
 
 
305
 
#if !defined(HAVE_ULONG) && !defined(__USE_MISC)
306
 
typedef unsigned long int ulong;
307
 
#endif
308
 
 
309
 
/* To hide the platform differences between MS Windows and Unix, I am
310
 
 * going to use the Microsoft way and #define the Microsoft-specific
311
 
 * functions to the unix way. Microsoft use a separate subsystem for sockets,
312
 
 * but Unix normally just use a filedescriptor on the same functions. It is
313
 
 * a lot easier to map back to the unix way with macros than going the other
314
 
 * way without side effect ;-)
315
 
 */
316
 
#ifdef TARGET_OS_WINDOWS
317
 
#define random() rand()
318
 
#define srandom(a) srand(a)
319
 
#define get_socket_errno() WSAGetLastError()
320
 
#else
321
 
#define INVALID_SOCKET -1
322
 
#define SOCKET_ERROR -1
323
 
#define closesocket(a) close(a)
324
 
#define get_socket_errno() errno
325
 
#endif
326
 
 
327
 
#endif /* __CONFIG_H__ */
328
 
  ])
329
 
 
330
 
  AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
331
 
  AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
332
 
 
333
 
  AC_SUBST([AM_CFLAGS])
334
 
  AC_SUBST([AM_CXXFLAGS])
335
 
  AC_SUBST([AM_CPPFLAGS])
336
 
  AC_SUBST([AM_LDFLAGS])
337
 
 
338
 
])