aboutsummaryrefslogtreecommitdiff
path: root/project/native.scala
diff options
context:
space:
mode:
Diffstat (limited to 'project/native.scala')
-rw-r--r--project/native.scala26
1 files changed, 23 insertions, 3 deletions
diff --git a/project/native.scala b/project/native.scala
index b6e4c19..5fb87ce 100644
--- a/project/native.scala
+++ b/project/native.scala
@@ -48,6 +48,26 @@ object NativeKeys {
}
+//windows, as usual, needs special treatment
+object CygwinUtil {
+
+ def onCygwin: Boolean = {
+ val uname = Process("uname").lines.headOption
+ uname map {
+ _.toLowerCase.startsWith("cygwin")
+ } getOrElse {
+ false
+ }
+ }
+
+ def toUnixPath(path: String): String = if (onCygwin) {
+ Process(s"cygpath ${path}").lines.head
+ } else {
+ path
+ }
+
+}
+
/** Provides implementations of wrapper tasks suitable for projects using Autotools */
object Autotools {
import NativeKeys._
@@ -64,14 +84,14 @@ object Autotools {
val log = streams.value.log
val src = (sourceDirectory in Native).value
val out = (target in Native).value
- val outPath = out.getAbsolutePath
+ val outPath = CygwinUtil.toUnixPath(out.getAbsolutePath)
val configure = if ((src / "config.status").exists) {
- Process("./config.status", src)
+ Process("sh ./config.status", src)
} else {
Process(
//Disable producing versioned library files, not needed for fat jars.
- s"./configure --prefix=$outPath --libdir=$outPath --disable-versioned-lib",
+ s"sh ./configure --prefix=$outPath --libdir=$outPath --disable-versioned-lib",
src
)
}