mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 22:12:24 +00:00
static and dynamic linking works on macosx -- noch
This commit is contained in:
parent
bdb2b32588
commit
87f7119dfd
5 changed files with 25 additions and 5 deletions
|
|
@ -30,7 +30,7 @@ CCOPT = -fPIC $(INCLUDEPATH) -g
|
|||
|
||||
CC = cc $(CCOPT) -c
|
||||
CL = cc $(CCOPT)
|
||||
LD = cc -dynamiclib -o $(LIBRARY).dylib
|
||||
LD = libtool -dynamic -lSystem -compatibility_version $(RELEASE) -current_version $(RELEASE) -install_name $(PREFIX)/lib/$(LIBRARY).dylib -o $(LIBRARY).dylib
|
||||
# s is necessary to create index inside a archive
|
||||
ARCHIVE = ar rcs $(LIBRARY).a
|
||||
|
||||
|
|
|
|||
BIN
ocat
BIN
ocat
Binary file not shown.
BIN
showdef
BIN
showdef
Binary file not shown.
|
|
@ -33,6 +33,8 @@ cc : ARRAY 1023 OF CHAR;
|
|||
ccopt : ARRAY 1023 OF CHAR;
|
||||
cmd : ARRAY 1023 OF CHAR;
|
||||
ext : ARRAY 5 OF CHAR;
|
||||
|
||||
cmd2 : ARRAY 1023 OF CHAR;
|
||||
BEGIN
|
||||
(*
|
||||
gcc -g -o hello hello.c -I $RPATH/src/lib/system/linux/gnuc/x86_64 -I. -I$RPATH -lOberon -L. -L$RPATH -static
|
||||
|
|
@ -46,13 +48,34 @@ Strings.Append(" ", cmd);
|
|||
Strings.Append(m, cmd);
|
||||
Strings.Append(ext, cmd);
|
||||
Strings.Append(additionalopts, cmd);
|
||||
IF statically THEN Strings.Append(" -static ", cmd) END;
|
||||
Strings.Append(" ", cmd);
|
||||
(*IF statically THEN Strings.Append(" -static ", cmd) END;*)
|
||||
IF statically THEN
|
||||
Strings.Append(version.prefix, cmd);
|
||||
Strings.Append("/lib/libVishapOberon.a ", cmd);
|
||||
END;
|
||||
Strings.Append(" -o ", cmd);
|
||||
Strings.Append(m, cmd);
|
||||
Strings.Append(" ", cmd);
|
||||
IF ~statically THEN
|
||||
Strings.Append ("-lVishapOberon -L. -L", ccOpt);
|
||||
Strings.Append (version.prefix, ccOpt);
|
||||
Strings.Append ("/lib ", ccOpt);
|
||||
END;
|
||||
Strings.Append(ccOpt, cmd);
|
||||
|
||||
Console.Ln; Console.String(cmd); Console.Ln; (* may be it's feasible to add debug mode later *)
|
||||
Unix.system(cmd);
|
||||
|
||||
IF ~statically THEN
|
||||
cmd2 := "";
|
||||
COPY ("install_name_tool -change libVishapOberon.dylib ", cmd2);
|
||||
Strings.Append(version.prefix, cmd2);
|
||||
Strings.Append ("/lib/libVishapOberon.dylib ", cmd2);
|
||||
Strings.Append (m, cmd2);
|
||||
Console.String(cmd2); Console.Ln;
|
||||
Unix.system(cmd2);
|
||||
END
|
||||
END LinkMain;
|
||||
|
||||
BEGIN
|
||||
|
|
@ -70,9 +93,6 @@ Strings.Append(version.prefix, tmp1);
|
|||
Strings.Append("/", tmp1);
|
||||
Strings.Append(incPath1, tmp1);
|
||||
Strings.Append(tmp1, ccOpt);
|
||||
Strings.Append ("-lVishapOberon -L. -L", ccOpt);
|
||||
Strings.Append (version.prefix, ccOpt);
|
||||
Strings.Append ("/lib ", ccOpt);
|
||||
Args.GetEnv("CFLAGS", CFLAGS);
|
||||
Strings.Append (CFLAGS, ccOpt);
|
||||
Strings.Append (" ", ccOpt);
|
||||
|
|
|
|||
BIN
voc
BIN
voc
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue