patches from rob browning

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1306 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 1998-10-15 03:53:12 +00:00
parent 48e408c393
commit 2590f3ef7e
11 changed files with 278 additions and 218 deletions

View File

@ -94,8 +94,8 @@ clean:
@cd src; $(MAKE) clean
distclean: clean
rm -f *~ *.o *.bak Makefile share/scm gnucash.bin
rm -f gnucash gnucash.motif gnucash.motif.static \
rm -f Makefile *~ *.o *.bak share/scm gnucash.bin
rm -f gnucash.motif gnucash.motif.static \
gnucash.gnome gnucash.gnome.static gnucash.qt
rm -f config.cache config.log config.status config.h
rm -f src/guile/path-defaults.h

199
configure vendored
View File

@ -23,6 +23,8 @@ ac_help="$ac_help
--with-motif-includes=DIR specify where to look for motif includes"
ac_help="$ac_help
--with-motif-libraries=DIR specify where to look for motif libs"
ac_help="$ac_help
--with-xmhtml-includes=DIR specify where to look for xmhtml headers"
ac_help="$ac_help
--with-xmhtml-libraries=DIR specify where to look for xmhtml libs"
ac_help="$ac_help
@ -633,6 +635,13 @@ if test "${with_motif_libraries+set}" = set; then
fi
# Check whether --with-xmhtml-includes or --without-xmhtml-includes was given.
if test "${with_xmhtml_includes+set}" = set; then
withval="$with_xmhtml_includes"
X_CFLAGS="${X_CFLAGS} -I$with_xmhtml_includes"
fi
# Check whether --with-xmhtml-libraries or --without-xmhtml-libraries was given.
if test "${with_xmhtml_libraries+set}" = set; then
withval="$with_xmhtml_libraries"
@ -695,7 +704,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:699: checking for a BSD compatible install" >&5
echo "configure:708: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -747,7 +756,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:751: checking for $ac_word" >&5
echo "configure:760: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -776,7 +785,7 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:780: checking for $ac_word" >&5
echo "configure:789: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -805,7 +814,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:809: checking for $ac_word" >&5
echo "configure:818: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -853,7 +862,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:857: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:866: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -863,11 +872,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
#line 867 "configure"
#line 876 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@ -887,12 +896,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:891: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:900: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:896: checking whether we are using GNU C" >&5
echo "configure:905: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -901,7 +910,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@ -916,7 +925,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:920: checking whether ${CC-cc} accepts -g" >&5
echo "configure:929: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -944,7 +953,7 @@ else
fi
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
echo "configure:948: checking for POSIXized ISC" >&5
echo "configure:957: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@ -965,14 +974,14 @@ else
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
echo "configure:969: checking whether byte ordering is bigendian" >&5
echo "configure:978: checking whether byte ordering is bigendian" >&5
if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
cat > conftest.$ac_ext <<EOF
#line 976 "configure"
#line 985 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@ -983,11 +992,11 @@ int main() {
#endif
; return 0; }
EOF
if { (eval echo configure:987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:996: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
# It does; now see whether it defined to BIG_ENDIAN or not.
cat > conftest.$ac_ext <<EOF
#line 991 "configure"
#line 1000 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@ -998,7 +1007,7 @@ int main() {
#endif
; return 0; }
EOF
if { (eval echo configure:1002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@ -1018,7 +1027,7 @@ if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
#line 1022 "configure"
#line 1031 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@ -1031,7 +1040,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
if { (eval echo configure:1035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_bigendian=no
else
@ -1055,7 +1064,7 @@ EOF
fi
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:1059: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo "configure:1068: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1085,7 +1094,7 @@ fi
# *******************************************
# check for UI libs:
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1089: checking how to run the C preprocessor" >&5
echo "configure:1098: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -1100,13 +1109,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1104 "configure"
#line 1113 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1110: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -1117,13 +1126,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1121 "configure"
#line 1130 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1136: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@ -1150,7 +1159,7 @@ echo "$ac_t""$CPP" 1>&6
# Uses ac_ vars as temps to allow command line to override cache and checks.
# --without-x overrides everything else, but does not touch the cache.
echo $ac_n "checking for X""... $ac_c" 1>&6
echo "configure:1154: checking for X" >&5
echo "configure:1163: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@ -1212,12 +1221,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
#line 1216 "configure"
#line 1225 "configure"
#include "confdefs.h"
#include <$x_direct_test_include>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1286,14 +1295,14 @@ if test "$ac_x_libraries" = NO; then
ac_save_LIBS="$LIBS"
LIBS="-l$x_direct_test_library $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1290 "configure"
#line 1299 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
if { (eval echo configure:1297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
LIBS="$ac_save_LIBS"
# We can link X programs with no special library path.
@ -1399,17 +1408,17 @@ else
case "`(uname -sr) 2>/dev/null`" in
"SunOS 5"*)
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
echo "configure:1403: checking whether -R must be followed by a space" >&5
echo "configure:1412: checking whether -R must be followed by a space" >&5
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1406 "configure"
#line 1415 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_nospace=yes
else
@ -1425,14 +1434,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
#line 1429 "configure"
#line 1438 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
if { (eval echo configure:1436: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_R_space=yes
else
@ -1464,7 +1473,7 @@ rm -f conftest*
# libraries were built with DECnet support. And karl@cs.umb.edu says
# the Alpha needs dnet_stub (dnet does not exist).
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
echo "configure:1468: checking for dnet_ntoa in -ldnet" >&5
echo "configure:1477: checking for dnet_ntoa in -ldnet" >&5
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1472,7 +1481,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1476 "configure"
#line 1485 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1483,7 +1492,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1505,7 +1514,7 @@ fi
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
echo "configure:1509: checking for dnet_ntoa in -ldnet_stub" >&5
echo "configure:1518: checking for dnet_ntoa in -ldnet_stub" >&5
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1513,7 +1522,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1517 "configure"
#line 1526 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1524,7 +1533,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
if { (eval echo configure:1528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1553,12 +1562,12 @@ fi
# The nsl library prevents programs from opening the X display
# on Irix 5.2, according to dickey@clark.net.
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
echo "configure:1557: checking for gethostbyname" >&5
echo "configure:1566: checking for gethostbyname" >&5
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1562 "configure"
#line 1571 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@ -1581,7 +1590,7 @@ gethostbyname();
; return 0; }
EOF
if { (eval echo configure:1585: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_gethostbyname=yes"
else
@ -1602,7 +1611,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1606: checking for gethostbyname in -lnsl" >&5
echo "configure:1615: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1610,7 +1619,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1614 "configure"
#line 1623 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1621,7 +1630,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:1625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1651,12 +1660,12 @@ fi
# -lsocket must be given before -lnsl if both are needed.
# We assume that if connect needs -lnsl, so does gethostbyname.
echo $ac_n "checking for connect""... $ac_c" 1>&6
echo "configure:1655: checking for connect" >&5
echo "configure:1664: checking for connect" >&5
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1660 "configure"
#line 1669 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@ -1679,7 +1688,7 @@ connect();
; return 0; }
EOF
if { (eval echo configure:1683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1692: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_connect=yes"
else
@ -1700,7 +1709,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
echo "configure:1704: checking for connect in -lsocket" >&5
echo "configure:1713: checking for connect in -lsocket" >&5
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1708,7 +1717,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1712 "configure"
#line 1721 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1719,7 +1728,7 @@ int main() {
connect()
; return 0; }
EOF
if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1743,12 +1752,12 @@ fi
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
echo $ac_n "checking for remove""... $ac_c" 1>&6
echo "configure:1747: checking for remove" >&5
echo "configure:1756: checking for remove" >&5
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1752 "configure"
#line 1761 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@ -1771,7 +1780,7 @@ remove();
; return 0; }
EOF
if { (eval echo configure:1775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_remove=yes"
else
@ -1792,7 +1801,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
echo "configure:1796: checking for remove in -lposix" >&5
echo "configure:1805: checking for remove in -lposix" >&5
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1800,7 +1809,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1804 "configure"
#line 1813 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1811,7 +1820,7 @@ int main() {
remove()
; return 0; }
EOF
if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1824: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1835,12 +1844,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
echo "configure:1839: checking for shmat" >&5
echo "configure:1848: checking for shmat" >&5
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1844 "configure"
#line 1853 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@ -1863,7 +1872,7 @@ shmat();
; return 0; }
EOF
if { (eval echo configure:1867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_shmat=yes"
else
@ -1884,7 +1893,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
echo "configure:1888: checking for shmat in -lipc" >&5
echo "configure:1897: checking for shmat in -lipc" >&5
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1892,7 +1901,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1896 "configure"
#line 1905 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1903,7 +1912,7 @@ int main() {
shmat()
; return 0; }
EOF
if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1936,7 +1945,7 @@ fi
# libraries we check for below, so use a different variable.
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
echo "configure:1940: checking for IceConnectionNumber in -lICE" >&5
echo "configure:1949: checking for IceConnectionNumber in -lICE" >&5
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1944,7 +1953,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1948 "configure"
#line 1957 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1955,7 +1964,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
if { (eval echo configure:1959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:1968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1984,7 +1993,7 @@ LIBS="-lm"
# the XmHTML widget needs libz, libjpeg, libpng and libm
# it also uses #ifdef's not #if's so DONT #def to zero.
echo $ac_n "checking for deflateEnd in -lz""... $ac_c" 1>&6
echo "configure:1988: checking for deflateEnd in -lz" >&5
echo "configure:1997: checking for deflateEnd in -lz" >&5
ac_lib_var=`echo z'_'deflateEnd | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1992,7 +2001,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1996 "configure"
#line 2005 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2003,7 +2012,7 @@ int main() {
deflateEnd()
; return 0; }
EOF
if { (eval echo configure:2007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2027,7 +2036,7 @@ else
fi
echo $ac_n "checking for jpeg_read_scanlines in -ljpeg""... $ac_c" 1>&6
echo "configure:2031: checking for jpeg_read_scanlines in -ljpeg" >&5
echo "configure:2040: checking for jpeg_read_scanlines in -ljpeg" >&5
ac_lib_var=`echo jpeg'_'jpeg_read_scanlines | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2035,7 +2044,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ljpeg $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2039 "configure"
#line 2048 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2046,7 +2055,7 @@ int main() {
jpeg_read_scanlines()
; return 0; }
EOF
if { (eval echo configure:2050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2070,7 +2079,7 @@ else
fi
echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
echo "configure:2074: checking for png_read_image in -lpng" >&5
echo "configure:2083: checking for png_read_image in -lpng" >&5
ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2078,7 +2087,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lpng $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2082 "configure"
#line 2091 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2089,7 +2098,7 @@ int main() {
png_read_image()
; return 0; }
EOF
if { (eval echo configure:2093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2119,7 +2128,7 @@ fi
# LIBS="-lXmu -lXt -lXext $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS"
echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6
echo "configure:2123: checking for XpmReadFileToXpmImage in -lXpm" >&5
echo "configure:2132: checking for XpmReadFileToXpmImage in -lXpm" >&5
ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2127,7 +2136,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lXpm -L $x_libraries -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2131 "configure"
#line 2140 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2138,7 +2147,7 @@ int main() {
XpmReadFileToXpmImage()
; return 0; }
EOF
if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2151: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2169,15 +2178,15 @@ fi
# Don't build the xmhtml source if user already has it installed...
# this is ugly, there must be a nicer way of setting this up ...
echo $ac_n "checking for XmHTMLTextScrollToLine in -lXmHTML""... $ac_c" 1>&6
echo "configure:2173: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5
echo "configure:2182: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5
ac_lib_var=`echo XmHTML'_'XmHTMLTextScrollToLine | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lXmHTML -lXm -L $x_libraries -lXext -lX11 $LIBS"
LIBS="-lXmHTML -lXm -L $x_libraries $X_LIBS -lXext -lXt -lX11 $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2181 "configure"
#line 2190 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2188,7 +2197,7 @@ int main() {
XmHTMLTextScrollToLine()
; return 0; }
EOF
if { (eval echo configure:2192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2219,7 +2228,7 @@ fi
# Set GUILELIBS according to the set of libraries needed to link
# with guile.
echo $ac_n "checking for gh_enter in -lguile""... $ac_c" 1>&6
echo "configure:2223: checking for gh_enter in -lguile" >&5
echo "configure:2232: checking for gh_enter in -lguile" >&5
ac_lib_var=`echo guile'_'gh_enter | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2227,7 +2236,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lguile $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2231 "configure"
#line 2240 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2238,7 +2247,7 @@ int main() {
gh_enter()
; return 0; }
EOF
if { (eval echo configure:2242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2257,7 +2266,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gh_define in -lguile""... $ac_c" 1>&6
echo "configure:2261: checking for gh_define in -lguile" >&5
echo "configure:2270: checking for gh_define in -lguile" >&5
ac_lib_var=`echo guile'_'gh_define | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2265,7 +2274,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lguile -ldl -lreadline $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2269 "configure"
#line 2278 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2276,7 +2285,7 @@ int main() {
gh_define()
; return 0; }
EOF
if { (eval echo configure:2280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2295,7 +2304,7 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for gh_eval_file in -lguile""... $ac_c" 1>&6
echo "configure:2299: checking for gh_eval_file in -lguile" >&5
echo "configure:2308: checking for gh_eval_file in -lguile" >&5
ac_lib_var=`echo guile'_'gh_eval_file | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2303,7 +2312,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lguile -ldl -lreadline -lqthreads $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2307 "configure"
#line 2316 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2314,7 +2323,7 @@ int main() {
gh_eval_file()
; return 0; }
EOF
if { (eval echo configure:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
if { (eval echo configure:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2446,7 +2455,7 @@ done
ac_given_srcdir=$srcdir
ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "gnucash Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
trap 'rm -fr `echo "Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
@ -2530,7 +2539,7 @@ EOF
cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"gnucash Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile"}
CONFIG_FILES=\${CONFIG_FILES-"Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then

View File

@ -45,6 +45,10 @@ AC_ARG_WITH( motif-libraries,
[ --with-motif-libraries=DIR specify where to look for motif libs],
X_LIBS="${X_LIBS} -L$with_motif_libraries" )
AC_ARG_WITH( xmhtml-includes,
[ --with-xmhtml-includes=DIR specify where to look for xmhtml headers],
X_CFLAGS="${X_CFLAGS} -I$with_xmhtml_includes" )
AC_ARG_WITH( xmhtml-libraries,
[ --with-xmhtml-libraries=DIR specify where to look for xmhtml libs],
X_LIBS="${X_LIBS} -L$with_xmhtml_libraries" )
@ -104,7 +108,7 @@ AC_CHECK_LIB(XmHTML, XmHTMLTextScrollToLine,
XMHTML_TARGET=default
XMHTML_INC=/lib/XmHTML-1.1.0/src
LIBS="-L $srcdir/lib/XmHTML-1.1.0 $LIBS" ,
-lXm -L $x_libraries -lXext -lX11)
-lXm -L $x_libraries $X_LIBS -lXext -lXt -lX11)
AC_SUBST(XMHTML_TARGET)
AC_SUBST(XMHTML_INC)
@ -126,6 +130,6 @@ AC_SUBST(GUILELIBS)
# *******************************************
AC_CONFIG_HEADER(config.h)
AC_OUTPUT(gnucash Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile)
AC_OUTPUT(Makefile src/Makefile src/engine/Makefile src/guile/Makefile src/gnome/Makefile src/motif/Makefile src/qt/Makefile src/register/Makefile src/reports/Makefile lib/Makefile lib/XmHTML-1.1.0/Makefile lib/XmHTML-1.1.0/src/Makefile lib/Xbae-4.6.2-linas/Makefile lib/Xbae-4.6.2-linas/src/Makefile lib/ComboBox-1.33/Makefile)
chmod +x gnucash

5
gnucash.in → gnucash Normal file → Executable file
View File

@ -1,14 +1,11 @@
#! /bin/sh
# @configure_input@
GNC_ARGS="${GNC_ARGS} --debug"
GNC_ARGS="${GNC_ARGS} --startup-file ./share/scm/startup.scm"
GNC_ARGS="${GNC_ARGS} --share-dir ./share"
GNC_ARGS="${GNC_ARGS} --config-dir ./etc"
GNC_ARGS="${GNC_ARGS} --load-path (\"(./share/scm)\")"
XACC_HELP=${XACC_HELP}:./Docs:./Reports
export XACC_HELP
GNC_ARGS="${GNC_ARGS} --doc-path (\"(./Docs)\"\"(./Reports)\")"
# Run whichever one was built last.
exec gnucash.bin ${GNC_ARGS} $@

View File

@ -34,7 +34,7 @@ CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH}
######################################################################
# See Makefile.common for information about these variables.
COMMON_SRCS := MultiLedger.c SplitLedger.c
CLEAN_SUBDIRS := engine gnome motif register guile swig qt
CLEAN_SUBDIRS := engine gnome motif register guile reports swig qt
######################################################################
all: default

View File

@ -28,3 +28,18 @@ So here is the law:
-- Linas Vepstas
17 August 1998
Rob's Style conventions (for anyone who cares):
Scheme:
* all gnucash functions and global variables are prefixed with gnc:
* all global variables are enclosed in ** (i.e. gnc:*load-path*)
* all private functions are enclosed in __ (i.e. gnc:_do-not-call_)
* all C functions exported via swig have underscores in place of dashes
C:
* all gnucash functions and global variables are prefixed with gnc_
* all private functions are enclosed in __ (i.e. _gnc_do_not_call_)
* use static functions whenever possible
* use const whenever possible

0
src/scm/doc.scm Normal file
View File

View File

@ -8,57 +8,62 @@
;;; Private
;; Central repository for all hooks -- so we can look them up later by name.
(define gnucash:*hooks* '())
(define gnc:*hooks* '())
(define (gnucash:hook-danglers-get hook)
(define (gnc:hook-danglers-get hook)
(vector-ref hook 2))
(define (gnucash:hook-danglers-set! hook danglers)
(define (gnc:hook-danglers-set! hook danglers)
(vector-set! hook 2 danglers))
;;; Developers
(define (gnucash:hook-define name description)
(define (gnc:hook-define name description)
(let ((hook-data (vector name description '())))
(set! gnucash:*hooks* (assoc-set! gnucash:*hooks* name hook-data))
(set! gnc:*hooks* (assoc-set! gnc:*hooks* name hook-data))
hook-data))
(define (gnucash:hook-danglers->list hook)
(gnucash:hook-danglers-get hook))
(define (gnc:hook-danglers->list hook)
(gnc:hook-danglers-get hook))
(define (gnucash:hook-replace-danglers hook function-list)
(gnucash:hook-danglers-set! hook function-list))
(define (gnc:hook-replace-danglers hook function-list)
(gnc:hook-danglers-set! hook function-list))
(define (gnucash:hook-run-danglers hook)
(for-each (lambda (dangler) (dangler)) (gnucash:hook-danglers-get hook)))
(define (gnc:hook-run-danglers hook)
(gnc:debug "Running functions on hook " (gnc:hook-name-get hook))
(for-each (lambda (dangler) (dangler)) (gnc:hook-danglers-get hook)))
;;; Public
(define (gnucash:hook-lookup name)
(assoc-ref gnucash:*hooks* name))
(define (gnc:hook-lookup name)
(assoc-ref gnc:*hooks* name))
(define (gnucash:hook-add-dangler hook function)
(let ((danglers (gnucash:hook-danglers-get hook)))
(gnucash:hook-danglers-set! hook (append danglers (list function)))))
(define (gnc:hook-add-dangler hook function)
(let ((danglers (gnc:hook-danglers-get hook)))
(gnc:hook-danglers-set! hook (append danglers (list function)))))
(define (gnucash:hook-remove-dangler hook function)
(let ((danglers (gnucash:hook-danglers-get hook)))
(gnucash:hook-danglers-set! hook (delq! function danglers))))
(define (gnc:hook-remove-dangler hook function)
(let ((danglers (gnc:hook-danglers-get hook)))
(gnc:hook-danglers-set! hook (delq! function danglers))))
(define (gnucash:hook-description-get hook)
(define (gnc:hook-description-get hook)
(vector-ref hook 1))
(define (gnucash:hook-name-get hook)
(define (gnc:hook-name-get hook)
(vector-ref hook 0))
(gnucash:hook-define 'startup-hook "Startup hooks")
(define gnc:*startup-hook*
(gnc:hook-define 'startup-hook "Functions to run at startup."))
(let ((hook (gnucash:hook-lookup 'startup-hook)))
(display (gnucash:hook-name-get hook))
(newline)
(display (gnucash:hook-description-get hook))
(newline)
(gnucash:hook-add-dangler hook (lambda ()
(display "Running a simple startup hook")
(newline)))
(gnucash:hook-run-danglers hook))
(define gnc:*shutdown-hook*
(gnc:hook-define 'shutdown-hook "Functions to run at shutdown."))
;;(let ((hook (gnc:hook-lookup 'startup-hook)))
;; (display (gnc:hook-name-get hook))
;; (newline)
;; (display (gnc:hook-description-get hook))
;; (newline)
;; (gnc:hook-add-dangler hook (lambda ()
;; (display "Running a simple startup hook")
;; (newline)))
;; (gnc:hook-run-danglers hook))

View File

@ -40,11 +40,12 @@
(gnc:debug "starting up.")
#t)
(define (gnc:shutdown value)
;; FIXME: This should be synchronized with the C shutdown process...
(gnc:debug "shutting down.")
(exit 0))
(define (gnc:shutdown exit-status)
(gnc:debug "Shutdown -- exit-status: " exit-status)
(gnc:hook-run-danglers gnc:*shutdown-hook*)
(_gnc_shutdown_ exit-status)
(exit exit-status))
(define gnc:*user-config-loaded?* #f)
@ -85,6 +86,7 @@
#f))))
(define gnc:_load-path-directories_ #f)
(define gnc:_doc-path-directories_ #f)
(define (directory? path)
;; This follows symlinks normally.
@ -118,7 +120,7 @@
(gnc:directory-subdirectories full-path)
dirs))))))))))))
(define (gnc:_load-path-expand_ items)
(define (gnc:_path-expand_ items default-items)
(if
(null? items)
'()
@ -127,9 +129,8 @@
(cond
((eq? item 'default)
(append
(gnc:_load-path-expand_
(gnc:config-var-default-value-get gnc:*load-path*)))
(gnc:_load-path-expand_ other-items))
(gnc:_path-expand_ default-items))
(gnc:_path-expand_ other-items default-items))
((string? item)
(if (and (char=? #\( (string-ref item 0))
(char=? #\) (string-ref item (- (string-length item) 1))))
@ -139,30 +140,61 @@
(if (directory? current-dir)
(let ((subdirs (gnc:directory-subdirectories current-dir))
(rest (gnc:_load-path-expand_ other-items)))
(rest (gnc:_path-expand_ other-items default-items)))
(cons current-dir (append subdirs rest)))
(begin
(gnc:warn "Non-directory " current-dir
"in gnc:*load-path* value."
"in gnc:_path-expand_ item."
"Ignoring.")
'())))
(if (directory? item)
(begin
(gnc:warn "Non-directory " item "in gnc:*load-path* value."
(gnc:warn "Non-directory " item "in gnc:_path-expand_ item."
"Ignoring.")
'())
(cons item (gnc:_load-path-expand_ other-items)))))
(else (gnc:warn "Invalid item " item " in gnc:*load-path*. Ignoring")
(gnc:_load-path-expand_ other-items))))))
(cons item (gnc:_path-expand_ other-items default-items)))))
(else (gnc:warn "Invalid item " item " in gnc:_path-expand_. Ignoring")
(gnc:_path-expand_ other-items default-items))))))
(define (gnc:_load-path-update_ items)
(let ((result (gnc:_load-path-expand_ items)))
(let ((result (gnc:_path-expand_
items
(gnc:config-var-default-value-get gnc:*load-path*))))
(if result
(begin
(set! gnc:_load-path-directories_ result)
result)
#f)))
(define (gnc:_doc-path-update_ items)
(let ((result (gnc:_path-expand_
items
(gnc:config-var-default-value-get gnc:*doc-path*))))
(if result
(begin
(set! gnc:_doc-path-directories_ result)
result)
#f)))
(define (gnc:find-in-directories file directories)
"Find file named 'file' anywhere in 'directories'. 'file' must be a
string and 'directories' must be a list of strings."
(gnc:debug "gnc:find-in-directories looking for " file " in " directories)
(do ((rest directories (cdr rest))
(finished? #f)
(result #f))
((or (null? rest) finished?) result)
(let ((file-name (string-append (car rest) "/" file)))
(gnc:debug " checking for " file-name)
(if (access? file-name F_OK)
(begin
(gnc:debug "found file " file-name)
(set! finished? #t)
(set! result file-name))))))
;; It may make sense to dump this in favor of guile's load-path later,
;; but for now this works, and having gnc things separate may be less
;; confusing and avoids shadowing problems.
@ -171,28 +203,17 @@
"Name must be a string. The system attempts to locate the file of
the given name and load it. The system will attempt to locate the
file in all of the directories specified by gnc:*load-path*."
(let ((directories gnc:_load-path-directories_))
(gnc:debug "gnc:load looking for " name " in " directories)
(do ((rest directories (cdr rest))
(finished? #f)
(result #f))
((or (null? rest) finished?) result)
(let ((file-name (string-append (car rest) "/" name)))
(gnc:debug " checking for " file-name)
(if (access? file-name F_OK)
(if (false-if-exception (primitive-load file-name))
(begin
(gnc:debug "loaded file " file-name)
(set! finished? #t)
(set! result #t))
(begin
(gnc:warn "failure loading " file-name)
(set! finished? #t)
(set! result #f))))))))
(let ((file-name (gnc:find-in-directories name gnc:_load-path-directories_)))
(if (not file-name)
#f
(if (false-if-exception (primitive-load file-name))
(begin
(gnc:debug "loaded file " file-name)
#t)
(begin
(gnc:warn "failure loading " file-name)
#f)))))
;;; config-var: You can create them, set values, find out of the value
;;; is different from the default, and you can get a description. You
@ -314,6 +335,27 @@ variable is modified. The symbol element default will expand to the default dir
(string-append "(" (getenv "HOME") "/.gnucash/scm)")
(string-append "(" gnc:_share-dir-default_ "/scm)"))))
(define gnc:*doc-path*
(gnc:make-config-var
"A list of strings indicating where to look for documentation files
Any path element enclosed in parentheses will automatically be
expanded to that directory and all its subdirectories whenever this
variable is modified. The symbol element default will expand to the
default directory. i.e. (gnc:config-var-value-set! gnc:*doc-path*
'(\"/my/dir/\" default))"
(lambda (var value)
(if (not (list? value))
#f
(let ((result (gnc:_doc-path-update_ value)))
(if (list? result)
(list result)
#f))))
equal?
(list
(string-append "(" (getenv "HOME") "/.gnucash/doc)")
(string-append "(" gnc:_doc-dir-default_ ")"))))
(define gnc:*prefs*
(list
@ -364,21 +406,25 @@ variable is modified. The symbol element default will expand to the default dir
(gnc:error "non-list given for --load-path: " val)
(gnc:shutdown 1)))))))
(cons
"doc-path"
(cons 'string
(lambda (val)
(let ((path-list
(call-with-input-string val (lambda (port) (read port)))))
(if (list? path-list)
(gnc:config-var-value-set! gnc:*doc-path* #f path-list)
(begin
(gnc:error "non-list given for --doc-path: " val)
(gnc:shutdown 1)))))))
(cons "load-user-config" (cons 'boolean gnc:load-user-config))
(cons "load-system-config" (cons 'boolean gnc:load-system-config))))
;;TODO
;;help-path...
;; /* get environment var stuff... TODO let cmd-line opts override this stuff */
;; if( (helpPath = getenv(HELP_VAR)) == NULL )
;; helpPath = HELP_ROOT;
;; also "-c"
(define (gnc:cmd-line-get-boolean-arg args)
;; --arg means #t
;; --arg true means #t
@ -410,29 +456,6 @@ variable is modified. The symbol element default will expand to the default dir
(define (gnc:prefs-show-usage)
(display "usage: gnucash [ option ... ] [ datafile ]") (newline))
; (for-each
; (lambda (item)
; (display
; (string-append
; " --" (gnc:pref-name-get (cdr item)) " "
; (gnc:pref-value-name-get (cdr item))))
; (newline)
; (display
; (string-append
; " description: " (gnc:pref-description-get (cdr item))))
; (newline)
; (display
; (string-append
; " type: " (symbol->string (gnc:pref-type-get (cdr item)))))
; (newline)
; (display
; " default: ")
; (display (gnc:pref-default-get (cdr item)))
; (newline)
; (newline)
; )
; gnc:*prefs*))
(define (gnc:handle-command-line-args)
(gnc:debug "handling command line arguments")
@ -491,28 +514,29 @@ variable is modified. The symbol element default will expand to the default dir
result))
;;;; Now the fun begins.
(gnc:startup)
(if (not (gnc:handle-command-line-args))
(gnucash:shutdown 1))
(gnc:shutdown 1))
;;; Now we can load a bunch of files.
;; (gnc:load 'hooks)
(gnc:load "hooks.scm")
(gnc:load "doc.scm")
;;; Load the system and user configs
(if (not gnc:*user-config-loaded?*)
(if (not (gnc:load-system-config))
(gnucash:shutdown 1)))
(gnc:shutdown 1)))
(if (not gnc:*system-config-loaded?*)
(if (not (gnc:load-user-config))
(gnucash:shutdown 1)))
(gnc:shutdown 1)))
; (gnc:hook-run-danglers gnc:*startup-hooks*)
(gnc:hook-run-danglers gnc:*startup-hook*)
(if (or (gnc:config-var-value-get gnc:*arg-show-usage*)
(gnc:config-var-value-get gnc:*arg-show-help*))

View File

@ -4,20 +4,26 @@
#include <guile/gh.h>
#include <FileIO.h>
/* Because swig doesn't declare the prototype anywhere */
void gnucash_swig_init();
static void
guile_entry_point(int argc, char *argv[]) {
char *input;
// gnucash_swig_init();
input = readline("gnucash> ");
while(input) {
SCM result = gh_eval_str(input);
gh_display(result);
gh_newline();
add_history(input);
free(input);
input = readline("gnucash> ");
}
/* input = readline("gnucash> "); */
/* while(input) { */
/* SCM result = gh_eval_str(input); */
/* gh_display(result); */
/* gh_newline(); */
/* add_history(input); */
/* free(input); */
/* input = readline("gnucash> "); */
/* } */
gnucash_swig_init();
gh_repl(argc, argv);
}
int

View File