Several macro names have been updated (according to what autoupdate
suggests: AC_CANONICAL_[SYSTEM->TARGET], AC_TRY_LINK-> AC_LINK_IFELSE,
AC_TRY_COMPILE -> AC_COMPILE_IFELSE). These are the preferred ones if we
agree on using autoconf 2.61.

We also add a new --enable-debug switch which is propagated from
toplevel; feel free to ignore this part for now.

Signed-off-by: Robert Schwebel <[EMAIL PROTECTED]>

 libffi/configure.ac |   35 ++++++++++++++++++++++-------------
 1 file changed, 22 insertions(+), 13 deletions(-)

Index: libffi/configure.ac
===================================================================
--- libffi/configure.ac.orig
+++ libffi/configure.ac
@@ -1,13 +1,13 @@
 dnl Process this with autoconf to create configure
 
-AC_PREREQ(2.59)
+AC_PREREQ(2.61)
 
 AC_INIT([libffi], [2.1], [http://gcc.gnu.org/bugs.html])
 AC_CONFIG_HEADERS([fficonfig.h])
 
-AM_ENABLE_MULTILIB(,)
+# AM_ENABLE_MULTILIB(, ..)
 
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_HOST
 target_alias=${target_alias-$host_alias}
 
 . ${srcdir}/configure.host
@@ -144,9 +144,7 @@ if test x$TARGET = xSPARC; then
        save_LDFLAGS="$LDFLAGS"
        CFLAGS="$CFLAGS -fpic"
        LDFLAGS="$LDFLAGS -shared"
-       AC_TRY_LINK([asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword 
%r_disp32(foo); .text");],,
-                   [libffi_cv_as_sparc_ua_pcrel=yes],
-                   [libffi_cv_as_sparc_ua_pcrel=no])
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([[asm (".text; foo: nop; .data; .align 
4; .byte 0; .uaword %r_disp32(foo); .text");]], 
[[]])],[libffi_cv_as_sparc_ua_pcrel=yes],[libffi_cv_as_sparc_ua_pcrel=no])
        CFLAGS="$save_CFLAGS"
        LDFLAGS="$save_LDFLAGS"])
     if test "x$libffi_cv_as_sparc_ua_pcrel" = xyes; then
@@ -158,9 +156,7 @@ if test x$TARGET = xSPARC; then
        libffi_cv_as_register_pseudo_op, [
        libffi_cv_as_register_pseudo_op=unknown
        # Check if we have .register
-       AC_TRY_COMPILE([asm (".register %g2, #scratch");],,
-                      [libffi_cv_as_register_pseudo_op=yes],
-                      [libffi_cv_as_register_pseudo_op=no])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm (".register %g2, 
#scratch");]], 
[[]])],[libffi_cv_as_register_pseudo_op=yes],[libffi_cv_as_register_pseudo_op=no])
     ])
     if test "x$libffi_cv_as_register_pseudo_op" = xyes; then
        AC_DEFINE(HAVE_AS_REGISTER_PSEUDO_OP, 1,
@@ -229,11 +225,24 @@ AC_SUBST(TARGETDIR)
 
 AC_SUBST(SHELL)
 
+#
+# Debugging
+#
+AC_MSG_CHECKING([whether to enable debugging])
 AC_ARG_ENABLE(debug,
-[  --enable-debug          debugging mode],
-  if test "$enable_debug" = "yes"; then
-    AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging.])
-  fi)
+    AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=yes@:>@]),
+        [case "$enableval" in
+        y | yes) CONFIG_DEBUG=yes ;;
+        *) CONFIG_DEBUG=no ;;
+    esac],
+    [CONFIG_DEBUG=yes])
+AC_MSG_RESULT([${CONFIG_DEBUG}])
+if test "${CONFIG_DEBUG}" = "yes"; then
+    CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security -g 
-O1"
+    AC_DEFINE(FFI_DEBUG, 1, [Define this if you want extra debugging])
+else
+    CFLAGS="${CFLAGS} -O2"
+fi
 
 AC_ARG_ENABLE(structs,
 [  --disable-structs       omit code for struct support],

--
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9

_______________________________________________
Developers mailing list
[email protected]
http://dotgnu.org/mailman/listinfo/developers

Reply via email to