~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2008-10-22 21:31:15 UTC
  • Revision ID: monty@inaugust.com-20081022213115-xuxc80r939tl88p1
Renamed drizzle_common again. Removed sql_common. (empty) 
Now all we need to do is merge/disect base.h, common.h, common_includes.h, server_includes.h and globa.h (good grief)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
AC_SUBST(CXXLDFLAGS)
29
29
 
30
30
AC_CANONICAL_TARGET
31
 
AM_INIT_AUTOMAKE(-Wall -Werror)
 
31
AM_INIT_AUTOMAKE(-Wall -Wno-portability -Werror)
32
32
 
33
33
PROTOCOL_VERSION=10
34
34
DOT_FRM_VERSION=6
36
36
SHARED_LIB_MAJOR_VERSION=1
37
37
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
38
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
################ End of section to be done before AC_PROG_CC #################
 
62
 
 
63
dnl Checks for programs.
 
64
AC_PROG_CC
 
65
ifdef([AC_PROG_CC_C99],[
 
66
  dnl TODO: Need to fix this to use c99 instead of gnu99
 
67
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
 
68
  C99_SUPPORT_HACK=""
 
69
],[C99_SUPPORT_HACK="-std=gnu99"])
 
70
AC_USE_SYSTEM_EXTENSIONS
 
71
AC_PROG_CXX
 
72
AC_CXX_HEADER_STDCXX_98
 
73
if test "$ac_cv_cxx_stdcxx_98" = "no"
 
74
then
 
75
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
 
76
fi
 
77
AC_PROG_CPP
 
78
AM_PROG_CC_C_O
 
79
 
 
80
AC_CXX_STL_HASH
 
81
AC_CXX_CSTDINT
 
82
AC_CXX_CINTTYPES
 
83
AC_CXX_CMATH
39
84
 
40
85
dnl AC_CANONICAL_HOST thinks it's a good idea to just set CFLAGS to 
41
86
dnl -g -O2 if you're running gcc. We would like to use something else, thanks.
185
230
# This is needed is SUBDIRS is set
186
231
AC_PROG_MAKE_SET
187
232
 
188
 
##############################################################################
189
 
# The below section needs to be done before AC_PROG_CC
190
 
##############################################################################
191
 
 
192
 
if test "x${CFLAGS-}" = x ; then
193
 
  cflags_is_set=no
194
 
else
195
 
  cflags_is_set=yes
196
 
fi
197
 
 
198
 
if test "x${CPPFLAGS-}" = x ; then
199
 
  cppflags_is_set=no
200
 
else
201
 
  cppflags_is_set=yes
202
 
fi
203
 
 
204
 
if test "x${LDFLAGS-}" = x ; then
205
 
  ldflags_is_set=no
206
 
else
207
 
  ldflags_is_set=yes
208
 
fi
209
 
 
210
 
################ End of section to be done before AC_PROG_CC #################
211
 
 
212
 
dnl Checks for programs.
213
 
AC_PROG_CC
214
 
ifdef([AC_PROG_CC_C99],[
215
 
  dnl TODO: Need to fix this to use c99 instead of gnu99
216
 
  AC_PROG_CC_C99([],[AC_MSG_ERROR([C99 support required for compiling Drizzle])])
217
 
  C99_SUPPORT_HACK=""
218
 
],[C99_SUPPORT_HACK="-std=gnu99"])
219
 
AC_PROG_CXX
220
 
AC_CXX_HEADER_STDCXX_98
221
 
if test "$ac_cv_cxx_stdcxx_98" = "no"
222
 
then
223
 
  AC_MSG_ERROR([C++ Compiler required to compile Drizzle])
224
 
fi
225
 
AC_PROG_CPP
226
 
AM_PROG_CC_C_O
227
233
 
228
234
# Print version of CC and CXX compiler (if they support --version)
229
235
case $SYSTEM_TYPE in
291
297
 
292
298
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
293
299
dnl       Need for all of this? 
294
 
if test "${build_vendor}" = "sun"
295
 
then
 
300
case "$target_os" in
 
301
  *solaris*)
296
302
  dnl Do we need both of these? 
297
 
  dnl This is for C++
298
 
  AC_DEFINE([__C99FEATURES__],[1],[C99 Features])
299
 
  dnl This is for C
300
 
  AC_DEFINE([_XOPEN_SOURCE],[600],[X/Open Level])
301
 
fi
 
303
  CXXFLAGS="${CXXFLAGS} -D__C99FEATURES__"
 
304
  CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=600"
 
305
  ;;
 
306
esac
 
307
 
302
308
 
303
309
# We use libtool
304
310
#AC_LIBTOOL_WIN32_DLL
807
813
  AC_MSG_RESULT([no])
808
814
fi
809
815
 
810
 
DRIZZLE_SYS_LARGEFILE
 
816
AC_SYS_LARGEFILE
 
817
AC_FUNC_FSEEKO
811
818
 
812
819
# Types that must be checked AFTER large file support is checked
813
820
AC_TYPE_SIZE_T
838
845
#--------------------------------------------------------------------
839
846
 
840
847
AC_CHECK_LIB(m, floor, [], AC_CHECK_LIB(m, __infinity))
841
 
AC_CHECK_FUNCS(log2)
842
848
 
843
849
AC_CHECK_FUNC(setsockopt, [], [AC_CHECK_LIB(socket, setsockopt)])
844
850
AC_CHECK_FUNC(yp_get_default_domain, [],
862
868
  AC_CHECK_FUNC(gtty, [], [AC_CHECK_LIB(compat, gtty)])
863
869
fi
864
870
 
865
 
AC_CHECK_TYPES([int8, uint8, int16, uint16, int32, uint32, int64, uint64,
866
 
                uchar, uint, ulong],[],[], [
867
 
#include <sys/types.h>
868
 
])
869
871
AC_CHECK_TYPES([fp_except], [], [], [
870
872
#include <sys/types.h>
871
873
#include <ieeefp.h>
928
930
AC_TYPE_OFF_T
929
931
AC_HEADER_TIME
930
932
AC_STRUCT_TM
931
 
# AC_CHECK_SIZEOF return 0 when it does not find the size of a
932
 
# type. We want a error instead.
933
 
AC_CHECK_SIZEOF(char, 1)
934
 
if test "$ac_cv_sizeof_char" -eq 0
935
 
then
936
 
  AC_MSG_ERROR([No size for char type.])
937
 
fi
938
 
AC_CHECK_SIZEOF(char*, 4)
939
 
AC_CHECK_SIZEOF(short, 2)
940
 
AC_CHECK_SIZEOF(int, 4)
941
 
if test "$ac_cv_sizeof_int" -eq 0
942
 
then
943
 
  AC_MSG_ERROR("No size for int type.")
944
 
fi
945
 
AC_CHECK_SIZEOF(long, 4)
946
 
if test "$ac_cv_sizeof_long" -eq 0
947
 
then
948
 
  AC_MSG_ERROR("No size for long type.")
949
 
fi
950
 
AC_CHECK_SIZEOF(long long, 8)
951
 
if test "$ac_cv_sizeof_long_long" -eq 0
952
 
then
953
 
  AC_MSG_ERROR("Drizzle needs a long long type.")
954
 
fi
955
933
# off_t is not a builtin type
956
934
AC_CHECK_SIZEOF(off_t, 4)
957
935
if test "$ac_cv_sizeof_off_t" -eq 0
966
944
DRIZZLE_CHECK_TIME_T
967
945
 
968
946
 
969
 
# do we need #pragma interface/#pragma implementation ?
970
 
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
971
 
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
972
 
# instead of trying to match SYSTEM_TYPE and CC_VERSION (that doesn't
973
 
# follow any standard), we'll use well-defined preprocessor macros:
974
 
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
975
 
#if !defined(__CYGWIN__) && !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
976
 
#error USE_PRAGMA_IMPLEMENTATION
977
 
#endif
978
 
]])],[
979
 
  AC_MSG_RESULT(no)
980
 
],[
981
 
  AC_MSG_RESULT(yes)
982
 
  AC_DEFINE(USE_PRAGMA_IMPLEMENTATION,[1],[pragma implementation is a good idea])
983
 
  AC_DEFINE(USE_PRAGMA_INTERFACE,[1],[pragma interface is a good idea])
984
 
])
985
 
 
986
947
# This always gives a warning. Ignore it unless you are cross compiling
987
948
AC_C_BIGENDIAN
988
949
#---START: Used in for client configure
1003
964
DRIZZLE_CXX_BOOL
1004
965
AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
1005
966
AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
1006
 
AC_CHECK_TYPES([u_int32_t])
1007
967
 
1008
968
DRIZZLE_PTHREAD_YIELD
1009
969
 
1315
1275
# Check for requested features
1316
1276
#--------------------------------------------------------------------
1317
1277
 
1318
 
DRIZZLE_CHECK_BIG_TABLES
1319
1278
DRIZZLE_CHECK_MAX_INDEXES
1320
1279
DRIZZLE_CHECK_VIO
1321
1280
 
1355
1314
fi
1356
1315
 
1357
1316
dnl TODO: Remove this define once we are using 2.61 across the board.
1358
 
# AC_HEADER_ASSERT
 
1317
# AX_HEADER_ASSERT
1359
1318
# ----------------
1360
1319
# Check whether to enable assertions.
1361
 
ifdef([AC_HEADER_ASSERT], [], [AC_DEFUN([AC_HEADER_ASSERT],
 
1320
AC_DEFUN([AX_HEADER_ASSERT],
1362
1321
[
1363
1322
  AC_MSG_CHECKING([whether to enable assertions])
1364
1323
  AC_ARG_ENABLE([assert],
1365
 
    [  --disable-assert        turn off assertions],
1366
 
    [AC_MSG_RESULT([no])
1367
 
     AC_DEFINE(NDEBUG, 1, [Define to 1 if assertions should be disabled.])],
1368
 
    [AC_MSG_RESULT(yes)])
1369
 
])])
 
1324
    [AS_HELP_STRING([--disable-assert],
 
1325
       [Turn off assertions])],
 
1326
    [ac_cv_assert="no"],
 
1327
    [ac_cv_assert="yes"])
 
1328
  AC_MSG_RESULT([$ac_cv_assert])
 
1329
])
1370
1330
 
1371
 
AC_HEADER_ASSERT
 
1331
AX_HEADER_ASSERT
1372
1332
 
1373
1333
CFLAGS="${SYMBOLS_CFLAGS} ${CFLAGS}"
1374
 
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
 
1334
CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}"
 
1335
#CXXFLAGS="${SYMBOLS_CXXFLAGS} ${CXXFLAGS}  -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
1375
1336
 
1376
1337
AC_ARG_WITH([debug],
1377
1338
    [AS_HELP_STRING([--with-debug],
1381
1342
if test "$with_debug" = "yes"
1382
1343
then
1383
1344
  # Medium debug.
1384
 
  CFLAGS="$DEBUG_OPTIMIZE_CC $CFLAGS ${SAVE_CFLAGS}"
1385
 
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX $CXXFLAGS ${SAVE_CXXFLAGS}"
 
1345
  CFLAGS="$DEBUG_OPTIMIZE_CC -DDEBUG $CFLAGS ${SAVE_CFLAGS}"
 
1346
  CXXFLAGS="$DEBUG_OPTIMIZE_CXX -DDEBUG $CXXFLAGS ${SAVE_CXXFLAGS}"
1386
1347
else
1387
1348
  # Optimized version. No debug
1388
1349
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS} ${SAVE_CFLAGS}"
1431
1392
    [ac_warn_strict_aliasing="$enableval"],
1432
1393
    [ac_warn_strict_aliasing="no"])
1433
1394
 
 
1395
AC_ARG_ENABLE([cast-warnings],
 
1396
    [AS_HELP_STRING([--enable-cast-warnings],
 
1397
       [Enable warnings about use of old C-style casts @<:@default=off@:>@])],
 
1398
    [ac_warn_cast="$enableval"],
 
1399
    [ac_warn_cast="no"])
 
1400
 
 
1401
AC_ARG_ENABLE([effective-style],
 
1402
    [AS_HELP_STRING([--enable-effective-style],
 
1403
       [Enable warnings violating Effective C++ Style Guidelines @<:@default=off@:>@])],
 
1404
    [ac_warn_effc="$enableval"],
 
1405
    [ac_warn_effc="no"])
 
1406
 
 
1407
AC_ARG_ENABLE([go-crazy],
 
1408
    [AS_HELP_STRING([--enable-go-crazy],
 
1409
       [Enables extra little warnings that might be too much @<:@default=off@:>@])],
 
1410
    [ac_warn_go_crazy="$enableval"],
 
1411
    [ac_warn_go_crazy="no"])
 
1412
 
1434
1413
 
1435
1414
if test "$GCC" = "yes"
1436
1415
then
1479
1458
    W_FAIL="-Werror"
1480
1459
  fi
1481
1460
 
1482
 
  BASE_WARNINGS="-W -Wall -Wextra"
1483
 
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
1484
 
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE}"
 
1461
  if test "$ac_warn_cast" = "yes"
 
1462
  then
 
1463
    W_CAST="-Wold-style-cast"
 
1464
  fi
 
1465
 
 
1466
  if test "$ac_warn_effc" = "yes"
 
1467
  then
 
1468
    W_EFFC="-Weffc++"
 
1469
  fi
 
1470
 
 
1471
  if test "$ac_warn_gocrazy" = "yes"
 
1472
  then
 
1473
    W_CRAZY="-Wshadow -Wconversion -Winvalid-pch"
 
1474
  fi
 
1475
 
 
1476
  BASE_WARNINGS="-W -Wall -Wextra -Wunused-macros"
 
1477
  GCC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CRAZY}"
 
1478
  GXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${W_FAIL} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_EFFC} ${W_CRAZY}"
1485
1479
 
1486
1480
  AM_CXXFLAGS="${GXX_WARNINGS} ${AM_CXXFLAGS}"
1487
1481
  AM_CFLAGS="${GCC_WARNINGS} ${AM_CFLAGS}"
1507
1501
esac
1508
1502
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
1509
1503
 
 
1504
dnl GCC Precompiled Header Support
 
1505
AM_CONDITIONAL([GCC_PCH],[test "x$GCC" = "xyes"])
 
1506
 
1510
1507
AC_CONFIG_FILES(Makefile extra/Makefile mysys/Makefile dnl
1511
1508
 mystrings/Makefile storage/Makefile dnl
1512
1509
 vio/Makefile po/Makefile.in dnl
1514
1511
 drizzled/Makefile dnl
1515
1512
 drizzled/field/Makefile dnl
1516
1513
 drizzled/serialize/Makefile dnl
 
1514
 drizzled/functions/Makefile dnl
 
1515
 drizzled/util/Makefile dnl
1517
1516
 drizzled/sql_builtin.cc dnl
1518
1517
 support-files/Makefile dnl
1519
1518
 tests/Makefile tests/install_test_db dnl
1527
1526
AC_CONFIG_COMMANDS_POST(ac_configure_args="$ac_configure_args CFLAGS='$CFLAGS' CXXFLAGS='$CXXFLAGS' AM_CFLAGS='$AM_CFLAGS' AM_CXXFLAGS='$AM_CXXFLAGS'")
1528
1527
 
1529
1528
AC_OUTPUT
 
1529
 
 
1530
echo "---"
 
1531
echo "Configuration summary for $PACKAGE_NAME version $VERSION"
 
1532
echo ""
 
1533
echo "   * Installation prefix:       $prefix"
 
1534
echo "   * System type:               $SYSTEM_TYPE"
 
1535
echo "   * Host CPU:                  $host_cpu"
 
1536
echo "   * C Compiler:                $CC_VERSION"
 
1537
echo "   * C++ Compiler:              $CXX"
 
1538
echo "   * Build auth_pam:            $ac_cv_header_security_pam_appl_h"
 
1539
echo "   * Assertions enabled:        $ac_cv_assert"
 
1540
echo "   * Debug enabled:             $with_debug"
 
1541
echo "   * Profiling enabled:         $ac_profiling"
 
1542
echo "   * Coverage enabled:          $ac_coverage"
 
1543
echo "   * Warnings as failure:       $ac_warn_fail"
 
1544
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
 
1545
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
 
1546
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
 
1547
echo "   * C++ cmath location:        $ac_cv_cxx_cmath"
 
1548
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
 
1549
echo ""
 
1550
echo "---"