haiku/src/tools/gensyscalls/Jamfile
Ingo Weinhold 758b1d0e05 Fixes that make Haiku build with gcc 4. Mainly out of the following
categories:
* Missing includes (like <stdlib.h> and <string.h>).
* Linking against $(TARGET_LIBSTDC++) instead of libstdc++.r4.so.
* Local variables shadowing parameters.
* Default parameters in function definitions (as opposed to function
  declarations).
* All C++ stuff (nothrow, map, set, vector, min, max,...) must be imported
  explicitly from the std:: namespace now.
* "new (sometype)[...]" must read "new sometype[...]", even if sometype is
  something like "const char *".
* __FUNCTION__ is no longer a string literal (but a string expression), i.e.
  'printf(__FUNCTION__ ": ...\n")' is invalid code.
* A type cast results in a non-lvalue. E.g. "(char *)buffer += bytes"
  is an invalid expression.
* "friend class SomeClass" only works when SomeClass is known before.
  Otherwise the an inner class with that name is considered as friend.
  gcc 4 is much pickier about scopes.
* gcc 4 is generally stricter with respect to type conversions in C.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14878 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-12 23:27:14 +00:00

147 lines
3.7 KiB
Plaintext

SubDir HAIKU_TOP src tools gensyscalls ;
# build gensyscallinfos
BuildPlatformMain gensyscallinfos : gensyscallinfos.cpp ;
LinkAgainst gensyscallinfos : $(HOST_LIBSTDC++) ;
# generate the syscall infos source file
local syscallsHeader = [ FGristFiles syscalls.h ] ;
SEARCH on $(syscallsHeader) = [ FDirName $(HAIKU_TOP) headers private kernel ] ;
local syscallsHeaderPP = [ FGristFiles syscalls.h.pp ] ;
MakeLocateArch $(syscallsHeaderPP) ;
local syscallInfos = [ FGristFiles gensyscalls_infos.c ] ;
MakeLocateArch $(syscallInfos) ;
rule GenSyscallInfos {
Depends $(1) : gensyscallinfos $(2) ;
GenSyscallInfos1 $(1) : gensyscallinfos $(2) ;
}
actions GenSyscallInfos1 {
$(2[1]) $(2[2]) $(1)
}
GenSyscallInfos $(syscallInfos) : $(syscallsHeaderPP) ;
# build gensyscalls
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos:S=$(SUFOBJ)) ;
LinkAgainst gensyscalls : $(HOST_LIBSTDC++) ;
UsePrivateObjectHeaders gensyscalls.cpp : kernel ;
UseArchObjectHeaders gensyscalls.cpp : $(TARGET_ARCH) ;
# generate the output files
# place them where there are needed
local dir = $(HAIKU_COMMON_DEBUG_OBJECT_DIR) ;
MakeLocate <syscalls>syscalls.S.inc : [ FDirName $(dir) system libroot os ] ;
MakeLocate <syscalls>syscall_dispatcher.h : [ FDirName $(dir) system kernel ] ;
MakeLocate <syscalls>syscall_numbers.h : [ FDirName $(dir) system kernel ] ;
MakeLocate <syscalls>syscall_table.h : [ FDirName $(dir) system kernel ] ;
MakeLocate <syscalls>strace_syscalls.h : [ FDirName $(dir) bin strace ] ;
rule GenSyscallsFile {
Depends $(1) : gensyscalls ;
GenSyscallsFile1 $(1) : gensyscalls ;
}
actions GenSyscallsFile1 {
$(2[1]) -c $(1)
}
rule GenSyscallsDispatcher {
Depends $(1) : gensyscalls ;
GenSyscallsDispatcher1 $(1) : gensyscalls ;
}
actions GenSyscallsDispatcher1 {
$(2[1]) -d $(1)
}
rule GenSyscallsNumbers {
Depends $(1) : gensyscalls ;
GenSyscallsNumbers1 $(1) : gensyscalls ;
}
actions GenSyscallsNumbers1 {
$(2[1]) -n $(1)
}
rule GenSyscallsTable {
Depends $(1) : gensyscalls ;
GenSyscallsTable1 $(1) : gensyscalls ;
}
actions GenSyscallsTable1 {
$(2[1]) -t $(1)
}
rule GenSyscallsSTrace {
Depends $(1) : gensyscalls ;
GenSyscallsSTrace1 $(1) : gensyscalls ;
}
actions GenSyscallsSTrace1 {
$(2[1]) -s $(1)
}
GenSyscallsFile <syscalls>syscalls.S.inc ;
GenSyscallsDispatcher <syscalls>syscall_dispatcher.h ;
GenSyscallsNumbers <syscalls>syscall_numbers.h ;
GenSyscallsTable <syscalls>syscall_table.h ;
GenSyscallsSTrace <syscalls>strace_syscalls.h ;
# preprocess the syscalls header
UsePrivateHeaders kernel ;
UseArchHeaders $(TARGET_ARCH) ;
rule PreprocessSyscalls
{
Depends $(<) : $(>) ;
local headers = [ on $(1) return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
local sysHeaders = [ on $(1) return $(SUBDIRSYSHDRS) $(SYSHDRS) ]
$(HAIKU_HDRS) ;
HDRS on $(<) = $(headers) ;
SYSHDRS on $(<) = $(sysHeaders) ;
HDRRULE on $(>) = HdrRule ;
HDRSCAN on $(>) = $(HDRPATTERN) ;
HDRSEARCH on $(>) = $(headers) $(sysHeaders) $(STDHDRS) ;
HDRGRIST on $(>) = $(HDRGRIST) ;
DEFINES on $(<) += $(HAIKU_DEFINES) GEN_SYSCALL_INFOS_PROCESSING ;
CCFLAGS on $(<) += $(HAIKU_CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM) ;
CCHDRS on $(<) = [ FIncludes $(headers) : $(HOST_LOCAL_INCLUDES_OPTION) ]
$(HOST_INCLUDES_SEPARATOR)
[ FSysIncludes $(sysHeaders) : $(HOST_SYSTEM_INCLUDES_OPTION) ] ;
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
}
actions PreprocessSyscalls
{
$(HAIKU_C++) -xc++ -E "$(2)" $(CCFLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
}
PreprocessSyscalls $(syscallsHeaderPP) : $(syscallsHeader) ;
# compile the syscall infos source file
# TODO: Clean this mess up!
SYSHDRS on $(syscallInfos:S=$(SUFOBJ)) = $(HAIKU_HDRS) ;
Object $(syscallInfos:S=$(SUFOBJ)) : $(syscallInfos) ;
CCFLAGS on $(syscallInfos:S=$(SUFOBJ)) += -nostdinc ;