| node list-next @ |
node list-next @ |
| repeat ; |
repeat ; |
| |
|
| \ linked libraries |
2variable c-libs \ library names in a string (without "lib") |
| |
|
| list% |
|
| cell% 2* field c-lib-string |
|
| end-struct c-lib% |
|
| |
|
| variable c-libs \ linked list of library names (without "lib") |
|
| |
|
| : add-lib ( c-addr u -- ) \ gforth |
: add-lib ( c-addr u -- ) \ gforth |
| \G Add library lib@i{string} to the list of libraries, where |
\G Add library lib@i{string} to the list of libraries, where |
| \G @i{string} is represented by @i{c-addr u}. |
\G @i{string} is represented by @i{c-addr u}. |
| c-lib% %size allocate throw dup >r |
c-libs 2@ d0= IF 0 allocate throw 0 c-libs 2! THEN |
| c-lib-string 2! |
c-libs 2@ s" -l" append 2swap append c-libs 2! ; |
| r> c-libs list-insert ; |
|
| |
: add-libpath ( c-addr u -- ) \ gforth |
| : append-l ( c-addr1 u1 node -- c-addr2 u2 ) |
\G Add path @i{string} to the list of library search pathes, where |
| \ append " -l<nodelib>" to string1 |
\G @i{string} is represented by @i{c-addr u}. |
| >r s" -l" append r> c-lib-string 2@ append ; |
c-libs 2@ d0= IF 0 allocate throw 0 c-libs 2! THEN |
| |
c-libs 2@ s" -L" append 2swap append c-libs 2! ; |
| |
|
| \ C prefix lines |
\ C prefix lines |
| |
|
| lib-filename 2@ dirname replace-rpath s+ s" " append |
lib-filename 2@ dirname replace-rpath s+ s" " append |
| lib-filename 2@ append s" .lo -o " append |
lib-filename 2@ append s" .lo -o " append |
| lib-filename 2@ append s" .la" append ( c-addr u ) |
lib-filename 2@ append s" .la" append ( c-addr u ) |
| c-libs @ ['] append-l list-map |
c-libs 2@ append |
| \ 2dup type cr |
\ 2dup type cr |
| 2dup system drop free throw $? abort" libtool link failed" |
2dup system drop free throw $? abort" libtool link failed" |
| open-wrappers dup 0= if |
open-wrappers dup 0= if |
| c-source-file-id @ if |
c-source-file-id @ if |
| compile-wrapper-function |
compile-wrapper-function |
| endif |
endif |
| 0 c-libs ! ; |
0. c-libs 2! ; |
| clear-libs |
clear-libs |
| |
|
| : c-library-incomplete ( -- ) |
: c-library-incomplete ( -- ) |