[123121] trunk/dports/science/arb
ryandesign at macports.org
ryandesign at macports.org
Tue Aug 5 16:45:16 PDT 2014
Revision: 123121
https://trac.macports.org/changeset/123121
Author: ryandesign at macports.org
Date: 2014-08-05 16:45:15 -0700 (Tue, 05 Aug 2014)
Log Message:
-----------
arb: detect compiler versions more correctly (#44367)
Modified Paths:
--------------
trunk/dports/science/arb/Portfile
trunk/dports/science/arb/files/patch-ARB-arb_compiler_version.pl.diff
Added Paths:
-----------
trunk/dports/science/arb/files/patch-Makefile.diff
Modified: trunk/dports/science/arb/Portfile
===================================================================
--- trunk/dports/science/arb/Portfile 2014-08-05 22:24:36 UTC (rev 123120)
+++ trunk/dports/science/arb/Portfile 2014-08-05 23:45:15 UTC (rev 123121)
@@ -53,7 +53,8 @@
patchfiles patch-ARB-config.makefile.diff \
patch-ARB-intro.fig.diff \
patch-ARB-arb.diff \
- patch-ARB-arb_compiler_version.pl.diff
+ patch-ARB-arb_compiler_version.pl.diff \
+ patch-Makefile.diff
# https://trac.macports.org/ticket/44368
platform darwin 11 {
Modified: trunk/dports/science/arb/files/patch-ARB-arb_compiler_version.pl.diff
===================================================================
--- trunk/dports/science/arb/files/patch-ARB-arb_compiler_version.pl.diff 2014-08-05 22:24:36 UTC (rev 123120)
+++ trunk/dports/science/arb/files/patch-ARB-arb_compiler_version.pl.diff 2014-08-05 23:45:15 UTC (rev 123121)
@@ -1,25 +1,52 @@
-Index: /trunk/SOURCE_TOOLS/arb_compiler_version.pl
-===================================================================
---- SOURCE_TOOLS/arb_compiler_version.pl (revision 12310)
-+++ SOURCE_TOOLS/arb_compiler_version.pl (revision 12604)
-@@ -38,4 +38,20 @@
- if ($detectedCompiler eq 'unknown') {
- if ($detailedVersion =~ /apple.*llvm.*clang/oi) { $detectedCompiler = 'clang'; }
-+ else {
-+ # check for clang according to #582
-+ my $cmd = "$compiler -dM -E -x c /dev/null";
-+ if (open(CMD,$cmd.'|')) {
-+ LINE: foreach (<CMD>) {
-+ if (/__clang__/) {
-+ $detectedCompiler = 'clang';
-+ last LINE;
-+ }
-+ }
-+ close(CMD);
+--- SOURCE_TOOLS/arb_compiler_version.pl.orig 2014-07-22 09:59:34.000000000 -0500
++++ SOURCE_TOOLS/arb_compiler_version.pl 2014-08-05 04:34:02.000000000 -0500
+@@ -26,17 +26,22 @@
+ if (not defined $dumpedVersion) { $dumpedVersion = $undetectable; }
+ if (not defined $detailedVersion) { $detailedVersion = $undetectable; }
+
+- if ($detailedVersion =~ /\s/) {
+- my $firstWord = $`;
+- if ($firstWord eq 'gcc' or $firstWord eq 'clang') {
+- $detectedCompiler = $firstWord;
++ my $cmd = "$compiler -dM -E -x c /dev/null";
++ if (open(CMD,$cmd.'|')) {
++ LINE: foreach (<CMD>) {
++ if (/__GNUC__/) {
++ $detectedCompiler = 'gcc';
++ # clang also defines __GNUC__ so don't "last" here
+ }
-+ else {
-+ print STDERR "failed to execute '$cmd'";
++ elsif (/__clang__/) {
++ $detectedCompiler = 'clang';
++ last LINE;
+ }
-+ }
+ }
+- elsif ($firstWord eq 'g++') { $detectedCompiler = 'gcc'; }
+- elsif ($firstWord eq 'clang++') { $detectedCompiler = 'clang'; }
++ close(CMD);
}
-
\ No newline at end of file
+-
+- if ($detectedCompiler eq 'unknown') {
+- if ($detailedVersion =~ /apple.*llvm.*clang/oi) { $detectedCompiler = 'clang'; }
++ else {
++ print STDERR "failed to execute '$cmd'";
+ }
+
+ if ($detectedCompiler eq 'unknown') {
+@@ -45,13 +50,11 @@
+ print STDERR "detailedVersion='$detailedVersion'\n";
+ }
+
+- if ($dumpedVersion =~ /\..*\./) {
+- $detectedVersion = $dumpedVersion;
++ if ($detailedVersion =~ /\s([0-9]+(?:\.[0-9]+)+)\s/) {
++ $detectedVersion = $1;
+ }
+- else { # if version info does not contain patchlevel -> use detailedVersion
+- if ($detailedVersion =~ /\s([0-9]+\.[0-9]+\.[0-9]+)\s/) {
+- $detectedVersion = $1;
+- }
++ elsif ($dumpedVersion =~ /^([0-9]+(?:\.[0-9]+)+)$/) {
++ $detectedVersion = $dumpedVersion;
+ }
+ }
+
Added: trunk/dports/science/arb/files/patch-Makefile.diff
===================================================================
--- trunk/dports/science/arb/files/patch-Makefile.diff (rev 0)
+++ trunk/dports/science/arb/files/patch-Makefile.diff 2014-08-05 23:45:15 UTC (rev 123121)
@@ -0,0 +1,43 @@
+--- Makefile.orig 2014-07-22 09:59:38.000000000 -0500
++++ Makefile 2014-08-05 05:51:40.000000000 -0500
+@@ -98,10 +98,6 @@
+ 4.8.0 4.8.1 4.8.2 4.8.3 \
+ 4.9.0 \
+
+-# supported clang versions:
+-ALLOWED_clang_VERSIONS=\
+- 4.2.1 \
+-
+ # ----------------------
+
+ COMPILER_INFO:=$(shell SOURCE_TOOLS/arb_compiler_version.pl $(A_CXX))
+@@ -118,7 +114,7 @@
+ endif
+
+ ifeq ($(USE_CLANG),1)
+-ALLOWED_COMPILER_VERSIONS=$(ALLOWED_clang_VERSIONS)
++ALLOWED_COMPILER_VERSIONS=$(COMPILER_VERSION)
+ else
+ ALLOWED_COMPILER_VERSIONS=$(ALLOWED_gcc_VERSIONS)
+ endif
+@@ -137,6 +133,7 @@
+ USE_GCC_47_OR_HIGHER:=
+ USE_GCC_48_OR_HIGHER:=
+
++ifeq ($(USE_CLANG),0)
+ ifeq ($(USE_GCC_MAJOR),4)
+ ifeq ($(USE_GCC_MINOR),5)
+ ifneq ('$(findstring $(USE_GCC_PATCHLEVEL),23456789)','')
+@@ -154,9 +151,12 @@
+ endif
+ endif
+ else
++ ifneq ('$(findstring $(USE_GCC_MAJOR),56789)','')
+ USE_GCC_452_OR_HIGHER:=yes
+ USE_GCC_47_OR_HIGHER:=yes
+ USE_GCC_48_OR_HIGHER:=yes
++ endif
++endif
+ endif
+
+ #---------------------- define special directories for non standard builds
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140805/34fecf15/attachment-0001.html>
More information about the macports-changes
mailing list