~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2008-12-20 21:07:44 UTC
  • mto: (722.2.2 devel)
  • mto: This revision was merged to the branch mainline in revision 727.
  • Revision ID: monty@inaugust.com-20081220210744-bhmvkzh2qspp9nxt
Cleaned up a few build things.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
AC_CONFIG_AUX_DIR(config)
9
9
AC_CONFIG_HEADERS([config.h])
10
10
 
11
 
# Save some variables and the command line options for mysqlbug
12
 
SAVE_CC="$CC"
13
 
SAVE_CXX="$CXX"
14
 
SAVE_ASFLAGS="$ASFLAGS"
15
 
SAVE_CFLAGS="$CFLAGS"
16
 
SAVE_CXXFLAGS="$CXXFLAGS"
17
 
SAVE_LDFLAGS="$LDFLAGS"
18
 
SAVE_CXXLDFLAGS="$CXXLDFLAGS"
19
 
CONF_COMMAND="$0 $ac_configure_args"
20
 
AC_SUBST(CONF_COMMAND)
21
 
AC_SUBST(SAVE_CC)
22
 
AC_SUBST(SAVE_CXX)
23
 
AC_SUBST(SAVE_ASFLAGS)
24
 
AC_SUBST(SAVE_CFLAGS)
25
 
AC_SUBST(SAVE_CXXFLAGS)
26
 
AC_SUBST(SAVE_LDFLAGS)
27
 
AC_SUBST(SAVE_CXXLDFLAGS)
28
 
AC_SUBST(CXXLDFLAGS)
 
11
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
 
12
SAVE_CFLAGS=${CFLAGS}
 
13
SAVE_CXXFLAGS=${CXXFLAGS}
 
14
CFLAGS=
 
15
CXXFLAGS=
29
16
 
30
17
AC_CANONICAL_TARGET
 
18
 
 
19
CFLAGS=${SAVE_CFLAGS}
 
20
CXXFLAGS=${SAVE_CXXFLAGS}
 
21
 
31
22
AM_INIT_AUTOMAKE(nostdinc -Wall -Werror)
32
 
 
33
 
PROTOCOL_VERSION=10
34
 
DOT_FRM_VERSION=6
 
23
if test "x${enable_dependency_tracking}" = "x"
 
24
then
 
25
  enable_dependency_tracking=yes
 
26
fi
 
27
 
 
28
 
35
29
# See the libtool docs for information on how to do shared lib versions.
36
30
SHARED_LIB_MAJOR_VERSION=1
37
31
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
38
 
 
39
 
##############################################################################
40
 
# The below section needs to be done before AC_PROG_CC
41
 
##############################################################################
42
 
 
43
 
if test "x${CFLAGS-}" = x ; then
44
 
  cflags_is_set=no
45
 
else
46
 
  cflags_is_set=yes
47
 
fi
48
 
 
49
 
if test "x${CPPFLAGS-}" = x ; then
50
 
  cppflags_is_set=no
51
 
else
52
 
  cppflags_is_set=yes
53
 
fi
54
 
 
55
 
if test "x${LDFLAGS-}" = x ; then
56
 
  ldflags_is_set=no
57
 
else
58
 
  ldflags_is_set=yes
59
 
fi
60
 
 
61
 
if test "x${enable_dependency_tracking}" = "x"
62
 
then
63
 
  enable_dependency_tracking=yes
64
 
fi
65
 
 
66
 
################ End of section to be done before AC_PROG_CC #################
 
32
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
 
33
AC_SUBST(SHARED_LIB_VERSION)
 
34
 
67
35
 
68
36
dnl Checks for programs.
69
37
AC_PROG_CC
70
 
ifdef([AC_PROG_CC_C99],[
71
 
  dnl TODO: Need to fix this to use c99 instead of gnu99
72
 
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
73
 
  C99_SUPPORT_HACK=""
74
 
],[C99_SUPPORT_HACK="-std=gnu99"])
75
38
 
76
 
AC_USE_SYSTEM_EXTENSIONS
 
39
ACX_USE_SYSTEM_EXTENSIONS
77
40
AC_PROG_CXX
78
41
AC_CXX_HEADER_STDCXX_98
79
42
if test "$ac_cv_cxx_stdcxx_98" = "no"
84
47
AM_PROG_CC_C_O
85
48
 
86
49
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
 
50
ifdef([AC_PROG_CC_C99],[
 
51
    AC_PROG_CC_C99([$1],[$2],[$3])
 
52
],[
 
53
if "x$GCC" = "xyes"
 
54
then
 
55
  C99_SUPPORT_HACK="-std=gnu99"
 
56
fi
 
57
if "x$SUNCC" = "xyes"
 
58
then
 
59
  C99_SUPPORT_HACK="-xc99"
 
60
fi
 
61
])
87
62
 
88
 
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
89
 
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
90
 
if test "x${CFLAGS}" = "x-g -O2"
91
 
then
92
 
  CFLAGS=
93
 
fi
94
 
if test "x${CXXFLAGS}" = "x-g -O2"
95
 
then
96
 
  CXXFLAGS=
97
 
fi
98
63
 
99
64
 
100
65
# Set all version vars based on $VERSION. How do we do this more elegant ?
112
77
DRIZZLE_BASE_VERSION=`echo $DRIZZLE_NUMERIC_VERSION | sed -e "s|\.[[^.]]*$||"`
113
78
DRIZZLE_VERSION_ID=`echo $DRIZZLE_NUMERIC_VERSION | \
114
79
    awk -F. '{printf "%d%0.2d%0.2d", $1, $2, $3}'`
 
80
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
 
81
                   [Major and minor version])
 
82
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
 
83
                   [Version ID that can be easily used for numeric comparison])
115
84
 
116
85
# The port should be constant for a LONG time
117
86
DRIZZLE_TCP_PORT_DEFAULT=4427
118
87
 
119
88
sinclude(m4/dtrace.m4)
 
89
 
120
90
sinclude(m4/character_sets.m4)
 
91
AC_SUBST(AVAILABLE_LANGUAGES)
 
92
 
121
93
sinclude(m4/gettext.m4)
122
 
 
123
94
AM_GNU_GETTEXT([external])
124
 
 
125
95
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
126
96
 
127
 
AC_SUBST(DRIZZLE_NO_DASH_VERSION)
128
 
AC_DEFINE_UNQUOTED(DRIZZLE_BASE_VERSION,["$DRIZZLE_BASE_VERSION"],
129
 
                  [Major and minor version])
130
 
AC_SUBST(DRIZZLE_VERSION_ID)
131
 
AC_DEFINE_UNQUOTED([DRIZZLE_VERSION_ID],[$DRIZZLE_VERSION_ID],
132
 
                   [Version ID that can be easily used for numeric comparison])
133
 
AC_SUBST(DRIZZLE_PREVIOUS_BASE_VERSION)
134
 
AC_SUBST(PROTOCOL_VERSION)
135
 
AC_DEFINE_UNQUOTED([PROTOCOL_VERSION], [$PROTOCOL_VERSION],
136
 
                   [mysql client protocol version])
137
 
AC_SUBST(DOT_FRM_VERSION)
138
 
AC_DEFINE_UNQUOTED([FRM_VER], [$DOT_FRM_VERSION],
139
 
                   [Version of .frm files])
140
 
AC_DEFINE_UNQUOTED([DRIZZLE_CONFIG_NAME],["drizzled"],[Name of server config section])
141
 
 
142
 
AC_SUBST(SHARED_LIB_MAJOR_VERSION)
143
 
AC_SUBST(SHARED_LIB_VERSION)
144
 
AC_SUBST(AVAILABLE_LANGUAGES)
145
 
 
146
 
dnl Ok. This is sort of lame, but we need to be nice to plugins Makefile.am's.
147
 
AM_CONDITIONAL(BUILD_DRIZZLE,[test "x" = "x"])
148
 
 
149
 
 
150
 
# General Constants
151
 
AC_DEFINE([IO_SIZE], [4096], [Io buffer size; Must be a power of 2 and 
152
 
  a multiple of 512. May be
153
 
  smaller what the disk page size. This influences the speed of the
154
 
  isam btree library. eg to big to slow.])
155
 
AC_DEFINE([SC_MAXWIDTH],[256], [Max width of screen (for error messages)])
156
 
AC_DEFINE([FN_LEN],[256 ], [Max file name len ])
157
 
AC_DEFINE([FN_EXTLEN],[20], [Max length of extension (part of FN_LEN) ])
158
 
AC_DEFINE([FN_REFLEN],[512], [Max length of full path-name ])
159
 
AC_DEFINE([FN_EXTCHAR],['.'], [File extension character])
160
 
AC_DEFINE([FN_HOMELIB],['~'], [~/ is used as abbrev for home dir ])
161
 
AC_DEFINE([FN_CURLIB],['.'], [./ is used as abbrev for current dir ])
162
 
AC_DEFINE([FN_PARENTDIR],[".."], [Parent directory; Must be a string ])
163
 
 
164
 
AC_DEFINE([MASTER],[1],[Compile without unireg])
165
 
 
166
 
AH_VERBATIM([QUOTE_ARG],[
167
 
/* Quote argument (before cpp) */
168
 
#ifndef QUOTE_ARG
169
 
# define QUOTE_ARG(x) #x
170
 
#endif
171
 
/* Quote argument, (after cpp) */
172
 
#ifndef STRINGIFY_ARG
173
 
# define STRINGIFY_ARG(x) QUOTE_ARG(x)
174
 
#endif
175
 
])
176
 
 
177
 
AH_VERBATIM([builtin_expect],[
178
 
/*
179
 
 * The macros below are borrowed from include/linux/compiler.h in the
180
 
 * Linux kernel. Use them to indicate the likelyhood of the truthfulness
181
 
 * of a condition. This serves two purposes - newer versions of gcc will be
182
 
 * able to optimize for branch predication, which could yield siginficant
183
 
 * performance gains in frequently executed sections of the code, and the
184
 
 * other reason to use them is for documentation
185
 
 */
186
 
#if !defined(__GNUC__)
187
 
#define __builtin_expect(x, expected_value) (x)
188
 
#endif
189
 
 
190
 
#define likely(x)  __builtin_expect((x),1)
191
 
#define unlikely(x)  __builtin_expect((x),0)
192
 
])
193
 
 
194
 
dnl  InnoDB depends on some Drizzle's internals which other plugins should not
195
 
dnl  need.  This is because of InnoDB's foreign key support, "safe" binlog
196
 
dnl  truncation, and other similar legacy features.
197
 
 
198
 
dnl  We define accessors for these internals unconditionally, but do not
199
 
dnl  expose them in mysql/plugin.h.  They are declared in ha_innodb.h for
200
 
dnl  InnoDB's use.
201
 
 
202
 
AC_DEFINE([INNODB_COMPATIBILITY_HOOKS],[1],[TODO: Remove the need for this])
203
 
dnl TODO: Make a test for when this needs to be set.
204
 
AC_DEFINE([_REENTRANT],[1],[Some thread libraries require this])
205
 
 
206
 
AH_VERBATIM([posix_pthread],[
207
 
/* We want posix threads */
208
 
#ifndef _POSIX_PTHREAD_SEMANTICS
209
 
#define _POSIX_PTHREAD_SEMANTICS
210
 
#endif
211
 
])
 
97
# Set this for plugins to use
 
98
ac_build_drizzle="yes"
212
99
 
213
100
 
214
101
# Canonicalize the configuration name.