gprofng: adjust GPROFNG_VARIANT
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Wed, 6 Jul 2022 20:52:57 +0000 (13:52 -0700)
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>
Thu, 7 Jul 2022 05:36:44 +0000 (22:36 -0700)
GPROFNG_VARIANT depends on compiler options, not on $(host).

gprofng/ChangeLog
2022-07-06  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

PR gprofng/29116
* libcollector/configure.ac: Adjust GPROFNG_VARIANT.
* libcollector/configure: Rebuild.

gprofng/libcollector/configure
gprofng/libcollector/configure.ac

index 52d9892faddeeac691bc1b735a290f31c18e3a27..cbb20405ffd563ca00d0123afe9777bd13e7f500 100755 (executable)
@@ -15476,17 +15476,20 @@ $as_echo "$as_me: WARNING: Cannot set --enable-shared for gprofng/libcollector.
 fi
 
 GPROFNG_VARIANT=unknown
-case "${host}" in
-  x86_64-*-linux*)
-    GPROFNG_VARIANT=amd64-Linux
-    ;;
-  i?86-*-linux*)
+x=`echo | $CC $CFLAGS -dM -E - | grep -w __x86_64`
+if test -n "$x"; then
+  GPROFNG_VARIANT=amd64-Linux
+else
+  x=`echo | $CC $CFLAGS -dM -E - | grep -w __i386__`
+  if test -n "$x"; then
     GPROFNG_VARIANT=intel-Linux
-    ;;
-  aarch64-*-linux*)
-    GPROFNG_VARIANT=aarch64-Linux
-    ;;
-esac
+  else
+    x=`echo | $CC $CFLAGS -dM -E - | grep -w __aarch64__`
+    if test -n "$x"; then
+      GPROFNG_VARIANT=aarch64-Linux
+    fi
+  fi
+fi
 
 
 ac_ext=c
index 2e67e740c9ec5dd30a60ffc63c6289bbf4bcd4f8..d3c6bd5588d19b3fcfcbf3e8a0eff40db9984845 100644 (file)
@@ -42,17 +42,20 @@ if test "$enable_shared" != "yes"; then
 fi
 
 GPROFNG_VARIANT=unknown
-case "${host}" in
-  x86_64-*-linux*)
-    GPROFNG_VARIANT=amd64-Linux
-    ;;
-  i?86-*-linux*)
+x=`echo | $CC $CFLAGS -dM -E - | grep -w __x86_64`
+if test -n "$x"; then
+  GPROFNG_VARIANT=amd64-Linux
+else
+  x=`echo | $CC $CFLAGS -dM -E - | grep -w __i386__`
+  if test -n "$x"; then
     GPROFNG_VARIANT=intel-Linux
-    ;;
-  aarch64-*-linux*)
-    GPROFNG_VARIANT=aarch64-Linux
-    ;;
-esac
+  else
+    x=`echo | $CC $CFLAGS -dM -E - | grep -w __aarch64__`
+    if test -n "$x"; then
+      GPROFNG_VARIANT=aarch64-Linux
+    fi
+  fi
+fi
 AC_SUBST(GPROFNG_VARIANT)
 
 ACX_PROG_CC_WARNING_OPTS([-Wno-nonnull-compare], [GPROFNG_NO_NONNULL_COMPARE_CFLAGS])