From c915e5be00914014a7cb17e26eec562a2b6b3822 Mon Sep 17 00:00:00 2001
From: Timothy Stack <stack@flux.utah.edu>
Date: Sun, 7 Nov 2004 17:43:08 +0000
Subject: [PATCH] Small hack to get the right value of $prefix into config.h. 
 If no prefix is specified on the command line the value of $prefix when the
 config.h is generated is 'NONE' instead of '/usr/testbed', so we have to
 manually define it to the default ourselves.

---
 configure    | 11 +++++++++--
 configure.in |  6 +++++-
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index b7bb1b1840..25a6d5f1c7 100755
--- a/configure
+++ b/configure
@@ -1006,10 +1006,17 @@ fi
 #
 # Be sure to add to config.h.in!
 #
-cat >> confdefs.h <<EOF
+if test x"$prefix" = x"NONE"; then
+    cat >> confdefs.h <<EOF
+#define TBROOT "/usr/testbed"
+EOF
+
+else
+    cat >> confdefs.h <<EOF
 #define TBROOT "$prefix"
 EOF
 
+fi
 cat >> confdefs.h <<EOF
 #define TBDBNAME "$TBDBNAME"
 EOF
@@ -1401,7 +1408,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1405: checking for a BSD compatible install" >&5
+echo "configure:1412: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
diff --git a/configure.in b/configure.in
index e4fd538905..23c795db52 100755
--- a/configure.in
+++ b/configure.in
@@ -193,7 +193,11 @@ fi
 #
 # Be sure to add to config.h.in!
 #
-AC_DEFINE_UNQUOTED(TBROOT, "$prefix")
+if test x"$prefix" = x"NONE"; then
+    AC_DEFINE_UNQUOTED(TBROOT, "/usr/testbed")
+else
+    AC_DEFINE_UNQUOTED(TBROOT, "$prefix")
+fi
 AC_DEFINE_UNQUOTED(TBDBNAME, "$TBDBNAME")
 AC_DEFINE_UNQUOTED(TBADMINGROUP, "$TBADMINGROUP")
 AC_DEFINE_UNQUOTED(IPBASE, "$IPBASE")
-- 
GitLab