summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java16
-rw-r--r--src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java3
2 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java
index 697dcf1..c8ec983 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuConfigureMojo.java
@@ -61,14 +61,12 @@ public class NarGnuConfigureMojo
if ( shouldSkip() )
return;
- if ( !useGnu() )
- return;
-
+ // always copy, in case we need libs or include dirs
+ File targetDir = getGnuAOLSourceDirectory();
if ( gnuSourceDirectory.exists() )
{
getLog().info( "Copying GNU sources" );
- File targetDir = getGnuAOLSourceDirectory();
try
{
FileUtils.mkdir( targetDir.getPath() );
@@ -78,7 +76,13 @@ public class NarGnuConfigureMojo
{
throw new MojoExecutionException( "Failed to copy GNU sources", e );
}
+ }
+ if ( !useGnu() )
+ return;
+
+ if ( targetDir.exists() )
+ {
File autogen = new File( targetDir, AUTOGEN );
if ( !gnuConfigureSkip && !gnuAutogenSkip && autogen.exists() )
{
@@ -88,7 +92,7 @@ public class NarGnuConfigureMojo
if ( result != 0 )
{
System.err.println( targetDir );
- throw new MojoExecutionException( "'"+AUTOGEN+"' errorcode: " + result );
+ throw new MojoExecutionException( "'" + AUTOGEN + "' errorcode: " + result );
}
}
@@ -102,7 +106,7 @@ public class NarGnuConfigureMojo
"--prefix=" + getGnuAOLTargetDirectory().getAbsolutePath() }, targetDir, null, getLog() );
if ( result != 0 )
{
- throw new MojoExecutionException( "'"+CONFIGURE+"' errorcode: " + result );
+ throw new MojoExecutionException( "'" + CONFIGURE + "' errorcode: " + result );
}
}
}
diff --git a/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java b/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java
index 2b9336f..0a6aea4 100644
--- a/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java
+++ b/src/main/java/org/apache/maven/plugin/nar/NarGnuProcess.java
@@ -41,9 +41,6 @@ public class NarGnuProcess
if ( shouldSkip() )
return;
- if ( !useGnu() )
- return;
-
File srcDir = getGnuAOLTargetDirectory();
if ( srcDir.exists() )
{