Following the Linux install.sh script, I downloaded the latest trunk version of gcbasic.bas, assembly.bi, preprocessor.bi, utils.bi, variables.bi and messages.dat.
I then compiled gcbasic with ../fbc_freebsd64/bin/fbc -exx -v -arch native gcbasic.bas which completed successfully, but received the following error when running gcbasic:
Cannot find /tmp/fb/gcbasic-code-r770-GCBASIC-trunk-LinuxBuild\messages.dat
Great Cow BASIC cannot operate without this file
It seems a backslash snuck into the executable instead of a forward slash. A quick vi of the executable and replacing the backslash with a forward slash and it works ... or at least it no longer complains, I have yet to compile something :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
@Trev - please use the distribution. https://sourceforge.net/projects/gcbasic/files/GCBasic%20-%20Linux%20Distribution/GCB%40Syn.rar/download
The latest and greatest may not be a 100% consistent build - sorry for that but I the project takes a lot of time and to retrotest daily builds is just not practical.
So, please start with the URL above. It will problable has the same backslash issue but then we know that you are on a stable build.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK - downloaded from that URL, compiled and yes, the same issue with backslash instead of the forward slash.
Looking at the source files I notice there are a lot of other instances which will fail on FreeBSD if I try anything more complicated than simply running gcbasic and getting the usage help.
The issue is the #IFDEFs don't deal with FreeBSD only Linux and if not Linux, then Windows by default. I tried changing the #IFDEF __FB_LINUX__ to #IFDEF (__FB_LINUX__ || __FB_FREEBSD__) but FreeBASIC doesn't like the conventional C syntax.
It might be better to change the categorisation to UNIX and Windows, rather than Linux and Windows. So, I tried replacing #IFDEF __FB_LINUX__ with #IFDEF __FB_UNIX__ in the source files which seems to have had the desired effect and the compilation completes successfully.
Now to test if my gcbasic hack actually works on FreeBSD with some demo programs.
[edit] added code tags to preserve undescores
Last edit: Trev 2018-09-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When compiling GCBasic for the Mac, I simply inserted a #Define FB_LINUX near the top of the code. This 'forced' the use of UNIX style paths and had the desired effect for me.
I found a few gotchas in attempting the compile, this being one of them, but eventually did have complete success.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OS: FreeBSD 10.4-STABLE r331401M: Fri Mar 23 14:00:26 AEDT 2018 amd64
Puter: MacMini (late 2009)
Following the Linux install.sh script, I downloaded the latest trunk version of gcbasic.bas, assembly.bi, preprocessor.bi, utils.bi, variables.bi and messages.dat.
I then compiled gcbasic with ../fbc_freebsd64/bin/fbc -exx -v -arch native gcbasic.bas which completed successfully, but received the following error when running gcbasic:
Cannot find /tmp/fb/gcbasic-code-r770-GCBASIC-trunk-LinuxBuild\messages.dat
Great Cow BASIC cannot operate without this file
It seems a backslash snuck into the executable instead of a forward slash. A quick vi of the executable and replacing the backslash with a forward slash and it works ... or at least it no longer complains, I have yet to compile something :)
The latest and greatest may not be a 100% consistent build - sorry for that but I the project takes a lot of time and to retrotest daily builds is just not practical.
So, please start with the URL above. It will problable has the same backslash issue but then we know that you are on a stable build.
OK - downloaded from that URL, compiled and yes, the same issue with backslash instead of the forward slash.
Looking at the source files I notice there are a lot of other instances which will fail on FreeBSD if I try anything more complicated than simply running gcbasic and getting the usage help.
The issue is the #IFDEFs don't deal with FreeBSD only Linux and if not Linux, then Windows by default. I tried changing the
#IFDEF __FB_LINUX__ to #IFDEF (__FB_LINUX__ || __FB_FREEBSD__)
but FreeBASIC doesn't like the conventional C syntax.It might be better to change the categorisation to UNIX and Windows, rather than Linux and Windows. So, I tried replacing
#IFDEF __FB_LINUX__ with #IFDEF __FB_UNIX__
in the source files which seems to have had the desired effect and the compilation completes successfully.Now to test if my gcbasic hack actually works on FreeBSD with some demo programs.
[edit] added code tags to preserve undescores
Last edit: Trev 2018-09-28
Success!
I modded first-start-sample.gcb for a PIC12F675 to flash a LED on GPIO.2 and it works :)
Excellent! Well done. Seriously, good to here.
Enjoy
I should have mentioned that FreeBSD 32 bit and 64 bit FreeBASIC binaries can be found as nightly builds at: http://users.freebasic-portal.de/stw/
When compiling GCBasic for the Mac, I simply inserted a #Define FB_LINUX near the top of the code. This 'forced' the use of UNIX style paths and had the desired effect for me.
I found a few gotchas in attempting the compile, this being one of them, but eventually did have complete success.