]> git.tdb.fi Git - builder.git/blob - bootstrap.sh
Improve automatic package finding to detect directories with version number
[builder.git] / bootstrap.sh
1 #!/bin/sh
2 # $Id$
3
4 set -e
5
6 REQUIRED="core datafile fs strings io"
7 CFLAGS="-Iinclude `pkg-config --cflags sigc++-2.0`"
8 LIBS="`pkg-config --libs sigc++-2.0` -lpthread -ldl"
9 if [ -z "$LIBPATH" ]; then
10         LIBPATH=`pwd`/..
11 fi
12
13 LIBPATH=`readlink -f $LIBPATH`
14
15 mkdir -p include/msp
16
17 sources=source/*.cpp
18
19 for i in $REQUIRED; do
20         path=`ls -1d $LIBPATH/*$i* 2>/dev/null | head -1`
21         if [ ! -d $path ]; then
22                 echo msp$i missing
23                 exit 1
24         fi
25         if [ $i = "core" ]; then
26                 ln -sf $path/source/* -t include/msp
27         else
28                 ln -sfT $path/source include/msp/$i
29         fi
30         sources="$sources `find $path/source -name '*.cpp'`"
31 done
32
33 g++ $sources -o builder-stage1 $CFLAGS $LIBS