--disable-sse2 - Compile without SSE2 support (default: on)
--arch='arch' - Compile for a specific architecture (default: none)
--cpu='cpu' - Compile for a specific CPU (default: none)
+ --target-os='os' - Cross-compile to a specific OS (default: $(uname -s))
+ --target-arch='arch' - Cross-compile to a specific CPU architecture
Module disable options:
echo "LARGE_FILE=-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE"
+ [ "$amd64" = "true" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
[ "$arch" != "" ] && echo "TARGETARCH=-march=$arch"
[ "$cpu" != "" ] && echo "TARGETCPU=-mcpu=$cpu"
if [ "$optimisations" = "true" ]
case $targetos in
Darwin)
- sysctl -a hw | grep "x86_64: 1" > /dev/null && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
echo "CFLAGS+=-fPIC -D__DARWIN__ `sdl-config --cflags`"
echo "SHFLAGS=-dynamiclib"
echo "LDFLAGS+=`sdl-config --libs`"
;;
Linux|GNU/kFreeBSD|GNU)
- [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
[ "$optimisations" = "true" ] &&
echo "OPTIMISATIONS+=-ffast-math"
echo "CFLAGS+=-fPIC -pthread"
echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
;;
FreeBSD)
- [ "$(uname -m)" = "amd64" -o "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
[ "$optimisations" = "true" ] &&
echo "OPTIMISATIONS+=-ffast-math"
echo "CFLAGS+=-fPIC -pthread"
echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
;;
NetBSD)
- [ "$(uname -m)" = "amd64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
[ "$optimisations" = "true" ] &&
echo "OPTIMISATIONS+=-ffast-math"
echo "CFLAGS+=-pthread"
echo "LDFLAGS+=-Wl,--no-undefined -Wl,--as-needed"
;;
MinGW)
- [ "$(uname -m)" = "x86_64" ] && echo "ARCH_X86_64=1" && echo "CFLAGS+=-DARCH_X86_64"
[ "$optimisations" = "true" ] &&
echo "OPTIMISATIONS+=-ffast-math"
echo "SHFLAGS=-shared"
export gpl3=false
export arch=
export cpu=
-export targetos=
-
-# Determine OS
-targetos=$(uname -s)
-# Chose appropriate suffix for libraries
-case $targetos in
- Darwin)
- LIBSUF=".dylib"
- ;;
- Linux|FreeBSD|NetBSD)
- LIBSUF=".so"
- ;;
- MINGW32_NT-*)
- targetos="MinGW"
- LIBSUF=".dll"
- ;;
- *)
- LIBSUF=".so"
- ;;
-esac
-export LIBSUF
+export targetos=$(uname -s)
+export targetarch=
+export amd64=false
# Iterate through arguments
for i in "$@"
do
case $i in
- --help ) help=1 ;;
+ --help ) help=1 ;;
--prefix=* ) prefix="${i#--prefix=}" ;;
--libdir=* ) libdir="${i#--libdir=}" ;;
--datadir=* ) datadir="${i#--datadir=}" ;;
--disable-sse2 ) sse2=false ;;
--enable-gpl ) gpl=true ;;
--enable-gpl3 ) gpl3=true ;;
- --arch=* ) arch="${i#--arch=}" ;;
- --cpu=* ) cpu="${i#--cpu=}" ;;
+ --arch=* ) arch="${i#--arch=}" ;;
+ --cpu=* ) cpu="${i#--cpu=}" ;;
+ --target-os=* ) targetos="${i#--target-os=}" ;;
+ --target-arch=* ) targetarch="${i#--target-arch=}" ;;
esac
done
+# Chose appropriate suffix for libraries
+case $targetos in
+ Darwin)
+ LIBSUF=".dylib"
+ if [ "$targetarch" = "" ]
+ then
+ sysctl -a hw | grep "x86_64: 1" > /dev/null
+ [ "$?" = "0" ] && targetarch="amd64"
+ fi
+ ;;
+ Linux|FreeBSD|NetBSD)
+ LIBSUF=".so"
+ ;;
+ MINGW32_NT-*|MinGW|mingw)
+ targetos="MinGW"
+ LIBSUF=".dll"
+ ;;
+ *)
+ LIBSUF=".so"
+ ;;
+esac
+export LIBSUF
+
+# Determine if we are compiling for 64-bit Intel architecture
+[ "$targetarch" = "" ] && targetarch=$(uname -m)
+[ "$targetarch" = "amd64" -o "$targetarch" = "x86_64" ] && amd64=true
+
# Determine the libdir if it's not specified in the args
[ "$libdir" = "" ] && libdir=$prefix/lib
[ "$datadir" = "" ] && datadir=$prefix/share
;;
esac
- qimage_includedir=/usr/include/qt4
- qimage_libdir=/usr/lib/qt4
+ qimage_includedir=
+ qimage_libdir=
if [ ! -d "$qimage_libdir" -o ! -d "$qimage_includedir" ]
then
fi
fi
- pkg-config --exists 'QtGui >= 4'
- if [ $? -eq 0 ] && [ "$force_qt3" = "" ]
+ if [ -d "$qimage_libdir" -a -d "$qimage_includedir" ]
then
- echo "Qt version 4.x detected, will compile Qt4 qimage producer"
- qt4_found=true
- echo "#define USE_QT4" >> config.h
- echo "USE_QT4=1" >> config.mak
- echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
- echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
-
- elif [ -d "$qimage_libdir" -a -d "$qimage_includedir" ]
- then
-
# test if we have a Qt3 or Qt4
if [ -f "$qimage_libdir/libQtCore.so" ] || [ -d "$qimage_libdir/QtGui.framework" ] || [ -f "$qimage_libdir/libQtCore4.a" ] && [ "$force_qt3" = "" ]
then
elif [ -f "$qimage_libdir/libQtCore4.a" ]
then
echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
- echo QTLIBS=-enable-auto-import -L$qimage_libdir -lQtCore4 -lQtGui4 -lQtXml4 -lQtSvg4 >> config.mak
+ echo QTLIBS=-Wl,-enable-auto-import -L$qimage_libdir -lQtCore4 -lQtGui4 -lQtXml4 -lQtSvg4 >> config.mak
else
echo QTCXXFLAGS=-I$qimage_includedir >> config.mak
echo QTLIBS=-L$qimage_libdir -lQtCore -lQtGui -lQtXml -lQtSvg >> config.mak
fi
fi
else
- echo "qimage: QT environment not found - disabling"
- touch ../disable-qimage
+ pkg-config --exists 'QtGui >= 4'
+ if [ $? -eq 0 ] && [ "$force_qt3" = "" ]
+ then
+ echo "Qt version 4.x detected, will compile Qt4 qimage producer"
+ qt4_found=true
+ echo "#define USE_QT4" >> config.h
+ echo "USE_QT4=1" >> config.mak
+ echo QTCXXFLAGS=$(pkg-config --cflags QtCore QtGui QtXml QtSvg ) >> config.mak
+ echo QTLIBS=$(pkg-config --libs QtCore QtGui QtXml QtSvg) >> config.mak
+ else
+ echo "qimage: QT environment not found - disabling"
+ touch ../disable-qimage
+ fi
fi
[ "$gpl3" = "true" ] && echo GPL3=1 >> config.mak
exit 0