Some build fixes for FreeBSD.

* Drop endian.h; no longer needed as FreeBSD provides its own
   (and this conflicts with some other things later in the build.)

 * Needs libgnuregex; enable and adjust paths.

Doesn't fully work yet. The fixes in the next commit for fat_shell
plus some other build system tweaks are still needed.
This commit is contained in:
Augustin Cavalier
2025-02-01 16:48:11 -05:00
parent 69970cdd5b
commit 78dd36e7cb
4 changed files with 5 additions and 28 deletions
-16
View File
@@ -1,16 +0,0 @@
#ifndef _HAIKU_BUILD_COMPATIBILITY_FREEBSD_ENDIAN
#define _HAIKU_BUILD_COMPATIBILITY_FREEBSD_ENDIAN
// There's no <endian.h> in FreeBSD, but <sys/endian.h>. And the macro naming
// differs.
#include <sys/endian.h>
#define __LITTLE_ENDIAN _LITTLE_ENDIAN
#define __BIG_ENDIAN _BIG_ENDIAN
#define __PDP_ENDIAN _PDP_ENDIAN
#define BYTE_ORDER _BYTE_ORDER
#endif // _HAIKU_BUILD_COMPATIBILITY_FREEBSD_ENDIAN
+1 -1
View File
@@ -8,6 +8,6 @@ SubInclude HAIKU_TOP src build libshared ;
SubInclude HAIKU_TOP src build libsolv ; SubInclude HAIKU_TOP src build libsolv ;
SubInclude HAIKU_TOP src build libuuid ; SubInclude HAIKU_TOP src build libuuid ;
if $(HOST_PLATFORM) = darwin { if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = freebsd {
SubInclude HAIKU_TOP src build libgnuregex ; SubInclude HAIKU_TOP src build libgnuregex ;
} }
+2
View File
@@ -1,5 +1,7 @@
SubDir HAIKU_TOP src build libgnuregex ; SubDir HAIKU_TOP src build libgnuregex ;
MakeLocate libgnuregex_build.so : $(HOST_BUILD_COMPATIBILITY_LIB_DIR) ;
BuildPlatformSharedLibrary libgnuregex_build.so : BuildPlatformSharedLibrary libgnuregex_build.so :
regex.c regex.c
printchar.c printchar.c
+2 -11
View File
@@ -6,25 +6,16 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src bin keymap ] ;
USES_BE_API on <build>keymap = true ; USES_BE_API on <build>keymap = true ;
local regexSources ;
local regexLib ; local regexLib ;
if $(HOST_PLATFORM) = darwin || $(HOST_PLATFORM) = freebsd {
if $(HOST_PLATFORM) = freebsd { UseHeaders [ FDirName $(HAIKU_TOP) src build libgnuregex ] : true ;
# FreeBSD isolates the GNU regex functions into their own library.
regexLib = gnuregex ;
} else if $(HOST_PLATFORM) = darwin {
# Darwin does not have them at all, so we use the bundled version.
regexLib = libgnuregex_build.so ; regexLib = libgnuregex_build.so ;
} }
BuildPlatformMain <build>keymap : BuildPlatformMain <build>keymap :
main.cpp main.cpp
Keymap.cpp Keymap.cpp
$(regexSources)
: libshared_build.a $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(regexLib) : libshared_build.a $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) $(regexLib)
; ;
LinkAgainst <build>keymap : $(HOST_LIBBE) ; LinkAgainst <build>keymap : $(HOST_LIBBE) ;
SEARCH on [ FGristFiles $(regexSources) ]
= [ FDirName $(HAIKU_TOP) src system libroot posix glibc regex ] ;