aboutsummaryrefslogtreecommitdiff
path: root/gprofng
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2024-05-02 18:29:28 -0700
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2024-05-08 22:18:24 -0700
commite5b12a313fdbbf9b628e920e40feb6613a9d6905 (patch)
tree8c43dc18ad95dad38eefef402979fdafc69ebc2d /gprofng
parent46b6ba96d0b071e1616710c4d3463ea6d8a60ea7 (diff)
downloadgdb-e5b12a313fdbbf9b628e920e40feb6613a9d6905.zip
gdb-e5b12a313fdbbf9b628e920e40feb6613a9d6905.tar.gz
gdb-e5b12a313fdbbf9b628e920e40feb6613a9d6905.tar.bz2
Fix hard-coded bash path in gprofng
When running 'make check', the default gprofng test suite creates a shell script for which it used a hardcoded shebang of '/usr/bin/bash' this script would not run if bash is in a different location, like /bin/bash This commit adds 'AC_PATH_PROG(BASH, bash)' to configure.ac so the installation path of bash is detected at configuration time. The configuration is propagated to the runtest command line where it is needed.
Diffstat (limited to 'gprofng')
-rw-r--r--gprofng/Makefile.am1
-rw-r--r--gprofng/Makefile.in2
-rwxr-xr-xgprofng/configure47
-rw-r--r--gprofng/configure.ac3
-rw-r--r--gprofng/doc/Makefile.in1
-rw-r--r--gprofng/gp-display-html/Makefile.in1
-rw-r--r--gprofng/src/Makefile.in1
-rw-r--r--gprofng/testsuite/config/default.exp2
8 files changed, 55 insertions, 3 deletions
diff --git a/gprofng/Makefile.am b/gprofng/Makefile.am
index 5d26441..a5ee9dd 100644
--- a/gprofng/Makefile.am
+++ b/gprofng/Makefile.am
@@ -68,6 +68,7 @@ if TCL_TRY
CLOCK_GETTIME_LINK="$(CLOCK_GETTIME_LINK)" \
CHECK_TARGET=$@ \
PREFIX="$(prefix)" \
+ BASH="$(BASH)" \
GPROFNG_BROKEN_JAVAC="$(GPROFNG_BROKEN_JAVAC)" \
MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS) $(PTHREAD_CFLAGS)" \
LDFLAGS="$(LDFLAGS)" LIBS="$(PTHREAD_LIBS) $(LIBS)" \
diff --git a/gprofng/Makefile.in b/gprofng/Makefile.in
index dbc8681..5ced0e0 100644
--- a/gprofng/Makefile.in
+++ b/gprofng/Makefile.in
@@ -238,6 +238,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASH = @BASH@
BISON = @BISON@
BUILD_SUBDIRS = @BUILD_SUBDIRS@
CC = @CC@
@@ -932,6 +933,7 @@ check-small check-extra check-install: site.exp development.exp
@TCL_TRY_TRUE@ CLOCK_GETTIME_LINK="$(CLOCK_GETTIME_LINK)" \
@TCL_TRY_TRUE@ CHECK_TARGET=$@ \
@TCL_TRY_TRUE@ PREFIX="$(prefix)" \
+@TCL_TRY_TRUE@ BASH="$(BASH)" \
@TCL_TRY_TRUE@ GPROFNG_BROKEN_JAVAC="$(GPROFNG_BROKEN_JAVAC)" \
@TCL_TRY_TRUE@ MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS) $(PTHREAD_CFLAGS)" \
@TCL_TRY_TRUE@ LDFLAGS="$(LDFLAGS)" LIBS="$(PTHREAD_LIBS) $(LIBS)" \
diff --git a/gprofng/configure b/gprofng/configure
index 17d1c50..9805535 100755
--- a/gprofng/configure
+++ b/gprofng/configure
@@ -639,6 +639,7 @@ GPROFNG_CPPFLAGS
GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS
GPROFNG_CFLAGS
LD_NO_AS_NEEDED
+BASH
BUILD_DOC_FALSE
BUILD_DOC_TRUE
BUILD_MAN_FALSE
@@ -12248,7 +12249,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12251 "configure"
+#line 12252 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12354,7 +12355,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 12357 "configure"
+#line 12358 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16861,6 +16862,48 @@ else
fi
+# Extract the first word of "bash", so it can be a program name with args.
+set dummy bash; 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_path_BASH+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $BASH in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_BASH="$BASH" # Let the user override the test with a path.
+ ;;
+ *)
+ 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_path_BASH="$as_dir/$ac_word$ac_exec_ext"
+ $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
+
+ ;;
+esac
+fi
+BASH=$ac_cv_path_BASH
+if test -n "$BASH"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH" >&5
+$as_echo "$BASH" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
LD_NO_AS_NEEDED=${no_as_needed}
GPROFNG_CFLAGS=${gprofng_cflags}
diff --git a/gprofng/configure.ac b/gprofng/configure.ac
index a7221d9..794e957 100644
--- a/gprofng/configure.ac
+++ b/gprofng/configure.ac
@@ -228,6 +228,9 @@ fi
AM_CONDITIONAL([BUILD_MAN], [test x$build_man = xtrue])
AM_CONDITIONAL([BUILD_DOC], [test x$build_doc = xtrue])
+AC_PATH_PROG([BASH], [bash])
+AC_SUBST([BASH])
+
AC_SUBST(LD_NO_AS_NEEDED, [${no_as_needed}])
AC_SUBST(GPROFNG_CFLAGS, [${gprofng_cflags}])
AC_SUBST(GPROFNG_NO_FORMAT_TRUNCATION_CFLAGS)
diff --git a/gprofng/doc/Makefile.in b/gprofng/doc/Makefile.in
index 27a073e..5b57544 100644
--- a/gprofng/doc/Makefile.in
+++ b/gprofng/doc/Makefile.in
@@ -222,6 +222,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASH = @BASH@
BISON = @BISON@
BUILD_SUBDIRS = @BUILD_SUBDIRS@
CC = @CC@
diff --git a/gprofng/gp-display-html/Makefile.in b/gprofng/gp-display-html/Makefile.in
index 61c00cd..b667ae9 100644
--- a/gprofng/gp-display-html/Makefile.in
+++ b/gprofng/gp-display-html/Makefile.in
@@ -182,6 +182,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASH = @BASH@
BISON = @BISON@
BUILD_SUBDIRS = @BUILD_SUBDIRS@
CC = @CC@
diff --git a/gprofng/src/Makefile.in b/gprofng/src/Makefile.in
index db763ef..cef4b27 100644
--- a/gprofng/src/Makefile.in
+++ b/gprofng/src/Makefile.in
@@ -306,6 +306,7 @@ AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
+BASH = @BASH@
BISON = @BISON@
BUILD_SUBDIRS = @BUILD_SUBDIRS@
CC = @CC@
diff --git a/gprofng/testsuite/config/default.exp b/gprofng/testsuite/config/default.exp
index 6b51d57..74d1dad 100644
--- a/gprofng/testsuite/config/default.exp
+++ b/gprofng/testsuite/config/default.exp
@@ -54,7 +54,7 @@ if { "$CHECK_TARGET" == "check-install" } {
}
set f [open "gprofng_wraper" w+]
- puts $f "#!/usr/bin/bash"
+ puts $f "#!$BASH"
puts $f "LD_LIBRARY_PATH=$ld_library_path:$orig_ld_library_path"
puts $f "GPROFNG_SYSCONFDIR=$env(srcroot)/src"
puts $f "GPROFNG_PRELOAD_LIBDIRS=$BUILDDIR/libcollector/.libs"