Patch by Morgan Howe (slightly modified): Several changes to support
building on Mac OS X (Darwin). A problem with makebootable remains. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21165 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+14
-2
@@ -335,9 +335,11 @@ HOST_AR = $(HOST_AR[1]) ;
|
|||||||
HOST_UNARFLAGS ?= x ;
|
HOST_UNARFLAGS ?= x ;
|
||||||
|
|
||||||
# check the host platform compatibility
|
# check the host platform compatibility
|
||||||
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host : linux freebsd ;
|
SetPlatformCompatibilityFlagVariables HOST_PLATFORM : HOST : host
|
||||||
|
: linux freebsd darwin ;
|
||||||
|
|
||||||
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd {
|
if $(HOST_PLATFORM) = linux || $(HOST_PLATFORM) = freebsd
|
||||||
|
|| $(HOST_PLATFORM) = darwin {
|
||||||
# don't use lex: otherwise rc will not work correctly
|
# don't use lex: otherwise rc will not work correctly
|
||||||
if $(LEX) = lex {
|
if $(LEX) = lex {
|
||||||
LEX = flex ;
|
LEX = flex ;
|
||||||
@@ -404,6 +406,7 @@ switch $(HOST_PLATFORM) {
|
|||||||
case haiku : HOST_DEBUG_FLAGS ?= -ggdb ;
|
case haiku : HOST_DEBUG_FLAGS ?= -ggdb ;
|
||||||
case linux : HOST_DEBUG_FLAGS ?= -ggdb ;
|
case linux : HOST_DEBUG_FLAGS ?= -ggdb ;
|
||||||
case freebsd : HOST_DEBUG_FLAGS ?= -ggdb ;
|
case freebsd : HOST_DEBUG_FLAGS ?= -ggdb ;
|
||||||
|
case darwin : HOST_DEBUG_FLAGS ?= -ggdb ;
|
||||||
case * : HOST_DEBUG_FLAGS ?= -g ;
|
case * : HOST_DEBUG_FLAGS ?= -g ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -465,10 +468,17 @@ if $(HOST_PLATFORM_BEOS_COMPATIBLE) {
|
|||||||
HOST_LIBSUPC++ = supc++ ;
|
HOST_LIBSUPC++ = supc++ ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $(HOST_PLATFORM) = darwin {
|
||||||
|
HOST_LIBSUPC++ = gcc_s.1 ;
|
||||||
|
}
|
||||||
|
|
||||||
# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
|
# Unlike glibc FreeBSD's libc doesn't have built-in regex support.
|
||||||
if $(HOST_PLATFORM) = freebsd {
|
if $(HOST_PLATFORM) = freebsd {
|
||||||
HOST_LIBROOT += /usr/lib/libgnuregex.so ;
|
HOST_LIBROOT += /usr/lib/libgnuregex.so ;
|
||||||
|
} else if $(HOST_PLATFORM) = darwin {
|
||||||
|
HOST_LIBROOT += /opt/local/lib/libgnuregex.dylib ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
|
# The BeOS compilers define __INTEL__ respectively __POWERPC__. On the
|
||||||
# build platform we need to make sure, this is also defined.
|
# build platform we need to make sure, this is also defined.
|
||||||
@@ -635,6 +645,7 @@ switch $(TARGET_PLATFORM) {
|
|||||||
case haiku : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
case haiku : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_HAIKU ;
|
||||||
case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ;
|
case linux : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LINUX ;
|
||||||
case freebsd : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_FREEBSD ;
|
case freebsd : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_FREEBSD ;
|
||||||
|
case darwin : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_DARWIN ;
|
||||||
case libbe_test : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
|
case libbe_test : TARGET_DEFINES += HAIKU_TARGET_PLATFORM_LIBBE_TEST ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -646,6 +657,7 @@ switch $(HOST_PLATFORM) {
|
|||||||
case haiku : HOST_DEFINES += HAIKU_HOST_PLATFORM_HAIKU ;
|
case haiku : HOST_DEFINES += HAIKU_HOST_PLATFORM_HAIKU ;
|
||||||
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
case linux : HOST_DEFINES += HAIKU_HOST_PLATFORM_LINUX ;
|
||||||
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
|
case freebsd : HOST_DEFINES += HAIKU_HOST_PLATFORM_FREEBSD ;
|
||||||
|
case darwin : HOST_DEFINES += HAIKU_HOST_PLATFORM_DARWIN ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -457,8 +457,14 @@ rule BuildPlatformSharedLibrary
|
|||||||
local libs = $(3) ;
|
local libs = $(3) ;
|
||||||
|
|
||||||
BuildPlatformMain $(target) : $(sources) : $(libs) ;
|
BuildPlatformMain $(target) : $(sources) : $(libs) ;
|
||||||
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
|
||||||
-shared -Xlinker -soname=\"$(target:G=)\" ;
|
if $(HOST_PLATFORM) = darwin {
|
||||||
|
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
||||||
|
-dynamic -dynamiclib -Xlinker -flat_namespace ;
|
||||||
|
} else {
|
||||||
|
LINKFLAGS on $(target) = [ on $(target) return $(LINKFLAGS) ]
|
||||||
|
-shared -Xlinker -soname=\"$(target:G=)\" ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rule BuildPlatformMergeObject
|
rule BuildPlatformMergeObject
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ if [ $isImage ]; then
|
|||||||
echo
|
echo
|
||||||
if [ ! $updateOnly ]; then
|
if [ ! $updateOnly ]; then
|
||||||
echo "Creating image ..."
|
echo "Creating image ..."
|
||||||
dd if=/dev/zero of=$imagePath bs=1M count=$imageSize
|
dd if=/dev/zero of=$imagePath bs=1048576 count=$imageSize
|
||||||
$bfsShell --initialize $imagePath Haiku
|
$bfsShell --initialize $imagePath Haiku
|
||||||
$makebootable $imagePath
|
$makebootable $imagePath
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -272,6 +272,7 @@ case "${platform}" in
|
|||||||
;;
|
;;
|
||||||
Linux) buildPlatform=linux ;;
|
Linux) buildPlatform=linux ;;
|
||||||
FreeBSD) buildPlatform=freebsd ;;
|
FreeBSD) buildPlatform=freebsd ;;
|
||||||
|
Darwin) buildPlatform=darwin ;;
|
||||||
*) echo Unsupported platform: ${platform}
|
*) echo Unsupported platform: ${platform}
|
||||||
exit 1 ;;
|
exit 1 ;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ extern "C" {
|
|||||||
extern size_t strlcpy(char *dest, const char *source, size_t length);
|
extern size_t strlcpy(char *dest, const char *source, size_t length);
|
||||||
extern size_t strlcat(char *dest, const char *source, size_t length);
|
extern size_t strlcat(char *dest, const char *source, size_t length);
|
||||||
|
|
||||||
#ifdef HAIKU_HOST_PLATFORM_FREEBSD
|
#if defined(HAIKU_HOST_PLATFORM_FREEBSD) || defined(HAIKU_HOST_PLATFORM_DARWIN)
|
||||||
extern size_t strnlen(const char *string, size_t length);
|
extern size_t strnlen(const char *string, size_t length);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _HAIKU_BUILD_COMPATIBILITY_DARWIN_ENDIAN
|
||||||
|
#define _HAIKU_BUILD_COMPATIBILITY_DARWIN_ENDIAN
|
||||||
|
|
||||||
|
#include <machine/endian.h>
|
||||||
|
|
||||||
|
#define __LITTLE_ENDIAN LITTLE_ENDIAN
|
||||||
|
#define __BIG_ENDIAN BIG_ENDIAN
|
||||||
|
#define __PDP_ENDIAN PDP_ENDIAN
|
||||||
|
|
||||||
|
#endif // _HAIKU_BUILD_COMPATIBILITY_DARWIN_ENDIAN
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#ifndef _HAIKU_BUILD_COMPATIBILITY_DARWIN_REGEX
|
||||||
|
#define _HAIKU_BUILD_COMPATIBILITY_DARWIN_REGEX
|
||||||
|
|
||||||
|
// Include the darwin port of gnuregex
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include </opt/local/include/gnuregex.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // _HAIKU_BUILD_COMPATIBILITY_DARWIN_REGEX
|
||||||
+9
-6
@@ -22,7 +22,7 @@ USES_BE_API on $(tools) = true ;
|
|||||||
BuildPlatformMain <build>catattr : catattr.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>catattr : catattr.cpp : $(HOST_LIBBE) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>copyattr : copyattr.cpp
|
BuildPlatformMain <build>copyattr : copyattr.cpp
|
||||||
: $(HOST_LIBBE) $(HOST_LIBSTDC++) ;
|
: $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>listattr : listattr.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>listattr : listattr.cpp : $(HOST_LIBBE) ;
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ BuildPlatformMain <build>mimeset :
|
|||||||
database_support.cpp
|
database_support.cpp
|
||||||
UpdateMimeInfoThread.cpp
|
UpdateMimeInfoThread.cpp
|
||||||
MimeUpdateThread.cpp
|
MimeUpdateThread.cpp
|
||||||
: $(HOST_LIBBE)
|
: $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
||||||
;
|
;
|
||||||
|
|
||||||
BuildPlatformMain <build>mkindex : mkindex.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>mkindex : mkindex.cpp : $(HOST_LIBBE) ;
|
||||||
@@ -43,13 +43,16 @@ BuildPlatformMain <build>mkindex : mkindex.cpp : $(HOST_LIBBE) ;
|
|||||||
BuildPlatformMain <build>rmattr : rmattr.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>rmattr : rmattr.cpp : $(HOST_LIBBE) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>set_haiku_revision : set_haiku_revision.cpp
|
BuildPlatformMain <build>set_haiku_revision : set_haiku_revision.cpp
|
||||||
: $(HOST_LIBSTDC++) ;
|
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>settype : settype.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>settype : settype.cpp : $(HOST_LIBBE)
|
||||||
|
$(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>setversion : setversion.cpp : $(HOST_LIBBE) ;
|
BuildPlatformMain <build>setversion : setversion.cpp : $(HOST_LIBBE)
|
||||||
|
$(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
BuildPlatformMain <build>xres : xres.cpp : $(HOST_LIBBE) $(HOST_LIBSTDC++) ;
|
BuildPlatformMain <build>xres : xres.cpp : $(HOST_LIBBE) $(HOST_LIBSTDC++)
|
||||||
|
$(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
SEARCH on [ FGristFiles
|
SEARCH on [ FGristFiles
|
||||||
Mime.cpp
|
Mime.cpp
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ PreprocessSyscalls $(syscallsHeaderPP) : $(syscallsHeader) ;
|
|||||||
|
|
||||||
BuildPlatformMain gensyscallinfos
|
BuildPlatformMain gensyscallinfos
|
||||||
: gensyscallinfos.cpp
|
: gensyscallinfos.cpp
|
||||||
: $(HOST_LIBSTDC++)
|
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ SubDirHdrs [ FDirName $(SUBDIR) arch $(TARGET_ARCH) ] ;
|
|||||||
# build gensyscalls
|
# build gensyscalls
|
||||||
|
|
||||||
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos) ;
|
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos) ;
|
||||||
LinkAgainst gensyscalls : $(HOST_LIBSTDC++) ;
|
LinkAgainst gensyscalls : $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
# Explicitly tell jam that gensyscalls.cpp includes the generated header.
|
# Explicitly tell jam that gensyscalls.cpp includes the generated header.
|
||||||
Includes [ FGristFiles gensyscalls.cpp ] : $(syscallsHeaderPP) ;
|
Includes [ FGristFiles gensyscalls.cpp ] : $(syscallsHeaderPP) ;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ USES_BE_API on <build>keymap = true ;
|
|||||||
BuildPlatformMain <build>keymap :
|
BuildPlatformMain <build>keymap :
|
||||||
main.cpp
|
main.cpp
|
||||||
Keymap.cpp
|
Keymap.cpp
|
||||||
|
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
||||||
;
|
;
|
||||||
|
|
||||||
LinkAgainst <build>keymap : $(HOST_LIBBE) ;
|
LinkAgainst <build>keymap : $(HOST_LIBBE) ;
|
||||||
|
|||||||
@@ -23,5 +23,5 @@ AddFileDataResource <build>makebootable : RAWT:666:BootCode : stage1.bin ;
|
|||||||
BuildPlatformMain <build>makebootable :
|
BuildPlatformMain <build>makebootable :
|
||||||
makebootable.cpp
|
makebootable.cpp
|
||||||
$(hostPlatformSources)
|
$(hostPlatformSources)
|
||||||
: $(HOST_LIBBE)
|
: $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ BuildPlatformMain <build>rc :
|
|||||||
strlcat.c
|
strlcat.c
|
||||||
;
|
;
|
||||||
LinkAgainst <build>rc
|
LinkAgainst <build>rc
|
||||||
: <build>librdef.a $(HOST_LIBSTDC++) $(HOST_LIBBE) ;
|
: <build>librdef.a $(HOST_LIBSTDC++) $(HOST_LIBBE) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
SEARCH on [ FGristFiles
|
SEARCH on [ FGristFiles
|
||||||
strlcat.c strlcpy.c
|
strlcat.c strlcpy.c
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ SubDir HAIKU_TOP src tools resattr ;
|
|||||||
USES_BE_API on <build>resattr = true ;
|
USES_BE_API on <build>resattr = true ;
|
||||||
|
|
||||||
BuildPlatformMain <build>resattr : resattr.cpp ;
|
BuildPlatformMain <build>resattr : resattr.cpp ;
|
||||||
LinkAgainst <build>resattr : $(HOST_LIBBE) ;
|
LinkAgainst <build>resattr : $(HOST_LIBBE) $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user