Skip to content

Commit

Permalink
Stop using gcc target ids in lib/freebasic/<target> path
Browse files Browse the repository at this point in the history
Previously,
	fbc -target i686-w64-mingw32
would use
	lib/freebasic/i686-w64-mingw32/
as the lib dir. This changes it to use
	lib/freebasic/win32/
i.e. the FB standard.

This means that cross-compiling (-target i686-w64-mingw32) and native
compilation (on win32) will use the same dir layout, making packaging and
distribution easier.

The only advantage of using the gcc target ids was that it allows doing
things like this:
	lib/freebasic/i486-pc-linux-gnu
	lib/freebasic/i686-pc-linux-gnu
which isn't possible with the <fbtarget> because that's just linux-x86
and doesn't encode the difference between i484 and i686. But I think it's
better to find a different solution for that problem, if needed, in
particular one that also works with the standalone dir layout (which only
uses the <fbtarget> ids).
  • Loading branch information
dkl committed Apr 12, 2015
1 parent 7717b07 commit 1afd593
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Version 1.03.0

[changed]
- -print now only prints the information, and then stops the compiler
- non-standalone builds: -target <gcctarget> no longer searches libs in lib/freebasic/<gcctarget>, but rather in the normal lib/freebasic/<fbtarget> directory. I.e. the directory layout for native or cross compiling is the same, making packaging and distribution easier.

[added]
- Package name + version to all the new/updated bindings
Expand Down
10 changes: 3 additions & 7 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,22 +346,18 @@ ifdef ENABLE_STANDALONE
prefixincdir := $(prefix)/inc
prefixlibdir := $(prefix)/$(libdir)
else
ifdef TARGET
libsubdir := $(TARGET)
endif

# With ENABLE_LIB64, put 64bit libs into
# lib64/freebasic/<target>/
# lib64/freebasic/<fbtarget>/
# instead of the default
# lib/freebasic/<target>/
# lib/freebasic/<fbtarget>/
libdirname := lib
ifdef ENABLE_LIB64
ifneq ($(filter x86_64 aarch64,$(TARGET_ARCH)),)
libdirname := lib64
endif
endif

# Normal (non-standalone) setup: bin/fbc, include/freebasic/, lib[64]/freebasic/<target>/.
# Normal (non-standalone) setup: bin/fbc, include/freebasic/, lib[64]/freebasic/<fbtarget>/.
FBC_EXE := bin/fbc$(ENABLE_SUFFIX)$(EXEEXT)
FBCNEW_EXE := bin/fbc$(ENABLE_SUFFIX)-new$(EXEEXT)
libdir := $(libdirname)/$(FBNAME)/$(libsubdir)
Expand Down
13 changes: 3 additions & 10 deletions src/compiler/fbc.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2296,10 +2296,8 @@ private sub fbcInit2( )
''
'' Normal has additional support for gcc targets (e.g. i686-pc-mingw32),
'' which have to be prefixed to the executable names of cross-compiling
'' tools in the bin/ directory (e.g. bin/i686-pc-mingw32-ld) and have
'' their own subdirs in lib/freebasic/ (containing the libfb.a etc.
'' built with that exact cross-compiler toolchain). For native
'' compilation, no target id is prefixed to bin/ tools at all.
'' tools in the bin/ directory (e.g. bin/i686-pc-mingw32-ld). However,
'' for native compilation, no target is prefixed to bin/ tools at all.
''
'' Normal uses include/freebasic/ and lib/freebasic/ to hold FB includes
'' and libraries, to stay out of the way of the C ones in include/ and
Expand Down Expand Up @@ -2350,12 +2348,7 @@ private sub fbcInit2( )

fbc.binpath = fbc.prefix + "bin" + FB_HOST_PATHDIV + fbc.targetprefix
fbc.incpath = fbc.prefix + "include" + FB_HOST_PATHDIV + fbname
fbc.libpath = fbc.prefix + libdirname + FB_HOST_PATHDIV + fbname + FB_HOST_PATHDIV
if( len( fbc.target ) > 0 ) then
fbc.libpath += fbc.target
else
fbc.libpath += targetid
end if
fbc.libpath = fbc.prefix + libdirname + FB_HOST_PATHDIV + fbname + FB_HOST_PATHDIV + targetid
#endif

if( fbc.verbose ) then
Expand Down

0 comments on commit 1afd593

Please sign in to comment.