How to build fbc the way it could `see` the inc directory?

General FreeBASIC programming questions.
Post Reply
hungnguyengia
Posts: 65
Joined: Jul 01, 2021 7:53

How to build fbc the way it could `see` the inc directory?

Post by hungnguyengia »

I built fbc from the bootstrap archive. It seems this fbc can't `see` the inc directory so I have to add -i $HOME/FreeBASIC/inc in order to have it able to find the headers. I know there must be something wrong as the normal fbc distributed by you has no problem `seeing` the inc directory. Please help.

This is everything I did: make bootstrap

I didn't use the normal source archive because I can't use the Ubuntu binary archive of fbc to compile the source, it will ask for libtinfo which is not available on my Linux distro. Should I stop with the bootstrap archive since I already have the fbc binary or I have to continue to build fbc again with the source archive and my bootstrapped fbc as the compiler? If it's so, which options needed?

I guest it's ENABLE_STANDALONE=1 isn't it? I get this option when reading makefile. Still have no idea what this option really do and which options really needed. I want a fbc distribution which is the same as the official distribution. Thanks.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: How to build fbc the way it could `see` the inc directory?

Post by caseih »

Where did you install the compiler binary? FBC normally looks relative to the directory where the fbc executable is. In other words ../include. So stick the compiler in $HOME/FreeBASIC/bin and it should see the include folder. I'm not sure why sometimes the folder is called include and sometimes just inc.

The official compiler bundle does run under Ubuntu. The tinfo thing has been discussed many times. Install the package libtinfo5. sudo apt install libtinfo5
hungnguyengia
Posts: 65
Joined: Jul 01, 2021 7:53

Re: How to build fbc the way it could `see` the inc directory?

Post by hungnguyengia »

caseih wrote:Where did you install the compiler binary? FBC normally looks relative to the directory where the fbc executable is. In other words ../include. So stick the compiler in $HOME/FreeBASIC/bin and it should see the include folder. I'm not sure why sometimes the folder is called include and sometimes just inc.

The official compiler bundle does run under Ubuntu. The tinfo thing has been discussed many times. Install the package libtinfo5. sudo apt install libtinfo5
I'm sure with you there is no libtinfo package. I'm not a noob, I understand the Linux distro I use. Don't tell me to install libinfo package. There is no such thing. My Linux distro is not of the Ubuntu/Debian family, nor the Redhat/Fedora family.

I build fbc from the bootstrap source. It has the same directory layout as the distributed release. The problem is this version of fbc can't `see` the inc directory unlike the fbc of the official release.

I want to know which options needed to reproduce what we have on the official release. Get it?
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: How to build fbc the way it could `see` the inc directory?

Post by caseih »

Yes I get it.

Short answer, I was somewhat incorrect in what I said before. fbc by default looks in ../include/freebasic/ and the bootstrap fbc is not different. Yes I just built bootstrap so I know for sure. Make your tree look exactly like the official tarball's tree and you're in business. From what I can see bootstrap isn't meant to be used as your "real" compiler. It's meant to be used to then compile your working FB distribution. But I don't see any problem with using the fbc created by the bootstrap tarball. Just make sure you move the contents of inc/ to include/freebasic/

As for the tinfo issue, you must be using a less-widely used distro. All the major distros have compatibility packages you can use to give you libtinfo.so.5. Some people report success symlinking libtinfo.so.6 to libtinfo.so.5 (which you will have if you have ncurses installed). Ubuntu, RedHat, Fedora, Arch, Mandriva, all have compat packages available, although Arch requires an AUR for that. But yes the bootstrap works and will give you an FBC that is linked to the more recent version of ncurses which is just fine.
hungnguyengia
Posts: 65
Joined: Jul 01, 2021 7:53

Re: How to build fbc the way it could `see` the inc directory?

Post by hungnguyengia »

caseih wrote:Yes I get it.

Short answer, I was somewhat incorrect in what I said before. fbc by default looks in ../include/freebasic/ and the bootstrap fbc is not different. Yes I just built bootstrap so I know for sure. Make your tree look exactly like the official tarball's tree and you're in business. From what I can see bootstrap isn't meant to be used as your "real" compiler. It's meant to be used to then compile your working FB distribution. But I don't see any problem with using the fbc created by the bootstrap tarball. Just make sure you move the contents of inc/ to include/freebasic/

As for the tinfo issue, you must be using a less-widely used distro. All the major distros have compatibility packages you can use to give you libtinfo.so.5. Some people report success symlinking libtinfo.so.6 to libtinfo.so.5 (which you will have if you have ncurses installed). Ubuntu, RedHat, Fedora, Arch, Mandriva, all have compat packages available, although Arch requires an AUR for that. But yes the bootstrap works and will give you an FBC that is linked to the more recent version of ncurses which is just fine.
Thanks. This is what I wanted to know. After modified the directory layout fbc now can find include files.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: How to build fbc the way it could `see` the inc directory?

Post by caseih »

A tip for finding out stuff like this is the strace command. That's how I determined where it was looking.
j8w344c6
Posts: 184
Joined: Oct 25, 2021 10:18

Re: How to build fbc the way it could `see` the inc directory?

Post by j8w344c6 »

caseih wrote:Where did you install the compiler binary? FBC normally looks relative to the directory where the fbc executable is. In other words ../include. So stick the compiler in $HOME/FreeBASIC/bin and it should see the include folder. I'm not sure why sometimes the folder is called include and sometimes just inc.

The official compiler bundle does run under Ubuntu. The tinfo thing has been discussed many times. Install the package libtinfo5. sudo apt install libtinfo5
I have no idea why this is undocumented. It's really caused real trouble for me. Exactly it is ..include/freebasic. Your answer saved me hour of researching. Thank you very much.
Post Reply