aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2003-05-18 11:23:12 +0000
committerJonathan Gray2003-05-18 11:23:12 +0000
commit48d642dea6eb11d74502faa29db638fd60afe96b (patch)
tree78caf154f99b76238e88e24935031890862ce19c
parentc3b5fce26220217c7a2f7b1a7a4add10e0684400 (diff)
downloadscummvm-rg350-48d642dea6eb11d74502faa29db638fd60afe96b.tar.gz
scummvm-rg350-48d642dea6eb11d74502faa29db638fd60afe96b.tar.bz2
scummvm-rg350-48d642dea6eb11d74502faa29db638fd60afe96b.zip
make less broken
svn-id: r7627
-rw-r--r--.cvsignore1
-rwxr-xr-xconfigure37
2 files changed, 28 insertions, 10 deletions
diff --git a/.cvsignore b/.cvsignore
index abc6d8292e..3550649f29 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -5,5 +5,6 @@ ChangeLog
build.rules
config.h
config.mak
+config.log
scummvm
ScummVM.app
diff --git a/configure b/configure
index 68f3db8ad5..b598091951 100755
--- a/configure
+++ b/configure
@@ -17,6 +17,9 @@
# * generate a config.mak file for use in makefiles
# * ....
+TMPC=scummvm-conf.cpp
+TMPO=scummvm-conf
+TMPLOG=config.log
# default lib behaviour yes/no/auto
_vorbis=auto
@@ -28,7 +31,22 @@ _build_simon=yes
_build_sky=yes
# binary names
_ranlib=ranlib
-
+_ldd=ldd
+
+cc_check() {
+ echo >> "$TMPLOG"
+ cat "$TMPC" >> "$TMPLOG"
+ echo >> "$TMPLOG"
+ echo "$CXX $TMPC -o $TMPO $@" >> "$TMPLOG"
+ rm -f "$TMPO"
+ ( $CXX "$TMPC" -o "$TMPO" "$@" ) >> "$TMPLOG" 2>&1
+ TMP="$?"
+ echo >> "$TMPLOG"
+ echo "ldd $TMPO" >> "$TMPLOG"
+ ( $_ldd "$TMPO" ) >> "$TMPLOG" 2>&1
+ echo >> "$TMPLOG"
+ return "$TMP"
+}
echocheck () {
echo -n "Checking for $@... "
@@ -275,12 +293,11 @@ echo "/* Libs */" >> config.h
echocheck "Ogg Vorbis"
if test "$_vorbis" = auto ; then
_vorbis=no
- cat > tmp_vorbis_check.cpp << EOF
+ cat > $TMPC << EOF
#include <vorbis/codec.h>
int main(void) { vorbis_packet_blocksize(0,0); return 0; }
EOF
- $CXX -lvorbis -logg -lm -o tmp_vorbis_check tmp_vorbis_check.cpp && _vorbis=yes
- rm tmp_vorbis_check tmp_vorbis_check.cpp 2> /dev/null
+ cc_check -lvorbis -logg -lm && _vorbis=yes
fi
if test "$_vorbis" = yes ; then
echo "#define USE_VORBIS" >> config.h
@@ -293,12 +310,11 @@ echo "$_vorbis"
echocheck "MAD"
if test "$_mad" = auto ; then
_mad=no
- cat > tmp_mad.cpp << EOF
+ cat > $TMPC << EOF
#include <mad.h>
int main(void) {return 0; }
EOF
- $CXX tmp_mad.cpp -lmad && _mad=yes
- rm tmp_mad.cpp tmp_mad 2> /dev/null
+ cc_check -lmad && _mad=yes
fi
if test "$_mad" = yes ; then
echo "#define USE_MAD" >> config.h
@@ -311,12 +327,11 @@ echo "$_mad"
echocheck "ALSA 9"
if test "$_alsa" = auto ; then
_alsa=no
- cat > tmp_alsa.cpp << EOF
+ cat > $TMPC << EOF
#include <alsa/asoundlib.h>
int main(void) { return (!(SND_LIB_MAJOR==0 && SND_LIB_MINOR==9)); }
EOF
- $CXX -lasound -o tmp_alsa tmp_alsa.cpp && _alsa=yes
- rm tmp_alsa tmp_alsa.cpp 2> /dev/null
+ cc_check -lasound && _alsa=yes
fi
if test "$_alsa" = yes ; then
echo "#define USE_ALSA" >> config.h
@@ -326,6 +341,8 @@ else
fi
echo "$_alsa"
+rm -f $TMPC $TMPO
+
#
# End of config.h
#