Commit 53c620d2 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add script: exports flags and libs from pc file for build with library for source tree

parent 69e91c71
#!/bin/sh
# Copyright (c) 2009 Free Software Foundation, Inc.
# Copyright (c) 2009 Vitaly Lipatov <lav@etersoft.ru>
# exports flags and libs from pc file for build with library for source tree
# EXPORTPATH contains path to the project dir (../uniset f.i.)
# Usage example:
# TryExport()
# {
# EXPORTPATH=$(readlink -f $1)
# test -r $1/$2 && . $1/$2
# }
#
# TryExport ../uniset libUniSet.include
PCFILE=$EXPORTPATH/libUniSet.pc
test -r "$PCFILE" || exit 1
# guess prefix in the first line of pkgconfig file
eval $(head -n1 $PCFILE)
test -d "$prefix" || exit 1
export UNISET_CFLAGS="$(pkg-config --cflags $PCFILE | sed -e "s|-I$prefix/include/uniset|-I$EXPORTPATH/include|g" )"
export UNISET_LIBS="-L$EXPORTPATH/lib $(pkg-config --libs $PCFILE | sed -e "s|-L$prefix ||g" )"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment