summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/it/it0018-fortran/pom.xml1
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/Library.java12
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java1
-rw-r--r--src/site/apt/configuration.apt1
4 files changed, 15 insertions, 0 deletions
diff --git a/src/it/it0018-fortran/pom.xml b/src/it/it0018-fortran/pom.xml
index ed20f5c..88d3d91 100644
--- a/src/it/it0018-fortran/pom.xml
+++ b/src/it/it0018-fortran/pom.xml
@@ -63,6 +63,7 @@ under the License.
<library>
<type>executable</type>
<linkFortran>true</linkFortran>
+ <linkFortranMain>true</linkFortranMain>
</library>
</libraries>
</configuration>
diff --git a/src/main/java/org/apache/maven/plugin/nar/Library.java b/src/main/java/org/apache/maven/plugin/nar/Library.java
index fbcf6dd..3f5588a 100644
--- a/src/main/java/org/apache/maven/plugin/nar/Library.java
+++ b/src/main/java/org/apache/maven/plugin/nar/Library.java
@@ -66,6 +66,13 @@ public class Library
private boolean linkFortran = false;
/**
+ * Link with fortran startup, so that the gcc linker can find the "main" of fortran. Defaults to false.
+ *
+ * @parameter expression=""
+ */
+ private boolean linkFortranMain = false;
+
+ /**
* If specified will create the NarSystem class with methods to load a JNI library.
*
* @parameter expression=""
@@ -118,6 +125,11 @@ public class Library
return linkFortran;
}
+ public final boolean linkFortranMain()
+ {
+ return linkFortranMain;
+ }
+
public final String getNarSystemPackage()
{
return narSystemPackage;
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java
index b67f0dd..e447b59 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarCompileMojo.java
@@ -140,6 +140,7 @@ public class NarCompileMojo
// fortran
task.setLinkFortran( library.linkFortran() );
+ task.setLinkFortranMain( library.linkFortranMain() );
// outDir
File outDir;
diff --git a/src/site/apt/configuration.apt b/src/site/apt/configuration.apt
index 9c5306c..0c52546 100644
--- a/src/site/apt/configuration.apt
+++ b/src/site/apt/configuration.apt
@@ -32,6 +32,7 @@ NAR Configuration
<type/>
<linkCPP/>
<linkFortran/>
+ <linkFortranMain/>
<run/>
<args>
<arg/>