Start a gnucash-config script.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5299 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-09-06 09:05:38 +00:00
parent c9e288f4c8
commit b21bd0f22e
3 changed files with 106 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ config.h.in
cscope.out
cscope.files
etags.files
gnucash-config
install-sh
intl
libtool

View File

@@ -33,6 +33,7 @@ EXTRA_DIST = \
HACKING \
README.patches \
gnucash.lsm \
gnucash-config.in \
make-gnucash-patch.in \
make-gnucash-potfiles.in \
po/.cvsignore \
@@ -41,6 +42,12 @@ EXTRA_DIST = \
po/glossary/gnc-glossary.txt \
po/glossary/txt-to-pot.sh
bin_SCRIPTS = gnucash-config
BUILT_SOURCES = gnucash-config
CLEANFILES += gnucash-config
## We borrow guile's convention and use @-...-@ as the substitution
## brackets here, instead of the usual @...@. This prevents autoconf
## from substituting the values directly into the left-hand sides of
@@ -59,6 +66,14 @@ make-gnucash-potfiles: make-gnucash-potfiles.in
chmod +x $@.tmp
mv $@.tmp $@
gnucash-config: gnucash-config.in
rm -f $@.tmp
sed < $@.in > $@.tmp \
-e 's:@-VERSION-@:${VERSION}:g' \
-e 's:@-GNC_INCLUDE_DIR-@:${GNC_INCLUDE_DIR}:g'
chmod +x $@.tmp
mv $@.tmp $@
DISTCLEANFILES += \
cscope.files cscope.out etags.files make-gnucash-patch

90
gnucash-config.in Normal file
View File

@@ -0,0 +1,90 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
exec_prefix_set=no
usage()
{
cat <<EOF
Usage: gnucash-config [OPTIONS] [LIBRARIES]
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
[--version]
[--libs]
[--cflags]
Libraries:
engine
gnucash
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
lib_gnucash=yes
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--prefix=*)
prefix=$optarg
if test $exec_prefix_set = no ; then
exec_prefix=$optarg
fi
;;
--prefix)
echo_prefix=yes
;;
--exec-prefix=*)
exec_prefix=$optarg
exec_prefix_set=yes
;;
--exec-prefix)
echo_exec_prefix=yes
;;
--version)
echo @-VERSION-@
exit 0
;;
--cflags)
echo_cflags=yes
;;
--libs)
echo_libs=yes
;;
engine)
lib_engine=yes
;;
gnucash)
lib_gnucash=yes
;;
*)
usage 1 1>&2
;;
esac
shift
done
if test "$echo_prefix" = "yes"; then
echo $prefix
fi
if test "$echo_exec_prefix" = "yes"; then
echo $exec_prefix
fi
if test "$echo_cflags" = "yes"; then
echo -I@-GNC_INCLUDE_DIR-@
fi
if test "$echo_libs" = "yes"; then
echo ""
fi