diff options
author | 2023-05-11 17:25:52 +0200 | |
---|---|---|
committer | 2023-05-11 17:25:52 +0200 | |
commit | f58400c634eea6f865db8486e7e174f67bb555ce (patch) | |
tree | 16dd706e8a33bd01832aea7c94eafb6637ced82c /build-pc.sh | |
parent | c3a38bdbd9e08ba631f34faf408cfac8171dd725 (diff) | |
download | string2-f58400c634eea6f865db8486e7e174f67bb555ce.tar.gz string2-f58400c634eea6f865db8486e7e174f67bb555ce.zip |
Change the way how to build this library
Diffstat (limited to 'build-pc.sh')
-rwxr-xr-x | build-pc.sh | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/build-pc.sh b/build-pc.sh new file mode 100755 index 0000000..eb7dca8 --- /dev/null +++ b/build-pc.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +# See LICENSE file for copyright and license details. + +VERSION=0.0.1 + +while [ $# -gt 0 ] +do + case $1 in + -p|--prefix) + shift + PREFIX=$1 + ;; + -n|--name) + shift + NAME=$1 + ;; + -ln|--lib-name) + shift + LIBNAME=$1 + ;; + -d|--description) + shift + DESCR=$1 + ;; + -v|--version) + shift + VERSION=$1 + ;; + *) + TARGET=$1 + ;; + esac + shift +done + +if [ -z $PREFIX ]; then + echo 'prefix must be set' + exit 1 +elif [ -z $NAME ]; then + echo 'name must be set' + exit 1 +fi + +cat <<EOF > $TARGET +prefix=$PREFIX +exec_prefix=\${prefix} +includedir=\${prefix}/include +libdir=\${exec_prefix}/lib + +Name: $NAME +Description: $LIBNAME - $DESCR +Version: $VERSION +Cflags: -I\${includedir} +Libs: -L\${libdir} -l$NAME +EOF |