--- gforth/libcc.fs 2008/09/18 02:42:24 1.54 +++ gforth/libcc.fs 2008/10/06 21:21:20 1.56 @@ -135,6 +135,7 @@ \ : delete-file 2drop 0 ; require struct.fs +require mkdir.fs \ c-function-ft word body: struct @@ -505,13 +506,15 @@ create gen-wrapped-types open-wrappers dup if lib-handle-addr @ ! else + libcc-named-dir $1ff mkdir-parents drop drop c-library-name-create endif ; : c-tmp-library-name ( c-addr u -- ) \ set up filenames for a new library; c-addr u is the basename of \ the library - libcc-tmp-dir prepend-dirname c-library-name-setup c-library-name-create ; + libcc-tmp-dir 2dup $1ff mkdir-parents drop + prepend-dirname c-library-name-setup c-library-name-create ; : lib-handle ( -- addr ) lib-handle-addr @ @ ; @@ -558,10 +561,10 @@ DEFER compile-wrapper-function ( -- ) s" includedir" getenv append ] sliteral s" -O -c " s+ lib-filename 2@ append s" .c -o " append lib-filename 2@ append s" .lo" append ( c-addr u ) - \ cr 2dup type + \ 2dup type cr 2dup system drop free throw $? abort" libtool compile failed" [ libtool-command s" --silent --mode=link --tag=CC " s+ - libtool-cc append s" -module -rpath " s+ ] sliteral + libtool-cc append libtool-flags append s" -module -rpath " s+ ] sliteral lib-filename 2@ dirname replace-rpath s+ s" " append lib-filename 2@ append s" .lo -o " append lib-filename 2@ append s" .la" append ( c-addr u )