summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith M Wesolowski <wesolows@foobazco.org>2012-06-19 00:27:43 +0000
committerKeith M Wesolowski <wesolows@foobazco.org>2012-06-19 17:01:59 +0000
commit093720c53f2c96581989709434d640bc174aa5bb (patch)
treee7e92fb738114c29f252210d68183495f844044c
parent511cdd23c5717d0bb98043c154efb4dadc2edbb8 (diff)
downloadillumos-kvm-cmd-093720c53f2c96581989709434d640bc174aa5bb.tar.gz
OS-1300 kvm-cmd build system relies on build system headers and libraries
-rwxr-xr-xbuild.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/build.sh b/build.sh
index c5153a3..827c29f 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,8 @@
#
for dir in seabios vgabios kvm/test; do
- cp roms/${dir}/config.mak.tmpl roms/${dir}/config.mak
+ [[ ! -f roms/${dir}/config.mak.tmpl ]] || \
+ cp roms/${dir}/config.mak.tmpl roms/${dir}/config.mak
done
PNGDIR="${PWD}/libpng-1.5.4"
@@ -23,7 +24,9 @@ fi
if [[ ! -e ${PNGLIB}/libpng.a ]]; then
(cd ${PNGDIR} && \
- LDFLAGS=-m64 CFLAGS=-m64 ./configure --disable-shared && \
+ LDFLAGS="-m64 -L${DESTDIR}/usr/lib -L${DESTDIR}/lib" \
+ CPPFLAGS="-isystem ${DESTDIR}/usr/include" \
+ CFLAGS="-m64" ./configure --disable-shared && \
make && \
mkdir -p ${PNGDIR}/proto && \
make DESTDIR=${PNGDIR}/proto install)
@@ -31,11 +34,14 @@ fi
echo "==> Running configure"
KVM_DIR="${KVM_DIR:-$(cd `pwd`/../kvm; pwd)}"
-CC="${CC:-/opt/gcc/4.4.4/bin/gcc}"
+CC="${CC:-${DESTDIR}/usr/bin/gcc}"
+XCFLAGS="-fno-builtin -I${PNGINC} -isystem ${DESTDIR}/usr/include"
+XLDFLAGS="-nodefaultlibs -L${PNGLIB} -L${DESTDIR}/usr/lib -L${DESTDIR}/lib"
+XLDFLAGS="${XLDFLAGS} -lz -lm -lc"
./configure \
--cc=$CC \
- --extra-cflags="-fno-builtin -nodefaultlibs -I${PNGDIR}/proto/usr/local/include" \
- --extra-ldflags="-L${PNGDIR}/proto/usr/local/lib -lz -lm -lc" \
+ --extra-cflags="${XCFLAGS}" \
+ --extra-ldflags="${XLDFLAGS}" \
--prefix=/smartdc \
--audio-card-list= \
--audio-drv-list= \