diff --git a/cloud-microphysics/setup.sh b/cloud-microphysics/setup.sh index 21a19a3b2..d038575c3 100755 --- a/cloud-microphysics/setup.sh +++ b/cloud-microphysics/setup.sh @@ -102,27 +102,8 @@ if [ $CI = true ]; then fi export PKG_CONFIG_PATH -touch build/run-fpm.sh +cp src/run-fpm.sh-header build/run-fpm.sh RUN_FPM_SH="`realpath ./build/run-fpm.sh`" -echo "#!/bin/sh" >> $RUN_FPM_SH -echo "#-- DO NOT EDIT -- created by inference-engine/setup.sh" >> $RUN_FPM_SH -echo "export PKG_CONFIG_PATH" >> $RUN_FPM_SH -echo "" >> $RUN_FPM_SH -echo "fpm_arguments=\"\"" >> $RUN_FPM_SH -echo "program_arguments=\"\"" >> $RUN_FPM_SH -echo "while test \$# -gt 0" >> $RUN_FPM_SH -echo "do" >> $RUN_FPM_SH -echo " case \"\$1\" in" >> $RUN_FPM_SH -echo " --) program_arguments=\"\$@\"" >> $RUN_FPM_SH -echo " ;;" >> $RUN_FPM_SH -echo " *) if [ -z \"\$program_arguments\" ]; then" >> $RUN_FPM_SH -echo " fpm_arguments=\"\$fpm_arguments \$1\"" >> $RUN_FPM_SH -echo " fi" >> $RUN_FPM_SH -echo " ;;" >> $RUN_FPM_SH -echo " esac" >> $RUN_FPM_SH -echo " shift" >> $RUN_FPM_SH -echo "done" >> $RUN_FPM_SH -echo "" >> $RUN_FPM_SH echo "`which fpm` \$fpm_arguments \\" >> $RUN_FPM_SH echo "--profile release \\" >> $RUN_FPM_SH echo "--c-compiler \"`pkg-config inference-engine --variable=INFERENCE_ENGINE_FPM_CC`\" \\" >> $RUN_FPM_SH diff --git a/cloud-microphysics/src/run-fpm.sh-header b/cloud-microphysics/src/run-fpm.sh-header new file mode 100644 index 000000000..e09df076b --- /dev/null +++ b/cloud-microphysics/src/run-fpm.sh-header @@ -0,0 +1,18 @@ +#!/bin/sh +#-- DO NOT EDIT -- created by inference-engine/setup.sh +export PKG_CONFIG_PATH + +fpm_arguments="" +program_arguments="" +while test $# -gt 0 +do + case "$1" in + --) program_arguments="$@" + ;; + *) if [ -z "$program_arguments" ]; then + fpm_arguments="$fpm_arguments $1" + fi + ;; + esac + shift +done