77# - Downloaded archives are cached in the input/ dir
88# - Output packages & manifests are put in the output/ dir
99# - Toolchain source packages are downloaded too
10- # - fbc sources are retrieved from Git; you can specify the exact commit to
11- # build, the default is "master" .
10+ # - fbc sources are retrieved from Git; you have to specify the exact commit
11+ # to build (or a tag/branch name) .
1212#
1313# The standalone fbc is built in the same directory as the normal fbc, by just
1414# rebuilding src/compiler/obj/fbc.o (that's all that's affected by
@@ -79,6 +79,19 @@ mkdir -p input
7979mkdir -p output
8080rm -rf build
8181mkdir build
82+
83+ echo " updating input/fbc repo"
84+ cd input
85+ if [ ! -d fbc ]; then
86+ git clone https://github.com/freebasic/fbc.git
87+ fi
88+ cd fbc
89+ git fetch
90+ git fetch --tags
91+ git remote prune origin
92+ git reset --hard origin/master
93+ cd ../..
94+
8295cd build
8396
8497buildinfo=../output/buildinfo-$target .txt
@@ -208,13 +221,6 @@ win64)
208221 ;;
209222esac
210223
211- get_fbc_sources () {
212- # fbc sources
213- download fbc-$fbccommit .tar.gz https://github.com/freebasic/fbc/archive/$fbccommit .tar.gz
214- tar xf ../input/fbc-$fbccommit .tar.gz
215- mv fbc-$fbccommit fbc
216- }
217-
218224bootfb_title=FreeBASIC-1.02.1-$fbtarget
219225
220226case $fbtarget in
@@ -227,7 +233,9 @@ linux*)
227233 download $bootfb_package " https://downloads.sourceforge.net/fbc/${bootfb_package} ?download"
228234 tar xf ../input/$bootfb_package
229235
230- get_fbc_sources
236+ # fbc sources
237+ cp -R ../input/fbc .
238+ cd fbc && git reset --hard " $fbccommit " && cd ..
231239
232240 mkdir tempinstall
233241 ;;
@@ -237,7 +245,9 @@ linux*)
237245 download $bootfb_package " https://downloads.sourceforge.net/fbc/${bootfb_package} ?download"
238246 unzip -q ../input/$bootfb_package
239247
240- get_fbc_sources
248+ # fbc sources
249+ cp -R ../input/fbc fbc
250+ cd fbc && git reset --hard " $fbccommit " && cd ..
241251 echo " prefix := ` pwd -W` " > fbc/config.mk
242252
243253 # On 64bit, we have to override the FB makefile's uname check, because MSYS uname reports 32bit still
0 commit comments