diff --git a/src/it/it0013-gnu-executable/pom.xml b/src/it/it0013-gnu-executable/pom.xml index 7573a8f70..15fa81b9e 100644 --- a/src/it/it0013-gnu-executable/pom.xml +++ b/src/it/it0013-gnu-executable/pom.xml @@ -57,6 +57,9 @@ true + + "--with-pkginfo=GNU Executable Integration Test" + diff --git a/src/it/it0013-gnu-executable/src/gnu/configure.ac b/src/it/it0013-gnu-executable/src/gnu/configure.ac index 97fc6b9ad..69ba0b51d 100644 --- a/src/it/it0013-gnu-executable/src/gnu/configure.ac +++ b/src/it/it0013-gnu-executable/src/gnu/configure.ac @@ -8,5 +8,14 @@ AM_INIT_AUTOMAKE AC_PROG_CC +AC_ARG_WITH(pkginfo, + AC_HELP_STRING([--with-pkginfo=PKG], + [Package information string]), + [case "$withval" in + (yes) AC_MSG_ERROR([package information not specified]) ;; + (*) PKG_INFO="$withval" ;; + esac]) +AC_SUBST(PKG_INFO) + AC_OUTPUT(Makefile src/Makefile) diff --git a/src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java b/src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java index c4f09dd03..ef15f1331 100644 --- a/src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java +++ b/src/main/java/com/github/maven_nar/NarGnuConfigureMojo.java @@ -21,6 +21,9 @@ import java.io.File; import java.io.IOException; +import java.util.List; +import java.util.ArrayList; +import java.util.regex.*; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -154,7 +157,14 @@ public final void narExecute() throws MojoExecutionException, MojoFailureExcepti // create the array to hold constant and additional args if (this.gnuConfigureArgs != null) { - final String[] a = this.gnuConfigureArgs.split(" "); + List list = new ArrayList(); + Matcher m = Pattern.compile("([^\"]\\S*|\".+?\")\\s*").matcher(this.gnuConfigureArgs); + // strip double quotes + while (m.find()) { + list.add(m.group(1).replace("\"", "")); + } + String[] a = new String[list.size()]; + a = list.toArray(a); args = new String[a.length + 2]; System.arraycopy(a, 0, args, 2, a.length);