#!/bin/sh # # qemu configure script (c) 2003 Fabrice Bellard # # set temporary file name if test ! -z "$TMPDIR" ; then TMPDIR1="${TMPDIR}" elif test ! -z "$TEMPDIR" ; then TMPDIR1="${TEMPDIR}" else TMPDIR1="/tmp" fi TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}" TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" # default parameters prefix="" static="no" libdir="lib" cross_prefix="" cc="gcc" host_cc="gcc" ar="ar" make="make" install="install" strip="strip" cpu=`uname -m` target_list="" case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" ;; armv*b) cpu="armv4b" ;; armv*l) cpu="armv4l" ;; alpha) cpu="alpha" ;; "Power Macintosh"|ppc|ppc64) cpu="powerpc" ;; mips) cpu="mips" ;; s390) cpu="s390" ;; sparc|sun4[muv]) cpu="sparc" ;; sparc64) cpu="sparc64" ;; ia64) cpu="ia64" ;; m68k) cpu="m68k" ;; x86_64|amd64) cpu="x86_64" libdir="lib64" ;; *) cpu="unknown" ;; esac gprof="no" bigendian="no" mingw32="no" EXESUF="" gdbstub="no" slirp="no" adlib="no" oss="no" dsound="no" coreaudio="no" alsa="no" fmod="no" fmod_lib="" fmod_inc="" bsd="no" linux="no" kqemu="no" profiler="no" kernel_path="" cocoa="no" check_gfx="yes" check_gcc="no" softmmu="yes" user="no" build_docs="no" build_acpi_tables="no" uname_release="" # OS specific targetos=`uname -s` case $targetos in CYGWIN*) mingw32="yes" CFLAGS="-O2 -mno-cygwin" ;; MINGW32*) mingw32="yes" ;; FreeBSD) bsd="yes" oss="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" fi ;; NetBSD) bsd="yes" oss="yes" ;; OpenBSD) bsd="yes" oss="yes" ;; Darwin) bsd="yes" darwin="yes" ;; SunOS) solaris="yes" ;; *) oss="yes" linux="yes" user="yes" if [ "$cpu" = "i386" -o "$cpu" = "x86_64" ] ; then kqemu="yes" fi ;; esac if [ "$bsd" = "yes" ] ; then if [ "$darwin" != "yes" ] ; then make="gmake" fi fi if [ "$solaris" = "yes" ] ; then make="gmake" install="ginstall" solarisrev=`uname -r | cut -f2 -d.` fi # find source path source_path=`dirname "$0"` if [ -z "$source_path" ]; then source_path=`pwd` else source_path=`cd "$source_path"; pwd` fi if test "$source_path" = `pwd` ; then source_path_used="no" else source_path_used="yes" fi for opt do optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` case "$opt" in --help|-h) show_help=yes ;; --prefix=*) prefix="$optarg" ;; --interp-prefix=*) interp_prefix="$optarg" ;; --source-path=*) source_path="$optarg" source_path_used="yes" ;; --cross-prefix=*) cross_prefix="$optarg" ;; --cc=*) cc="$optarg" ;; --host-cc=*) host_cc="$optarg" ;; --make=*) make="$optarg" ;; --install=*) install="$optarg" ;; --extra-cflags=*) CFLAGS="$optarg" ;; --extra-ldflags=*) LDFLAGS="$optarg" ;; --cpu=*) cpu="$optarg" ;; --target-list=*) target_list="$optarg" ;; --enable-gprof) gprof="yes" ;; --static) static="yes" ;; --disable-sdl) sdl="no" ;; --enable-coreaudio) coreaudio="yes" ;; --enable-alsa) alsa="yes" ;; --enable-dsound) dsound="yes" ;; --enable-fmod) fmod="yes" ;; --fmod-lib=*) fmod_lib="$optarg" ;; --fmod-inc=*) fmod_inc="$optarg" ;; --enable-mingw32) mingw32="yes" ; cross_prefix="i386-mingw32-" ; user="no" ;; --disable-slirp) slirp="no" ;; --enable-adlib) adlib="yes" ;; --disable-kqemu) kqemu="no" ;; --enable-profiler) profiler="yes" ;; --kernel-path=*) kernel_path="$optarg" ;; --enable-cocoa) cocoa="yes" ; coreaudio="yes" ; sdl="no" ;; --disable-gcc-check) check_gcc="no" ;; --disable-system) softmmu="no" ;; --enable-system) softmmu="yes" ;; --disable-user) user="no" ;; --enable-user) user="yes" ;; --enable-uname-release=*) uname_release="$optarg" ;; --enable-iasl) build_acpi_tables="yes" ;; esac done # Checking for CFLAGS if test -z "$CFLAGS"; then CFLAGS="-O2" fi if test x"$show_help" = x"yes" ; then cat << EOF Usage: configure [options] Options: [defaults in brackets after descriptions] EOF echo "Standard options:" echo " --help print this message" echo " --prefix=PREFIX install in PREFIX [$prefix]" echo " --interp-prefix=PREFIX where to find shared libraries, etc." echo " use %M for cpu name [$interp_prefix]" echo " --target-list=LIST set target list [$target_list]" echo "" echo "kqemu kernel acceleration support:" echo " --disable-kqemu disable kqemu support" echo " --kernel-path=PATH set the kernel path (configure probes it)" echo "" echo "Advanced options (experts only):" echo " --source-path=PATH path of source code [$source_path]" echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" echo " --cc=CC use C compiler CC [$cc]" echo " --host-cc=CC use C compiler CC [$host_cc] for dyngen etc." echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --static enable static build [$static]" echo " --enable-cocoa enable COCO
#! /bin/sh
# A little script I whipped up to make it easy to
# patch source trees and have sane error handling
# -Erik
#
# (c) 2002 Erik Andersen <andersen@codepoet.org>
# Set directories from arguments, or use defaults.
targetdir=${1-.}
patchdir=${2-../kernel-patches}
patchpattern=${3-*}
if [ ! -d "${targetdir}" ] ; then
echo "Aborting. '${targetdir}' is not a directory."
exit 1
fi
if [ ! -d "${patchdir}" ] ; then
echo "Aborting. '${patchdir}' is not a directory."
exit 1
fi
for i in ${patchdir}/${patchpattern} ; do
case "$i" in
*.gz)
type="gzip"; uncomp="gunzip -dc"; ;;
*.bz)
type="bzip"; uncomp="bunzip -dc"; ;;
*.bz2)
type="bzip2"; uncomp="bunzip2 -dc"; ;;
*.zip)
type="zip"; uncomp="unzip -d"; ;;
*.Z)
type="compress"; uncomp="uncompress -c"; ;;
*)
type="plaintext"; uncomp="cat"; ;;
esac
[ -d "${i}" ] && echo "Ignoring subdirectory ${i}" && continue
echo ""
echo "Applying ${i} using ${type}: "
${uncomp} ${i} | ${PATCH:-patch} -f -p1 -E -d ${targetdir}
if [ $? != 0 ] ; then
echo "Patch failed! Please fix $i!"
exit 1
fi
done
# Check for rejects...
if [ "`find $targetdir/ '(' -name '*.rej' -o -name '.*.rej' ')' -print`" ] ; then
echo "Aborting. Reject files found."
exit 1
fi
# Remove backup files
find $targetdir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \;