aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac11
-rw-r--r--src/posix-util.c6
2 files changed, 16 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 21951fe6..11118492 100644
--- a/configure.ac
+++ b/configure.ac
@@ -236,6 +236,17 @@ AM_CONDITIONAL(BUILD_W32_QT, test "$build_w32_qt" = yes)
AM_CONDITIONAL(HAVE_PTHREAD, test "$have_pthread" = "yes")
+AC_ARG_ENABLE([fixed-path],
+ AC_HELP_STRING([--enable-fixed-path=PATH],
+ [locate binaries only via this PATH]),
+ [fixed_search_path="$enableval"],
+ [fixed_search_path=""])
+if test x$fixed_search_path != x ; then
+ AC_DEFINE_UNQUOTED(FIXED_SEARCH_PATH, "$fixed_search_path",
+ [Locate binaries only via this PATH])
+fi
+
+
#
# Provide information about the build.
#
diff --git a/src/posix-util.c b/src/posix-util.c
index 1b92ec17..e78cd771 100644
--- a/src/posix-util.c
+++ b/src/posix-util.c
@@ -78,9 +78,13 @@ walk_path (const char *pgm)
const char *orig_path, *path, *s;
char *fname, *p;
+#ifdef FIXED_SEARCH_PATH
+ orig_path = FIXED_SEARCH_PATH;
+#else
orig_path = getenv ("PATH");
if (!orig_path)
- orig_path = "/bin:/usr/bin:.";
+ orig_path = "/bin:/usr/bin";
+#endif
fname = malloc (strlen (orig_path) + 1 + strlen (pgm) + 1);
if (!fname)