diff options
Diffstat (limited to 'src/compil.sh')
-rwxr-xr-x | src/compil.sh | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/compil.sh b/src/compil.sh index 4afcc2e..bc21245 100755 --- a/src/compil.sh +++ b/src/compil.sh @@ -2,24 +2,34 @@ clear -set -x +#set -x CXX="g++ -Wall -g" BUILD_PATH="../build" AMDAPP_PATH="/opt/AMDAPP" +DEFINES="" INCLUDES="" LIBS="" # OpenCL -INCLUDES="$INCLUDES -I $AMDAPP_PATH/include" -LIBS="$LIBS -lOpenCL" +if [ -d "$AMDAPP_PATH/include" ] +then DEFINES="-DHAS_OPENCL" + INCLUDES="$INCLUDES -I $AMDAPP_PATH/include" + LIBS="$LIBS -lOpenCL" +else echo "WARNING : invalid AMDAPP_PATH : '$AMDAPP_PATH'" +fi # GTKGLEXT -INCLUDES="$INCLUDES $(pkg-config --cflags gtkglextmm-1.2)" -LIBS="$LIBS $(pkg-config --libs gtkglextmm-1.2)" - -set +x +if pkg-config --modversion gtkglextmm-1.2 gdkmm-2.4 > /dev/null +then INCLUDES="$INCLUDES $(pkg-config --cflags gtkglextmm-1.2)" + LIBS="$LIBS $(pkg-config --libs gtkglextmm-1.2)" +else echo "ERROR : pkg-config is unavailable or gtkglextmm-1.2 developpemnt files are not installed" + echo "On Ubuntu (12.04, 12.10) you can resolve that with :" + echo " sudo apt-get install pkg-config libgtkmm-2.4-dev libgtkglextmm-x11-1.2-dev" + exit 1 +fi +#set +x function build_cxx() { echo "$PS4$CXX \$INCLUDES -o $BUILD_PATH/$1 -c $2" @@ -33,7 +43,7 @@ function link_cxx() { $CXX $* -o $BUILD_PATH/$out $LIBS } -rm $BUILD_PATH/* || true +rm -v $BUILD_PATH/* || true build_cxx gpudataviz.o gpudataviz.cc build_cxx boring_parts.o boring_parts.cc |