Fixed bash build.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7998 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2004-06-15 22:13:59 +00:00
parent 79b4983458
commit 020be68a26
2 changed files with 58 additions and 46 deletions
+17 -4
View File
@@ -2,6 +2,10 @@ SubDir OBOS_TOP src apps bin bash ;
SubDirCcFlags -DHAVE_CONFIG_H -DPROGRAM='\"sh\"' -DCONF_HOSTTYPE='\"i586\"' -DCONF_OSTYPE='\"beos\"' -DCONF_MACHTYPE='\"i586-pc-beos\"' -DCONF_VENDOR='\"pc\"' -DSHELL ; SubDirCcFlags -DHAVE_CONFIG_H -DPROGRAM='\"sh\"' -DCONF_HOSTTYPE='\"i586\"' -DCONF_OSTYPE='\"beos\"' -DCONF_MACHTYPE='\"i586-pc-beos\"' -DCONF_VENDOR='\"pc\"' -DSHELL ;
# filter warnings we don't want here
local originalCCFlags = $(CCFLAGS) ;
CCFLAGS = [ Filter $(CCFLAGS) : -Wall -Wmissing-prototypes -Wsign-compare ] ;
SubDirHdrs [ FDirName $(SUBDIR) include ] ; SubDirHdrs [ FDirName $(SUBDIR) include ] ;
SubDirHdrs [ FDirName $(SUBDIR) lib ] ; SubDirHdrs [ FDirName $(SUBDIR) lib ] ;
@@ -13,7 +17,7 @@ BinCommand mksignames :
SEARCH on [ FGristFiles mksignames.c ] = [ FDirName $(SUBDIR) support ] ; SEARCH on [ FGristFiles mksignames.c ] = [ FDirName $(SUBDIR) support ] ;
MakeLocate mksyntax mksignames : $(LOCATE_TARGET) ; MakeLocate mksyntax mksignames : [ FObjectsDir ] ;
rule MkSyntaxExt rule MkSyntaxExt
{ {
@@ -30,14 +34,14 @@ actions MkSyntaxExt1
$(2) -o $(1) ; $(2) -o $(1) ;
} }
MkSyntaxExt <src!apps!bin!bash>syntax.c ; MkSyntaxExt [ FGristFiles syntax.c ] ;
rule MkSignamesExt rule MkSignamesExt
{ {
SetupObjectsDir ; SetupObjectsDir ;
MakeLocate $(<) : $(LOCATE_TARGET) ; MakeLocate $(<) : $(LOCATE_TARGET) ;
Depends $(<) : mksyntax ; Depends $(<) : mksignames ;
MkSignamesExt1 $(<) : mksignames ; MkSignamesExt1 $(<) : mksignames ;
LocalClean clean : $(<) ; LocalClean clean : $(<) ;
} }
@@ -47,7 +51,7 @@ actions MkSignamesExt1
$(2) $(1) ; $(2) $(1) ;
} }
MkSignamesExt <src!apps!bin!bash>signames.h ; MkSignamesExt <bash>signames.h ;
BinCommand sh : BinCommand sh :
parse.y shell.c eval.c general.c make_cmd.c print_cmd.c parse.y shell.c eval.c general.c make_cmd.c print_cmd.c
@@ -61,5 +65,14 @@ BinCommand sh :
: libreadline.a libglob.a libbuiltins.a libtilde.a libsh.a libtermcap.a : libreadline.a libglob.a libbuiltins.a libtilde.a libsh.a libtermcap.a
: bash.rdef ; : bash.rdef ;
# trap.c includes signames.h
Includes [ FGristFiles trap.c ] : <bash>signames.h ;
# some sources include the generated builtext.h
Includes [ FGristFiles execute_cmd.c nojobs.c parse.c ] : <bash>builtext.h ;
SubInclude OBOS_TOP src apps bin bash lib ; SubInclude OBOS_TOP src apps bin bash lib ;
SubInclude OBOS_TOP src apps bin bash builtins ; SubInclude OBOS_TOP src apps bin bash builtins ;
# restore CCFLAGS
CCFLAGS = $(originalCCFlags) ;
+41 -42
View File
@@ -10,28 +10,17 @@ BinCommand mkbuiltins : mkbuiltins.c ;
MakeLocate mkbuiltins : $(LOCATE_TARGET) ; MakeLocate mkbuiltins : $(LOCATE_TARGET) ;
rule UserObject
{
switch $(2)
{
case *.S : assemble $(1) : $(2) ;
case *.o : return ;
case *.def : {
Depends $(<) : builtext.h ;
Cc $(<) : $(<:S=.c) ;
MkBuiltinsComp $(<:S=.c) : $(>) ;
}
case * : ECHO "unknown suffix on" $(2) ;
}
}
rule MkBuiltinsComp rule MkBuiltinsComp
{ {
MakeLocate $(<) : $(LOCATE_SOURCE) ; local source = $(1) ;
local defFile = $(2) ;
Depends $(<) : $(>) mkbuiltins ; SEARCH on $(defFile) = $(SEARCH_SOURCE) ;
MkBuiltinsComp1 $(<) : mkbuiltins $(>) ; MakeLocate $(source) : $(LOCATE_SOURCE) ;
LocalClean clean : $(<) ;
Depends $(source) : $(defFile) mkbuiltins ;
MkBuiltinsComp1 $(source) : mkbuiltins $(defFile) ;
LocalClean clean : $(source) ;
} }
actions MkBuiltinsComp1 actions MkBuiltinsComp1
@@ -41,12 +30,15 @@ actions MkBuiltinsComp1
rule MkBuiltinsExt rule MkBuiltinsExt
{ {
MakeLocate $(<) : $(LOCATE_SOURCE) ; local sources = $(1) ;
SEARCH on $(>) = $(SEARCH_SOURCE) ; local defFiles = [ FGristFiles $(2) ] ;
MakeLocate $(sources) : $(LOCATE_SOURCE) ;
SEARCH on $(defFiles) = $(SEARCH_SOURCE) ;
Depends $(<) : $(>) mkbuiltins ; Depends $(sources) : $(defFiles) mkbuiltins ;
MkBuiltinsExt1 $(<) : mkbuiltins $(>) ; MkBuiltinsExt1 $(sources) : mkbuiltins $(defFiles) ;
LocalClean clean : $(<) ; LocalClean clean : $(sources) ;
} }
actions MkBuiltinsExt1 actions MkBuiltinsExt1
@@ -54,25 +46,32 @@ actions MkBuiltinsExt1
$(2[1]) -externfile $(1[1]) -structfile $(1[2]) -noproduction $(2[2-]) ; $(2[1]) -externfile $(1[1]) -structfile $(1[2]) -noproduction $(2[2-]) ;
} }
MkBuiltinsExt builtext.h <src!apps!bin!bash!builtins>builtins.c : local bashDefFiles =
alias.def bind.def alias.def bind.def break.def builtin.def cd.def colon.def command.def
break.def builtin.def cd.def colon.def command.def declare.def echo.def enable.def eval.def exec.def exit.def fc.def fg_bg.def
declare.def echo.def enable.def eval.def exec.def hash.def help.def history.def jobs.def kill.def let.def pushd.def read.def
exit.def fc.def fg_bg.def hash.def help.def history.def jobs.def kill.def let.def return.def set.def setattr.def shift.def source.def suspend.def test.def
pushd.def read.def return.def set.def setattr.def shift.def source.def times.def trap.def type.def ulimit.def umask.def wait.def getopts.def
suspend.def test.def times.def trap.def type.def ulimit.def umask.def shopt.def printf.def complete.def
wait.def getopts.def shopt.def printf.def complete.def
; ;
StaticLibrary builtins : # generate the source file for the .def files
alias.def bind.def local bashDefFile ;
break.def builtin.def cd.def colon.def command.def for bashDefFile in [ FGristFiles $(bashDefFiles) ] {
common.c declare.def echo.def enable.def eval.def evalfile.c local source = $(bashDefFile:S=.c) ;
evalstring.c exec.def Includes $(cFile) : <bash>builtext.h ;
exit.def fc.def fg_bg.def hash.def help.def history.def jobs.def kill.def let.def Depends $(cFile:S=$(SUFOBJ)) : <bash>builtext.h ;
pushd.def read.def return.def set.def setattr.def shift.def source.def MkBuiltinsComp $(source) : $(bashDefFile) ;
suspend.def test.def times.def trap.def type.def ulimit.def umask.def }
wait.def getopts.def shopt.def printf.def getopt.c bashgetopt.c complete.def
builtins.c # generate builtext.h and builtins.c
MkBuiltinsExt <bash>builtext.h [ FGristFiles builtins.c ] : $(bashDefFiles) ;
# generate the builtins library
StaticLibrary builtins
: common.c evalfile.c evalstring.c getopt.c bashgetopt.c builtins.c
[ FGristFiles $(bashDefFiles:S=.c) ]
; ;
# common.c includes builtext.h
Includes [ FGristFiles common.c ] : <bash>builtext.h ;