Skip to content

Commit

Permalink
Allow simpler configuration of Poly/ML linker flags
Browse files Browse the repository at this point in the history
Previously, one had to copy out all of the generated flags and put
them and the addition into one's poly-includes.ML file. Now one can
just provide a definition of EXTRA_POLY_LDFLAGS, e.g.:

  val EXTRA_POLY_LDFLAGS = ["-ld_classic"]

This example is needed with current Poly/ML on current versions of the
Mac C infrastructure (Xcode version 15).

See

  polyml/polyml#194

for some discussion of the issue with Poly/ML.
  • Loading branch information
mn200 committed Jan 7, 2024
1 parent eb52ee5 commit 85c8ef4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools-poly/configure.sml
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,17 @@ in
("val POLY_LDFLAGS = [" ^
String.concatWith ", "
(map quote
(if null POLY_LDFLAGS then machine_flags
else POLY_LDFLAGS)) ^
((if null POLY_LDFLAGS then machine_flags
else POLY_LDFLAGS) @ EXTRA_POLY_LDFLAGS)) ^
"]\n"),
"val POLY_LDFLAGS_STATIC =" -->
("val POLY_LDFLAGS_STATIC = [" ^
String.concatWith ", "
(map quote
(if null POLY_LDFLAGS_STATIC then
("-static" :: machine_flags)
else
POLY_LDFLAGS_STATIC)) ^
((if null POLY_LDFLAGS_STATIC then
("-static" :: machine_flags)
else
POLY_LDFLAGS_STATIC) @ EXTRA_POLY_LDFLAGS)) ^
"]\n"),
"val CC =" --> ("val CC = "^quote CC^"\n"),
"val OS =" --> ("val OS = "^quote OS^"\n"),
Expand Down
1 change: 1 addition & 0 deletions tools-poly/smart-configure.sml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ val DOT_PATH = SOME "";
val MLTON = SOME "";
val GNUMAKE = "";
val POLY_LDFLAGS = [] : string list;
val EXTRA_POLY_LDFLAGS = [] : string list;
val POLY_LDFLAGS_STATIC = [] : string list;

val _ = let
Expand Down

0 comments on commit 85c8ef4

Please sign in to comment.