From 58386a30e17d1e681b727cc855c0fe772d00886c Mon Sep 17 00:00:00 2001 From: yuqing Date: Mon, 28 Dec 2015 14:17:31 +0800 Subject: [PATCH] correct sed option --- make.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/make.sh b/make.sh index 6aece81..cbbf252 100755 --- a/make.sh +++ b/make.sh @@ -118,11 +118,22 @@ elif [ -f /usr/lib/libc_r.so ]; then fi fi +function sed_replace() +{ + sed_cmd=$1 + filename=$2 + if [ "$uname" = "FreeBSD" ] || [ "$uname" = "Darwin" ]; then + sed -i "" "$sed_cmd" $filename + else + sed -i "$sed_cmd" $filename + fi +} + cd src cp Makefile.in Makefile -sed -i "" "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile -sed -i "" "s/\\\$(LIBS)/$LIBS/g" Makefile -sed -i "" "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile +sed_replace "s/\\\$(CFLAGS)/$CFLAGS/g" Makefile +sed_replace "s/\\\$(LIBS)/$LIBS/g" Makefile +sed_replace "s/\\\$(LIB_VERSION)/$LIB_VERSION/g" Makefile make $1 $2 $3 if [ "$1" = "clean" ]; then