Lines 10020-10036
Link Here
|
10020 |
|
10020 |
|
10021 |
|
10021 |
|
10022 |
|
10022 |
|
10023 |
dnl XDT_FEATURE_DEBUG() |
10023 |
dnl XDT_FEATURE_DEBUG(default_level=minimum) |
10024 |
dnl |
10024 |
dnl |
10025 |
AC_DEFUN([XDT_FEATURE_DEBUG], |
10025 |
AC_DEFUN([XDT_FEATURE_DEBUG], |
10026 |
[ |
10026 |
[ |
|
|
10027 |
dnl weird indentation to keep output indentation correct |
10027 |
AC_ARG_ENABLE([debug], |
10028 |
AC_ARG_ENABLE([debug], |
10028 |
AC_HELP_STRING([--enable-debug[=yes|no|full]], [Build with debugging support]) |
10029 |
AC_HELP_STRING([--enable-debug@<:@=no|minimum|yes|full@:>@], |
10029 |
AC_HELP_STRING([--disable-debug], [Include no debugging support [default]]), |
10030 |
[Build with debugging support @<:@default=m4_default([$1], [minimum])@:>@]) |
10030 |
[], [enable_debug=no]) |
10031 |
AC_HELP_STRING([--disable-debug], [Include no debugging support]), |
|
|
10032 |
[enable_debug=$enableval], [enable_debug=m4_default([$1], [minimum])]) |
10031 |
|
10033 |
|
10032 |
AC_MSG_CHECKING([whether to build with debugging support]) |
10034 |
AC_MSG_CHECKING([whether to build with debugging support]) |
10033 |
if test x"$enable_debug" != x"no"; then |
10035 |
if test x"$enable_debug" = x"full" -o x"$enable_debug" = x"yes"; then |
10034 |
AC_DEFINE([DEBUG], [1], [Define for debugging support]) |
10036 |
AC_DEFINE([DEBUG], [1], [Define for debugging support]) |
10035 |
|
10037 |
|
10036 |
xdt_cv_additional_CFLAGS="-DXFCE_DISABLE_DEPRECATED \ |
10038 |
xdt_cv_additional_CFLAGS="-DXFCE_DISABLE_DEPRECATED \ |
Lines 10043-10053
Link Here
|
10043 |
-Wcast-align -Wformat-security \ |
10045 |
-Wcast-align -Wformat-security \ |
10044 |
-Winit-self -Wmissing-include-dirs -Wundef \ |
10046 |
-Winit-self -Wmissing-include-dirs -Wundef \ |
10045 |
-Wmissing-format-attribute -Wnested-externs \ |
10047 |
-Wmissing-format-attribute -Wnested-externs \ |
10046 |
-fstack-protector -D_FORTIFY_SOURCE=2" |
10048 |
-fstack-protector" |
|
|
10049 |
CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" |
10047 |
|
10050 |
|
10048 |
if test x"$enable_debug" = x"full"; then |
10051 |
if test x"$enable_debug" = x"full"; then |
10049 |
AC_DEFINE([DEBUG_TRACE], [1], [Define for tracing support]) |
10052 |
AC_DEFINE([DEBUG_TRACE], [1], [Define for tracing support]) |
10050 |
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -g3 -Werror" |
10053 |
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -O0 -g3 -Werror" |
|
|
10054 |
CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG" |
10051 |
AC_MSG_RESULT([full]) |
10055 |
AC_MSG_RESULT([full]) |
10052 |
else |
10056 |
else |
10053 |
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -g" |
10057 |
xdt_cv_additional_CFLAGS="$xdt_cv_additional_CFLAGS -g" |
Lines 10070-10080
Link Here
|
10070 |
CFLAGS="$CFLAGS $supported_CFLAGS" |
10074 |
CFLAGS="$CFLAGS $supported_CFLAGS" |
10071 |
CXXFLAGS="$CXXFLAGS $supported_CXXFLAGS" |
10075 |
CXXFLAGS="$CXXFLAGS $supported_CXXFLAGS" |
10072 |
else |
10076 |
else |
10073 |
AC_MSG_RESULT([no]) |
10077 |
CPPFLAGS="$CPPFLAGS -DNDEBUG" |
|
|
10078 |
|
10079 |
if test x"$enable_debug" = x"no"; then |
10080 |
CPPFLAGS="$CPPFLAGS -DG_DISABLE_CAST_CHECKS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS" |
10081 |
AC_MSG_RESULT([no]) |
10082 |
else |
10083 |
AC_MSG_RESULT([minimum]) |
10084 |
fi |
10074 |
fi |
10085 |
fi |
10075 |
]) |
10086 |
]) |
10076 |
|
10087 |
|
10077 |
|
10088 |
|
|
|
10089 |
dnl XDT_FEATURE_VISIBILITY() |
10090 |
dnl |
10091 |
dnl Checks to see if the compiler supports the 'visibility' attribute |
10092 |
dnl If so, adds -DHAVE_GNUC_VISIBILTY to CPPFLAGS. Also sets the |
10093 |
dnl automake conditional HAVE_GNUC_VISIBILITY. |
10094 |
dnl |
10095 |
AC_DEFUN([XDT_FEATURE_VISIBILITY], |
10096 |
[ |
10097 |
AC_ARG_ENABLE([visibility], |
10098 |
AC_HELP_STRING([--disable-visibility], |
10099 |
[Don't use ELF visibility attributes]), |
10100 |
[enable_visibility=$enableval], [enable_visibility=yes]) |
10101 |
have_gnuc_visibility=no |
10102 |
if test "x$enable_visibility" != "xno"; then |
10103 |
XDT_SUPPORTED_FLAGS([xdt_vis_test_cflags], [-Wall -Werror -Wno-unused-parameter]) |
10104 |
saved_CFLAGS="$CFLAGS" |
10105 |
CFLAGS="$CFLAGS $xdt_vis_test_cflags" |
10106 |
AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute]) |
10107 |
AC_COMPILE_IFELSE(AC_LANG_SOURCE( |
10108 |
[ |
10109 |
void test_default (void); |
10110 |
void test_hidden (void); |
10111 |
|
10112 |
void __attribute__ ((visibility("default"))) test_default (void) {} |
10113 |
void __attribute__ ((visibility("hidden"))) test_hidden (void) {} |
10114 |
|
10115 |
int main (int argc, char **argv) { |
10116 |
test_default (); |
10117 |
test_hidden (); |
10118 |
return 0; |
10119 |
} |
10120 |
]), |
10121 |
[ |
10122 |
have_gnuc_visibility=yes |
10123 |
AC_MSG_RESULT([yes]) |
10124 |
], |
10125 |
[ |
10126 |
AC_MSG_RESULT([no]) |
10127 |
]) |
10128 |
CFLAGS="$saved_CFLAGS" |
10129 |
fi |
10130 |
|
10131 |
if test "x$have_gnuc_visibility" = "xyes"; then |
10132 |
CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY" |
10133 |
XDT_SUPPORTED_FLAGS([xdt_vis_hidden_cflags], [-fvisibility=hidden]) |
10134 |
CFLAGS="$CFLAGS $xdt_vis_hidden_cflags" |
10135 |
fi |
10136 |
|
10137 |
AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test "x$have_gnuc_visibility" = "xyes"]) |
10138 |
]) |
10139 |
|
10140 |
dnl XDT_FEATURE_LINKER_OPTS |
10141 |
dnl |
10142 |
dnl Checks for and enables any special linker optimizations. |
10143 |
dnl |
10144 |
AC_DEFUN([XDT_FEATURE_LINKER_OPTS], |
10145 |
[ |
10146 |
AC_ARG_ENABLE([linker-opts], |
10147 |
AC_HELP_STRING([--disable-linker-opts], |
10148 |
[Disable linker optimizations]), |
10149 |
[enable_linker_opts=$enableval], [enable_linker_opts=yes]) |
10150 |
|
10151 |
if test "x$enable_linker_opts" != "xno"; then |
10152 |
AC_MSG_CHECKING([whether $LD accepts --as-needed]) |
10153 |
case `$LD --as-needed -v 2>&1 </dev/null` in |
10154 |
*GNU* | *'with BFD'*) |
10155 |
LDFLAGS="$LDFLAGS -Wl,--as-needed" |
10156 |
AC_MSG_RESULT([yes]) |
10157 |
;; |
10158 |
*) |
10159 |
AC_MSG_RESULT([no]) |
10160 |
;; |
10161 |
esac |
10162 |
AC_MSG_CHECKING([whether $LD accepts -O1]) |
10163 |
case `$LD -O1 -v 2>&1 </dev/null` in |
10164 |
*GNU* | *'with BFD'*) |
10165 |
LDFLAGS="$LDFLAGS -Wl,-O1" |
10166 |
AC_MSG_RESULT([yes]) |
10167 |
;; |
10168 |
*) |
10169 |
AC_MSG_RESULT([no]) |
10170 |
;; |
10171 |
esac |
10172 |
fi |
10173 |
]) |
10078 |
|
10174 |
|
10079 |
dnl BM_DEBUG_SUPPORT() |
10175 |
dnl BM_DEBUG_SUPPORT() |
10080 |
dnl |
10176 |
dnl |