This list all the available platforms looking for platform/*/m4/configure.m4 and generate the appropriate m4 file for the configure.ac to include
Signed-off-by: Nicolas Morey-Chaisemartin <[email protected]> --- bootstrap | 23 +++++++++++++++++++++++ configure.ac | 9 +-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/bootstrap b/bootstrap index 7c3d220..daa8c58 100755 --- a/bootstrap +++ b/bootstrap @@ -1,5 +1,28 @@ #! /bin/sh set -x + +# Auto generate the platform list +PLATFORM_M4S=$(ls platform/*/m4/configure.m4) +PLATFORMS=$(basename -a ${PLATFORM_M4S//\/m4\/configure\.m4/}) +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}"; +then + m4_include([./platform/${platform}/m4/configure.m4]) +EOF + prefix="el" +done +cat << EOF >> $GEN_M4 +else + echo "UNSUPPORTED PLATFORM: \${with_platform}" + exit 1 +fi +EOF + aclocal -I config -I m4 libtoolize --copy autoheader diff --git a/configure.ac b/configure.ac index 0d7860b..157e5f3 100644 --- a/configure.ac +++ b/configure.ac @@ -87,14 +87,7 @@ netmap_support=no ########################################################################## # Run platform specific checks and settings -########################################################################## -if test "${with_platform}" == "linux-generic"; -then - m4_include([./platform/linux-generic/m4/configure.m4]) -else - echo "UNSUPPORTED PLATFORM: ${with_platform}" - exit 1 -fi +m4_include([m4/platforms.m4]) ########################################################################## # Set conditionals as computed within platform specific files -- 2.6.3.372.gcb93895 _______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
