浏览代码

In Linux --exclude-libs is needed.

Luciano 7 年之前
父节点
当前提交
2c105a4d58
共有 1 个文件被更改,包括 25 次插入8 次删除
  1. 25 8
      static_rnnoise.sh

+ 25 - 8
static_rnnoise.sh

@@ -1,13 +1,30 @@
-#!/bin/sh
-if [ -d "rnnoise" ]; then
-  rm -rf ./rnnoise
-fi
+#!/usr/bin/env bash
+
+rm -rf rnnoise || true
 git clone https://github.com/xiph/rnnoise.git
 cd rnnoise/
 ./autogen.sh
-CFLAGS="-fvisibility=hidden -fPIC " \ 
+
+if [ "$(uname)" == "Darwin" ]; then
+  CFLAGS="-fvisibility=hidden -fPIC " \ 
+	./configure \
+  --disable-examples --disable-doc \
+	--disable-shared --enable-static        
+elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
+  CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
 	./configure \
   --disable-examples --disable-doc \
-	--disable-shared --enable-static
-make -j2
-#-Wl,--exclude-libs,ALL
+  --disable-shared --enable-static
+# elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
+#     CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
+# 	./configure \
+#   --disable-examples --disable-doc \
+#   --disable-shared --enable-static
+# elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
+#     CFLAGS="-fvisibility=hidden -fPIC -Wl,--exclude-libs,ALL" \
+# 	./configure \
+#   --disable-examples --disable-doc \
+#   --disable-shared --enable-static
+fi
+
+make -j2