~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
dnl -*- bash -*-
dnl Process this file with autoconf to produce a configure script.

dnl  Copyright (C) 2009 Sun Microsystems
dnl
dnl  This program is free software; you can redistribute it and/or modify
dnl  it under the terms of the GNU General Public License as published by
dnl  the Free Software Foundation; version 2 of the License.
dnl
dnl  This program is distributed in the hope that it will be useful,
dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl  GNU General Public License for more details.
dnl
dnl  You should have received a copy of the GNU General Public License
dnl  along with this program; if not, write to the Free Software
dnl  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA


AC_PREREQ(2.59)dnl		Minimum Autoconf version required.
dnl Version from the AC_INIT call below is overridden later
dnl So don't update it here
AC_INIT([drizzle7],[7],[http://bugs.launchpad.net/drizzle])
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
AC_CONFIG_AUX_DIR([config])

PANDORA_CANONICAL_TARGET(less-warnings, warnings-always-on, require-cxx, force-gcc42, version-from-vc, skip-visibility)

LIBDRIZZLE_LIBRARY_VERSION=1:0:0
#                          | | |
#                   +------+ | +---+
#                   |        |     |
#                current:revision:age
#                   |        |     |
#                   |        |     +- increment if interfaces have been added
#                   |        |        set to zero if interfaces have been
#                   |        |        removed or changed
#                   |        +- increment if source code has changed
#                   |           set to zero if current is incremented
#                   +- increment if interfaces have been added, removed or
#                      changed
AC_SUBST(LIBDRIZZLE_LIBRARY_VERSION)

# libdrizzle versioning when linked with GNU ld.
AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
  LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/config/drizzle.ver"
  ])
AC_SUBST(LD_VERSION_SCRIPT)

dnl Set the default datadir location to /usr/local/var/drizzle. If a
dnl localstatedir is explicitly given, just use that.
AS_IF([test "x${localstatedir}" = 'x${prefix}/var'],[
  localstatedir='${prefix}/var/drizzle'
])

AC_PATH_PROG(GPERF, gperf)
AS_IF([test "x$GPERF" = "x"],
      AC_MSG_ERROR("Drizzle requires gperf to build."))

# libexecinfo provides backtrace_symbols on FreeBSD
AC_SEARCH_LIBS(backtrace_symbols, [execinfo])

PANDORA_RUN_CPPLINT

PANDORA_REQUIRE_LIBPROTOBUF
PANDORA_PROTOBUF_REQUIRE_VERSION([2.1.0])
PANDORA_REQUIRE_PROTOC

AC_LANG_PUSH(C++)
PANDORA_REQUIRE_PTHREAD
PANDORA_REQUIRE_LIBUUID
PANDORA_REQUIRE_LIBZ
PANDORA_REQUIRE_LIBPCRE
PANDORA_REQUIRE_LIBREADLINE
PANDORA_REQUIRE_LIBDL
AC_LANG_POP

DRIZZLE_STACK_DIRECTION

PANDORA_USE_BETTER_MALLOC

PANDORA_DRIZZLE_BUILD
AC_DEFINE([BUILDING_DRIZZLED],[1],
          [Define indicating we are building and not consuming drizzle.])

PANDORA_HAVE_LIBGTEST
PANDORA_HAVE_LIBSQLITE3

AC_CHECK_FUNC(inet_ntoa, [], [AC_CHECK_LIB(nsl, inet_ntoa)])


AC_ARG_WITH([server-suffix],
    [AS_HELP_STRING([--with-server-suffix],
      [Append value to the version string.])],
    [ DRIZZLE_SERVER_SUFFIX="$withval" ]
    [ DRIZZLE_SERVER_SUFFIX= ])

AC_DEFINE_UNQUOTED([DRIZZLE_SERVER_SUFFIX],[$DRIZZLE_SERVER_SUFFIX],
                   [Append value to the version string])


AC_ARG_WITH([drizzled-user],
    [AS_HELP_STRING([--with-drizzled-user=username],
            [What user the drizzled daemon shall be run as.
		@<:@default=drizzle@:>@])],
    [ DRIZZLED_USER="$withval" ],
    [ DRIZZLED_USER=drizzle ])
AC_SUBST(DRIZZLED_USER)


AC_ARG_WITH([comment],
    [AS_HELP_STRING([--with-comment],
            [Comment about compilation environment. @<:@default=off@:>@])],
    [with_comment=$withval],
    [with_comment=no])
AS_IF([test "$with_comment" != "no"],[
  COMPILATION_COMMENT=$with_comment
],[
  COMPILATION_COMMENT="Source distribution (${PANDORA_RELEASE_COMMENT})"
])
AC_DEFINE_UNQUOTED([COMPILATION_COMMENT],["$COMPILATION_COMMENT"],
                   [Comment about compilation environment])


#########################################################################


dnl Has to be done late, as the plugin may need to check for existence of
dnl functions tested above
PANDORA_PLUGINS([drizzled/module/load_list.h])

dnl GCC Precompiled Header Support
dnl re-enable later
dnl AM_CONDITIONAL([BUILD_GCC_PCH],[test "$GCC" = "yes"])
AM_CONDITIONAL([BUILD_GCC_PCH],[test "no" = "yes"])

AS_IF([test "$lt_cv_prog_gnu_ld" = "yes"],[
  LDFLAGS="${LDFLAGS} ${LD_VERSION_SCRIPT}"
  ])


AC_CONFIG_FILES(Makefile dnl
 tests/Makefile dnl
 drizzled/plugin/version.h dnl
 support-files/libdrizzle.pc dnl
 support-files/drizzle.server support-files/drizzle-log-rotate
 support-files/smf/install.sh dnl
 support-files/drizzle.spec dnl
 support-files/smf/drizzle.xml dnl
 support-files/smf/drizzle)

scheduling_plugins_available="
  pool_of_threads 
  single_thread
"

for sched_plugin in $scheduling_plugins_available
do
  varname="\${with_plugin_${sched_plugin}}"
  result=`eval "echo $varname"`
  if test "x$result" = "xyes"
  then
    scheduling_plugins="$sched_plugin $scheduling_plugins"
  fi
done

AC_OUTPUT

echo "---"
echo "Configuration summary for $PACKAGE_NAME version $VERSION $PANDORA_RELEASE_COMMENT"
echo ""
echo "   * Installation prefix:       $prefix"
echo "   * System type:               $host_vendor-$host_os"
echo "   * pandora-build version:     PANDORA_CANONICAL_VERSION"
echo "   * Host CPU:                  $host_cpu"
echo "   * C Compiler:                $CC_VERSION"
echo "   * C++ Compiler:              $CXX_VERSION"
echo "   * Assertions enabled:        $ac_cv_assert"
echo "   * Debug enabled:             $with_debug"
echo "   * Profiling enabled:         $ac_profiling"
echo "   * Coverage enabled:          $ac_coverage"
echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
echo ""
echo "---"

case "$host_os" in
  *freebsd*)
    echo "*****"
    echo "*"
    echo "*  NOTE: You are on FreeBSD. BSD make will not work."
    echo "*"
    echo "*   use 'gmake' To build Drizzle"
    echo "*"
    echo "*  And ensure that /usr/local/lib/gcc44 is in your LD_LIBRARY_PATH"
    echo "*" 
    echo "*****"
  ;;
esac


dnl libtoolize scans configure.ac  and needs to see some text
m4_define([LIBTOOLIZE_AC_INIT], [])