#!/bin/sh HAVE_ROAR=false while [ "$1" != '' ] do case "$1" in --inst-dir) INSTALL_DIR="$2" shift; ;; --force-have-roar) HAVE_ROAR=true ;; --help|-h) cat << EOF Usage: ./configure [OPTIONS]... Options: --help - Show this help --inst-dir DIR - Install dir EOF ;; *) echo 'Unknown option. Try ./configure --help' exit 2 esac shift; done on_error () { exit 1; } echo -n 'testing for C compiler... ' CC=$(which gcc cc 2> /dev/null | head -n 1) if [ -x "$CC" ] then echo $CC else echo no. on_error; fi echo -n 'testing for gtk... ' GTK_LIBS=`gtk-config --libs 2> /dev/null` GTK_CFLAFS=`gtk-config --cflags 2> /dev/null` if [ "$GTK_LIBS" = '' -a "$GTK_CFLAFS" = '' ] then echo no. on_error; else echo yes fi echo -n 'testing for xmms... ' XMMS_LIBS=`xmms-config --libs 2> /dev/null` XMMS_CFLAGS=`xmms-config --cflags 2> /dev/null` if [ "$XMMS_LIBS" = '' -a "$XMMS_CFLAGS" = '' ] then echo no. on_error; else echo yes fi echo -n 'testing for xmms plugin dir... ' if [ "$INSTALL_DIR" = '' ] then INSTALL_DIR=`xmms-config --output-plugin-dir` if [ "$INSTALL_DIR" = '' ] then echo not found. on_error; else echo "$INSTALL_DIR" fi else echo "$INSTALL_DIR" fi echo -n 'testing for libroar... ' if $HAVE_ROAR then echo 'yes (forced)' else cat > tests.c << EOF #include int main (void) { return 0; } EOF $CC -lroar -o tests tests.c 2> /dev/null ./tests 2> /dev/null if [ "$?" = '0' ] then echo yes else echo no. on_error fi fi rm -f tests tests.c echo creating Makefile.conf... { echo "CC=$CC" echo echo "GTK_LIBS=$GTK_LIBS" echo "GTK_CFLAFS=$GTK_CFLAFS" echo echo "XMMS_LIBS=$XMMS_LIBS" echo "XMMS_CFLAGS=$XMMS_CFLAGS" echo echo "INSTALL_DIR=$INSTALL_DIR" } > Makefile.conf #ll