3
# Copyright abandoned 2013 Tamas TEVESZ <ice@extreme.hu>
5
# this script builds LibreCAD on FreeBSD
6
# The following ports must be installed:
8
# x11-toolkits/qt4-gui devel/qt4-linguist devel/qt4-help-tools
9
# graphics/qt4-svg databases/qt4-sql(?) textproc/qt4-clucene(?)
10
# devel/boost-libs math/muparser
14
# lang/clang33 and devel/llvm33 and devel/libc++
16
scriptpath="$( readlink -f "${0}" )"
17
scriptpath="${scriptpath%/*}"
19
if [ -z "${use_cxx}" ]
21
if [ "$( which g++47 )" ]
24
elif [ "$( which g++48 )" ]
27
elif [ "$( which g++49 )" ]
30
elif [ "$( which clang++33 )" ]
34
echo "No supported compiler found. Install one of lang/{gcc4{7,8,9},clang33}" >&2
37
elif [ -z "$( which ${use_cxx} )" ]
39
echo "Selected compiler ${use_cxx} not found" >&2
48
compiler_version=${use_cxx##*++}
51
rpath="$( make -C /usr/ports/lang/gcc${compiler_version} -V LOCALBASE )"/lib/gcc${compiler_version}
54
if [ ! -e "$( make -C /usr/ports/lang/clang${compiler_version} -V LOCALBASE )"/lib/libc++.so ]
56
echo "Install devel/libc++" >&2
59
cxxflags="-I /usr/local/include/c++/v1"
63
spec="freebsd-${use_cxx}"
66
qmake-qt4 librecad.pro ${spec:+-spec ${spec}} "${rpath:+QMAKE_RPATHDIR=\"${rpath}\"}" "${cxxflags:+QMAKE_CXXFLAGS=\"${cxxflags}\"}" "${libs:+QMAKE_LIBS=\"${libs}\"}"
67
make -j$( /sbin/sysctl -n hw.ncpu )