~drizzle-trunk/drizzle/development

1085.1.4 by Monty Taylor
pandora-build v1
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
1126.6.8 by Monty Taylor
pandora-build v0.62 - cleaned up some copyright header mistakes. Merged in trond's innodb detection.
7
AC_DEFUN([PANDORA_CANONICAL_VERSION],[0.62])
1085.1.4 by Monty Taylor
pandora-build v1
8
9
AC_DEFUN([PANDORA_FORCE_DEPEND_TRACKING],[
10
  dnl Force dependency tracking on for Sun Studio builds
11
  AS_IF([test "x${enable_dependency_tracking}" = "x"],[
12
    enable_dependency_tracking=yes
13
  ])
14
])
15
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
16
dnl The standard setup for how we build Pandora projects
17
AC_DEFUN([PANDORA_CANONICAL_TARGET],[
1085.1.4 by Monty Taylor
pandora-build v1
18
  AC_REQUIRE([PANDORA_FORCE_DEPEND_TRACKING])
1085.1.7 by Monty Taylor
pandora-build r0.7
19
  ifdef([m4_define],,[define([m4_define],   defn([define]))])
20
  ifdef([m4_undefine],,[define([m4_undefine],   defn([undefine]))])
21
  m4_define([PCT_ALL_ARGS],[$*])
1085.1.4 by Monty Taylor
pandora-build v1
22
  m4_define([PCT_USE_GNULIB],[no])
23
  m4_define([PCT_REQUIRE_CXX],[no])
24
  m4_define([PCT_IGNORE_SHARED_PTR],[no])
1085.1.7 by Monty Taylor
pandora-build r0.7
25
  m4_define([PCT_FORCE_GCC42],[no])
1126.6.1 by Monty Taylor
pandora-build v0.58
26
  m4_define([PCT_SRC_IN_SRC],[no])
1085.3.4 by Monty Taylor
pandora-build v0.8
27
  m4_foreach([pct_arg],[$*],[
1085.1.4 by Monty Taylor
pandora-build v1
28
    m4_case(pct_arg,
29
      [use-gnulib], [
30
        m4_undefine([PCT_USE_GNULIB])
31
        m4_define([PCT_USE_GNULIB],[yes])
32
      ],
33
      [require-cxx], [
34
        m4_undefine([PCT_REQUIRE_CXX])
35
        m4_define([PCT_REQUIRE_CXX],[yes])
36
      ],
37
      [ignore-shared-ptr], [
38
        m4_undefine([PCT_IGNORE_SHARED_PTR])
39
        m4_define([PCT_IGNORE_SHARED_PTR],[yes])
1085.1.7 by Monty Taylor
pandora-build r0.7
40
      ],
41
      [force-gcc42], [
42
        m4_undefine([PCT_FORCE_GCC42])
43
        m4_define([PCT_FORCE_GCC42],[yes])
1126.6.1 by Monty Taylor
pandora-build v0.58
44
      ],
45
      [src-in-src], [
46
        m4_undefine([PCT_SRC_IN_SRC])
47
        m4_define([PCT_SRC_IN_SRC],[yes])
1085.1.4 by Monty Taylor
pandora-build v1
48
    ])
49
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
50
51
  # We need to prevent canonical target
52
  # from injecting -O2 into CFLAGS - but we won't modify anything if we have
53
  # set CFLAGS on the command line, since that should take ultimate precedence
54
  AS_IF([test "x${ac_cv_env_CFLAGS_set}" = "x"],
55
        [CFLAGS=""])
56
  AS_IF([test "x${ac_cv_env_CXXFLAGS_set}" = "x"],
57
        [CXXFLAGS=""])
58
  
59
  AC_CANONICAL_TARGET
60
  
61
  AM_INIT_AUTOMAKE(-Wall -Werror nostdinc subdir-objects)
1093.9.24 by Monty Taylor
Added support for automake 1.11 and silent build rules.
62
  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
1085.1.4 by Monty Taylor
pandora-build v1
63
64
  m4_if(PCT_USE_GNULIB,yes,[ gl_EARLY ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
65
  
66
  AC_REQUIRE([AC_PROG_CC])
1085.1.7 by Monty Taylor
pandora-build r0.7
67
  AC_REQUIRE([PANDORA_MAC_GCC42])
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
68
  AC_REQUIRE([PANDORA_64BIT])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
69
70
  dnl Once we can use a modern autoconf, we can use this
71
  dnl AC_PROG_CC_C99
1093.7.6 by Monty Taylor
pandora-build v0.34
72
  AC_REQUIRE([AC_PROG_CXX])
1093.9.23 by Monty Taylor
pandora-build v0.49
73
  PANDORA_EXTENSIONS
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
74
  AM_PROG_CC_C_O
75
1093.4.1 by Monty Taylor
pandora-build v0.22 - fixes solaris build.
76
1085.1.7 by Monty Taylor
pandora-build r0.7
77
  m4_if(PCT_FORCE_GCC42, [yes], [
78
    AS_IF([test "$GCC" = "yes"], PANDORA_ENSURE_GCC_VERSION)
79
  ])
1093.2.2 by mordred
pandora-build v0.18
80
1099.1.12 by Monty Taylor
Rearranged two orderings.
81
  PANDORA_PLATFORM
82
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
83
  PANDORA_LIBTOOL
84
1085.1.4 by Monty Taylor
pandora-build v1
85
  dnl autoconf doesn't automatically provide a fail-if-no-C++ macro
86
  dnl so we check c++98 features and fail if we don't have them, mainly
87
  dnl for that reason
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
88
  PANDORA_CHECK_CXX_STANDARD
1085.1.4 by Monty Taylor
pandora-build v1
89
  m4_if(PCT_REQUIRE_CXX, [yes], [
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
90
    AS_IF([test "$ac_cv_cxx_stdcxx_98" = "no"],[
91
      AC_MSG_ERROR([No working C++ Compiler has been found. ${PACKAGE} requires a C++ compiler that can handle C++98])
92
    ])
93
  ])
94
  
95
  PANDORA_SHARED_PTR
1085.1.4 by Monty Taylor
pandora-build v1
96
  m4_if(PCT_IGNORE_SHARED_PTR, [no], [
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
97
    AS_IF([test "$ac_cv_shared_ptr_namespace" = "missing"],[
98
      AC_MSG_WARN([a usable shared_ptr implementation was not found. Let someone know what your platform is.])
99
    ])
100
  ])
101
  
1126.6.1 by Monty Taylor
pandora-build v0.58
102
  m4_if(PCT_USE_GNULIB, [yes], [
103
    gl_INIT
104
    AC_CONFIG_LIBOBJ_DIR([gnulib])
105
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
106
107
  AC_C_BIGENDIAN
108
  AC_C_CONST
109
  AC_C_INLINE
110
  AC_C_VOLATILE
1093.2.2 by mordred
pandora-build v0.18
111
  AC_C_RESTRICT
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
112
113
  AC_HEADER_TIME
114
  AC_TYPE_SIZE_T
1085.1.4 by Monty Taylor
pandora-build v1
115
  AC_SYS_LARGEFILE
116
117
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
118
  PANDORA_CHECK_C_VERSION
119
  PANDORA_CHECK_CXX_VERSION
120
121
  PANDORA_OPTIMIZE
1085.1.7 by Monty Taylor
pandora-build r0.7
122
1090.3.5 by Monty Taylor
pandora-build v0.12
123
  dnl We need to inject error into the cflags to test if visibility works or not
124
  save_CFLAGS="${CFLAGS}"
125
  CFLAGS="${CFLAGS} -Werror"
1085.1.7 by Monty Taylor
pandora-build r0.7
126
  gl_VISIBILITY
1090.3.5 by Monty Taylor
pandora-build v0.12
127
  CFLAGS="${save_CFLAGS}"
128
129
  PANDORA_HEADER_ASSERT
1085.1.7 by Monty Taylor
pandora-build r0.7
130
1085.1.4 by Monty Taylor
pandora-build v1
131
  PANDORA_WARNINGS(PCT_ALL_ARGS)
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
132
133
  PANDORA_ENABLE_DTRACE
134
1093.2.1 by Monty Taylor
pandora-build v0.16
135
  AC_LIB_PREFIX
136
  PANDORA_HAVE_BETTER_MALLOC
137
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
138
  AC_CHECK_PROGS([DOXYGEN], [doxygen])
139
  AC_CHECK_PROGS([PERL], [perl])
140
141
  AS_IF([test "x${gl_LIBOBJS}" != "x"],[
142
    AS_IF([test "$GCC" = "yes"],[
143
      AM_CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${AM_CPPFLAGS}"
144
    ],[
145
    AM_CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${AM_CPPFLAGS}"
146
    ])
147
  ])
1126.6.1 by Monty Taylor
pandora-build v0.58
148
  AS_IF([test "PCT_SRC_IN_SRC" = "yes"],[
149
    AM_CPPFLAGS="-I\$(top_srcdir)/src -I\$(top_builddir)/src ${AM_CPPFLAGS}"
150
  ])
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
151
1093.9.14 by Monty Taylor
pandora-build v0.43 Added -pipe to CFLAGS
152
  PANDORA_USE_PIPE
153
154
1085.1.3 by Monty Taylor
Split out warnings - start using the pandora build system.
155
  AM_CPPFLAGS="-I\${top_srcdir} -I\${top_builddir} ${AM_CPPFLAGS}"
156
  AM_CFLAGS="${AM_CFLAGS} ${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
157
  AM_CXXFLAGS="${AM_CXXFLAGS} ${CXX_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE}"
158
159
  AC_SUBST([AM_CFLAGS])
160
  AC_SUBST([AM_CXXFLAGS])
161
  AC_SUBST([AM_CPPFLAGS])
162
163
])