Conditionals must always be defined if reference in a Makefile.am
 even if the Makefile does not apply to the platform being built.
As long as all the conditional are defined with default values in
platform/<platform>/m4/conditionals.m4, bootstrap will automatically
include them so there won't be any issue when including multiple
platforms in the same repo

Signed-off-by: Nicolas Morey-Chaisemartin <nmo...@kalray.eu>
---
 bootstrap | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/bootstrap b/bootstrap
index 274ce2a..1af732d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -7,6 +7,7 @@ GEN_M4="m4/platforms.m4"
 
 prefix=""
 echo "# Auto-Generated platform list" > $GEN_M4
+
 for platform in $PLATFORMS; do
        cat << EOF >> $GEN_M4
 ${prefix}if test "\${with_platform}" == "${platform}";
@@ -25,6 +26,17 @@ else
 fi
 EOF
 
+echo "# Include conditionals definitions if the platform has any" >> $GEN_M4
+for platform in $PLATFORMS; do
+       if [ ! -f platform/${platform}/m4/conditionals.m4 ]; then
+               continue
+       fi
+       cat << EOF >> $GEN_M4
+# Include conditional definitions for platform '${platform}'
+m4_include([./platform/${platform}/m4/conditionals.m4])
+EOF
+done;
+
 aclocal -I config -I m4
 libtoolize --copy
 autoheader
-- 
2.10.1.4.g0ffc436


Reply via email to