mirror of
https://github.com/TREX-CoE/trexio.git
synced 2025-04-22 16:40:10 +02:00
34 lines
654 B
Bash
Executable File
34 lines
654 B
Bash
Executable File
#!/bin/sh
|
|
|
|
PREFIX=$1
|
|
TASK=$2
|
|
PKGCONFIG_COMMAND="pkg-config --libs --cflags trexio"
|
|
|
|
INSTALLED="no"
|
|
|
|
# Try with system defaults
|
|
if cc test.c >/dev/null 2>&1 ; then
|
|
exit
|
|
fi
|
|
|
|
# Try with pkg-config
|
|
if eval $PKGCONFIG_COMMAND >/dev/null 2>&1; then
|
|
exit
|
|
fi
|
|
|
|
# Compile C library
|
|
set -e
|
|
if test "$TASK" = "build" ; then
|
|
tar -zxf trexio-*.tar.gz
|
|
cd trexio-*
|
|
# ./configure --prefix=${PREFIX} --without-fortran --enable-static --disable-shared
|
|
./configure --prefix=${PWD}/.. --without-fortran --enable-static --disable-shared
|
|
make -j 4
|
|
make -j install
|
|
cd ../
|
|
elif test "$TASK" = "install" ; then
|
|
cd trexio-*
|
|
make install
|
|
rm -rf trexio-*/
|
|
fi
|