From 9ee615bce0186f7062f41a2c63cd7215b648f193 Mon Sep 17 00:00:00 2001 From: Chilledheart Date: Sun, 8 Jun 2014 14:55:16 +0800 Subject: [PATCH] Use uname command to detect Darwin platform --- autogen.sh | 8 ++++---- configure.ac | 2 +- updateversion.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/autogen.sh b/autogen.sh index 35a798c6..ec1d2c26 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,7 +5,7 @@ : ${AUTOHEADER=autoheader} : ${AUTOMAKE=automake} : ${ACLOCAL=aclocal} -if test "${TERM_PROGRAM}" != "Apple_Terminal" ; then +if test "$(uname)" != "Darwin"; then : ${LIBTOOLIZE=libtoolize} else : ${LIBTOOLIZE=glibtoolize} @@ -51,7 +51,7 @@ DIE=0 DIE=1 } -if [[ ! ${TERM_PROGRAM} =~ ^Apple ]] ; then +if test "$(uname)" != "Darwin"; then (grep "^AC_PROG_LIBTOOL" $CONFIGURE >/dev/null) && { ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || { echo @@ -75,7 +75,7 @@ if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then GETTEXTIZE="gettextize" GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" fi - + $GETTEXTIZE --version < /dev/null > /dev/null 2>&1 if test $? -ne 0; then echo @@ -97,7 +97,7 @@ aclocalinclude="$aclocalinclude -I m4" if test x"$MSYSTEM" = x"MINGW32"; then aclocalinclude="$aclocalinclude -I /local/share/aclocal" -elif [[ ${TERM_PROGRAM} =~ ^Apple ]] ; then +elif test "$(uname)" = "Darwin"; then aclocalinclude="$aclocalinclude -I /opt/local/share/aclocal" fi diff --git a/configure.ac b/configure.ac index 3bf007e6..3110ecbf 100644 --- a/configure.ac +++ b/configure.ac @@ -43,7 +43,7 @@ else fi AC_MSG_CHECKING(for Mac) -if test "$TERM_PROGRAM" = "Apple_Terminal"; then +if test "$(uname)" = "Darwin"; then bmac=true AC_MSG_RESULT(compile in mac) else diff --git a/updateversion.sh b/updateversion.sh index 7ed027ec..5feb4761 100755 --- a/updateversion.sh +++ b/updateversion.sh @@ -3,12 +3,12 @@ if [ $# != "2" ]; then echo "$0 " exit -fi +fi old_ver=$1 new_ver=$2 -if [[ "${TERM_PROGRAM}" =~ ^Apple ]]; then +if test "$(uname)" = "Darwin"; then sed -i '' -e "s|$old_ver|$new_ver|" web/setup_mac.py sed -i '' -e "s|VERSION=$old_ver|VERSION=$new_ver|" setupmac.sh sed -i '' -e "s|$old_ver|$new_ver|" gui/mac/seafile/seafile/*.plist