mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -17,6 +17,7 @@ config.h.in
|
||||
cscope.out
|
||||
cscope.files
|
||||
etags.files
|
||||
gnucash-config
|
||||
install-sh
|
||||
intl
|
||||
libtool
|
||||
|
||||
15
Makefile.am
15
Makefile.am
@@ -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
90
gnucash-config.in
Normal 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
|
||||
Reference in New Issue
Block a user