summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2017-01-08 08:32:10 (GMT)
committerAlexey Neyman <stilor@att.net>2017-01-10 18:39:37 (GMT)
commit37a5a09e6505b28deb7cb4aaa5643950e4f892e9 (patch)
tree771d19b99e565c33c2aaf21985113eab38835b45
parent7989e5d7434cc5bf822bf659875a3e0e105cfca7 (diff)
Add MacOS options.
Needed for linking gettext/libiconv. Signed-off-by: Alexey Neyman <stilor@att.net>
-rw-r--r--scripts/crosstool-NG.sh.in23
1 files changed, 23 insertions, 0 deletions
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index 3495867..ba36bc8 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -496,6 +496,22 @@ if [ -z "${CT_RESTART}" ]; then
CT_CFLAGS_FOR_BUILD+=" ${CT_EXTRA_CFLAGS_FOR_BUILD}"
CT_LDFLAGS_FOR_BUILD="-L${CT_BUILDTOOLS_PREFIX_DIR}/lib"
CT_LDFLAGS_FOR_BUILD+=" ${CT_EXTRA_LDFLAGS_FOR_BUILD}"
+
+ case "${CT_BUILD}" in
+ *darwin*)
+ # Two issues while building on MacOS. Really, we should be checking for
+ # clang instead.
+ # - gettext static library fails to link unless CoreFoundation framework
+ # is included
+ # - ranlib on MacOS does not include common symbols into the symbol index
+ # for a static library, and hence linker fails to pull in the right
+ # archive members; hence, avoid common symbols. Alternative is to
+ # have ranlib wrapper in buildtools/bin supply -c option.
+ CT_CFLAGS_FOR_BUILD+=" -fno-common"
+ CT_LDFLAGS_FOR_BUILD+=" -framework CoreFoundation"
+ ;;
+ esac
+
CT_DoLog DEBUG "CFLAGS for build compiler: '${CT_CFLAGS_FOR_BUILD}'"
CT_DoLog DEBUG "LDFLAGS for build compiler: '${CT_LDFLAGS_FOR_BUILD}'"
@@ -508,6 +524,13 @@ if [ -z "${CT_RESTART}" ]; then
CT_CFLAGS_FOR_HOST+=" ${CT_EXTRA_CFLAGS_FOR_HOST}"
CT_LDFLAGS_FOR_HOST="-L${CT_HOST_COMPLIBS_DIR}/lib"
CT_LDFLAGS_FOR_HOST+=" ${CT_EXTRA_LDFLAGS_FOR_HOST}"
+ case "${CT_HOST}" in
+ *darwin*)
+ # Same as above, for host
+ CT_CFLAGS_FOR_HOST+=" -fno-common"
+ CT_LDFLAGS_FOR_HOST+=" -framework CoreFoundation"
+ ;;
+ esac
CT_DoLog DEBUG "CFLAGS for host compiler: '${CT_CFLAGS_FOR_HOST}'"
CT_DoLog DEBUG "LDFLAGS for host compiler: '${CT_LDFLAGS_FOR_HOST}'"