pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/lang/clang To get a working compiler on SunOS, a numbe...
details: https://anonhg.NetBSD.org/pkgsrc/rev/ddf1d5d93147
branches: trunk
changeset: 627952:ddf1d5d93147
user: richard <richard%pkgsrc.org@localhost>
date: Tue Dec 24 05:57:44 2013 +0000
description:
To get a working compiler on SunOS, a number of hardcoded gcc/linker
related paths are replaced.
http://article.gmane.org/gmane.comp.compilers.llvm.devel/63317
ok'd by wiz@
diffstat:
lang/clang/Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 42 insertions(+), 2 deletions(-)
diffs (58 lines):
diff -r 5f2a466a117f -r ddf1d5d93147 lang/clang/Makefile
--- a/lang/clang/Makefile Tue Dec 24 03:26:55 2013 +0000
+++ b/lang/clang/Makefile Tue Dec 24 05:57:44 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2013/07/02 10:33:02 adam Exp $
+# $NetBSD: Makefile,v 1.23 2013/12/24 05:57:44 richard Exp $
DISTNAME= clang-3.3
CATEGORIES= lang
@@ -38,7 +38,47 @@
PLIST_SUBST+= SOEXT="so"
.endif
-CFLAGS.SunOS+= -mimpure-text
+.include "../../mk/compiler.mk"
+
+.if ${OPSYS} == "SunOS" && !empty(PKGSRC_COMPILER:Mgcc)
+# This should probably be in hacks, but since clang hardcodes gcc paths
+# put this here so it can be removed when clang matures.
+# cxa_finalize.o is no longer necessary with libc.so >= ILLUMOS_0.5
+TEST_ILLUMOS_3849!=\
+ if /usr/bin/elfdump -v /lib/libc.so |\
+ ${GREP} -q 'ILLUMOS_0.5' ; then \
+ ${ECHO} 1; \
+ else ${ECHO} 0; \
+ fi
+
+#doesn't seem to be needed anymore, but may be dependent on
+#a recent version of solaris (illumos) ld.
+#
+#CFLAGS.SunOS+= -mimpure-text
+
+SUBST_CLASSES+= fix-paths
+SUBST_STAGE.fix-paths= pre-configure
+SUBST_MESSAGE.fix-paths= Fixing absolute gcc paths for SunOS.
+SUBST_FILES.fix-paths= tools/clang/lib/Driver/Tools.cpp
+. if defined(_GCC_ARCHDIR)
+SUBST_SED.fix-paths= -e 's,/usr/gcc/4.5/lib/gcc/,${_GCC_ARCHDIR}/,g'
+. else
+LIBGCCDIR!= ${CC} -print-libgcc-file-name
+ARCHDIR:= ${LIBGCCDIR:H}
+SUBST_SED.fix-paths= -e 's,/usr/gcc/4.5/lib/gcc/,${ARCHDIR}/,g'
+. endif
+SUBST_SED.fix-paths+= -e '/^.*i386.*getVendorName.*$$/{N;d;}'
+SUBST_SED.fix-paths+= -e 's,/4.5.2/amd64/,amd64/,g'
+SUBST_SED.fix-paths+= -e 's,"as","gas",g'
+. if exists(/usr/bin/ld)
+SUBST_SED.fix-paths+= -e 's,getToolChain().GetProgramPath("ld"),"/usr/bin/ld",g'
+. else
+SUBST_SED.fix-paths+= -e 's,getToolChain().GetProgramPath("ld"),"/usr/ccs/bin/ld",g'
+. endif
+. if ${TEST_ILLUMOS_3849}
+SUBST_SED.fix-paths+= -e 's,^.*cxa_finalize.*$$, ; //cxa_finalize.o,g'
+. endif
+.endif
post-extract:
mv ${WRKDIR}/cfe-${PKGVERSION_NOREV}.src ${WRKSRC}/tools/clang
Home |
Main Index |
Thread Index |
Old Index