Use uname command to detect Darwin platform

This commit is contained in:
Chilledheart 2014-06-08 14:55:16 +08:00
parent 41e8968929
commit 9ee615bce0
3 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@
: ${AUTOHEADER=autoheader} : ${AUTOHEADER=autoheader}
: ${AUTOMAKE=automake} : ${AUTOMAKE=automake}
: ${ACLOCAL=aclocal} : ${ACLOCAL=aclocal}
if test "${TERM_PROGRAM}" != "Apple_Terminal" ; then if test "$(uname)" != "Darwin"; then
: ${LIBTOOLIZE=libtoolize} : ${LIBTOOLIZE=libtoolize}
else else
: ${LIBTOOLIZE=glibtoolize} : ${LIBTOOLIZE=glibtoolize}
@ -51,7 +51,7 @@ DIE=0
DIE=1 DIE=1
} }
if [[ ! ${TERM_PROGRAM} =~ ^Apple ]] ; then if test "$(uname)" != "Darwin"; then
(grep "^AC_PROG_LIBTOOL" $CONFIGURE >/dev/null) && { (grep "^AC_PROG_LIBTOOL" $CONFIGURE >/dev/null) && {
($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || { ($LIBTOOL --version) < /dev/null > /dev/null 2>&1 || {
echo echo
@ -75,7 +75,7 @@ if grep "^AM_[A-Z0-9_]\{1,\}_GETTEXT" "$CONFIGURE" >/dev/null; then
GETTEXTIZE="gettextize" GETTEXTIZE="gettextize"
GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" GETTEXTIZE_URL="ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
fi fi
$GETTEXTIZE --version < /dev/null > /dev/null 2>&1 $GETTEXTIZE --version < /dev/null > /dev/null 2>&1
if test $? -ne 0; then if test $? -ne 0; then
echo echo
@ -97,7 +97,7 @@ aclocalinclude="$aclocalinclude -I m4"
if test x"$MSYSTEM" = x"MINGW32"; then if test x"$MSYSTEM" = x"MINGW32"; then
aclocalinclude="$aclocalinclude -I /local/share/aclocal" aclocalinclude="$aclocalinclude -I /local/share/aclocal"
elif [[ ${TERM_PROGRAM} =~ ^Apple ]] ; then elif test "$(uname)" = "Darwin"; then
aclocalinclude="$aclocalinclude -I /opt/local/share/aclocal" aclocalinclude="$aclocalinclude -I /opt/local/share/aclocal"
fi fi

View File

@ -43,7 +43,7 @@ else
fi fi
AC_MSG_CHECKING(for Mac) AC_MSG_CHECKING(for Mac)
if test "$TERM_PROGRAM" = "Apple_Terminal"; then if test "$(uname)" = "Darwin"; then
bmac=true bmac=true
AC_MSG_RESULT(compile in mac) AC_MSG_RESULT(compile in mac)
else else

View File

@ -3,12 +3,12 @@
if [ $# != "2" ]; then if [ $# != "2" ]; then
echo "$0 <old_version> <new_version>" echo "$0 <old_version> <new_version>"
exit exit
fi fi
old_ver=$1 old_ver=$1
new_ver=$2 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|$old_ver|$new_ver|" web/setup_mac.py
sed -i '' -e "s|VERSION=$old_ver|VERSION=$new_ver|" setupmac.sh sed -i '' -e "s|VERSION=$old_ver|VERSION=$new_ver|" setupmac.sh
sed -i '' -e "s|<string>$old_ver</string>|<string>$new_ver</string>|" gui/mac/seafile/seafile/*.plist sed -i '' -e "s|<string>$old_ver</string>|<string>$new_ver</string>|" gui/mac/seafile/seafile/*.plist