C Building a current version of BOSSA

Because the version in ports is ancient as a rock and doesn't support SAM4 Processors, I need to build a more recent Version. As usual for Linux- and Windows-centric software, documentation is near to non-existent, especially on how to build it, let alone on FreeBSD....
Apart from some commits stating to have added FreeBSD build support and a few lines in the Makefile, there is absolutely nothing useful (at least for me as a sysadmin and non-Cpp-Programmer) on how to get this thing to build.

If I just try to build the cloned repository:
Code:
% gmake
gmake: wx-config: No such file or directory
gmake: wx-config: No such file or directory
CPP BOSSA src/BossaForm.cpp
In file included from src/BossaForm.cpp:8:
src/BossaForm.h:11:10: fatal error: 'wx/artprov.h' file not found
#include <wx/artprov.h>
         ^~~~~~~~~~~~~~
1 error generated.                                                                                                            
gmake: *** [Makefile:260: obj/BossaForm.o] Error 1

I've found some hints on how to get GNU make to recognize the include-directory on FreeBSD with --include-dir, but it still fails:
Code:
% gmake --include-dir=/usr/local/include/wx-3.1/wx/
gmake: wx-config: No such file or directory
gmake: wx-config: No such file or directory
CPP APPLET src/WordCopyArm.cpp
CPP COMMON src/Samba.cpp
CPP COMMON src/Flash.cpp
CPP COMMON src/D5xNvmFlash.cpp
CPP COMMON src/D2xNvmFlash.cpp
CPP COMMON src/EfcFlash.cpp
CPP COMMON src/EefcFlash.cpp
CPP COMMON src/Applet.cpp
CPP COMMON src/WordCopyApplet.cpp
CPP COMMON src/Flasher.cpp
CPP COMMON src/Device.cpp
CPP COMMON src/PosixSerialPort.cpp
CPP COMMON src/BSDPortFactory.cpp
CPP BOSSA src/BossaForm.cpp
In file included from src/BossaForm.cpp:8:
src/BossaForm.h:11:10: fatal error: 'wx/artprov.h' file not found
#include <wx/artprov.h>
         ^~~~~~~~~~~~~~
1 error generated.                                                                                                            
gmake: *** [Makefile:260: obj/BossaForm.o] Error 1

It seems it "forgets" about the include-path halfway through?

As I absolutely don't need the GUI part of bossa, I'm also perfectly fine to get completely rid of it, but I can't find any build-options to only build 'bossac'. The Port actually gives this option, but I couldn't find how it achieves this and gmake doesn't seem to support making a config like with "make config".

Can someone please assist me in how to get bossac built on FreeBSD 12.1-RELEASE (or 11.3-RELEASE) ? As a network/sysadmin with only some very basic C programming experience when it comes to compiled languages (plain bourne shell and pearl are usually my weapons of choice...), I'm completely lost here...
 
If you look at the existing port (devel/bossa) there are a bunch of patches in files/. That means it's not a straight-forward build. What I usually do is take the original port, change the version numbers and see how far it goes. Most of the time one or more patches will fail to apply because of changes in the source. So you're going to need to figure out if those patches are still needed and if they're needed how to modify them so they apply cleanly.
 
Hi. I used to try building the latest version of CodeLite myself but failed before I asked the maintainer of this port to update it. It's a wxWidgets based application, too. So I encountered this wx-config problem.

The answer is: it's there, but with a different name. You have to make a symlink named wx-config to the actual name of the script installed by the package. Check the file installed by the package with pkg info -l [your wx version name].

e.g: my wx is wx31-gtk3, so pkg info -l wx31-gtk3 | grep bin give: /usr/local/bin/wxgtk3u-3.1-config (the script usually put into the bin dir, so grep bin).

Then: doas ln -s /usr/local/bin/wxgtk3u-3.1-config /usr/local/bin/wx-config

Done. You could continue with the build and safety keep this symlink (assumed you have only one version of wx like me).
 
You should probably also follow Gh_origin's advice, but this error
(snip)
Code:
% gmake --include-dir=/usr/local/include/wx-3.1/wx/
...
src/BossaForm.h:11:10: fatal error: 'wx/artprov.h' file not found
#include <wx/artprov.h>
         ^~~~~~~~~~~~~~
1 error generated.                                                                                                           
gmake: *** [Makefile:260: obj/BossaForm.o] Error 1

Can probably be fixed by changing the gmake invocation to gmake --include-dir=/usr/local/include/wx-3.1
 
gh_origin
Thanks, this fixed the wx errors!
But now the linker fails:

Code:
% doas ln -s /usr/local/bin/wxgtk3u-3.0-config /usr/local/bin/wx-config
% gmake --include-dir=/usr/local/include/wx-3.1/wx/
CPP BOSSA src/BossaForm.cpp
CPP BOSSA src/BossaWindow.cpp
CPP BOSSA src/BossaAbout.cpp
CPP BOSSA src/BossaApp.cpp
CPP BOSSA src/BossaBitmaps.cpp
CPP BOSSA src/BossaInfo.cpp
CPP BOSSA src/BossaThread.cpp
CPP BOSSA src/BossaProgress.cpp
LD bin/bossa
ld: error: undefined symbol: BSDPortFactory::def()
>>> referenced by BSDPortFactory.cpp
>>>               obj/BSDPortFactory.o:(vtable for BSDPortFactory)
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:312: bin/bossa] Error 1


Edit: managed to fix that; this was a bug that got fixed and I just applied the Patch.

But of course, it still won't build :rolleyes:
Code:
src/bossash.cpp:33:10: fatal error: 'readline/readline.h' file not found
#include <readline/readline.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.                                                                                                            
gmake: *** [Makefile:286: obj/bossash.o] Error 1

tried adding the include path:
Code:
% gmake --include-dir=/usr/local/include/wx-3.1/wx/ --include-dir=/usr/local/include/
CPP BOSSASH src/bossash.cpp
src/bossash.cpp:33:10: fatal error: 'readline/readline.h' file not found
#include <readline/readline.h>
         ^~~~~~~~~~~~~~~~~~~~~
1 error generated.                                                                                                            
gmake: *** [Makefile:286: obj/bossash.o] Error 1

gmake ignores it, even when I add /usr/local/include before the wx-path...
 
sko Are you sure you have the basic skills needed to build software? You didn't give us the repo so we can't check. But at least the include path finding job is of the configure script. You run it before gmake. And I didn't found you run any configure script on your posts! Another thing proved you lacked the skills is no one build a C++ project with just a one make jobs like you. We all use make jobs to parallel the build to increase build speed. e.g: gmake -j4. You should learn the basic skills before even attempted to try otherwise it's just a waste of time for both you and us!
 
sko Are you sure you have the basic skills needed to build software?...
Well, I think asking in places such as this is how you get the skills.

Look here to read up on what a C/C++ #include statement does. One thing that's important to know is that #includes understand relative paths. So #include<foo/bar.h> will search all of the system directories for a directory called "foo", and if found, a file called "bar.h" therein.
 
Well, I think asking in places such as this is how you get the skills.
Before you asking here you should at least know how to install and use autoconf and automake [the most basic level], run a configure script and install the needed dependencies. The software you want to build should have that information already put in README or INSTALL. That's how I started and Google is always our friend. Asking before you are not even seriously tried is just a waste of time for both of you and the ones wanted to help you. Only ask when you are stuck and have no idea to get further! It's what I have learnt so far.
 
sko Are you sure you have the basic skills needed to build software? You didn't give us the repo so we can't check. But at least the include path finding job is of the configure script. You run it before gmake. And I didn't found you run any configure script on your posts! Another thing proved you lacked the skills is no one build a C++ project with just a one make jobs like you. We all use make jobs to parallel the build to increase build speed. e.g: gmake -j4. You should learn the basic skills before even attempted to try otherwise it's just a waste of time for both you and us!

I usually only build software from ports and seldomly some other tools from source, but usually they contain a) a working config(script)/makefile and b) at least some basic instructions on how to build it, dependencies etc. bossa (https://github.com/shumatech/BOSSA) doesn't provide any of that - it only comes with a makefile, but no config file/script, so autoconf and automake won't work. 'gmake config' also didn't work as it is usually the case with 'make config'.
As said: I've never dealt with C++ and also never (knowingly) had to use GNU make instead of plain 'make' on FreeBSD, where it is usually sufficient to do e.g. a 'make config' and 'make install clean'. I also never had to explicitly tell 'make' where to find includes, but gmake doesn't seem to do this by itself. Thus I added --include-path as stated in the manpage, but it still fails to find the include files at some point (even if it already accessed them earlier in the same build!).

Anyways, in the meantime I found out that the various components in fact can be built separately - but the targets are named differently to what one might expect ("strip-bossac" instead of just naming it "bossac"...). So this dumps all the wx and readline (which are of course both installed and the include files are present!) dependencies and only builds the cli-tool I need... But it turned out it won't connect in any version (same on Windows BTW...), so I gave up on it and just used the atmel sam-ba tool on a borrowed windows laptop instead...
 
sko This project is weird. I have no idea to troubleshoot it for you. Perhaps you should try to contact the port maintainer to ask him to update it for you, or fire a bug report about that port here: https://bugs.freebsd.org/bugzilla/
 
I've submitted a patch upstream that fixes compilation and linking on Freebsd. It builds, links and runs for me, but I don't have any of the hardware necessary to test it. You should probably file a bug against x11-toolkits/wxgtk30 to have it create the link for wx-config when it installs.
 
Back
Top