Skip to contentSkip to conversation

tools/configure.ac: generate Paths.mk if it's not available

PATCH In review Wei Liu 2 participants 5 messages Apr 20, 2015 – Apr 21, 2015

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 tools/configure.ac: generate Paths.mk if it's not available

Xen toolstack references many variables in Paths.mk when building and installing, so tools' configure should generate Paths.mk if it's not available. Also make inclusion of Paths.mk mandatory in Tools.mk.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>

---
Please rerun autogen.sh

---
 config/Tools.mk.in |  2 +-
 tools/configure    | 27 +++++++++++++++++++++++++++
 tools/configure.ac |  5 +++++
 3 files changed, 33 insertions(+), 1 deletion(-)
config/Tools.mk.in +1 -1
index e7da99d..b1ad33f 100644
@@ -1,4 +1,4 @@
--include $(XEN_ROOT)/config/Paths.mk
+include $(XEN_ROOT)/config/Paths.mk
 
 CONFIG_RUMP         := @CONFIG_RUMP@
 ifeq ($(CONFIG_RUMP),y)
tools/configure +27 -0
index a752acd..d252a34 100755
@@ -9000,6 +9000,32 @@ if test "x$systemd" = "xy"; then :
 
 fi
 
+# In case Paths.mk is not generated, i.e. toplevel ./configure is not invoked.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ../config/Paths.mk" >&5
+$as_echo_n "checking for ../config/Paths.mk... " >&6; }
+if ${ac_cv_file____config_Paths_mk+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "../config/Paths.mk"; then
+  ac_cv_file____config_Paths_mk=yes
+else
+  ac_cv_file____config_Paths_mk=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file____config_Paths_mk" >&5
+$as_echo "$ac_cv_file____config_Paths_mk" >&6; }
+if test "x$ac_cv_file____config_Paths_mk" = xyes; then :
+
+else
+
+    ac_config_files="$ac_config_files ../config/Paths.mk"
+
+
+fi
+
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -9716,6 +9742,7 @@ do
     "hotplug/Linux/systemd/xenstored.service") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.service" ;;
     "hotplug/Linux/systemd/xenstored.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored.socket" ;;
     "hotplug/Linux/systemd/xenstored_ro.socket") CONFIG_FILES="$CONFIG_FILES hotplug/Linux/systemd/xenstored_ro.socket" ;;
+    "../config/Paths.mk") CONFIG_FILES="$CONFIG_FILES ../config/Paths.mk" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
tools/configure.ac +5 -0
index d31c2f3..83095f1 100644
@@ -395,5 +395,10 @@ AS_IF([test "x$systemd" = "xy"], [
     ])
 ])
 
+# In case Paths.mk is not generated, i.e. toplevel ./configure is not invoked.
+AC_CHECK_FILE([../config/Paths.mk],,[
+    AC_CONFIG_FILES([../config/Paths.mk])
+])
+
 AC_OUTPUT()
 
Signature · 1 line
1.9.1
author
#1 lore raw
Quoted 3 lines · Wei Liu

Xen toolstack references many variables in Paths.mk when building and installing, so tools' configure should generate Paths.mk if it's not available. Also make inclusion of Paths.mk mandatory in Tools.mk.

Hmm... I just discovered that docs build also involves Paths.mk. This patch is ugly enough that I don't want to duplicate it for docs. So advise on how to fix this would be much appreciated.

Or we can state clear that anyone who builds Xen from source needs to run ./configure in top level directory, not the ones in subsystems.

Wei.

#2 lore raw
Quoted 8 lines · Wei Liu
Quoted 3 lines · Wei Liu

Xen toolstack references many variables in Paths.mk when building and installing, so tools' configure should generate Paths.mk if it's not available. Also make inclusion of Paths.mk mandatory in Tools.mk.

Hmm... I just discovered that docs build also involves Paths.mk. This patch is ugly enough that I don't want to duplicate it for docs. So advise on how to fix this would be much appreciated.

I wasn't terribly happy with having more than one place update Paths.mk already.

Quoted 2 lines

Or we can state clear that anyone who builds Xen from source needs to run ./configure in top level directory, not the ones in subsystems.

I think that's essentially what we've done so far, but it's not terribly satisfactory I'll admit. Is this the only issue which prevents this?

Perhaps change each subsystem to generate+consume its own Paths ${subsys}.mk instead of a single global one? Either in config/Paths ${subsys.mk} or in ${subsys}/Paths.mk.

If you invoke from the top-level then they will all end up with the same contents, but so what...

Ian.

author
#3 lore raw
Quoted 19 lines · Ian Campbell
Quoted 8 lines · Wei Liu
Quoted 3 lines · Wei Liu

Xen toolstack references many variables in Paths.mk when building and installing, so tools' configure should generate Paths.mk if it's not available. Also make inclusion of Paths.mk mandatory in Tools.mk.

Hmm... I just discovered that docs build also involves Paths.mk. This patch is ugly enough that I don't want to duplicate it for docs. So advise on how to fix this would be much appreciated.

I wasn't terribly happy with having more than one place update Paths.mk already.

Quoted 2 lines

Or we can state clear that anyone who builds Xen from source needs to run ./configure in top level directory, not the ones in subsystems.

I think that's essentially what we've done so far, but it's not terribly satisfactory I'll admit. Is this the only issue which prevents this?

Quoted 7 lines

Perhaps change each subsystem to generate+consume its own Paths ${subsys}.mk instead of a single global one? Either in config/Paths ${subsys.mk} or in ${subsys}/Paths.mk.

If you invoke from the top-level then they will all end up with the same contents, but so what...

I can try to refactor Paths.mk.in into several files.

Quoted 1 line

Ian.

#4 lore raw
Quoted 24 lines · Wei Liu
Quoted 23 lines · Ian Campbell
Quoted 8 lines · Wei Liu
Quoted 3 lines · Wei Liu

Xen toolstack references many variables in Paths.mk when building and installing, so tools' configure should generate Paths.mk if it's not available. Also make inclusion of Paths.mk mandatory in Tools.mk.

Hmm... I just discovered that docs build also involves Paths.mk. This patch is ugly enough that I don't want to duplicate it for docs. So advise on how to fix this would be much appreciated.

I wasn't terribly happy with having more than one place update Paths.mk already.

Quoted 2 lines

Or we can state clear that anyone who builds Xen from source needs to run ./configure in top level directory, not the ones in subsystems.

I think that's essentially what we've done so far, but it's not terribly satisfactory I'll admit. Is this the only issue which prevents this?

Perhaps change each subsystem to generate+consume its own Paths ${subsys}.mk instead of a single global one? Either in config/Paths ${subsys.mk} or in ${subsys}/Paths.mk.

Quoted 5 lines
Quoted 3 lines

If you invoke from the top-level then they will all end up with the same contents, but so what...

I can try to refactor Paths.mk.in into several files.

I was suggesting a single input but create multiple outputs, otherwise we have to keep all the inputs in sync.

I expect the majority of paths are common to all sub components.

Ian.