7575# -winlibs-gcc-10.2.0 (winlibs mingwrt 8.0.0r8)
7676# -winlibs-gcc-10.3.0 (winlibs mingwrt 8.0.0r1)
7777# -equation-gcc-8.3.0 (Equation - experimental)
78+ # * -linux-arm
7879# * -raspbian9-arm
7980# * -debian12-armhf
81+ # * -rpios10-arm
82+ # * -rpios10-aarch64
83+ # * -rpios11-arm
84+ # * -rpios11-aarch64
85+ # * -linux-aarch64
86+ # * -ubuntu-22.04-aarch64
8087#
8188# Not all recipes are supported on all targets.
8289#
182189fi
183190
184191# check recipe name
185- # TODO: error on invalid combination of target and recipe
192+ # recipe_name is from the command line option, empty string if not given
193+ # user_recipe is either explicit (from command line) or automatic (below)
186194if [ ! -z " $recipe_name " ]; then
187195 user_recipe=$recipe_name
188196else
@@ -207,21 +215,26 @@ else
207215 esac
208216fi
209217
210- # multiple recipe names specified by the user or automatically
211- # determined above will map to recognized named recipes
212- case $user_recipe in
213- raspbian9-arm|linux-arm-raspbian9)
214- named_recipe=raspbian9-arm
218+ # user_recipe may be blank and optionally start with a dash '-'
219+ # named_recipe must be blank or start with a dash '-'
220+
221+ case " $user_recipe " in
222+ " " |-* )
223+ named_recipe=$user_recipe
215224 ;;
216225* )
217- named_recipe=$user_recipe
226+ named_recipe=- $user_recipe
218227 ;;
219228esac
220229
221230echo " building FB-$target (uname = ` uname` , uname -m = ` uname -m` )"
222231echo " from repository: https://github.com/freebasic/fbc.git"
223- echo " user gave recipe '$user_recipe '"
224- echo " using named recipe '$named_recipe '"
232+ if [ ! -z " $user_recipe " ]; then
233+ echo " user gave recipe '$user_recipe '"
234+ fi
235+ if [ ! -z " $named_recipe " ]; then
236+ echo " using named recipe '$named_recipe '"
237+ fi
225238if [ ! -z " $repo_url " ]; then
226239 echo " from repository: $repo_url "
227240fi
@@ -266,7 +279,11 @@ cd ../..
266279
267280cd build
268281
282+ if [ ! -z " $named_recipe " ] ; then
283+ buildinfo=../output/buildinfo$named_recipe .txt
284+ else
269285buildinfo=../output/buildinfo-$target .txt
286+ fi
270287echo " fbc $fbccommit $target , build based on:" > $buildinfo
271288echo " named recipe: $named_recipe " >> $buildinfo
272289echo >> $buildinfo
@@ -709,40 +726,54 @@ win64)
709726 ;;
710727esac
711728
729+ BUILD_BOOTFBCFLAGS=
730+ AppendBOOTFBCFLAGS () {
731+ if [ ! -z " $1 " ]; then
732+ if [ -z " $BUILD_BOOTFBCFLAGS " ]; then
733+ BUILD_BOOTFBCFLAGS=" $1 "
734+ else
735+ BUILD_BOOTFBCFLAGS=" $BUILD_BOOTFBCFLAGS $1 "
736+ fi
737+ fi
738+ }
739+
712740# choose a bootstrap source for the target
713741# - the minimum needed to build the current release
714742# - plus any options to build the current version from the bootstrap version
715- case $named_recipe in
716- debian12-armhf)
743+ case " $named_recipe " in
744+ - debian12-armhf)
717745 # 1.10.2 for arm is a little weird because it depended on changes
718746 # in fbc to make the 1.10.2 bootstrap on debian 12 with gcc 12.
719747 # So, no matter what, we need some manual intervention for this release
720748 # and should improve the automation in the next release
721749 # but it requires some manual intervention to set compile options
722750 #
723- BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
724- BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A_FP
725- bootfb_title=FreeBASIC-1.10.2-$fbtarget
751+ AppendBOOTFBCFLAGS " DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A_FP"
752+ bootfb_title=" FreeBASIC-1.10.2-$fbtarget "
726753 ;;
727- raspbian9-arm)
728- BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
729- BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV6
730- bootfb_title=FreeBASIC-1.10.1-$named_recipe
754+ -raspbian9-arm)
755+ AppendBOOTFBCFLAGS " DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV6"
756+ bootfb_title=" FreeBASIC-1.10.1$named_recipe "
731757 ;;
732- linux-arm|rpios10-arm|rpios11-arm)
733- BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
734- BUILD_BOOTFBCFLAGS=$BUILD_BOOTFBCFLAGS DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A
735- bootfb_title=FreeBASIC-1.10.1-$named_recipe
758+ -linux-arm|-rpios10-arm|-rpios11-arm)
759+ AppendBOOTFBCFLAGS " DEFAULT_CPUTYPE_ARM=FB_CPUTYPE_ARMV7A"
760+ bootfb_title=" FreeBASIC-1.10.1$named_recipe "
736761 ;;
737- linux-aarch64|rpios10-aarch64|rpios11-aarch64)
738- BUILD_BOOTFBCFLAGS=FBPACKTARGET=$named_recipe
739- bootfb_title=FreeBASIC-1.07.2-$named_recipe
762+ -rpios10-aarch64|-rpios11-aarch64)
763+ bootfb_title=" FreeBASIC-1.07.2$named_recipe "
764+ ;;
765+ -linux-aarch64|-ubuntu-22.04-aarch64)
766+ bootfb_title=" FreeBASIC-1.10.1$named_recipe "
740767 ;;
741768* )
742- bootfb_title=FreeBASIC-1.06.0-$fbtarget
769+ bootfb_title=" FreeBASIC-1.06.0-$fbtarget "
743770 ;;
744771esac
745772
773+ if [ ! -z " $named_recipe " ]; then
774+ AppendBOOTFBCFLAGS " FBPACKTARGET=${named_recipe# -} "
775+ fi
776+
746777case $fbtarget in
747778linux* )
748779 # Special case: linux builds use the host gcc toolchain
0 commit comments