From 9faec425225fcb21d7227aace994188d98989236 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Tue, 1 Dec 2009 22:14:28 +0100 Subject: Fixed NAR-3 and NAR-114 --- .../java/org/apache/maven/plugin/nar/Linker.java | 31 +++++--- .../org/apache/maven/plugin/nar/aol.properties | 84 +++++++++++++++++++++- 2 files changed, 106 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/apache/maven/plugin/nar/Linker.java b/src/main/java/org/apache/maven/plugin/nar/Linker.java index 053462d..51c89cb 100644 --- a/src/main/java/org/apache/maven/plugin/nar/Linker.java +++ b/src/main/java/org/apache/maven/plugin/nar/Linker.java @@ -155,8 +155,9 @@ public class Linker { this.name = name; } - - public final String getName() { + + public final String getName() + { return name; } @@ -218,6 +219,20 @@ public class Linker throw new MojoFailureException( "Cannot deduce version number from: " + out ); } } + else if ( name.equals( "icc" ) || name.equals( "icpc" ) ) + { + NarUtil.runCommand( "icc", new String[] { "--version" }, null, null, out, err, dbg ); + Pattern p = Pattern.compile( "\\d+\\.\\d+" ); + Matcher m = p.matcher( out.toString() ); + if ( m.find() ) + { + version = m.group( 0 ); + } + else + { + throw new MojoFailureException( "Cannot deduce version number from: " + out ); + } + } else { throw new MojoFailureException( "Cannot find version number for linker '" + name + "'" ); @@ -225,7 +240,8 @@ public class Linker return version; } - public final LinkerDef getLinker( AbstractCompileMojo mojo, Project antProject, String os, String prefix, String type ) + public final LinkerDef getLinker( AbstractCompileMojo mojo, Project antProject, String os, String prefix, + String type ) throws MojoFailureException, MojoExecutionException { if ( name == null ) @@ -300,16 +316,15 @@ public class Linker linker.addConfiguredLinkerArg( arg ); } } - + // FIXME, this should be done in CPPTasks at some point, and may not be necessary, but was for VS 2010 beta 2 - if ( os.equals( OS.WINDOWS ) - && getName( null, null ).equals( "msvc" ) && !getVersion().startsWith( "6." ) ) { + if ( os.equals( OS.WINDOWS ) && getName( null, null ).equals( "msvc" ) && !getVersion().startsWith( "6." ) ) + { LinkerArgument arg = new LinkerArgument(); arg.setValue( "/MANIFEST" ); - linker.addConfiguredLinkerArg( arg ); + linker.addConfiguredLinkerArg( arg ); } - // Add options to linker if ( options != null ) { diff --git a/src/main/resources/org/apache/maven/plugin/nar/aol.properties b/src/main/resources/org/apache/maven/plugin/nar/aol.properties index 0a705ee..5421123 100644 --- a/src/main/resources/org/apache/maven/plugin/nar/aol.properties +++ b/src/main/resources/org/apache/maven/plugin/nar/aol.properties @@ -277,7 +277,7 @@ i386.Linux.ecc.executable.extension= # Linux ecpc (C++ linker) # i386.Linux.ecpc.cpp.compiler=ecpc -i386.Linux.icpc.cpp.defines=Linux +i386.Linux.ecpc.cpp.defines=Linux i386.Linux.ecpc.cpp.options=-ansi -mp -no-gcc -w1 i386.Linux.ecpc.cpp.includes=**/*.cc **/*.cpp **/*.cxx i386.Linux.ecpc.cpp.excludes= @@ -474,6 +474,88 @@ x86_64.MacOSX.gcc.jni.extension=jnilib #x86_64.MacOSX.g++.arch.includes=lib/**/*.a lib/**/*.so lib/**/*.dylib lib/**/*.jnilib +Here is the AOL for x86_64-MacOSX-icpc, pretty simple without any default compiler options, works for me ... if i make further changes or add new stuff i will let you know ... + +# +# MacOSX ("Mac OS X" => MacOSX) Intel (64 bits) icc +# +x86_64.MacOSX.icc.cpp.compiler=icpc +x86_64.MacOSX.icc.cpp.defines=Darwin __APPLE__ +x86_64.MacOSX.icc.cpp.options= +x86_64.MacOSX.icc.cpp.includes=**/*.cc **/*.cpp **/*.cxx +x86_64.MacOSX.icc.cpp.excludes= + +x86_64.MacOSX.icc.c.compiler=icc +x86_64.MacOSX.icc.c.defines=Darwin __APPLE__ +x86_64.MacOSX.icc.c.options= +x86_64.MacOSX.icc.c.includes=**/*.c +x86_64.MacOSX.icc.c.excludes= + +x86_64.MacOSX.icc.fortran.compiler=ifort +x86_64.MacOSX.icc.fortran.defines=Darwin __APPLE__ +x86_64.MacOSX.icc.fortran.options= +x86_64.MacOSX.icc.fortran.includes=**/*.f **/*.for +x86_64.MacOSX.icc.fortran.excludes= + +x86_64.MacOSX.icc.java.include=include;include/macosx +x86_64.MacOSX.icc.java.runtimeDirectory=IGNORED + +x86_64.MacOSX.icc.lib.prefix=lib +x86_64.MacOSX.icc.shared.prefix=lib +x86_64.MacOSX.icc.static.extension=a +x86_64.MacOSX.icc.shared.extension=dylib +x86_64.MacOSX.icc.plugin.extension=bundle +x86_64.MacOSX.icc.jni.extension=jnilib +x86_64.MacOSX.icc.executable.extension= + +# FIXME to be removed when NAR-6 +x86_64.MacOSX.icc.static.extension=a +x86_64.MacOSX.icc.shared.extension=dylib +x86_64.MacOSX.icc.plugin.extension=bundle +x86_64.MacOSX.icc.jni.extension=jnilib + +#x86_64.MacOSX.icc.arch.includes=lib/**/*.a lib/**/*.so lib/**/*.dylib lib/**/*.jnilib + +# +# MacOSX ("Mac OS X" => MacOSX) Intel (64 bits) icpc +# +x86_64.MacOSX.icpc.cpp.compiler=icpc +x86_64.MacOSX.icpc.cpp.defines=Darwin __APPLE__ +x86_64.MacOSX.icpc.cpp.options= +x86_64.MacOSX.icpc.cpp.includes=**/*.cc **/*.cpp **/*.cxx +x86_64.MacOSX.icpc.cpp.excludes= + +x86_64.MacOSX.icpc.c.compiler=icc +x86_64.MacOSX.icpc.c.defines=Darwin __APPLE__ +x86_64.MacOSX.icpc.c.options= +x86_64.MacOSX.icpc.c.includes=**/*.c +x86_64.MacOSX.icpc.c.excludes= + +x86_64.MacOSX.icpc.fortran.compiler=ifort +x86_64.MacOSX.icpc.fortran.defines=Darwin __APPLE__ +x86_64.MacOSX.icpc.fortran.options= +x86_64.MacOSX.icpc.fortran.includes=**/*.f **/*.for +x86_64.MacOSX.icpc.fortran.excludes= + +x86_64.MacOSX.icpc.java.include=include;include/macosx +x86_64.MacOSX.icpc.java.runtimeDirectory=IGNORED + +x86_64.MacOSX.icpc.lib.prefix=lib +x86_64.MacOSX.icpc.shared.prefix=lib +x86_64.MacOSX.icpc.static.extension=a +x86_64.MacOSX.icpc.shared.extension=dylib +x86_64.MacOSX.icpc.plugin.extension=bundle +x86_64.MacOSX.icpc.jni.extension=jnilib +x86_64.MacOSX.icpc.executable.extension= + +# FIXME to be removed when NAR-6 +x86_64.MacOSX.icpc.static.extension=a +x86_64.MacOSX.icpc.shared.extension=dylib +x86_64.MacOSX.icpc.plugin.extension=bundle +x86_64.MacOSX.icpc.jni.extension=jnilib + +#x86_64.MacOSX.icpc.arch.includes=lib/**/*.a lib/**/*.so lib/**/*.dylib lib/**/*.jnilib + # # Solaris # -- cgit v1.2.3