From 85c8ef4a9702f65fd4a8d1e24df1cf0f0dff952c Mon Sep 17 00:00:00 2001 From: Michael Norrish Date: Mon, 8 Jan 2024 10:49:29 +1100 Subject: [PATCH] Allow simpler configuration of Poly/ML linker flags 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 https://github.com/polyml/polyml/issues/194 for some discussion of the issue with Poly/ML. --- tools-poly/configure.sml | 12 ++++++------ tools-poly/smart-configure.sml | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools-poly/configure.sml b/tools-poly/configure.sml index 431deb16ef..d5af2a2b64 100644 --- a/tools-poly/configure.sml +++ b/tools-poly/configure.sml @@ -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"), diff --git a/tools-poly/smart-configure.sml b/tools-poly/smart-configure.sml index 0f455efc10..763822fa55 100644 --- a/tools-poly/smart-configure.sml +++ b/tools-poly/smart-configure.sml @@ -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