[Ada] Consistently use explicit Entity_Id type instead of alias
[gcc.git] / libbacktrace / configure
index b72380ebcb20fa62e778926b0b276df44288e9b2..8c8c34d45cfe7975b7b2589d2d1a364545efbb54 100755 (executable)
@@ -635,8 +635,18 @@ LTLIBOBJS
 LIBOBJS
 NATIVE_FALSE
 NATIVE_TRUE
-HAVE_DSYMUTIL_FALSE
-HAVE_DSYMUTIL_TRUE
+HAVE_LIBLZMA_FALSE
+HAVE_LIBLZMA_TRUE
+HAVE_MINIDEBUG_FALSE
+HAVE_MINIDEBUG_TRUE
+HAVE_COMM_FALSE
+HAVE_COMM_TRUE
+COMM
+HAVE_XZ_FALSE
+HAVE_XZ_TRUE
+XZ
+USE_DSYMUTIL_FALSE
+USE_DSYMUTIL_TRUE
 HAVE_OBJCOPY_DEBUGLINK_FALSE
 HAVE_OBJCOPY_DEBUGLINK_TRUE
 READELF
@@ -804,7 +814,8 @@ LIBS
 CPPFLAGS
 CPP
 OBJCOPY
-DSYMUTIL'
+DSYMUTIL
+NM'
 
 
 # Initialize some variables set by options.
@@ -1436,7 +1447,7 @@ Optional Features:
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --disable-largefile     omit support for large files
-  --enable-cet            enable Intel CET in target libraries [default=no]
+  --enable-cet            enable Intel CET in target libraries [default=auto]
   --enable-host-shared    build host code as shared libraries
   --enable-cet            enable Intel CET in host libraries [default=auto]
 
@@ -1460,6 +1471,7 @@ Some influential environment variables:
   CPP         C preprocessor
   OBJCOPY     location of objcopy
   DSYMUTIL    location of dsymutil
+  NM          location of nm
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -11505,7 +11517,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11508 "configure"
+#line 11520 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11611,7 +11623,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11614 "configure"
+#line 11626 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12156,19 +12168,22 @@ if test "${enable_cet+set}" = set; then :
                           esac
 
 else
-  enable_cet=no
+  enable_cet=auto
 fi
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CET support" >&5
 $as_echo_n "checking for CET support... " >&6; }
 
+# NB: Avoid nested save_CFLAGS and save_LDFLAGS.
 case "$host" in
   i[34567]86-*-linux* | x86_64-*-linux*)
     case "$enable_cet" in
       auto)
        # Check if target supports multi-byte NOPs
-       # and if assembler supports CET insn.
+       # and if compiler and assembler support CET insn.
+       cet_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -fcf-protection"
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12192,6 +12207,7 @@ else
   enable_cet=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       CFLAGS="$cet_save_CFLAGS"
        ;;
       yes)
        # Check if assembler supports CET.
@@ -12400,12 +12416,12 @@ $as_echo_n "checking for CET support... " >&6; }
 case "$host" in
   i[34567]86-*-linux* | x86_64-*-linux*)
     may_have_cet=yes
-    save_CFLAGS="$CFLAGS"
+    cet_save_CFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -fcf-protection"
     case "$enable_cet" in
       auto)
        # Check if target supports multi-byte NOPs
-       # and if assembler supports CET insn.
+       # and if compiler and assembler support CET.
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12431,7 +12447,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
        ;;
       yes)
-       # Check if assembler supports CET.
+       # Check if compiler and assembler support CET.
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12444,14 +12460,27 @@ asm ("setssbsy");
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-
+  support_cet=yes
 else
-  as_fn_error $? "assembler with CET support is required for --enable-cet" "$LINENO" 5
+  support_cet=no
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       if test $support_cet = "no"; then
+         if test x$enable_bootstrap != xno \
+            && test -z "${with_build_subdir}" \
+            && (test ! -f ../stage_current \
+                || test `cat ../stage_current` != "stage1"); then
+           # Require CET support only for the final GCC build.
+           as_fn_error $? "compiler and assembler with CET support are required for --enable-cet" "$LINENO" 5
+         else
+           # Don't enable CET without CET support for non-bootstrap
+           # build, in stage1 nor for build support.
+           enable_cet=no
+         fi
+       fi
        ;;
     esac
-    CFLAGS="$save_CFLAGS"
+    CFLAGS="$cet_save_CFLAGS"
     ;;
   *)
     may_have_cet=no
@@ -12459,9 +12488,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     ;;
 esac
 
-save_CFLAGS="$CFLAGS"
+cet_save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -fcf-protection=none"
-save_LDFLAGS="$LDFLAGS"
+cet_save_LDFLAGS="$LDFLAGS"
 LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
 if test x$may_have_cet = xyes; then
   # Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.
@@ -12486,7 +12515,8 @@ rm -f core conftest.err conftest.$ac_objext \
 fi
 
 if test x$may_have_cet = xyes; then
-  if test "$cross_compiling" = yes; then :
+  if test x$cross_compiling = xno; then
+    if test "$cross_compiling" = yes; then :
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
@@ -12531,9 +12561,14 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-  if test x$enable_cet = xno -a x$have_cet = xyes; then
-    as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    if test x$enable_cet = xno -a x$have_cet = xyes; then
+      as_fn_error $? "Intel CET must be enabled on Intel CET enabled host" "$LINENO" 5
+    fi
   fi
+else
+  # Enable CET in cross compiler if possible so that it will run on both
+  # CET and non-CET hosts.
+  have_cet=yes
 fi
 if test x$enable_cet = xyes; then
   CET_HOST_FLAGS="-fcf-protection"
@@ -12543,8 +12578,8 @@ else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
-CFLAGS="$save_CFLAGS"
-LDFLAGS="$save_LDFLAGS"
+CFLAGS="$cet_save_CFLAGS"
+LDFLAGS="$cet_save_LDFLAGS"
 
 case x$enable_languages in
 *jit*)
@@ -13568,13 +13603,21 @@ CFLAGS="$CFLAGS -gdwarf-5"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int i;
+int
+main ()
+{
+return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
   libbacktrace_cv_lib_dwarf5=yes
 else
   libbacktrace_cv_lib_dwarf5=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
 CFLAGS=$CFLAGS_hold
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libbacktrace_cv_lib_dwarf5" >&5
@@ -13817,12 +13860,202 @@ $as_echo "no" >&6; }
 fi
 
 
- if test -n "${DSYMUTIL}"; then
-  HAVE_DSYMUTIL_TRUE=
-  HAVE_DSYMUTIL_FALSE='#'
+ if test -n "${DSYMUTIL}" -a "$FORMAT_FILE" = "macho.lo"; then
+  USE_DSYMUTIL_TRUE=
+  USE_DSYMUTIL_FALSE='#'
+else
+  USE_DSYMUTIL_TRUE='#'
+  USE_DSYMUTIL_FALSE=
+fi
+
+
+
+# Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_NM="nm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+$as_echo "$NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+# Extract the first word of "xz", so it can be a program name with args.
+set dummy xz; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_XZ+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$XZ"; then
+  ac_cv_prog_XZ="$XZ" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_XZ="xz"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+XZ=$ac_cv_prog_XZ
+if test -n "$XZ"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XZ" >&5
+$as_echo "$XZ" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$XZ" != ""; then
+  HAVE_XZ_TRUE=
+  HAVE_XZ_FALSE='#'
+else
+  HAVE_XZ_TRUE='#'
+  HAVE_XZ_FALSE=
+fi
+
+# Extract the first word of "comm", so it can be a program name with args.
+set dummy comm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_COMM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$COMM"; then
+  ac_cv_prog_COMM="$COMM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_COMM="comm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+COMM=$ac_cv_prog_COMM
+if test -n "$COMM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMM" >&5
+$as_echo "$COMM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$COMM" != ""; then
+  HAVE_COMM_TRUE=
+  HAVE_COMM_FALSE='#'
+else
+  HAVE_COMM_TRUE='#'
+  HAVE_COMM_FALSE=
+fi
+
+
+ if test "${with_target_subdir}" = "" -a "$FORMAT_FILE" = "elf.lo" -a "${OBJCOPY}" != "" -a "${NM}" != "" -a "${XZ}" != "" -a "${COMM}" != ""; then
+  HAVE_MINIDEBUG_TRUE=
+  HAVE_MINIDEBUG_FALSE='#'
+else
+  HAVE_MINIDEBUG_TRUE='#'
+  HAVE_MINIDEBUG_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_auto_decoder in -llzma" >&5
+$as_echo_n "checking for lzma_auto_decoder in -llzma... " >&6; }
+if ${ac_cv_lib_lzma_lzma_auto_decoder+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  HAVE_DSYMUTIL_TRUE='#'
-  HAVE_DSYMUTIL_FALSE=
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_auto_decoder ();
+int
+main ()
+{
+return lzma_auto_decoder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzma_lzma_auto_decoder=yes
+else
+  ac_cv_lib_lzma_lzma_auto_decoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_auto_decoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_auto_decoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_auto_decoder" = xyes; then :
+
+$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h
+
+fi
+
+ if test "$ac_cv_lib_lzma_lzma_auto_decoder" = yes; then
+  HAVE_LIBLZMA_TRUE=
+  HAVE_LIBLZMA_FALSE='#'
+else
+  HAVE_LIBLZMA_TRUE='#'
+  HAVE_LIBLZMA_FALSE=
 fi
 
 
@@ -14038,8 +14271,24 @@ if test -z "${HAVE_OBJCOPY_DEBUGLINK_TRUE}" && test -z "${HAVE_OBJCOPY_DEBUGLINK
   as_fn_error $? "conditional \"HAVE_OBJCOPY_DEBUGLINK\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${HAVE_DSYMUTIL_TRUE}" && test -z "${HAVE_DSYMUTIL_FALSE}"; then
-  as_fn_error $? "conditional \"HAVE_DSYMUTIL\" was never defined.
+if test -z "${USE_DSYMUTIL_TRUE}" && test -z "${USE_DSYMUTIL_FALSE}"; then
+  as_fn_error $? "conditional \"USE_DSYMUTIL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_XZ_TRUE}" && test -z "${HAVE_XZ_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_XZ\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_COMM_TRUE}" && test -z "${HAVE_COMM_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_COMM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_MINIDEBUG_TRUE}" && test -z "${HAVE_MINIDEBUG_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_MINIDEBUG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBLZMA_TRUE}" && test -z "${HAVE_LIBLZMA_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_LIBLZMA\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${NATIVE_TRUE}" && test -z "${NATIVE_FALSE}"; then