Since Haiku is available in different versions, build on different gcc versions, you need to build your yab apps on all versions to make them available for all Haiku users.

To make this work simply, i want to introduce you to an opportunity that I already use a long time.

I have installed on multiple partitions, separate versions of haiku, so I can build my yab apps for all this versions. Thereby it was close to create an central directory to build from there.


I simply created an additional partition, formatted it with the Be File System and named it SharedBFS. Then I have copied yab and my project files on that partition.

The biggest advantage is that you does not have to install yab on any of these systems anymore. You only need to create a link from the yab binary to /boot/home/config/bin and a link of the yabIDE to your Desktop. A further advantage is that you open on all haiku systems the same source file then you have placed it on the central partition. The same effect using the yabIDE, the editor stores all last opend documents and reopen them starting up the editor.

yab Script

To make the whole even easier, I've created a script which creates without having to start before the yabIDE or to use a terminal my program.

  • Over the script you can choose between using a current source file or to use a new one.
  • The script check the Haiku version using the shell tool setgcc. It should be noted, that you dont have to use this script then you have changed the gcc version of haiku using this shell tool after start up Haiku before.
  • If you want to use this script for yourself, you need to adjust the file paths. What is logical or nice for me must not be the same for you.

 

#!/bin/sh
#developer: lelldorin

infogcc=$(setgcc)

if [ "$infogcc" = "Current GCC: x86/gcc2" ]; then
      gcc=/SharedBFS/yab/bin/gcc2/yab
else
      gcc=/SharedBFS/yab/bin/gcc4/yab
fi

if [ "$(alert "Use special yab version?" "No" "Yes")" == "Yes" ]; then
      gcc=$(filepanel -d /SharedBFS/yab/bin)
fi

if [ "$(alert "Use current Source file?" "No" "Yes")" == "Yes" ]; then
      cd /SharedBFS/yab/BuildFactory/
      $gcc /SharedBFS/yab/BuildFactory/BuildFactory.yab /boot/home/Build_yabApp /SharedBFS/yab/BuildFactory/Source.yab
else
      if [ "$(alert "Select a yab Source Code" "Browse")" == "Browse" ]; then
            yabsource=$(filepanel -l -d /boot/home/Desktop)
            cp $yabsource /SharedBFS/yab/BuildFactory/Source.yab
            cd /SharedBFS/yab/BuildFactory/
            $gcc /SharedBFS/yab/BuildFactory/BuildFactory.yab /boot/home/Build_yabApp $yabsource
      fi

fi

alert "Building process complete" "Ok"
open /boot/home


Process of the script



At the beginning you can change the yab version. If you select Yes a filepanel will be opend...



...over which you can browse and select a other yab version.

Then the script will ask you to use a current source code or another one.

 

This only makes sense if you have build your program on one of the other Haiku systems before.

 



If you select Yes a new query will ask you to Browse for the new source code.



A filepanel will be open over that you can browse and select the new source code.

After this the source code is bound to yab, compressed...



If the build process is complete you get a message.



At the end the directory is opened in that the finished program was created.


 

Tutorial by Christian Albrecht (Lelldorin), Juni 2013
Made available by BeSly, the Haiku, BeOS and Zeta knowledge base.