From 71df60afc8e8a5526dacf5d2048d8d48d7b2ff30 Mon Sep 17 00:00:00 2001 From: nplourde Date: Sat, 10 Sep 2005 18:44:17 +0000 Subject: perl check for macosx git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16445 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4a12331d3e..b9b984fa6b 100755 --- a/configure +++ b/configure @@ -45,12 +45,23 @@ cc_check() { return "$TMP" } +perl_check() { + echo >> "$TMPLOG" + cat "$TMPP" >> "$TMPLOG" + echo >> "$TMPLOG" + echo "perl $TMPP" >> "$TMPLOG" + perl "$TMPP" >> "$TMPLOG" 2>&1 + TMP="$?" + echo >> "$TMPLOG" + return "$TMP" +} + # Display error message, flushes tempfile, exit die () { echo echo "Error: $@" >&2 echo >&2 - rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" + rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" "TMPP" echo "Check \"$TMPLOG\" if you do not understand why it failed." exit 1 } @@ -547,6 +558,7 @@ TMPC="$I/mplayer-conf-$RANDOM-$$.c" TMPCPP="$I/mplayer-conf-$RANDOM-$$.cpp" TMPO="$I/mplayer-conf-$RANDOM-$$.o" TMPS="$I/mplayer-conf-$RANDOM-$$.S" +TMPP="$I/mplayer-conf-$RANDOM-$$.perl" # config files @@ -3263,7 +3275,35 @@ echores "$_sys_sysinfo" echocheck "Mac OS X APIs" if test "$_macosx" = auto ; then - if darwin && ppc; then + +cat > $TMPP <; +\$plistData =~ /(.*?)<\/dict>/gis; +@items = split(//, \$plistData); + +shift @items; +foreach \$item (@items) { + \$item =~ /(.*?)<\/key>.*?(.*?)<\/string>/gis; + \$versiondata{ \$1 } = \$2; +} + +close(PLIST); + +if( \$versiondata{"ProductName"} eq "Mac OS X") { + exit(0); +} + +exit(1); +EOF + + if perl_check; then _macosx=yes else _macosx=no @@ -7958,4 +7998,4 @@ EOF fi # Last move: -rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" +rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP" "$TMPP" -- cgit v1.2.3