~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Brian Aker
  • Date: 2009-03-03 18:50:34 UTC
  • mfrom: (908.1.17 mordred)
  • Revision ID: brian@tangent.org-20090303185034-obr7tiwx8vyn0i7j
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
AC_PREREQ(2.59)dnl              Minimum Autoconf version required.
5
5
 
6
 
AC_INIT([drizzle],[7.0.0],[http://bugs.launchpad.net/drizzle])
 
6
m4_include(m4/bzr_version.m4)
 
7
 
7
8
AC_CONFIG_SRCDIR([drizzled/drizzled.cc])
8
9
AC_CONFIG_AUX_DIR(config)
9
10
AC_CONFIG_HEADERS([config.h])
 
11
AC_CONFIG_MACRO_DIR([m4])
10
12
 
11
13
# Setting CFLAGS here prevents AC_CANONICAL_TARGET from injecting them
12
14
SAVE_CFLAGS=${CFLAGS}
80
82
# The port should be constant for a LONG time
81
83
DRIZZLE_TCP_PORT_DEFAULT=4427
82
84
 
83
 
# We need to hack in some of the non-standard locations that solaris sticks
84
 
# stuff in. This makes me very sad.
85
 
case "$host_os" in
86
 
  solaris*)
87
 
    CPPFLAGS="${CPPFLAGS} -I/opt/csw/include -I/opt/local/include"
88
 
    LDFLAGS="${LDFLAGS} -L/opt/csw/lib -L/opt/csw/lib"
89
 
    ;;
90
 
esac
91
 
 
92
85
m4_include(m4/dtrace.m4)
93
86
 
94
87
m4_include(m4/character_sets.m4)
119
112
    [SYSTEM_TYPE="$host_vendor-$host_os"])
120
113
AC_ARG_WITH([machine-type],
121
114
    [AS_HELP_STRING([--with-machine-type],
122
 
       [Set the machine type, like "powerpc"])],
 
115
       [Set the machine type, like "sparc"])],
123
116
    [MACHINE_TYPE="$withval"],
124
117
    [MACHINE_TYPE="$host_cpu"])
125
118
AC_SUBST(SYSTEM_TYPE)
234
227
then
235
228
  case "$host_cpu" in
236
229
    *ppc* | *powerpc*)
237
 
      AM_CFLAGS="$AM_CFLAGS -mno-fused-madd"
238
 
      AM_CXXFLAGS="$AM_CXXFLAGS -mno-fused-madd"
 
230
      CFLAGS="$CFLAGS -mno-fused-madd"
 
231
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
239
232
    ;;
240
233
  esac
241
234
fi
243
236
# First check for gcc and g++
244
237
if test "$GCC" = "yes"
245
238
then
246
 
  AM_CFLAGS="${AM_CPPFLAGS} -ggdb3 -std=gnu99"
247
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -ggdb3 -std=gnu++98"
 
239
  CFLAGS="${CFLAGS} -ggdb3 -std=gnu99"
 
240
  CXXFLAGS="${CXXFLAGS} -ggdb3 -std=gnu++98"
248
241
 
249
242
  DEBUG_CFLAGS="-O0"
250
243
  DEBUG_CXXFLAGS="-O0"
254
247
fi
255
248
if test "$SUNCC" = "yes"
256
249
then
 
250
  isainfo_k=`isainfo -k`
257
251
  if test "$target_cpu" = "sparc"
258
252
  then
259
253
    MEMALIGN_FLAGS="-xmemalign=8s"
 
254
    IS_64="-m64"
 
255
    LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
 
256
  else
 
257
    if test "$isainfo_k" = "amd64"
 
258
    then
 
259
      IS_64="-m64"
 
260
      LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
 
261
    fi
260
262
  fi
261
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -xlang=c99 -g -compat=5 -library=stlport4 -template=no%extdef ${MEMALIGN_FLAGS}"
262
 
  AM_CFLAGS="${AM_CFLAGS} -g ${MEMALIGN_FLAGS}"
 
263
  CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
 
264
 
 
265
  CXXFLAGS="${CXXFLAGS} -xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS}"
 
266
  CFLAGS="${CFLAGS} -g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS}"
263
267
  DEBUG_CFLAGS="-xO0"
264
268
  DEBUG_CXXFLAGS="-xO0" 
265
269
 
266
 
  OPTIMIZE_FLAGS="-xO4 -xlibmil -xdepend -xprefetch=explicit"
 
270
  dnl TODO: -xO4 causes a Sun Studio failure in innodb... let's check back
 
271
  dnl       in on this one.
 
272
  OPTIMIZE_FLAGS="-xO3 -xlibmil -xdepend"
267
273
  OPTIMIZE_CFLAGS="${OPTIMIZE_FLAGS} -Xa -xstrconst"
268
274
  OPTIMIZE_CXXFLAGS="${OPTIMIZE_FLAGS}"
 
275
 
269
276
fi
270
277
 
271
278
# We use libtool
296
303
if test "$with_debug" = "yes"
297
304
then
298
305
  # Debuging. No optimization.
299
 
  AM_CFLAGS="${DEBUG_CFLAGS} -DDEBUG ${AM_CFLAGS}"
300
 
  AM_CXXFLAGS="${DEBUG_CXXFLAGS} -DDEBUG ${AM_CXXFLAGS}"
 
306
  CFLAGS="${DEBUG_CFLAGS} -DDEBUG ${CFLAGS}"
 
307
  CXXFLAGS="${DEBUG_CXXFLAGS} -DDEBUG ${CXXFLAGS}"
301
308
else
302
309
  # Optimized version. No debug
303
 
  AM_CFLAGS="${OPTIMIZE_CFLAGS} ${AM_CFLAGS}"
304
 
  AM_CXXFLAGS="$OPTIMIZE_CXXFLAGS ${AM_CXXFLAGS}"
 
310
  CFLAGS="${OPTIMIZE_CFLAGS} ${CFLAGS}"
 
311
  CXXFLAGS="${OPTIMIZE_CXXFLAGS} ${CXXFLAGS}"
305
312
fi
306
313
 
307
314
 
395
402
 
396
403
ACX_PTHREAD(,AC_MSG_ERROR(could not find libpthread))
397
404
LIBS="$PTHREAD_LIBS $LIBS"
398
 
AM_CFLAGS="${AM_CFLAGS} $PTHREAD_CFLAGS"
 
405
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
399
406
CC="$PTHREAD_CC"
400
407
 
401
408
#--------------------------------------------------------------------
1336
1343
  NO_REDUNDANT_DECLS="-Wno-redundant-decls"
1337
1344
  # Disable exceptions as they seams to create problems with gcc and threads.
1338
1345
  # drizzled doesn't use run-time-type-checking, so we disable it.
1339
 
  AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"
1340
 
  AM_CPPFLAGS="${AM_CPPFLAGS} -fpch-deps"
 
1346
  CXXFLAGS="${CXXFLAGS} -fno-rtti"
 
1347
  CPPFLAGS="${CPPFLAGS} -fpch-deps"
1341
1348
  PROTOSKIP_WARNINGS="${NO_SHADOW}"
1342
1349
fi
1343
1350
if test "$SUNCC" = "yes"
1344
1351
then
1345
1352
  if test "$ac_datarace" = "yes"
1346
1353
  then
1347
 
    AM_CFLAGS="${AM_CFLAGS} -xinstrument=datarace"
1348
 
    AM_CXXFLAGS="${AM_CXXFLAGS} -xinstrument=datarace"
 
1354
    CFLAGS="${CFLAGS} -xinstrument=datarace"
 
1355
    CXXFLAGS="${CXXFLAGS} -xinstrument=datarace"
1349
1356
  fi
1350
1357
 
1351
1358
  if test "$ac_warn_fail" = "yes"
1353
1360
    W_FAIL="-errwarn=%all"
1354
1361
  fi
1355
1362
 
1356
 
  CC_WARNINGS="-v -xc99=all -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR"
1357
 
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse -compat=5"
1358
 
  #CC_WARNINGS="-v -xc99=all -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR"
1359
 
  #CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder -compat=5"
1360
 
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse"
 
1363
  CC_WARNINGS="-v -errtags=yes -erroff=E_ATTRIBUTE_NOT_VAR ${W_FAIL}"
 
1364
  CXX_WARNINGS="+w +w2 -xport64 -errtags=yes -erroff=attrskipunsup,doubunder,reftotemp,inllargeuse,truncwarn1,signextwarn ${W_FAIL}" 
 
1365
  PROTOSKIP_WARNINGS="-erroff=attrskipunsup,doubunder,reftotemp,wbadinitl,identexpected,inllargeuse,truncwarn1,signextwarn"
1361
1366
  NO_UNREACHED="-erroff=E_STATEMENT_NOT_REACHED"
1362
1367
  if test "$ac_exceptions" = "no"
1363
1368
  then
1365
1370
    W_EXCEPTIONS="-features=except"
1366
1371
  fi
1367
1372
fi
1368
 
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS}  ${AM_CXXFLAGS}"
1369
 
AM_CFLAGS="${CC_WARNINGS} ${AM_CFLAGS}"
1370
 
 
1371
1373
AC_SUBST(NO_EXCEPTIONS)
1372
1374
AC_SUBST(W_EXCEPTIONS)
1373
1375
AC_SUBST(NO_SHADOW)
1376
1378
AC_SUBST(PROTOSKIP_WARNINGS)
1377
1379
AC_SUBST(NO_UNREACHED)
1378
1380
 
1379
 
GLOBAL_CPPFLAGS='-I$(top_srcdir) -I$(top_builddir)'
1380
1381
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1381
1382
then
1382
 
  GLOBAL_CPPFLAGS="${GLOBAL_CPPFLAGS} -I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib"
 
1383
  CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
1383
1384
fi
1384
 
AC_SUBST([GLOBAL_CPPFLAGS])
1385
 
AC_SUBST([AM_CPPFLAGS],['${GLOBAL_CPPFLAGS}'])
1386
 
AC_SUBST([GLOBAL_CXXFLAGS],[${AM_CXXFLAGS}])
 
1385
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
 
1386
 
 
1387
AM_CPPFLAGS="${CPPFLAGS}"
 
1388
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
 
1389
AM_CXXFLAGS="${CXX_WARNINGS} ${NO_EXCEPTIONS} ${CXXFLAGS}"
 
1390
 
 
1391
AC_SUBST([AM_CPPFLAGS])
1387
1392
AC_SUBST([AM_CFLAGS])
1388
1393
AC_SUBST([AM_CXXFLAGS])
1389
1394
 
1390
 
 
1391
 
# Some usefull subst
1392
 
AC_SUBST(CC)
1393
 
AC_SUBST(GXX)
1394
 
 
1395
 
# Set configuration options for make_binary_distribution
1396
 
case $SYSTEM_TYPE in
1397
 
  *netware*)
1398
 
    MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --no-strip"
1399
 
    ;;
1400
 
  *)
1401
 
    : # no change for other platforms yet
1402
 
    ;;
1403
 
esac
1404
 
AC_SUBST(MAKE_BINARY_DISTRIBUTION_OPTIONS)
 
1395
dnl We've collected the flags in AM_*FLAGS now, so blank these.
 
1396
CFLAGS=""
 
1397
CXXFLAGS=""
 
1398
CPPFLAGS=""
1405
1399
 
1406
1400
AC_SUBST(pkgplugindir,"\$(pkglibdir)/plugin")
1407
1401
 
1489
1483
echo "   * C++ cmath namespace:       $ac_cv_cxx_cmath_namespace"
1490
1484
echo ""
1491
1485
echo "---"
 
1486
 
 
1487
dnl libtoolize scans configure.ac  and needs to see some text
 
1488
m4_define([LIBTOOLIZE_AC_INIT], [])