alien.inline.compiler: fixed library-path and made other words private

db4
Jeremy Hughes 2009-07-11 19:23:49 +12:00
parent b03b769966
commit eb72ba84f6
1 changed files with 14 additions and 11 deletions

View File

@ -22,14 +22,8 @@ SYMBOL: C++
{ [ dup windows? ] [ drop ".dll" ] } { [ dup windows? ] [ drop ".dll" ] }
} cond ; } cond ;
: library-path ( str -- str' ) : library-path ( str -- path )
'[ "lib" % _ % library-suffix % ] "" make temp-file ; '[ "lib" % _ % library-suffix % ] "" make inline-library-file ;
: src-suffix ( lang -- str )
{
{ C [ ".c" ] }
{ C++ [ ".cpp" ] }
} case ;
HOOK: compiler os ( lang -- str ) HOOK: compiler os ( lang -- str )
@ -59,8 +53,16 @@ M: macosx link-descr
{ "-g" "-prebind" "-dynamiclib" "-o" } { "-g" "-prebind" "-dynamiclib" "-o" }
cpu x86.64? [ { "-arch" "x86_64" } prepend ] when ; cpu x86.64? [ { "-arch" "x86_64" } prepend ] when ;
: link-command ( in out lang -- descr ) <PRIVATE
compiler-descr link-descr append prepend prepend ; : src-suffix ( lang -- str )
{
{ C [ ".c" ] }
{ C++ [ ".cpp" ] }
} case ;
: link-command ( args in out lang -- descr )
[ 2array ] dip compiler-descr link-descr
append prepend prepend ;
:: compile-to-object ( lang contents name -- ) :: compile-to-object ( lang contents name -- )
name ".o" append temp-file name ".o" append temp-file
@ -71,8 +73,9 @@ M: macosx link-descr
:: link-object ( lang args name -- ) :: link-object ( lang args name -- )
args name [ library-path ] args name [ library-path ]
[ ".o" append temp-file ] bi 2array [ ".o" append temp-file ] bi
lang link-command try-process ; lang link-command try-process ;
PRIVATE>
:: compile-to-library ( lang args contents name -- ) :: compile-to-library ( lang args contents name -- )
lang contents name compile-to-object lang contents name compile-to-object