Add a New Comment (Rich Markup)
Comment Type & Canned Response: None No canned response available
Making it a deferred word is a stopgap measure, but in the long run we cannot expect every Gforth user to find out how to do this stuff on their platform, and define compile-wrapper-function appropriately.
I guess a few different definitions for the different OSs should be sufficient. It would be nice if C compilers had a common command-line interface for this sort of stuff, but apparently this is not the case.
Concerning the bin directory needed for MacOS X, this looks like it should be the bindir in the Makefile, and should be fed into the image in the same way that includedir is fed in, i.e., through getenv during image generation.
BTW, please generate your patches with "diff -u ...". TIA.
Ok, I have applied your latest patch and the changes needed to get bindir into the environment.
I explored this a bit more, and think that
So I'd prefer to have compile-wrapper-function a DEFERred word. Then users can override it how they like. For example, here is a definition to work with plan9port:
:NONAME ( -- ) c-source-file close-file throw 0 c-source-file-id ! s" 9c -I /Users/darrenbane/include -o " lib-filename 2@ s+ s" .o " append lib-filename 2@ append s" .c" append ( c-addr u ) 2dup system drop free throw $? abort" compiler generated error" \ !! call dlerror S" 9l -bundle -bundle_loader /Users/darrenbane/bin/gforth-0.6.9-20070604 -o\ " lib-filename 2@ s+ S" .bundle " append lib-filename 2@ append S" .o" append 2dup system drop free throw $? abort" linker generated error" lib-filename 2@ s" .bundle" s+ 2dup open-lib dup 0= abort" open-lib failed" \ !! call dlerror ( lib-handle ) lib-handle-addr @ ! 2dup delete-file throw drop free throw lib-filename 2@ s" .c" s+ 2dup delete-file throw drop free throw lib-filename 2@ s" .o" s+ 2dup delete-file throw drop free throw lib-filename 2@ drop free throw 0 0 lib-filename 2! ; IS compile-wrapper-fu\ nction
Patch to fix this attached. However, I'm not happy with it: you need to hard-code the location of the eventual gforth binary. Suggestions welcomed.
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 5 latest changes.
Copyright © 2022 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.9