[253] | 1 | #!/usr/bin/env bash
|
---|
| 2 |
|
---|
| 3 | echo "##########################################################"
|
---|
| 4 | echo "# ___________ ____ ______ __ __ _____ #"
|
---|
| 5 | echo "# \____ \__ \ _/ ___\\____ \^| ^| \/ ___/ #"
|
---|
| 6 | echo "# ^| ^|_^> ^> __ \\ \___^| ^|_^> ^> ^| /\___ \ #"
|
---|
| 7 | echo "# ^| __(____ /\___ ^> __/^|____//____ ^> #"
|
---|
| 8 | echo "# ^|__^| \/ \/^|__^| \/ #"
|
---|
| 9 | echo "# #"
|
---|
| 10 | echo "##########################################################"
|
---|
| 11 | echo ""
|
---|
| 12 | echo "========================================"
|
---|
| 13 | echo " PACPUS BUILD IGEP "
|
---|
| 14 | echo "========================================"
|
---|
| 15 |
|
---|
| 16 | #recupere cmake
|
---|
[255] | 17 | if [ -f ${OECORE_NATIVE_SYSROOT}/usr/bin/cmake ]; then
|
---|
| 18 | CMAKE_NATIVE=${OECORE_NATIVE_SYSROOT}/usr/bin/cmake
|
---|
[253] | 19 | else
|
---|
[255] | 20 | echo "cross toolchain is not installed, please read https://devel.hds.utc.fr/projects/igep/wiki/toolchain/install"
|
---|
[253] | 21 | exit 1
|
---|
| 22 | fi
|
---|
| 23 |
|
---|
| 24 |
|
---|
| 25 | function usage {
|
---|
| 26 | echo Usage:
|
---|
| 27 | echo build-linux.sh [install_dir]
|
---|
| 28 | echo [install-dir] is optional
|
---|
| 29 | echo The script must be run in the build directory, which is 'trunk\build'
|
---|
| 30 | echo ""
|
---|
| 31 | echo Where:
|
---|
| 32 | echo install_dir is the installation directory of the library
|
---|
| 33 | echo ""
|
---|
| 34 | echo For instance, here is how to build Pacpus:
|
---|
| 35 | echo ../scripts/build-igep.sh "/opt/Pacpus"
|
---|
| 36 | echo ""
|
---|
| 37 | exit 1
|
---|
| 38 | }
|
---|
| 39 |
|
---|
| 40 | function build {
|
---|
| 41 | # Initialize the build
|
---|
| 42 | $CMAKE_NATIVE .. -DPACPUS_INSTALL_DIR=$1 -DPACPUS_INSTALL_3RD=TRUE \
|
---|
| 43 | -DPACPUS_USE_LOG=TRUE -DCMAKE_BUILD_TYPE=Release \
|
---|
[255] | 44 | -DPACPUS_INSTALL_WITH_VERSION_NUMBER=TRUE -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_CROSS_TOOLCHAIN}
|
---|
[253] | 45 | make
|
---|
| 46 | sudo make install
|
---|
| 47 | $CMAKE_NATIVE .. -DPACPUS_INSTALL_DIR=$1 -DPACPUS_INSTALL_3RD=TRUE \
|
---|
| 48 | -DPACPUS_USE_LOG=TRUE -DCMAKE_BUILD_TYPE=Debug
|
---|
[255] | 49 | -DPACPUS_INSTALL_WITH_VERSION_NUMBER=TRUE -DCMAKE_TOOLCHAIN_FILE=${OECORE_CMAKE_CROSS_TOOLCHAIN} \
|
---|
[253] | 50 | make
|
---|
| 51 | sudo make install
|
---|
| 52 | echo "Build finished"
|
---|
| 53 | exit 0
|
---|
| 54 | }
|
---|
| 55 |
|
---|
| 56 | #Check if the user is in the build directory
|
---|
| 57 | if [ `basename $PWD` == "build" ]; then
|
---|
| 58 | if [ $# -ne 1 ]; then
|
---|
| 59 | INST_PATH="/opt/pacpus"
|
---|
| 60 | else
|
---|
| 61 | INST_PATH=$1
|
---|
| 62 | fi
|
---|
| 63 | build $INST_PATH
|
---|
| 64 | else
|
---|
| 65 | usage
|
---|
| 66 | fi
|
---|