~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to configure.ac

Merged solaris gcc build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
 
184
184
AM_CONDITIONAL(HAVE_LCOV,[test "x$LCOV" != "x"])
185
185
 
186
 
dnl TODO: This needs to go away and be replaced with _ISOC99_SOURCE
187
 
if test "$ac_cv_c_compiler_gnu" = "yes" -o "$target_os" = "linux-gnu"
188
 
then
189
 
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
190
 
fi
191
 
 
192
 
dnl C99 is illegal in C++... but these turn on extensions to the standard
193
 
dnl On Solars. This whole block is sort of silly atm, since we don't do 
194
 
dnl GCC on Solaris.
195
 
if test "$GCC" = "yes"
196
 
then
197
 
  case "$target_os" in
198
 
    *solaris*)
199
 
    AC_DEFINE([_XOPEN_SOURCE],[600],[Turn on XOpen 6.0 Features])
200
 
    AC_DEFINE([__C99FEATURES__],[1],[Turn on C99 Features for C++])
201
 
    AC_DEFINE([__XPG6],[1],[Turn on C99/XOpen Group 6 Extensions])
202
 
    ;;
203
 
  esac
204
 
fi
205
 
 
206
186
AC_SUBST(NM)dnl
207
187
 
208
188
AC_PROG_INSTALL
220
200
  AC_MSG_ERROR(["bison is required for Drizzle to build from a bzr branch"])
221
201
fi
222
202
 
 
203
  isainfo_b=`isainfo -b`
 
204
 
223
205
# Build optimized or debug version ?
224
206
# First check for gcc and g++
225
207
if test "$GCC" = "yes"
226
208
then
 
209
  if test "$isainfo_b" = "64"
 
210
  then
 
211
    IS_64="-m64"
 
212
  fi
 
213
  AC_DEFINE([_GNU_SOURCE],[1],[Fix problem with S_ISLNK() on Linux])
 
214
 
227
215
  dnl The following is required for portable results of floating point 
228
216
  dnl calculations on PowerPC. The same must also be done for IA-64, but 
229
217
  dnl this options is missing in the IA-64 gcc backend.
234
222
    ;;
235
223
  esac
236
224
 
237
 
  CFLAGS="-ggdb3 -std=gnu99 ${CFLAGS}"
238
 
  CXXFLAGS="-ggdb3 ${CXXFLAGS}"
 
225
  CFLAGS="-ggdb3 ${IS_64} -std=gnu99 ${CFLAGS}"
 
226
  CXXFLAGS="-ggdb3  ${IS_64} ${CXXFLAGS}"
239
227
  AC_CXX_CHECK_STANDARD
240
228
  
241
229
 
247
235
fi
248
236
if test "$SUNCC" = "yes"
249
237
then
 
238
  if test "$isainfo_b" = "64"
 
239
  then
 
240
    IS_64="-m64"
 
241
  fi
250
242
  dnl we put CPPFLAGS and LDFLAGS first here, because if the user has specified
251
243
  dnl command line CPPFLAGS or LDFLAGS, their -I or -L should come _first_
252
244
  if test "$target_cpu" = "sparc"
254
246
    MEMALIGN_FLAGS="-xmemalign=8s"
255
247
  fi
256
248
 
257
 
  isainfo_b=`isainfo -b`
258
 
  if test "$isainfo_b" = "64"
259
 
  then
260
 
    IS_64="-m64"
261
 
  fi
262
249
  if test "x$use_additional" != "xyes"
263
250
  then
264
251
    LDFLAGS="${LDFLAGS} -L/usr/local/lib/${isainfo_b} -L/usr/local/lib -L/opt/csw/lib/${isainfo_b} -L/opt/csw/lib"
1308
1295
    
1309
1296
    GCC_PEDANTIC="-pedantic -Wundef -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls ${W_STRICT_ALIASING}"
1310
1297
    GXX_PEDANTIC="-pedantic -Wundef -Woverloaded-virtual  -Wnon-virtual-dtor -Wctor-dtor-privacy ${GXX_W_REDUNDANT_DECLS} ${W_LONGLONG} ${W_STRICT_ALIASING}"
1311
 
 
1312
 
    AC_CACHE_CHECK([whether __attribute__ visibility "hidden" is supported],
1313
 
      [ac_cv_can_use_hidden_],
1314
 
      [AC_LANG_PUSH(C++)
1315
 
       AC_COMPILE_IFELSE(
1316
 
         [AC_LANG_PROGRAM([
1317
 
          AC_INCLUDES_DEFAULT
1318
 
__attribute__((visibility ("hidden")))
1319
 
void testme() {  };],[
1320
 
     testme();])],  
1321
 
         [ac_cv_can_use_hidden_=yes],
1322
 
         [ac_cv_can_use_hidden_=no])
1323
 
       AC_LANG_POP()])
1324
 
    if test "$ac_cv_can_use_hidden_" = "yes"
1325
 
    then
1326
 
      AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
1327
 
                [Define to 1 if you have support for __attribute__((visibility("hidden")))])
1328
 
    fi
1329
1298
  fi
1330
1299
 
1331
1300
  if test "$ac_warn_unreachable" = "yes"
1392
1361
 
1393
1362
if test "$ac_cv_func_timegm" = "no" -o "$gl_cv_func_gnu_getopt" = "no"
1394
1363
then
1395
 
  CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
 
1364
  if test "$GCC" = "yes"
 
1365
  then
 
1366
    CPPFLAGS="-isystem \$(top_srcdir)/gnulib -isystem \$(top_builddir)/gnulib ${CPPFLAGS}"
 
1367
  else
 
1368
    CPPFLAGS="-I\$(top_srcdir)/gnulib -I\$(top_builddir)/gnulib ${CPPFLAGS}"
 
1369
  fi
1396
1370
fi
1397
1371
CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
1398
1372
 
 
1373
/* Must be done once we turn on warnings and such */
 
1374
AC_CACHE_CHECK(
 
1375
  [whether __attribute__ visibility "hidden" is supported],
 
1376
  [ac_cv_can_use_hidden_],
 
1377
  [AC_LANG_PUSH(C++)
 
1378
   AC_COMPILE_IFELSE([
 
1379
     AC_LANG_PROGRAM([[
 
1380
__attribute__((visibility ("hidden")))
 
1381
void testme() {  };],[
 
1382
     testme();]]
 
1383
     )],  
 
1384
   [ac_cv_can_use_hidden_=yes],
 
1385
   [ac_cv_can_use_hidden_=no])
 
1386
  AC_LANG_POP()])
 
1387
if test "$ac_cv_can_use_hidden_" = "yes"
 
1388
then
 
1389
  AC_DEFINE(HAVE_ATTR_HIDDEN, 1,
 
1390
  [Define to 1 if you have support for __attribute__((visibility("hidden")))])
 
1391
fi
 
1392
 
1399
1393
AM_CPPFLAGS="${CPPFLAGS}"
1400
1394
AM_CFLAGS="${CC_WARNINGS} ${CFLAGS}"
1401
1395
AM_CXXFLAGS="${CXX_WARNINGS} ${W_EXCEPTIONS} ${CXXFLAGS}"