~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Monty Taylor
  • Date: 2009-03-10 00:05:04 UTC
  • mfrom: (919.2.22 mordred)
  • mto: This revision was merged to the branch mainline in revision 928.
  • Revision ID: mordred@inaugust.com-20090310000504-sx3b9kgdkjcame63
MergedĀ fromĀ Solaris.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
m4_include(m4/character_sets.m4)
117
117
AC_SUBST(AVAILABLE_LANGUAGES)
118
118
 
119
 
m4_include(m4/gettext.m4)
120
 
AM_GNU_GETTEXT(external, need-formatstring-macros)
121
 
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
122
 
then
123
 
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
124
 
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
125
 
  MSGMERGE="${GMSGMERGE}"
126
 
fi
127
 
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
128
 
 
129
119
 
130
120
# Set this for plugins to use
131
121
ac_build_drizzle="yes"
201
191
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
202
192
fi
203
193
 
204
 
dnl  Solaris 9 include file <sys/feature_tests.h> refers to X/Open document
205
 
 
206
 
dnl  System Interfaces and Headers, Issue 5
207
 
 
208
 
dnl  saying we should define _XOPEN_SOURCE=500 to get POSIX.1c prototypes,
209
 
dnl  but apparently other systems (namely FreeBSD) don't agree.
210
 
 
211
 
dnl  On a newer Solaris 10, the above file recognizes also _XOPEN_SOURCE=600.
212
 
dnl  Furthermore, it tests that if a program requires older standard
213
 
dnl  (_XOPEN_SOURCE<600 or _POSIX_C_SOURCE<200112L) it cannot be
214
 
dnl  run on a new compiler (that defines _STDC_C99) and issues an #error.
215
 
dnl  It's also an #error if a program requires new standard (_XOPEN_SOURCE=600
216
 
dnl  or _POSIX_C_SOURCE=200112L) and a compiler does not define _STDC_C99.
217
 
 
218
 
dnl  To add more to this mess, Sun Studio C compiler defines _STDC_C99 while
219
 
dnl  C++ compiler does not!
220
 
 
221
 
dnl TODO: Can _ISOC99_SOURCE be defined on all platforms and remove the 
222
 
dnl       Need for all of this? 
 
194
dnl C99 is illegal in C++... but these turn on extensions to the standard
 
195
dnl On Solars. This whole block is sort of silly atm, since we don't do 
 
196
dnl GCC on Solaris.
223
197
if test "$GCC" = "yes"
224
198
then
225
199
  case "$target_os" in
226
200
    *solaris*)
227
201
    AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
228
202
    AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
 
203
    AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
229
204
    ;;
230
205
  esac
231
206
fi
247
222
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
248
223
fi
249
224
 
250
 
 
251
 
# The following is required for portable results of floating point calculations
252
 
# on PowerPC. The same must also be done for IA-64, but this options is missing
253
 
# in the IA-64 gcc backend.
254
 
 
 
225
# Build optimized or debug version ?
 
226
# First check for gcc and g++
255
227
if test "$GCC" = "yes"
256
228
then
 
229
  dnl The following is required for portable results of floating point 
 
230
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
 
231
  dnl this options is missing in the IA-64 gcc backend.
257
232
  case "$host_cpu" in
258
233
    *ppc* | *powerpc*)
259
 
      CFLAGS="$CFLAGS -mno-fused-madd"
260
 
      CXXFLAGS="$CXXFLAGS -mno-fused-madd"
 
234
      CFLAGS="-mno-fused-madd ${CFLAGS}"
 
235
      CXXFLAGS="-mno-fused-madd ${CXXFLAGS}"
261
236
    ;;
262
237
  esac
263
 
fi
264
 
# Build optimized or debug version ?
265
 
# First check for gcc and g++
266
 
if test "$GCC" = "yes"
267
 
then
268
 
  CFLAGS="${CFLAGS} -ggdb3 -std=gnu99"
269
 
  CXXFLAGS="${CXXFLAGS} -ggdb3 -std=gnu++98"
 
238
 
 
239
  CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
 
240
  CXXFLAGS="-ggdb3 ${CXXFLAGS}"
 
241
  AC_CXX_CHECK_STANDARD
 
242
  
270
243
 
271
244
  DEBUG_CFLAGS="-O0"
272
245
  DEBUG_CXXFLAGS="-O0"
276
249
fi
277
250
if test "$SUNCC" = "yes"
278
251
then
 
252
  dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
 
253
  dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
279
254
  isainfo_k=`isainfo -k`
280
255
  if test "$target_cpu" = "sparc"
281
256
  then
282
257
    MEMALIGN_FLAGS="-xmemalign=8s"
283
258
    IS_64="-m64"
284
 
    LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
285
259
  else
286
260
    if test "$isainfo_k" = "amd64"
287
261
    then
288
262
      IS_64="-m64"
289
 
      LDFLAGS="${LDFLAGS} -L/usr/lib/${isainfo_k} -L/usr/local/lib/${isainfo_k}"
290
263
    fi
291
264
  fi
292
 
  CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
 
265
  LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_k} -L/usr/local/lib -L/opt/csw/lib/${isainfo_k} -L/opt/csw/lib -L/usr/lib/${isainfo_k}"
 
266
  CPPFLAGS="${CPPFLAGS} -I/usr/local/include -I/opt/csw/include"
293
267
 
294
 
  CXXFLAGS="${CXXFLAGS} -xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS}"
295
 
  CFLAGS="${CFLAGS} -g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS}"
 
268
  CXXFLAGS="-xlang=c99 -g -mt -compat=5 -library=stlport4 -template=no%extdef ${IS_64} ${MEMALIGN_FLAGS} ${CXXFLAGS}"
 
269
  CFLAGS="-g -mt -xc99=all ${IS_64} ${MEMALIGN_FLAGS} ${CFLAGS}"
296
270
  DEBUG_CFLAGS="-xO0"
297
271
  DEBUG_CXXFLAGS="-xO0" 
298
272
 
304
278
 
305
279
fi
306
280
 
 
281
m4_include(m4/gettext.m4)
 
282
AM_GNU_GETTEXT(external, need-formatstring-macros)
 
283
if test "x$MSGMERGE" = "x" -o "x$MSGMERGE" = "x:"
 
284
then
 
285
  AM_PATH_PROG_WITH_TEST(GMSGMERGE, gmsgmerge,
 
286
    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
 
287
  MSGMERGE="${GMSGMERGE}"
 
288
fi
 
289
AM_CONDITIONAL([BUILD_GETTEXT],[test "x$MSGMERGE" != "x" -a "x$MSGMERGE" != "x:"])
 
290
 
 
291
 
307
292
# We use libtool
308
293
AC_PROG_LIBTOOL
309
294
 
344
329
AC_CXX_STL_HASH
345
330
AC_CXX_CSTDINT
346
331
AC_CXX_CINTTYPES
 
332
AC_CXX_SHARED_PTR
347
333
 
348
334
DRIZZLE_PROG_AR
349
335
 
1296
1282
 
1297
1283
  if test "$ac_warn_pedantic" = "yes"
1298
1284
  then
1299
 
    save_CXXFLAGS="${CXXFLAGS}"
1300
 
    CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1301
1285
    AC_CACHE_CHECK([whether it is safe to use -Wredundant-decls],
1302
1286
      [ac_cv_safe_to_use_Wredundant_decls_],
1303
1287
      [AC_LANG_PUSH(C++)
 
1288
       save_CXXFLAGS="${CXXFLAGS}"
 
1289
       CXXFLAGS="${CXXFLAGS} ${W_FAIL} -Wredundant-decls"
1304
1290
       AC_COMPILE_IFELSE(
1305
1291
         [AC_LANG_PROGRAM([
1306
1292
template <typename E> struct C { void foo(); };
1309
1295
            AC_INCLUDES_DEFAULT])],
1310
1296
          [ac_cv_safe_to_use_Wredundant_decls_=yes],
1311
1297
          [ac_cv_safe_to_use_Wredundant_decls_=no])
 
1298
        CXXFLAGS="${save_CXXFLAGS}"
1312
1299
        AC_LANG_POP()])
1313
1300
    if test $ac_cv_safe_to_use_Wredundant_decls_ = yes
1314
1301
    then
1337
1324
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1338
1325
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1339
1326
    fi
1340
 
 
1341
 
    CXXFLAGS="${save_CXXFLAGS}"
1342
1327
  fi
1343
1328
 
1344
1329
  if test "$ac_warn_unreachable" = "yes"
1361
1346
    W_CONVERSION="-Wconversion"
1362
1347
  fi
1363
1348
 
1364
 
  CC_WARNINGS="${C99_SUPPORT_HACK} ${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
 
1349
  CC_WARNINGS="${BASE_WARNINGS} ${GCC_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_SHADOW} ${W_CONVERSION}"
1365
1350
  CXX_WARNINGS="${BASE_WARNINGS} ${GXX_PEDANTIC} ${W_UNREACHABLE} ${GPROF_PROFILING} ${GPROF_COVERAGE} ${W_CAST} ${W_SHADOW} ${W_EFFC} ${W_CONVERSION}"
1366
1351
 
1367
1352
  if test "$ac_exceptions" = "no"
1376
1361
then
1377
1362
  if test "$ac_datarace" = "yes"
1378
1363
  then
1379
 
    CFLAGS="${CFLAGS} -xinstrument=datarace"
1380
 
    CXXFLAGS="${CXXFLAGS} -xinstrument=datarace"
 
1364
    CFLAGS="-xinstrument=datarace ${CFLAGS}"
 
1365
    CXXFLAGS="-xinstrument=datarace ${CXXFLAGS}"
1381
1366
  fi
1382
1367
 
1383
1368
  if test "$ac_warn_fail" = "yes"
1506
1491
echo "   * C++ cstdint location:      $ac_cv_cxx_cstdint"
1507
1492
echo "   * C++ hash_map location:     $ac_cv_cxx_hash_map"
1508
1493
echo "   * C++ hash namespace:        $ac_cv_cxx_hash_namespace"
 
1494
echo "   * C++ shared_ptr namespace:  $ac_cv_shared_ptr_namespace"
1509
1495
echo ""
1510
1496
echo "---"
1511
1497