From 2e20e35b314848ce8e154c3fcb4ac429da26baf7 Mon Sep 17 00:00:00 2001 From: "T. Joseph Carter" Date: Thu, 12 Mar 2015 07:54:52 -0700 Subject: [PATCH] Fix function variables to be empty when functions aren't defined --- libretro-build-common.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libretro-build-common.sh b/libretro-build-common.sh index 4accae77..dee65b4e 100755 --- a/libretro-build-common.sh +++ b/libretro-build-common.sh @@ -272,10 +272,13 @@ libretro_build_core() { case "$core_build_rule" in generic_makefile) - core_build_configure="libretro_${1}_build_configure" - core_build_preclean="libretro_${1}_build_preclean" - core_build_prebuild="libretro_${1}_build_prebuild" - core_build_prepkg="libretro_${1}_build_prepkg" + for a in configure preclean prebuild prepkg; do + if [ "$(type -f libretro_${1}_build_$a)" = "function" ]; then + eval "core_build_$a=libretro_${1}_build_$a" + else + eval "core_build_$a=" + fi + done eval "core_build_makefile=\$libretro_${1}_build_makefile" eval "core_build_subdir=\$libretro_${1}_build_subdir" eval "core_build_args=\$libretro_${1}_build_args"