From e6a025cd57e1fcbafea1a9a2906b648dcec06b77 Mon Sep 17 00:00:00 2001 From: Dave Peticolas Date: Thu, 23 Mar 2000 04:26:59 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2104 57a11ea4-9604-0410-9ed3-97b8803252fd --- config.h.in | 3 + configure | 4451 +++++++++++++------------- configure.in | 58 +- src/gnome/Makefile.in | 6 +- src/gnome/gnc-dialogs.glade | 1148 +++++++ src/gnome/window-register.c | 4 +- src/scm/main.scm | 6 + src/scm/printing/number-to-words.scm | 112 + src/scm/printing/print-check.scm | 59 + src/scm/qif-import/qif-file.scm | 558 ++-- src/scm/qif-import/qif-guess-map.scm | 4 +- src/scm/qif-import/qif-objects.scm | 27 +- src/scm/qif-import/qif-parse.scm | 50 +- src/scm/qif-import/qif-to-gnc.scm | 25 +- src/scm/qif-import/qif-utils.scm | 13 +- 15 files changed, 3976 insertions(+), 2548 deletions(-) create mode 100644 src/gnome/gnc-dialogs.glade create mode 100644 src/scm/printing/number-to-words.scm create mode 100644 src/scm/printing/print-check.scm diff --git a/config.h.in b/config.h.in index 53e065810d..f9add2f783 100644 --- a/config.h.in +++ b/config.h.in @@ -55,6 +55,9 @@ /* Use the new XmHTML widdget instead of the old htmlw widget */ #define HAVE_LIBXMHTML 1 +/* use gnomeprint if it's available */ +#undef HAVE_LIBGNOMEPRINT + /* misc image and compression libs needed by html widget */ #undef HAVE_ZLIB #undef HAVE_PNG diff --git a/configure b/configure index 863cf7f972..fb11d2f880 100755 --- a/configure +++ b/configure @@ -19,6 +19,14 @@ ac_help="$ac_help --enable-debug compile with debugging flags set" ac_help="$ac_help --enable-warnings compile with lots of warnings generated" +ac_help="$ac_help + --with-locale-dir=PATH specify where to look for locale-specific information" +ac_help="$ac_help + --disable-nls do not use Native Language Support" +ac_help="$ac_help + --with-included-gettext use the GNU gettext library included here" +ac_help="$ac_help + --with-catgets use catgets functions if available" ac_help="$ac_help --enable-qt enable building of the Qt version of gnucash" ac_help="$ac_help @@ -57,14 +65,6 @@ ac_help="$ac_help --with-guile-config=executable which guile-config to use to find guile " ac_help="$ac_help --with-guile=PATH specify where to look for guile includes and libs" -ac_help="$ac_help - --with-locale-dir=PATH specify where to look for locale-specific information" -ac_help="$ac_help - --disable-nls do not use Native Language Support" -ac_help="$ac_help - --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --with-catgets use catgets functions if available" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -1352,9 +1352,6 @@ done ### Variables ### Set up all the initial variable values... - - - # USE_QUICKFILL: cat >> confdefs.h <<\EOF #define USE_QUICKFILL 1 @@ -1427,185 +1424,459 @@ EOF fi -### -------------------------------------------------------------------------- -## qt-version of gnucash -# The qt version of gnucash is far from doing anything usefull, so most people -# don't care about it. Those who want to play with it, must specify --enable-qt - -# Check whether --enable-qt or --disable-qt was given. -if test "${enable_qt+set}" = set; then - enableval="$enable_qt" - GNC_QT_ENABLED=yes -fi - -if test x"$GNC_QT_ENABLED" = xyes; then - QT_TARGET="qt.real" - QT_STATIC_TARGET="qt.static.real" +### -------------------------------------------------------------------------- +### i18n +# Check whether --with-locale-dir or --without-locale-dir was given. +if test "${with_locale_dir+set}" = set; then + withval="$with_locale_dir" + LOCALE_DIR="$with_locale_dir" else - QT_TARGET="qt.disable" - QT_STATIC_TARGET="qt.disable" + LOCALE_DIR="$prefix/share/locale" fi +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1442: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1463: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1497: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 -### -------------------------------------------------------------------------- -### Programs - -# Check for perl, force version 5 -# AC_CHECK_PROGS(PERL,perl5 perl) # Sets @PERL@ -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1462: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then +ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for locale.h""... $ac_c" 1>&6 +echo "configure:1523: checking for locale.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$PERL" in - /*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_PERL="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" fi -PERL="$ac_cv_path_PERL" -if test -n "$PERL"; then - echo "$ac_t""$PERL" 1>&6 +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_cv_header_locale_h=yes else echo "$ac_t""no" 1>&6 +ac_cv_header_locale_h=no fi -# Check whether --with-perl or --without-perl was given. -if test "${with_perl+set}" = set; then - withval="$with_perl" - PERL="${with_perl}" +if test "$ac_cv_header_locale_h" = yes; then + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 +echo "configure:1557: checking for LC_MESSAGES" >&5 +if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +return LC_MESSAGES +; return 0; } +EOF +if { (eval echo configure:1569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_val_LC_MESSAGES=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_val_LC_MESSAGES=no fi - - -# Make sure Perl was found -if test x"$PERL" = x; then - { echo "configure: error: Cannot find Perl. Try using the --with-perl flag." 1>&2; exit 1; } +rm -f conftest* fi -# Make sure it's version 5 or later -if "$PERL" -e 'exit 1 if $] < 5.0'; then - : +echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 + if test "$am_cv_val_LC_MESSAGES" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LC_MESSAGES 1 +EOF + + fi + fi + echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 +echo "configure:1590: checking whether NLS is requested" >&5 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval else - { echo "configure: error: Found ${PERL} reports version - `${PERL} -e 'print $'`" 1>&2; exit 1; } + USE_NLS=yes fi + echo "$ac_t""$USE_NLS" 1>&6 + -# Now check for perl headers -# This appears to be what Perl's ExtUtils::MakeMaker module does, so -# I'm reasonably sure it's correct. -# PERLINCL="/usr/lib/perl5/i386-linux/5.00404" -# -PERLINCL=`$PERL -MConfig -e 'print $Config{"archlibexp"}'` -# Check whether --with-perl-includes or --without-perl-includes was given. -if test "${with_perl_includes+set}" = set; then - withval="$with_perl_includes" - PERLINCL="$with_perl_includes" -fi + USE_INCLUDED_LIBINTL=no + if test "$USE_NLS" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_NLS 1 +EOF -if test ! -d ${PERLINCL}/CORE; then - { echo "configure: error: Missing directory ${PERLINCL}/CORE in the perl include directory" 1>&2; exit 1; } + echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 +echo "configure:1610: checking whether included gettext is requested" >&5 + # Check whether --with-included-gettext or --without-included-gettext was given. +if test "${with_included_gettext+set}" = set; then + withval="$with_included_gettext" + nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no fi + echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 -# Check for eperl (rgmerk) -# Permits compilation without eperl, but if it can't find eperl you -# must either use the --with-eperl option or, at a last resort, -# it'll use /usr/bin/eperl. + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + nls_cv_header_intl= + nls_cv_header_libgt= + CATOBJEXT=NONE -# Extract the first word of "eperl", so it can be a program name with args. -set dummy eperl; ac_word=$2 + ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 +echo "configure:1629: checking for libintl.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 +echo "configure:1656: checking for gettext in libc" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { +return (int) gettext ("") +; return 0; } +EOF +if { (eval echo configure:1668: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gettext_libc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gettext_libc=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 + + if test "$gt_cv_func_gettext_libc" != "yes"; then + echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 +echo "configure:1684: checking for bindtextdomain in -lintl" >&5 +ac_lib_var=`echo intl'_'bindtextdomain | 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="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 +echo "configure:1719: checking for gettext in libintl" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 +echo "configure:1724: checking for gettext in -lintl" >&5 +ac_lib_var=`echo intl'_'gettext | 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="-lintl $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + gt_cv_func_gettext_libintl=yes +else + echo "$ac_t""no" 1>&6 +gt_cv_func_gettext_libintl=no +fi + +fi + +echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + fi + + if test "$gt_cv_func_gettext_libc" = "yes" \ + || test "$gt_cv_func_gettext_libintl" = "yes"; then + cat >> confdefs.h <<\EOF +#define HAVE_GETTEXT 1 +EOF + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1541: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_EPERL'+set}'`\" = set"; then +echo "configure:1782: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$EPERL" in + case "$MSGFMT" in /*) - ac_cv_path_EPERL="$EPERL" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_EPERL="$EPERL" # Let the user override the test with a dos path. + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_EPERL="$ac_dir/$ac_word" - break + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_EPERL" && ac_cv_path_EPERL="no" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi -EPERL="$ac_cv_path_EPERL" -if test -n "$EPERL"; then - echo "$ac_t""$EPERL" 1>&6 +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi + if test "$MSGFMT" != "no"; then + for ac_func in dcgettext +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1816: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); -# Check whether --with-eperl or --without-eperl was given. -if test "${with_eperl+set}" = set; then - withval="$with_eperl" - EPERL="${with_eperl}" -fi +int main() { +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif -if test x"$EPERL" = xno; then - echo "configure: warning: Can't find eperl. Try using the --with-eperl flag." 1>&2 - EPERL="/usr/bin/eperl" +; return 0; } +EOF +if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* fi -# for some reason the code needs both the full path and the basename. -# these get dumped into src/guile/pathconfig.h - -EPERL_PATH="$EPERL" -EPERL_NAME=`basename $EPERL` - - - -### ------------------------------------------------------------------- +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done -# Check for 'swig' -# Extract the first word of "swig", so it can be a program name with args. -set dummy swig; ac_word=$2 + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1600: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_SWIG'+set}'`\" = set"; then +echo "configure:1871: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$SWIG" in + case "$GMSGFMT" in /*) - ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_SWIG="$SWIG" # Let the user override the test with a dos path. + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -1613,60 +1884,35 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_SWIG="$ac_dir/$ac_word" + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_SWIG" && ac_cv_path_SWIG="no" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -SWIG="$ac_cv_path_SWIG" -if test -n "$SWIG"; then - echo "$ac_t""$SWIG" 1>&6 +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 else echo "$ac_t""no" 1>&6 fi - # Sets @SWIG@ -# Check whether --with-swig or --without-swig was given. -if test "${with_swig+set}" = set; then - withval="$with_swig" - SWIG="${with_swig}" -fi - - -if test x"$SWIG" = xno; then - { echo "configure: error: Cannot find Swig. Try using the --with-swig flag." 1>&2; exit 1; } -fi - -### ------------------------------------------------------------------- - -# Let the user specify glib paths: -GLIB_CONFIG_BIN="glib-config" -# Check whether --with-glib-config or --without-glib-config was given. -if test "${with_glib_config+set}" = set; then - withval="$with_glib_config" - GLIB_CONFIG_BIN="$with_glib_config" -fi - -# If the user hasn't specified the binary, then try to find it. -if test x"${GLIB_CONFIG_BIN}" = x -then - # Extract the first word of "glib-config", so it can be a program name with args. -set dummy glib-config; ac_word=$2 + # Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1661: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG_BIN'+set}'`\" = set"; then +echo "configure:1907: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGMERGE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GLIB_CONFIG_BIN" in + case "$GMSGMERGE" in /*) - ac_cv_path_GLIB_CONFIG_BIN="$GLIB_CONFIG_BIN" # Let the user override the test with a path. + ac_cv_path_GMSGMERGE="$GMSGMERGE" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_GLIB_CONFIG_BIN="$GLIB_CONFIG_BIN" # Let the user override the test with a dos path. + ac_cv_path_GMSGMERGE="$GMSGMERGE" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -1674,1117 +1920,1239 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GLIB_CONFIG_BIN="$ac_dir/$ac_word" + ac_cv_path_GMSGMERGE="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GLIB_CONFIG_BIN" && ac_cv_path_GLIB_CONFIG_BIN="GLIB_CONFIG_NOT_FOUND" + test -z "$ac_cv_path_GMSGMERGE" && ac_cv_path_GMSGMERGE=":" ;; esac fi -GLIB_CONFIG_BIN="$ac_cv_path_GLIB_CONFIG_BIN" -if test -n "$GLIB_CONFIG_BIN"; then - echo "$ac_t""$GLIB_CONFIG_BIN" 1>&6 +GMSGMERGE="$ac_cv_path_GMSGMERGE" +if test -n "$GMSGMERGE"; then + echo "$ac_t""$GMSGMERGE" 1>&6 else echo "$ac_t""no" 1>&6 fi -fi - - -# Let the user specify gnome paths: -GNOME_CONFIG_BIN="gnome-config" -# Check whether --with-gnome-config or --without-gnome-config was given. -if test "${with_gnome_config+set}" = set; then - withval="$with_gnome_config" - GNOME_CONFIG_BIN="$with_gnome_config" -fi - - -# If the user hasn't specified the binary, then try to find it. -if test x"${GNOME_CONFIG_BIN}" = x -then - # Extract the first word of "gnome-config", so it can be a program name with args. -set dummy gnome-config; ac_word=$2 + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1712: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG_BIN'+set}'`\" = set"; then +echo "configure:1943: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GNOME_CONFIG_BIN" in + case "$XGETTEXT" in /*) - ac_cv_path_GNOME_CONFIG_BIN="$GNOME_CONFIG_BIN" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GNOME_CONFIG_BIN="$GNOME_CONFIG_BIN" # Let the user override the test with a dos path. + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GNOME_CONFIG_BIN="$ac_dir/$ac_word" - break + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GNOME_CONFIG_BIN" && ac_cv_path_GNOME_CONFIG_BIN="GNOME_CONFIG_NOT_FOUND" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi -GNOME_CONFIG_BIN="$ac_cv_path_GNOME_CONFIG_BIN" -if test -n "$GNOME_CONFIG_BIN"; then - echo "$ac_t""$GNOME_CONFIG_BIN" 1>&6 +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 else echo "$ac_t""no" 1>&6 fi + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + CATOBJEXT=.gmo + DATADIRNAME=share +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CATOBJEXT=.mo + DATADIRNAME=lib +fi +rm -f conftest* + INSTOBJEXT=.mo + fi + fi + +else + echo "$ac_t""no" 1>&6 fi -### -------------------------------------------------------------------------- -### Libraries -LIBS="$LIBS -lm" + if test "$CATOBJEXT" = "NONE"; then + echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 +echo "configure:2006: checking whether catgets can be used" >&5 + # Check whether --with-catgets or --without-catgets was given. +if test "${with_catgets+set}" = set; then + withval="$with_catgets" + nls_cv_use_catgets=$withval +else + nls_cv_use_catgets=no +fi -# We're going to set up our own X configure variables. These are only -# used in side configure. At the end, we use them to set X_LIBS. -# This allows us to be careful about libarary ordering, in case that's -# important. + echo "$ac_t""$nls_cv_use_catgets" 1>&6 -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1758: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + if test "$nls_cv_use_catgets" = "yes"; then + echo $ac_n "checking for main in -li""... $ac_c" 1>&6 +echo "configure:2019: checking for main in -li" >&5 +ac_lib_var=`echo i'_'main | 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 - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < conftest.$ac_ext < -Syntax Error + +int main() { +main() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1779: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : +if { (eval echo configure:2034: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + + LIBS="-li $LIBS" + +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for catgets""... $ac_c" 1>&6 +echo "configure:2062: checking for catgets" >&5 +if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < -Syntax Error +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char catgets(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_catgets) || defined (__stub___catgets) +choke me +#else +catgets(); +#endif + +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1813: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : +if { (eval echo configure:2090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_catgets=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* + eval "ac_cv_func_catgets=no" fi rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" fi -echo "$ac_t""$CPP" 1>&6 -# If we find X, set shell vars x_includes and x_libraries to the -# paths, otherwise set no_x=yes. -# 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:1842: checking for X" >&5 +if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_CATGETS 1 +EOF -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" - : + INTLOBJS="\$(CATOBJS)" + # Extract the first word of "gencat", so it can be a program name with args. +set dummy gencat; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2112: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GENCAT" in + /*) + ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GENCAT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" + ;; +esac fi - -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. -if test "x$with_x" = xno; then - # The user explicitly disabled X. - have_x=disabled +GENCAT="$ac_cv_path_GENCAT" +if test -n "$GENCAT"; then + echo "$ac_t""$GENCAT" 1>&6 else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else -if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then + echo "$ac_t""no" 1>&6 +fi + if test "$GENCAT" != "no"; then + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2148: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - # One or both of the vars are not set, and there is no cached value. -ac_x_includes=NO ac_x_libraries=NO -rm -fr conftestdir -if mkdir conftestdir; then - cd conftestdir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat > Imakefile <<'EOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -EOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then - # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` - # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break - fi - done - # Screen out bogus values from the imake configuration. They are - # bogus both because they are the default anyway, and because - # using them would break gcc on systems where it needs fixed includes. - case "$ac_im_incroot" in - /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; - esac - case "$ac_im_usrlibdir" in - /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; - esac - fi - cd .. - rm -fr conftestdir + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 fi -if test "$ac_x_includes" = NO; then - # Guess where to find include files, by looking for this one X11 .h file. - test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + if test "$GMSGFMT" = "no"; then + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2185: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi - # First, try using that file with no special directory specified. -cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1909: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - # We can compile using X headers with no special include directory. -ac_x_includes= + fi + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2220: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - # Look for the header file in a standard set of common directories. -# Check X11 before X11Rn because it is often a symlink to the current release. - for ac_dir in \ - /usr/X11/include \ - /usr/X11R6/include \ - /usr/X11R5/include \ - /usr/X11R4/include \ - \ - /usr/include/X11 \ - /usr/include/X11R6 \ - /usr/include/X11R5 \ - /usr/include/X11R4 \ - \ - /usr/local/X11/include \ - /usr/local/X11R6/include \ - /usr/local/X11R5/include \ - /usr/local/X11R4/include \ - \ - /usr/local/include/X11 \ - /usr/local/include/X11R6 \ - /usr/local/include/X11R5 \ - /usr/local/include/X11R4 \ - \ - /usr/X386/include \ - /usr/x386/include \ - /usr/XFree86/include/X11 \ - \ - /usr/include \ - /usr/local/include \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ - /usr/openwin/include \ - /usr/openwin/share/include \ - ; \ - do - if test -r "$ac_dir/$x_direct_test_include"; then - ac_x_includes=$ac_dir - break + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi fi done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 fi -rm -f conftest* -fi # $ac_x_includes = NO -if test "$ac_x_libraries" = NO; then - # Check for the libraries. + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.cat + INSTOBJEXT=.cat + DATADIRNAME=lib + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi +else + echo "$ac_t""no" 1>&6 +fi - test -z "$x_direct_test_library" && x_direct_test_library=Xt - test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + fi + fi - # See if we find them without any special options. - # Don't add to $LIBS permanently. - ac_save_LIBS="$LIBS" - LIBS="-l$x_direct_test_library $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - LIBS="$ac_save_LIBS" -# We can link X programs with no special library path. -ac_x_libraries= + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2278: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - LIBS="$ac_save_LIBS" -# First see if replacing the include by lib works. -# Check X11 before X11Rn because it is often a symlink to the current release. -for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ - /usr/X11/lib \ - /usr/X11R6/lib \ - /usr/X11R5/lib \ - /usr/X11R4/lib \ - \ - /usr/lib/X11 \ - /usr/lib/X11R6 \ - /usr/lib/X11R5 \ - /usr/lib/X11R4 \ - \ - /usr/local/X11/lib \ - /usr/local/X11R6/lib \ - /usr/local/X11R5/lib \ - /usr/local/X11R4/lib \ - \ - /usr/local/lib/X11 \ - /usr/local/lib/X11R6 \ - /usr/local/lib/X11R5 \ - /usr/local/lib/X11R4 \ - \ - /usr/X386/lib \ - /usr/x386/lib \ - /usr/XFree86/lib/X11 \ - \ - /usr/lib \ - /usr/local/lib \ - /usr/unsupported/lib \ - /usr/athena/lib \ - /usr/local/x11r5/lib \ - /usr/lpp/Xamples/lib \ - /lib/usr/lib/X11 \ - \ - /usr/openwin/lib \ - /usr/openwin/share/lib \ - ; \ -do - for ac_extension in a so sl; do - if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then - ac_x_libraries=$ac_dir - break 2 + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi fi done -done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test -n "$MSGFMT"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 fi -rm -f conftest* -fi # $ac_x_libraries = NO -if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2312: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2348: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test -n "$XGETTEXT"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INSTOBJEXT=.mo + DATADIRNAME=share + INTLDEPS='$(top_builddir)/intl/libintl.a' + INTLLIBS=$INTLDEPS + LIBS=`echo $LIBS | sed -e 's/-lintl//'` + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 + XGETTEXT=":" + fi + fi + + # We need to process the po/ directory. + POSUB=po + else + DATADIRNAME=share + nls_cv_header_intl=intl/libintl.h + nls_cv_header_libgt=intl/libgettext.h + fi + + + + + # If this is used in GNU gettext we have to set USE_NLS to `yes' + # because some of the sources are only built for this goal. + if test "$PACKAGE" = gettext; then + USE_NLS=yes + USE_INCLUDED_LIBINTL=yes + fi + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + POXFILES="$POXFILES $lang.pox" + done + + + + + + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 +echo "configure:2443: checking for catalogs to be installed" >&5 + NEW_LINGUAS= + for lang in ${LINGUAS=$ALL_LINGUAS}; do + case "$ALL_LINGUAS" in + *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; + esac + done + LINGUAS=$NEW_LINGUAS + echo "$ac_t""$LINGUAS" 1>&6 + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + if test "$ac_cv_header_locale_h" = yes; then + INCLUDE_LOCALE_H="#include " + else + INCLUDE_LOCALE_H="\ +/* The system does not provide the header . Take care yourself. */" + fi + + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + test -d po || mkdir po + if test "x$srcdir" != "x."; then + if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then + posrcprefix="$srcdir/" + else + posrcprefix="../$srcdir/" + fi + else + posrcprefix="../" + fi + rm -f po/POTFILES + sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ + < $srcdir/po/POTFILES.in > po/POTFILES + + + +### -------------------------------------------------------------------------- +## qt-version of gnucash +# The qt version of gnucash is far from doing anything usefull, so most people +# don't care about it. Those who want to play with it, must specify --enable-qt + +# Check whether --enable-qt or --disable-qt was given. +if test "${enable_qt+set}" = set; then + enableval="$enable_qt" + GNC_QT_ENABLED=yes +fi + + +if test x"$GNC_QT_ENABLED" = xyes; then + QT_TARGET="qt.real" + QT_STATIC_TARGET="qt.static.real" +else + QT_TARGET="qt.disable" + QT_STATIC_TARGET="qt.disable" +fi + + + + +### -------------------------------------------------------------------------- +### Programs + +# Check for perl, force version 5 +# AC_CHECK_PROGS(PERL,perl5 perl) # Sets @PERL@ +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2523: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + ;; +esac fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 fi - fi - eval "$ac_cv_have_x" -fi # $with_x != no -if test "$have_x" != yes; then - echo "$ac_t""$have_x" 1>&6 - no_x=yes -else - # If each of the values was on the command line, it overrides each guess. - test "x$x_includes" = xNONE && x_includes=$ac_x_includes - test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries - # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 +# Check whether --with-perl or --without-perl was given. +if test "${with_perl+set}" = set; then + withval="$with_perl" + PERL="${with_perl}" fi -if test "$no_x" = yes; then - # Not all programs may use this symbol, but it does not hurt to define it. - cat >> confdefs.h <<\EOF -#define X_DISPLAY_MISSING 1 -EOF - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= -else - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi +# Make sure Perl was found +if test x"$PERL" = x; then + { echo "configure: error: Cannot find Perl. Try using the --with-perl flag." 1>&2; exit 1; } +fi - # It would also be nice to do this for all -L options, not just this one. - if test -n "$x_libraries"; then - X_LIBS="$X_LIBS -L$x_libraries" - # For Solaris; some versions of Sun CC require a space after -R and - # others require no space. Words are not sufficient . . . . - 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:2091: checking whether -R must be followed by a space" >&5 - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" - cat > conftest.$ac_ext <&2; exit 1; } +fi -int main() { -; return 0; } -EOF -if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_R_nospace=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_nospace=no +# Now check for perl headers +# This appears to be what Perl's ExtUtils::MakeMaker module does, so +# I'm reasonably sure it's correct. +# PERLINCL="/usr/lib/perl5/i386-linux/5.00404" +# +PERLINCL=`$PERL -MConfig -e 'print $Config{"archlibexp"}'` +# Check whether --with-perl-includes or --without-perl-includes was given. +if test "${with_perl_includes+set}" = set; then + withval="$with_perl_includes" + PERLINCL="$with_perl_includes" fi -rm -f conftest* - if test $ac_R_nospace = yes; then - echo "$ac_t""no" 1>&6 - X_LIBS="$X_LIBS -R$x_libraries" - else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_R_space=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_R_space=no +if test ! -d ${PERLINCL}/CORE; then + { echo "configure: error: Missing directory ${PERLINCL}/CORE in the perl include directory" 1>&2; exit 1; } fi -rm -f conftest* - if test $ac_R_space = yes; then - echo "$ac_t""yes" 1>&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$ac_t""neither works" 1>&6 - fi - fi - LIBS="$ac_xsave_LIBS" - esac - fi - # Check for system-dependent libraries X programs must link with. - # Do this before checking for the system-independent R6 libraries - # (-lICE), since we may need -lsocket or whatever for X linking. - if test "$ISC" = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" - else - # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X - # 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:2156: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" +# Extract the first word of "eperl", so it can be a program name with args. +set dummy eperl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2602: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_EPERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - + case "$EPERL" in + /*) + ac_cv_path_EPERL="$EPERL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_EPERL="$EPERL" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_EPERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_EPERL" && ac_cv_path_EPERL="no" + ;; +esac fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +EPERL="$ac_cv_path_EPERL" +if test -n "$EPERL"; then + echo "$ac_t""$EPERL" 1>&6 else echo "$ac_t""no" 1>&6 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:2197: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-ldnet_stub $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + +if test x"$EPERL" = xno; then + echo "configure: warning: Can't find eperl. Try using the --with-eperl flag." 1>&2 + EPERL="/usr/bin/eperl" fi -rm -f conftest* -LIBS="$ac_save_LIBS" +# for some reason the code needs both the full path and the basename. +# these get dumped into src/guile/pathconfig.h + +EPERL_PATH="$EPERL" +EPERL_NAME=`basename $EPERL` + + + +### ------------------------------------------------------------------- + +# Check for 'swig' +# Extract the first word of "swig", so it can be a program name with args. +set dummy swig; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2661: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_SWIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$SWIG" in + /*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_SWIG="$SWIG" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_SWIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_SWIG" && ac_cv_path_SWIG="no" + ;; +esac fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +SWIG="$ac_cv_path_SWIG" +if test -n "$SWIG"; then + echo "$ac_t""$SWIG" 1>&6 else echo "$ac_t""no" 1>&6 fi + # Sets @SWIG@ +# Check whether --with-swig or --without-swig was given. +if test "${with_swig+set}" = set; then + withval="$with_swig" + SWIG="${with_swig}" +fi - fi - - # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, - # to get the SysV transport functions. - # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) - # needs -lnsl. - # 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:2245: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); -int main() { +if test x"$SWIG" = xno; then + { echo "configure: error: Cannot find Swig. Try using the --with-swig flag." 1>&2; exit 1; } +fi -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); -#endif +### ------------------------------------------------------------------- -; return 0; } -EOF -if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" -fi -rm -f conftest* +# Let the user specify glib paths: +GLIB_CONFIG_BIN="glib-config" +# Check whether --with-glib-config or --without-glib-config was given. +if test "${with_glib_config+set}" = set; then + withval="$with_glib_config" + GLIB_CONFIG_BIN="$with_glib_config" fi -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi - if test $ac_cv_func_gethostbyname = no; then - echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2294: 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 +# If the user hasn't specified the binary, then try to find it. +if test x"${GLIB_CONFIG_BIN}" = x +then + # Extract the first word of "glib-config", so it can be a program name with args. +set dummy glib-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2722: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - + case "$GLIB_CONFIG_BIN" in + /*) + ac_cv_path_GLIB_CONFIG_BIN="$GLIB_CONFIG_BIN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GLIB_CONFIG_BIN="$GLIB_CONFIG_BIN" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GLIB_CONFIG_BIN="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GLIB_CONFIG_BIN" && ac_cv_path_GLIB_CONFIG_BIN="GLIB_CONFIG_NOT_FOUND" + ;; +esac fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +GLIB_CONFIG_BIN="$ac_cv_path_GLIB_CONFIG_BIN" +if test -n "$GLIB_CONFIG_BIN"; then + echo "$ac_t""$GLIB_CONFIG_BIN" 1>&6 else echo "$ac_t""no" 1>&6 fi - fi +fi - # lieder@skyler.mavd.honeywell.com says without -lsocket, - # socket/setsockopt and other routines are undefined under SCO ODT - # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says simon@lia.di.epfl.ch: it contains - # gethostby* variants that don't use the nameserver (or something). - # -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:2343: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect(); -int main() { +# Let the user specify gnome paths: +GNOME_CONFIG_BIN="gnome-config" +# Check whether --with-gnome-config or --without-gnome-config was given. +if test "${with_gnome_config+set}" = set; then + withval="$with_gnome_config" + GNOME_CONFIG_BIN="$with_gnome_config" +fi -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -connect(); -#endif -; return 0; } -EOF -if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_connect=yes" +# If the user hasn't specified the binary, then try to find it. +if test x"${GNOME_CONFIG_BIN}" = x +then + # Extract the first word of "gnome-config", so it can be a program name with args. +set dummy gnome-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2773: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG_BIN'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_connect=no" -fi -rm -f conftest* + case "$GNOME_CONFIG_BIN" in + /*) + ac_cv_path_GNOME_CONFIG_BIN="$GNOME_CONFIG_BIN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GNOME_CONFIG_BIN="$GNOME_CONFIG_BIN" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_GNOME_CONFIG_BIN="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GNOME_CONFIG_BIN" && ac_cv_path_GNOME_CONFIG_BIN="GNOME_CONFIG_NOT_FOUND" + ;; +esac fi - -if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : +GNOME_CONFIG_BIN="$ac_cv_path_GNOME_CONFIG_BIN" +if test -n "$GNOME_CONFIG_BIN"; then + echo "$ac_t""$GNOME_CONFIG_BIN" 1>&6 else echo "$ac_t""no" 1>&6 fi - if test $ac_cv_func_connect = no; then - echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:2392: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" -else - echo "$ac_t""no" 1>&6 -fi - fi +### -------------------------------------------------------------------------- +### Libraries +LIBS="$LIBS -lm" + +# We're going to set up our own X configure variables. These are only +# used in side configure. At the end, we use them to set X_LIBS. +# This allows us to be careful about libarary ordering, in case that's +# important. + +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# 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:2823: checking for X" >&5 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + : +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:2435: checking for remove" >&5 -if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else +if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove(); - -int main() { + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=NO ac_x_libraries=NO +rm -fr conftestdir +if mkdir conftestdir; then + cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case "$ac_im_incroot" in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir +fi -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) -choke me -#else -remove(); -#endif +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h -; return 0; } + # First, try using that file with no special directory specified. +cat > conftest.$ac_ext < EOF -if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2890: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then rm -rf conftest* - eval "ac_cv_func_remove=yes" + # We can compile using X headers with no special include directory. +ac_x_includes= else + echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_remove=no" + # Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done fi rm -f conftest* -fi +fi # $ac_x_includes = NO -if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -fi +if test "$ac_x_libraries" = NO; then + # Check for the libraries. - if test $ac_cv_func_remove = no; then - echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:2484: 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 -else + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + + # See if we find them without any special options. + # Don't add to $LIBS permanently. ac_save_LIBS="$LIBS" -LIBS="-lposix $LIBS" + LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -else - echo "$ac_t""no" 1>&6 -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:2527: 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 < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) -choke me -#else -shmat(); -#endif + LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11 \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11/lib \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11 \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X386/lib \ + /usr/x386/lib \ + /usr/XFree86/lib/X11 \ + \ + /usr/lib \ + /usr/local/lib \ + /usr/unsupported/lib \ + /usr/athena/lib \ + /usr/local/x11r5/lib \ + /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ + \ + /usr/openwin/lib \ + /usr/openwin/share/lib \ + ; \ +do + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest* +fi # $ac_x_libraries = NO -; return 0; } -EOF -if { (eval echo configure:2555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_shmat=yes" +if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_shmat=no" + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi -rm -f conftest* fi + fi + eval "$ac_cv_have_x" +fi # $with_x != no -if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes else - echo "$ac_t""no" 1>&6 + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 fi - if test $ac_cv_func_shmat = no; then - echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:2576: 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 +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + cat >> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 +EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else - ac_save_LIBS="$LIBS" -LIBS="-lipc $LIBS" -cat > conftest.$ac_ext </dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +echo "configure:3072: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + ac_R_nospace=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + ac_R_nospace=no fi rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" -else - echo "$ac_t""no" 1>&6 -fi - - fi - fi - - # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS="$LDFLAGS" - test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" - # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to - # check for ICE first), but we must link in the order -lSM -lICE or - # we get undefined symbols. So assume we have SM if we have ICE. - # These have to be linked with before -lX11, unlike the other - # 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:2628: 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 -else - ac_save_LIBS="$LIBS" -LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat > conftest.$ac_ext <&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + ac_R_space=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + ac_R_space=no fi rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" -else - echo "$ac_t""no" 1>&6 -fi - - LDFLAGS="$ac_save_LDFLAGS" - -fi - -if test x"$no_x" = xyes; then - { echo "configure: error: Can not find X11 development headers or libraries." 1>&2; exit 1; } -fi - - -# This is how to use the variables set by AC_PATH_XTRA: -# cc @X_CFLAGS@ -c -o foo.o foo.c -# cc @X_LIBS@ (-lfoo...) @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ -# (But see also the test for Motif libraries, below.) -# (Perhaps X_LIBS should have been called X_LDFLAGS.) - -# XXX - Not all programs need all of these, surely. -X_LIBS="$X_LIBS -lXext -lXmu -lXt -lX11" -# XXX - Ask Motif what it wants -MOTIF_LIBS="-lXm" - -### -------------------------------------------------------------------------- -### Motif libs -- these are needed for the motif builds only -# Let the user specify motif paths: -# Check whether --with-motif or --without-motif was given. -if test "${with_motif+set}" = set; then - withval="$with_motif" - X_LIBS="${X_LIBS} -L$with_motif/lib" X_CFLAGS="$X_CFLAGS -I$with_motif/include" -fi - - -# Check whether --with-motif-includes or --without-motif-includes was given. -if test "${with_motif_includes+set}" = set; then - withval="$with_motif_includes" - X_CFLAGS="${X_CFLAGS} -I$with_motif_includes" -fi - - -# Check whether --with-motif-libraries or --without-motif-libraries was given. -if test "${with_motif_libraries+set}" = set; then - withval="$with_motif_libraries" - X_LIBS="${X_LIBS} -L$with_motif_libraries" -fi - - -### -------------------------------------------------------------------------- -### Gnome libs -- these are needed for the gnome builds only -# Let the user specify gnome paths: -# -I...libgnomesupport is to fix bug in gnome-1.3 release -# -# I believe all the gnome configuration can and should be superceded by -# --with-gnome-config. - -# Check whether --with-gnome or --without-gnome was given. -if test "${with_gnome+set}" = set; then - withval="$with_gnome" - X_LIBS="${X_LIBS} -L$with_gnome/lib" X_CFLAGS="$X_CFLAGS -I$with_gnome/include -I$with_gnome/lib/gnome-libs/include" -fi - - -# Check whether --with-gnome-includes or --without-gnome-includes was given. -if test "${with_gnome_includes+set}" = set; then - withval="$with_gnome_includes" - X_CFLAGS="${X_CFLAGS} -I$with_gnome_includes -I$with_gnome_includes/libgnomesupport" -fi - - -# Check whether --with-gnome-libraries or --without-gnome-libraries was given. -if test "${with_gnome_libraries+set}" = set; then - withval="$with_gnome_libraries" - X_LIBS="${X_LIBS} -L$with_gnome_libraries" -fi - - - -# Let the user specify imlib paths: -# Check whether --with-imlib or --without-imlib was given. -if test "${with_imlib+set}" = set; then - withval="$with_imlib" - X_LIBS="${X_LIBS} -L$with_imlib/lib" X_CFLAGS="$X_CFLAGS -I$with_imlib/include" -fi - - -### -------------------------------------------------------------------------- -# The XmHTML widget is used by motif and gnome alike. - -# 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="-I$with_xmhtml_includes ${X_CFLAGS}" -fi - - -# Check whether --with-xmhtml-libraries or --without-xmhtml-libraries was given. -if test "${with_xmhtml_libraries+set}" = set; then - withval="$with_xmhtml_libraries" - X_LIBS="-L$with_xmhtml_libraries ${X_LIBS}" -fi + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&6 + fi + fi + LIBS="$ac_xsave_LIBS" + esac + fi + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. -# 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:2769: checking for deflateEnd in -lz" >&5 -ac_lib_var=`echo z'_'deflateEnd | sed 'y%./+-%__p_%'` + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # 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:3137: 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 else ac_save_LIBS="$LIBS" -LIBS="-lz $LIBS" +LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2799,35 +3167,33 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_ZLIB 1 -EOF - LIBS="-lz $LIBS" + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for jpeg_read_scanlines in -ljpeg""... $ac_c" 1>&6 -echo "configure:2812: checking for jpeg_read_scanlines in -ljpeg" >&5 -ac_lib_var=`echo jpeg'_'jpeg_read_scanlines | sed 'y%./+-%__p_%'` + 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:3178: 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 else ac_save_LIBS="$LIBS" -LIBS="-ljpeg $LIBS" +LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2842,84 +3208,89 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_JPEG 1 -EOF - LIBS="-ljpeg $LIBS" + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" else echo "$ac_t""no" 1>&6 fi -echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 -echo "configure:2855: 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 + fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # 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:3226: checking for gethostbyname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lpng $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char png_read_image(); +char gethostbyname(); int main() { -png_read_image() + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif + ; return 0; } EOF -if { (eval echo configure:2874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_gethostbyname=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_gethostbyname=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_PNG 1 -EOF - LIBS="-lpng $LIBS" + : else echo "$ac_t""no" 1>&6 fi - -# This should be done in the OTHER_LIBRARIES argument to AC_CHECK_LIB -# if it's actually needed and Makefile.in's should be using -# X_PRE_LIBS, X_LIBS, and X_EXTRA_LIBS, rather than relying on LIBS. -# 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:2904: checking for XpmReadFileToXpmImage in -lXpm" >&5 -ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'` + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:3275: 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 else ac_save_LIBS="$LIBS" -LIBS="-lXpm $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" +LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2934,192 +3305,182 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_XPM 1 -EOF - X_LIBS="-lXpm $X_LIBS" + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" else echo "$ac_t""no" 1>&6 -cat >> confdefs.h <<\EOF -#define HAVE_XPM 0 -EOF - 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:2954: 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 + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -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:3324: checking for connect" >&5 +if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lXmHTML $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS $X_LIBS $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char XmHTMLTextScrollToLine(); +char connect(); int main() { -XmHTMLTextScrollToLine() + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif + ; return 0; } EOF -if { (eval echo configure:2973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_connect=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_connect=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then echo "$ac_t""yes" 1>&6 - MOTIF_LIBS="-lXmHTML $MOTIF_LIBS" + : else echo "$ac_t""no" 1>&6 fi - - - - - -### ------------------------------------------------------------------------- -## gtk-xmhtml -# if gtk-xmhtml header or library not found, gnome builds are disabled -# make gnome will run make gnome.disabled which echoes a warning message - -## XXX - need to do this because gtk-xmhtml requires glibconfig.h -## and I don't want CPPFLAGS permanently altered. -## If there's a better way to tackle this please let me know! - -OLDCPPFLAGS="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS `$GNOME_CONFIG_BIN --cflags gnome`" - - -# gnome targets if all goes well -# XXX - should we shift these to the rest of the gnome configuration -# section? - -GNOME_TARGET="gnome.real" -GNOME_STATIC_TARGET="gnome.static.real" -#AC_CHECK_HEADER might work, but I'm not sure it uses CPPFLAGS -# this guarantees it - it works. Promise!! -echo $ac_n "checking gtk-xmhtml/gtk-xmhtml.h""... $ac_c" 1>&6 -echo "configure:3020: checking gtk-xmhtml/gtk-xmhtml.h" >&5 + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:3373: 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 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { +connect() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - echo "$ac_t""yes" 1>&6 + eval "ac_cv_lib_$ac_lib_var=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - echo "configure: warning: Cannot find gtk-xmhtml.h -- gnome build disabled (not required for motif)" 1>&2 - GNOME_TARGET="gnome.disabled" - GNOME_STATIC_TARGET="gnome.disabled" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" -#undo damage to CPPFLAGS -CPPFLAGS="$OLDCPPFLAGS" +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +else + echo "$ac_t""no" 1>&6 +fi -OLDLDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS `$GNOME_CONFIG_BIN --libs gtkxmhtml`" - -#check for gtkxmhtml, export library link to variable GTK_XMHTML -echo $ac_n "checking for gtk_xmhtml_new in -lgtkxmhtml""... $ac_c" 1>&6 -echo "configure:3051: checking for gtk_xmhtml_new in -lgtkxmhtml" >&5 -ac_lib_var=`echo gtkxmhtml'_'gtk_xmhtml_new | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + 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:3416: checking for remove" >&5 +if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lgtkxmhtml $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char gtk_xmhtml_new(); +char remove(); int main() { -gtk_xmhtml_new() + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +remove(); +#endif + ; return 0; } EOF -if { (eval echo configure:3070: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3444: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + eval "ac_cv_func_remove=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + eval "ac_cv_func_remove=no" fi rm -f conftest* -LIBS="$ac_save_LIBS" - fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + +if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then echo "$ac_t""yes" 1>&6 - GTK_XMHTML="gtkxmhtml" + : else echo "$ac_t""no" 1>&6 -echo "configure: warning: Cannotfind libgtkxmhtml -- gnome build disabled (not required for motif)" 1>&2 - GNOME_TARGET="gnome.disabled" - GNOME_STATIC_TARGET="gnome.disabled" fi - -LDFLAGS="$OLDLDFLAGS" - -# XXX - should we export these here or later in the configure script? - - - - -### -------------------------------------------------------------------------- -# If readline exists, just assume that guile needs it. It probably does. -echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:3104: checking for readline in -lreadline" >&5 -ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` + if test $ac_cv_func_remove = no; then + echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:3465: 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 else ac_save_LIBS="$LIBS" -LIBS="-lreadline $LIBS" +LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3134,544 +3495,412 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 fi - - -### -------------------------------------------------------------------------- -### Guile (libraries and executable) - -# Don't disable this. It's the only reliable way to detect guile's -# settings on current guile installs. If it doesn't work for you, then -# don't specify --with-guile-config. (RLB) - -# In the long run, --with-guile should go away in favor of -# --with-guile-config. It might make sense to do this now. If you have -# guile 1.3 installed, but don't have guile-config, your install is -# most likely broken anyway, and should be fixed. (RLB) - -# Let the user override the guile-config executable. -# Check whether --with-guile-config or --without-guile-config was given. -if test "${with_guile_config+set}" = set; then - withval="$with_guile_config" - echo $ac_n "checking for guile-config""... $ac_c" 1>&6 -echo "configure:3169: checking for guile-config" >&5 - echo "$ac_t""${with_guile_config}" 1>&6 - GUILE_CONFIG="$with_guile_config" - LIBS="`${GUILE_CONFIG} link` ${LIBS}" - CFLAGS="$CFLAGS `${GUILE_CONFIG} compile`" -fi - - -if test x"$GUILE_CONFIG" = x; then - # Try to find a default guile-config - # Extract the first word of "guile-config", so it can be a program name with args. -set dummy guile-config; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3182: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GUILE_CONFIG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GUILE_CONFIG" in - /*) - ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GUILE_CONFIG="$ac_dir/$ac_word" - break fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -GUILE_CONFIG="$ac_cv_path_GUILE_CONFIG" -if test -n "$GUILE_CONFIG"; then - echo "$ac_t""$GUILE_CONFIG" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -fi - -# Still allow the old method (for now). -# Check whether --with-guile or --without-guile was given. -if test "${with_guile+set}" = set; then - withval="$with_guile" - LIBS="-L$with_guile/lib ${LIBS}" CFLAGS="$CFLAGS -I$with_guile/include" -fi - - -# You can't have both... -if test x"$GUILE_CONFIG" != x && test x"$with_guile" != x ; then - { echo "configure: error: ${GUILE_CONFIG} ================ ${with_guile}" 1>&2; exit 1; } - { echo "configure: error: You cannot specify both --with-guile and --with-guile-config" 1>&2; exit 1; } -fi - -if test x"$GUILE_CONFIG" = x; then - # If we didn't get GUILE_CONFIG, then do things the old, dumb way. - - # Have to use AC_TRY_LINK here because AC_CHECK_LIB caches the - # results, so one failure makes all further attempts fail. - GNC_LIBS_SAFE=${LIBS} - echo $ac_n "checking for guile""... $ac_c" 1>&6 -echo "configure:3238: checking for guile" >&5 -if eval "test \"`echo '$''{'ac_cv_lib_guile'+set}'`\" = set"; then + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo $ac_n "checking for shmat""... $ac_c" 1>&6 +echo "configure:3508: checking for shmat" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - for GNC_TEST_LIBS in "-lguile" "-lguile -ldl" "-lguile -lqthreads" \ - "-lguile -ltermcap" "-lguile -lqthreads -ltermcap" \ - "-lguile -lreadline -lncurses"; do - if test x"${GUILELIBS}" != x; then - ac_cv_lib_guile=${GUILELIBS} - break - else - LIBS="${GNC_TEST_LIBS} ${GNC_LIBS_SAFE}" - cat > conftest.$ac_ext < conftest.$ac_ext < +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat(); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + int main() { -gh_eval_file; + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +shmat(); +#endif + ; return 0; } EOF -if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - GUILELIBS="${GNC_TEST_LIBS}" + eval "ac_cv_func_shmat=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shmat=no" fi rm -f conftest* - fi - done fi -echo "$ac_t""$ac_cv_lib_guile" 1>&6 - - GUILELIBS=${ac_cv_lib_guile} +if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : else - # We did find a suitable guile-config. Use that. - # and use any guile binary in that same directory. - GUILE_INC=`${GUILE_CONFIG} compile` - GUILELIBS=`${GUILE_CONFIG} link` + echo "$ac_t""no" 1>&6 fi -# Find the appropriate guile binary. -if test x"$GUILE_CONFIG" != x; then - # Extract the first word of "guile", so it can be a program name with args. -set dummy guile; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3285: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then + if test $ac_cv_func_shmat = no; then + echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +echo "configure:3557: 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 else - case "$GUILE_BIN" in - /*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="`dirname ${GUILE_CONFIG}`" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -GUILE_BIN="$ac_cv_path_GUILE_BIN" -if test -n "$GUILE_BIN"; then - echo "$ac_t""$GUILE_BIN" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi + ac_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi +rm -f conftest* +LIBS="$ac_save_LIBS" -# If that didn't work, try the --with-guile directory, if any. -if test x"$GUILE_BIN" = x && test x"$with_guile" != x; then - # Extract the first word of "guile", so it can be a program name with args. -set dummy guile; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3324: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GUILE_BIN" in - /*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="`${with_guile}/bin`" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac fi -GUILE_BIN="$ac_cv_path_GUILE_BIN" -if test -n "$GUILE_BIN"; then - echo "$ac_t""$GUILE_BIN" 1>&6 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" else echo "$ac_t""no" 1>&6 fi -fi + fi + fi -# Final stab at locating a guile binary. -if test x"${GUILE_BIN}" = x; then - # Extract the first word of "guile", so it can be a program name with args. -set dummy guile; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3363: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # 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:3609: 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 else - case "$GUILE_BIN" in - /*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - ;; -esac -fi -GUILE_BIN="$ac_cv_path_GUILE_BIN" -if test -n "$GUILE_BIN"; then - echo "$ac_t""$GUILE_BIN" 1>&6 + ac_save_LIBS="$LIBS" +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" else - echo "$ac_t""no" 1>&6 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" fi +rm -f conftest* +LIBS="$ac_save_LIBS" fi - -if test x"${GUILELIBS}" = x || test x"${GUILE_BIN}" = x; then - { echo "configure: error: Cannot configure guile bits. Do you have guile 1.3 installed?" 1>&2; exit 1; } +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +else + echo "$ac_t""no" 1>&6 fi -# Get just the directory for the guile binary. -GUILE_BIN=`dirname ${GUILE_BIN}` - - - - - + LDFLAGS="$ac_save_LDFLAGS" -### -------------------------------------------------------------------------- -### Plotutils +fi -#AC_CHECK_LIB(plot, pl_openpl, -# AC_DEFINE(HAVE_PLOTUTILS,1) -# HAVE_PLOTUTILS=1 -# AC_DEFINE(PLOTUTILS_LIBS,"-lXaw -lXt -lplot"), -# , -# $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS -lXaw $X_LIBS) +if test x"$no_x" = xyes; then + { echo "configure: error: Can not find X11 development headers or libraries." 1>&2; exit 1; } +fi -# We need this in at least one of the Makefile.in's -#AC_SUBST(HAVE_PLOTUTILS) -#AC_SUBST(PLOTUTILS_LIBS) +# This is how to use the variables set by AC_PATH_XTRA: +# cc @X_CFLAGS@ -c -o foo.o foo.c +# cc @X_LIBS@ (-lfoo...) @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@ +# (But see also the test for Motif libraries, below.) +# (Perhaps X_LIBS should have been called X_LDFLAGS.) +# XXX - Not all programs need all of these, surely. +X_LIBS="$X_LIBS -lXext -lXmu -lXt -lX11" +# XXX - Ask Motif what it wants +MOTIF_LIBS="-lXm" ### -------------------------------------------------------------------------- -############################################################# -### Set up the install style and all the default paths... ### - -# some confusion due to FSSTND stuff -- -# the readme's and miscellaneous docs are in /usr/doc (or equivalent) -# the online help system is in /usr/share/gnucash/Doc and various subdirs -# the parsed-html report supsystem is in /usr/share/gnucash/Reports - -if test ${OPT_STYLE_INSTALL} = 1 -then - GNC_DOCDIR='${prefix}/doc' - GNC_BINDIR='${prefix}/bin' - GNC_LIBDIR='${prefix}/lib' - GNC_CONFIGDIR=${sysconfdir} - GNC_SHAREDIR=${datadir} -else - GNC_DOCDIR='${prefix}/doc/gnucash' - GNC_BINDIR='${prefix}/bin' - GNC_LIBDIR='${prefix}/lib/gnucash' - GNC_CONFIGDIR=${sysconfdir}/gnucash - GNC_SHAREDIR=${datadir}/gnucash +### Motif libs -- these are needed for the motif builds only +# Let the user specify motif paths: +# Check whether --with-motif or --without-motif was given. +if test "${with_motif+set}" = set; then + withval="$with_motif" + X_LIBS="${X_LIBS} -L$with_motif/lib" X_CFLAGS="$X_CFLAGS -I$with_motif/include" fi +# Check whether --with-motif-includes or --without-motif-includes was given. +if test "${with_motif_includes+set}" = set; then + withval="$with_motif_includes" + X_CFLAGS="${X_CFLAGS} -I$with_motif_includes" +fi +# Check whether --with-motif-libraries or --without-motif-libraries was given. +if test "${with_motif_libraries+set}" = set; then + withval="$with_motif_libraries" + X_LIBS="${X_LIBS} -L$with_motif_libraries" +fi +### -------------------------------------------------------------------------- +### Gnome libs -- these are needed for the gnome builds only +# Let the user specify gnome paths: +# -I...libgnomesupport is to fix bug in gnome-1.3 release +# +# I believe all the gnome configuration can and should be superceded by +# --with-gnome-config. +# Check whether --with-gnome or --without-gnome was given. +if test "${with_gnome+set}" = set; then + withval="$with_gnome" + X_LIBS="${X_LIBS} -L$with_gnome/lib" X_CFLAGS="$X_CFLAGS -I$with_gnome/include -I$with_gnome/lib/gnome-libs/include" +fi -# HACK : inserts the path to gnucash.pm, which is used in the -# reporting code and is defined in gnucash.h - -GNC_RUNTIME_PERLLIBPATH=`eval echo ${GNC_LIBDIR}` +# Check whether --with-gnome-includes or --without-gnome-includes was given. +if test "${with_gnome_includes+set}" = set; then + withval="$with_gnome_includes" + X_CFLAGS="${X_CFLAGS} -I$with_gnome_includes -I$with_gnome_includes/libgnomesupport" +fi +# Check whether --with-gnome-libraries or --without-gnome-libraries was given. +if test "${with_gnome_libraries+set}" = set; then + withval="$with_gnome_libraries" + X_LIBS="${X_LIBS} -L$with_gnome_libraries" +fi -# The variables GNC_RUNTIME_SHAREDIR and GNC_RUNTIME_CONFIGDIR are used -# to configure bootstrap.scm and gnucash.h. This configuration is performed -# by Makefile.config.finish, invoked at the end of AC_OUTPUT. We have to -# handle these separately, because they are the *runtime* (not install -# time) defaults, and thus -# 1) We don't want them to change if you do -# make prefix=foo install -# This allows you to build distributions in a separate directory. -# 2) They are normally defined in terms of $prefix, and AC_OUPUT does -# not do recursive substitution, i.e., if we USED AC_OUTPUT to -# generate them, we would get ${prefix}/share/gnucash instead -# of the fully expanded directory name. -ABSOLUTE_TOP_SRCDIR=`pwd` +# Let the user specify imlib paths: +# Check whether --with-imlib or --without-imlib was given. +if test "${with_imlib+set}" = set; then + withval="$with_imlib" + X_LIBS="${X_LIBS} -L$with_imlib/lib" X_CFLAGS="$X_CFLAGS -I$with_imlib/include" +fi -### Begin i18n +### -------------------------------------------------------------------------- +# The XmHTML widget is used by motif and gnome alike. -# Check whether --with-locale-dir or --without-locale-dir was given. -if test "${with_locale_dir+set}" = set; then - withval="$with_locale_dir" - LOCALE_DIR="$with_locale_dir" -else - LOCALE_DIR="$prefix/share/locale" +# 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="-I$with_xmhtml_includes ${X_CFLAGS}" fi - -ac_safe=`echo "locale.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for locale.h""... $ac_c" 1>&6 -echo "configure:3495: checking for locale.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_cv_header_locale_h=yes -else - echo "$ac_t""no" 1>&6 -ac_cv_header_locale_h=no +# Check whether --with-xmhtml-libraries or --without-xmhtml-libraries was given. +if test "${with_xmhtml_libraries+set}" = set; then + withval="$with_xmhtml_libraries" + X_LIBS="-L$with_xmhtml_libraries ${X_LIBS}" fi -if test "$ac_cv_header_locale_h" = yes; then - echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3529: checking for LC_MESSAGES" >&5 -if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then + +# 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:3750: 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 else - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char deflateEnd(); + int main() { -return LC_MESSAGES +deflateEnd() ; return 0; } EOF -if { (eval echo configure:3541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - am_cv_val_LC_MESSAGES=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - am_cv_val_LC_MESSAGES=no + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi - -echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 - if test "$am_cv_val_LC_MESSAGES" = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_LC_MESSAGES 1 -EOF +LIBS="$ac_save_LIBS" - fi - fi - echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3562: checking whether NLS is requested" >&5 - # Check whether --enable-nls or --disable-nls was given. -if test "${enable_nls+set}" = set; then - enableval="$enable_nls" - USE_NLS=$enableval -else - USE_NLS=yes fi - - echo "$ac_t""$USE_NLS" 1>&6 - - - USE_INCLUDED_LIBINTL=no - - if test "$USE_NLS" = "yes"; then - cat >> confdefs.h <<\EOF -#define ENABLE_NLS 1 +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_ZLIB 1 EOF - - echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3582: checking whether included gettext is requested" >&5 - # Check whether --with-included-gettext or --without-included-gettext was given. -if test "${with_included_gettext+set}" = set; then - withval="$with_included_gettext" - nls_cv_force_use_gnu_gettext=$withval + LIBS="-lz $LIBS" else - nls_cv_force_use_gnu_gettext=no + echo "$ac_t""no" 1>&6 fi - echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3601: checking for libintl.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then +echo $ac_n "checking for jpeg_read_scanlines in -ljpeg""... $ac_c" 1>&6 +echo "configure:3793: 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 else - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char jpeg_read_scanlines(); + +int main() { +jpeg_read_scanlines() +; return 0; } EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then +if { (eval echo configure:3812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else - echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3628: checking for gettext in libc" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then + cat >> confdefs.h <<\EOF +#define HAVE_JPEG 1 +EOF + LIBS="-ljpeg $LIBS" +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6 +echo "configure:3836: 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 else - cat > conftest.$ac_ext < conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char png_read_image(); + int main() { -return (int) gettext ("") +png_read_image() ; return 0; } EOF -if { (eval echo configure:3640: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - gt_cv_func_gettext_libc=yes + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - gt_cv_func_gettext_libc=no + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_PNG 1 +EOF + LIBS="-lpng $LIBS" +else + echo "$ac_t""no" 1>&6 fi -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3656: checking for bindtextdomain in -lintl" >&5 -ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` +# This should be done in the OTHER_LIBRARIES argument to AC_CHECK_LIB +# if it's actually needed and Makefile.in's should be using +# X_PRE_LIBS, X_LIBS, and X_EXTRA_LIBS, rather than relying on LIBS. +# 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:3885: 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 else ac_save_LIBS="$LIBS" -LIBS="-lintl $LIBS" +LIBS="-lXpm $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3686,32 +3915,42 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3691: checking for gettext in libintl" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_XPM 1 +EOF + X_LIBS="-lXpm $X_LIBS" else - echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3696: checking for gettext in -lintl" >&5 -ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` + echo "$ac_t""no" 1>&6 +cat >> confdefs.h <<\EOF +#define HAVE_XPM 0 +EOF + +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:3935: 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="-lintl $LIBS" +LIBS="-lXmHTML $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS $X_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3726,283 +3965,191 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - gt_cv_func_gettext_libintl=yes + MOTIF_LIBS="-lXmHTML $MOTIF_LIBS" else echo "$ac_t""no" 1>&6 -gt_cv_func_gettext_libintl=no fi + -fi -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - fi - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_GETTEXT 1 -EOF +### ------------------------------------------------------------------------- +## gtk-xmhtml +# if gtk-xmhtml header or library not found, gnome builds are disabled +# make gnome will run make gnome.disabled which echoes a warning message - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3754: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$MSGFMT" in - /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" - ;; -esac -fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 +## XXX - need to do this because gtk-xmhtml requires glibconfig.h +## and I don't want CPPFLAGS permanently altered. +## If there's a better way to tackle this please let me know! + +OLDCPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS `$GNOME_CONFIG_BIN --cflags gnome`" + + +# gnome targets if all goes well +# XXX - should we shift these to the rest of the gnome configuration +# section? + +GNOME_TARGET="gnome.real" +GNOME_STATIC_TARGET="gnome.static.real" + +#AC_CHECK_HEADER might work, but I'm not sure it uses CPPFLAGS +# this guarantees it - it works. Promise!! +echo $ac_n "checking gtk-xmhtml/gtk-xmhtml.h""... $ac_c" 1>&6 +echo "configure:4001: checking gtk-xmhtml/gtk-xmhtml.h" >&5 +cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + echo "$ac_t""yes" 1>&6 else - echo "$ac_t""no" 1>&6 -fi - if test "$MSGFMT" != "no"; then - for ac_func in dcgettext -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3788: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "configure: warning: Cannot find gtk-xmhtml.h -- gnome build disabled (not required for motif)" 1>&2 + GNOME_TARGET="gnome.disabled" + GNOME_STATIC_TARGET="gnome.disabled" +fi +rm -f conftest* + +#undo damage to CPPFLAGS +CPPFLAGS="$OLDCPPFLAGS" + +### -------------------------------------------------------------------------- +# If readline exists, just assume that guile needs it. It probably does. +echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 +echo "configure:4030: checking for readline in -lreadline" >&5 +ac_lib_var=`echo readline'_'readline | 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 - cat > conftest.$ac_ext < conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ -char $ac_func(); +char readline(); int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - +readline() ; return 0; } EOF -if { (eval echo configure:3816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4049: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* -fi +LIBS="$ac_save_LIBS" -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 -fi -done - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3843: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" - ;; -esac -fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi + LIBS="-lreadline $LIBS" - # Extract the first word of "msgmerge", so it can be a program name with args. -set dummy msgmerge; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3879: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGMERGE'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGMERGE" in - /*) - ac_cv_path_GMSGMERGE="$GMSGMERGE" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGMERGE="$GMSGMERGE" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGMERGE="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGMERGE" && ac_cv_path_GMSGMERGE=":" - ;; -esac -fi -GMSGMERGE="$ac_cv_path_GMSGMERGE" -if test -n "$GMSGMERGE"; then - echo "$ac_t""$GMSGMERGE" 1>&6 else echo "$ac_t""no" 1>&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3915: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + + +### -------------------------------------------------------------------------- +EXTRALIBS=`$GNOME_CONFIG_BIN --libs gtkxmhtml` + +#check for gtkxmhtml, export library link to variable GTK_XMHTML +echo $ac_n "checking for gtk_xmhtml_new in -lgtkxmhtml""... $ac_c" 1>&6 +echo "configure:4083: checking for gtk_xmhtml_new in -lgtkxmhtml" >&5 +ac_lib_var=`echo gtkxmhtml'_'gtk_xmhtml_new | 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 - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - CATOBJEXT=.gmo - DATADIRNAME=share + eval "ac_cv_lib_$ac_lib_var=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - CATOBJEXT=.mo - DATADIRNAME=lib + eval "ac_cv_lib_$ac_lib_var=no" fi rm -f conftest* - INSTOBJEXT=.mo - fi - fi - +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + GTK_XMHTML="gtkxmhtml" else echo "$ac_t""no" 1>&6 +echo "configure: warning: Cannotfind libgtkxmhtml -- gnome build disabled (not required for motif)" 1>&2 + GNOME_TARGET="gnome.disabled" + GNOME_STATIC_TARGET="gnome.disabled" fi - if test "$CATOBJEXT" = "NONE"; then - echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:3978: checking whether catgets can be used" >&5 - # Check whether --with-catgets or --without-catgets was given. -if test "${with_catgets+set}" = set; then - withval="$with_catgets" - nls_cv_use_catgets=$withval -else - nls_cv_use_catgets=no -fi + - echo "$ac_t""$nls_cv_use_catgets" 1>&6 +### -------------------------------------------------------------------------- +EXTRALIBS=`$GNOME_CONFIG_BIN --libs print` - if test "$nls_cv_use_catgets" = "yes"; then - echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:3991: checking for main in -li" >&5 -ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` +# check for gnome-print and enable it via HAVE_LIBGNOMEPRINT +# if found +echo $ac_n "checking for gnome_print_context_new in -lgnomeprint""... $ac_c" 1>&6 +echo "configure:4134: checking for gnome_print_context_new in -lgnomeprint" >&5 +ac_lib_var=`echo gnomeprint'_'gnome_print_context_new | 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="-li $LIBS" +LIBS="-lgnomeprint $EXTRALIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4153: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4017,79 +4164,65 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + ac_tr_lib=HAVE_LIB`echo gnomeprint | sed -e 's/[^a-zA-Z0-9_]/_/g' \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` cat >> confdefs.h <&6 fi - echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:4034: checking for catgets" >&5 -if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char catgets(); -int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_catgets) || defined (__stub___catgets) -choke me -#else -catgets(); -#endif +# XXX - should we export these here or later in the configure script? -; return 0; } -EOF -if { (eval echo configure:4062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_catgets=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_catgets=no" -fi -rm -f conftest* + + + +### -------------------------------------------------------------------------- +### Guile (libraries and executable) + +# Don't disable this. It's the only reliable way to detect guile's +# settings on current guile installs. If it doesn't work for you, then +# don't specify --with-guile-config. (RLB) + +# In the long run, --with-guile should go away in favor of +# --with-guile-config. It might make sense to do this now. If you have +# guile 1.3 installed, but don't have guile-config, your install is +# most likely broken anyway, and should be fixed. (RLB) + +# Let the user override the guile-config executable. +# Check whether --with-guile-config or --without-guile-config was given. +if test "${with_guile_config+set}" = set; then + withval="$with_guile_config" + echo $ac_n "checking for guile-config""... $ac_c" 1>&6 +echo "configure:4204: checking for guile-config" >&5 + echo "$ac_t""${with_guile_config}" 1>&6 + GUILE_CONFIG="$with_guile_config" + LIBS="`${GUILE_CONFIG} link` ${LIBS}" + CFLAGS="$CFLAGS `${GUILE_CONFIG} compile`" fi -if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_CATGETS 1 -EOF - INTLOBJS="\$(CATOBJS)" - # Extract the first word of "gencat", so it can be a program name with args. -set dummy gencat; ac_word=$2 +if test x"$GUILE_CONFIG" = x; then + # Try to find a default guile-config + # Extract the first word of "guile-config", so it can be a program name with args. +set dummy guile-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4084: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then +echo "configure:4217: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GUILE_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GENCAT" in + case "$GUILE_CONFIG" in /*) - ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. + ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path. + ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -4097,199 +4230,180 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GENCAT="$ac_dir/$ac_word" + ac_cv_path_GUILE_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" ;; esac fi -GENCAT="$ac_cv_path_GENCAT" -if test -n "$GENCAT"; then - echo "$ac_t""$GENCAT" 1>&6 +GUILE_CONFIG="$ac_cv_path_GUILE_CONFIG" +if test -n "$GUILE_CONFIG"; then + echo "$ac_t""$GUILE_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi - if test "$GENCAT" != "no"; then - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4120: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" - ;; -esac + fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 + +# Still allow the old method (for now). +# Check whether --with-guile or --without-guile was given. +if test "${with_guile+set}" = set; then + withval="$with_guile" + LIBS="-L$with_guile/lib ${LIBS}" CFLAGS="$CFLAGS -I$with_guile/include" fi - if test "$GMSGFMT" = "no"; then - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4157: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + +# You can't have both... +if test x"$GUILE_CONFIG" != x && test x"$with_guile" != x ; then + { echo "configure: error: ${GUILE_CONFIG} ================ ${with_guile}" 1>&2; exit 1; } + { echo "configure: error: You cannot specify both --with-guile and --with-guile-config" 1>&2; exit 1; } +fi + +if test x"$GUILE_CONFIG" = x; then + # If we didn't get GUILE_CONFIG, then do things the old, dumb way. + + # Have to use AC_TRY_LINK here because AC_CHECK_LIB caches the + # results, so one failure makes all further attempts fail. + + GNC_LIBS_SAFE=${LIBS} + echo $ac_n "checking for guile""... $ac_c" 1>&6 +echo "configure:4273: checking for guile" >&5 +if eval "test \"`echo '$''{'ac_cv_lib_guile'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" - ;; -esac + for GNC_TEST_LIBS in "-lguile" "-lguile -ldl" "-lguile -lqthreads" \ + "-lguile -ltermcap" "-lguile -lqthreads -ltermcap" \ + "-lguile -lreadline -lncurses"; do + if test x"${GUILELIBS}" != x; then + ac_cv_lib_guile=${GUILELIBS} + break + else + LIBS="${GNC_TEST_LIBS} ${GNC_LIBS_SAFE}" + cat > conftest.$ac_ext < +int main() { +gh_eval_file; +; return 0; } +EOF +if { (eval echo configure:4293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + GUILELIBS="${GNC_TEST_LIBS}" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 +rm -f conftest* + fi + done +fi + +echo "$ac_t""$ac_cv_lib_guile" 1>&6 + + GUILELIBS=${ac_cv_lib_guile} else - echo "$ac_t""no" 1>&6 + # We did find a suitable guile-config. Use that. + # and use any guile binary in that same directory. + GUILE_INC=`${GUILE_CONFIG} compile` + GUILELIBS=`${GUILE_CONFIG} link` fi - fi - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 +# Find the appropriate guile binary. +if test x"$GUILE_CONFIG" != x; then + # Extract the first word of "guile", so it can be a program name with args. +set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4192: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then +echo "configure:4320: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$XGETTEXT" in + case "$GUILE_BIN" in /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="`dirname ${GUILE_CONFIG}`" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi + ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" + break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 +GUILE_BIN="$ac_cv_path_GUILE_BIN" +if test -n "$GUILE_BIN"; then + echo "$ac_t""$GUILE_BIN" 1>&6 else echo "$ac_t""no" 1>&6 fi - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.cat - INSTOBJEXT=.cat - DATADIRNAME=lib - INTLDEPS='$(top_builddir)/intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h - fi -else - echo "$ac_t""no" 1>&6 fi - fi - fi - - if test "$CATOBJEXT" = "NONE"; then - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - INTLOBJS="\$(GETTOBJS)" - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 +# If that didn't work, try the --with-guile directory, if any. +if test x"$GUILE_BIN" = x && test x"$with_guile" != x; then + # Extract the first word of "guile", so it can be a program name with args. +set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4250: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then +echo "configure:4359: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$MSGFMT" in + case "$GUILE_BIN" in /*) - ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. ;; *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="`${with_guile}/bin`" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_MSGFMT="$ac_dir/$ac_word" - break - fi + ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" + break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" ;; esac fi -MSGFMT="$ac_cv_path_MSGFMT" -if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 +GUILE_BIN="$ac_cv_path_GUILE_BIN" +if test -n "$GUILE_BIN"; then + echo "$ac_t""$GUILE_BIN" 1>&6 else echo "$ac_t""no" 1>&6 fi - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 +fi + +# Final stab at locating a guile binary. +if test x"${GUILE_BIN}" = x; then + # Extract the first word of "guile", so it can be a program name with args. +set dummy guile; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4284: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then +echo "configure:4398: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GUILE_BIN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - case "$GMSGFMT" in + case "$GUILE_BIN" in /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a path. ;; ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ac_cv_path_GUILE_BIN="$GUILE_BIN" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" @@ -4297,169 +4411,106 @@ else for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + ac_cv_path_GUILE_BIN="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 +GUILE_BIN="$ac_cv_path_GUILE_BIN" +if test -n "$GUILE_BIN"; then + echo "$ac_t""$GUILE_BIN" 1>&6 else echo "$ac_t""no" 1>&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4320: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + +if test x"${GUILELIBS}" = x || test x"${GUILE_BIN}" = x; then + { echo "configure: error: Cannot configure guile bits. Do you have guile 1.3 installed?" 1>&2; exit 1; } +fi + +# Get just the directory for the guile binary. +GUILE_BIN=`dirname ${GUILE_BIN}` + + + + + + +### -------------------------------------------------------------------------- +### Plotutils + +#AC_CHECK_LIB(plot, pl_openpl, +# AC_DEFINE(HAVE_PLOTUTILS,1) +# HAVE_PLOTUTILS=1 +# AC_DEFINE(PLOTUTILS_LIBS,"-lXaw -lXt -lplot"), +# , +# $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS -lXaw $X_LIBS) + +# We need this in at least one of the Makefile.in's +#AC_SUBST(HAVE_PLOTUTILS) +#AC_SUBST(PLOTUTILS_LIBS) + + + +### -------------------------------------------------------------------------- +############################################################# +### Set up the install style and all the default paths... ### + +# some confusion due to FSSTND stuff -- +# the readme's and miscellaneous docs are in /usr/doc (or equivalent) +# the online help system is in /usr/share/gnucash/Doc and various subdirs +# the parsed-html report supsystem is in /usr/share/gnucash/Reports + +if test ${OPT_STYLE_INSTALL} = 1 +then + GNC_DOCDIR='${prefix}/doc' + GNC_BINDIR='${prefix}/bin' + GNC_LIBDIR='${prefix}/lib' + GNC_CONFIGDIR=${sysconfdir} + GNC_SHAREDIR=${datadir} else - echo "$ac_t""no" 1>&6 + GNC_DOCDIR='${prefix}/doc/gnucash' + GNC_BINDIR='${prefix}/bin' + GNC_LIBDIR='${prefix}/lib/gnucash' + GNC_CONFIGDIR=${sysconfdir}/gnucash + GNC_SHAREDIR=${datadir}/gnucash fi - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h - fi - if test "$XGETTEXT" != ":"; then - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 - XGETTEXT=":" - fi - fi - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h - fi - - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - POXFILES="$POXFILES $lang.pox" - done - - - - - - - - - - - - - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4415: checking for catalogs to be installed" >&5 - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - echo "$ac_t""$LINGUAS" 1>&6 - fi +# HACK : inserts the path to gnucash.pm, which is used in the +# reporting code and is defined in gnucash.h - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi +GNC_RUNTIME_PERLLIBPATH=`eval echo ${GNC_LIBDIR}` - if test "$ac_cv_header_locale_h" = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - - MKINSTALLDIRS= - if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" - fi - if test -z "$MKINSTALLDIRS"; then - MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" - fi - - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - -### End i18n +# The variables GNC_RUNTIME_SHAREDIR and GNC_RUNTIME_CONFIGDIR are used +# to configure bootstrap.scm and gnucash.h. This configuration is performed +# by Makefile.config.finish, invoked at the end of AC_OUTPUT. We have to +# handle these separately, because they are the *runtime* (not install +# time) defaults, and thus +# 1) We don't want them to change if you do +# make prefix=foo install +# This allows you to build distributions in a separate directory. +# 2) They are normally defined in terms of $prefix, and AC_OUPUT does +# not do recursive substitution, i.e., if we USED AC_OUTPUT to +# generate them, we would get ${prefix}/share/gnucash instead +# of the fully expanded directory name. + + +ABSOLUTE_TOP_SRCDIR=`pwd` + @@ -4633,6 +4684,28 @@ s%@SET_MAKE@%$SET_MAKE%g s%@RANLIB@%$RANLIB%g s%@CC@%$CC%g s%@OPT_STYLE_INSTALL@%$OPT_STYLE_INSTALL%g +s%@LOCALE_DIR@%$LOCALE_DIR%g +s%@CPP@%$CPP%g +s%@USE_NLS@%$USE_NLS%g +s%@MSGFMT@%$MSGFMT%g +s%@GMSGFMT@%$GMSGFMT%g +s%@GMSGMERGE@%$GMSGMERGE%g +s%@XGETTEXT@%$XGETTEXT%g +s%@GENCAT@%$GENCAT%g +s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g +s%@CATALOGS@%$CATALOGS%g +s%@CATOBJEXT@%$CATOBJEXT%g +s%@DATADIRNAME@%$DATADIRNAME%g +s%@GMOFILES@%$GMOFILES%g +s%@INSTOBJEXT@%$INSTOBJEXT%g +s%@INTLDEPS@%$INTLDEPS%g +s%@INTLLIBS@%$INTLLIBS%g +s%@INTLOBJS@%$INTLOBJS%g +s%@POFILES@%$POFILES%g +s%@POXFILES@%$POXFILES%g +s%@POSUB@%$POSUB%g +s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g +s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g s%@QT_TARGET@%$QT_TARGET%g s%@QT_STATIC_TARGET@%$QT_STATIC_TARGET%g s%@PERL@%$PERL%g @@ -4643,7 +4716,6 @@ s%@EPERL_NAME@%$EPERL_NAME%g s%@SWIG@%$SWIG%g s%@GLIB_CONFIG_BIN@%$GLIB_CONFIG_BIN%g s%@GNOME_CONFIG_BIN@%$GNOME_CONFIG_BIN%g -s%@CPP@%$CPP%g s%@X_CFLAGS@%$X_CFLAGS%g s%@X_PRE_LIBS@%$X_PRE_LIBS%g s%@X_LIBS@%$X_LIBS%g @@ -4665,27 +4737,6 @@ s%@GNC_CONFIGDIR@%$GNC_CONFIGDIR%g s%@GNC_SHAREDIR@%$GNC_SHAREDIR%g s%@GNC_RUNTIME_PERLLIBPATH@%$GNC_RUNTIME_PERLLIBPATH%g s%@ABSOLUTE_TOP_SRCDIR@%$ABSOLUTE_TOP_SRCDIR%g -s%@LOCALE_DIR@%$LOCALE_DIR%g -s%@USE_NLS@%$USE_NLS%g -s%@MSGFMT@%$MSGFMT%g -s%@GMSGFMT@%$GMSGFMT%g -s%@GMSGMERGE@%$GMSGMERGE%g -s%@XGETTEXT@%$XGETTEXT%g -s%@GENCAT@%$GENCAT%g -s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g -s%@CATALOGS@%$CATALOGS%g -s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g -s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g -s%@INTLLIBS@%$INTLLIBS%g -s%@INTLOBJS@%$INTLOBJS%g -s%@POFILES@%$POFILES%g -s%@POXFILES@%$POXFILES%g -s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g CEOF EOF diff --git a/configure.in b/configure.in index b8f31f31f4..f1a7465acb 100644 --- a/configure.in +++ b/configure.in @@ -44,9 +44,6 @@ AC_CHECK_FUNCS(stpcpy) ### Variables ### Set up all the initial variable values... - - - # USE_QUICKFILL: AC_DEFINE(USE_QUICKFILL,1) @@ -77,6 +74,19 @@ AC_ARG_ENABLE( warnings, LDFLAGS="${LDFLAGS} -g -Wall" AC_DEFINE(DEBUG_MEMORY,1) AC_DEFINE(USE_DEBUG,1) ) + +### -------------------------------------------------------------------------- +### i18n +AC_ARG_WITH( locale-dir, + [ --with-locale-dir=PATH specify where to look for locale-specific information], + LOCALE_DIR="$with_locale_dir", + LOCALE_DIR="$prefix/share/locale") +AC_SUBST(LOCALE_DIR) + +AC_CHECK_HEADER(locale.h, ac_cv_header_locale_h=yes, ac_cv_header_locale_h=no) +AC_CAN_USE_GNU_GETTEXT + + ### -------------------------------------------------------------------------- ## qt-version of gnucash # The qt version of gnucash is far from doing anything usefull, so most people @@ -336,28 +346,37 @@ AC_TRY_CPP([#include ], AC_MSG_RESULT(yes) , #undo damage to CPPFLAGS CPPFLAGS="$OLDCPPFLAGS" -OLDLDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS `$GNOME_CONFIG_BIN --libs gtkxmhtml`" +### -------------------------------------------------------------------------- +# If readline exists, just assume that guile needs it. It probably does. +AC_CHECK_LIB(readline, readline) + + +### -------------------------------------------------------------------------- +EXTRALIBS=`$GNOME_CONFIG_BIN --libs gtkxmhtml` #check for gtkxmhtml, export library link to variable GTK_XMHTML AC_CHECK_LIB(gtkxmhtml, gtk_xmhtml_new, GTK_XMHTML="gtkxmhtml", AC_MSG_WARN([Cannotfind libgtkxmhtml -- gnome build disabled (not required for motif)]) GNOME_TARGET="gnome.disabled" - GNOME_STATIC_TARGET="gnome.disabled") + GNOME_STATIC_TARGET="gnome.disabled", + $EXTRALIBS) AC_SUBST(GTK_XMHTML) -LDFLAGS="$OLDLDFLAGS" - + + +### -------------------------------------------------------------------------- +EXTRALIBS=`$GNOME_CONFIG_BIN --libs print` + +# check for gnome-print and enable it via HAVE_LIBGNOMEPRINT +# if found +AC_CHECK_LIB(gnomeprint, gnome_print_context_new, , , $EXTRALIBS) + + # XXX - should we export these here or later in the configure script? AC_SUBST(GNOME_TARGET) AC_SUBST(GNOME_STATIC_TARGET) -### -------------------------------------------------------------------------- -# If readline exists, just assume that guile needs it. It probably does. -AC_CHECK_LIB(readline, readline) - - ### -------------------------------------------------------------------------- ### Guile (libraries and executable) @@ -523,19 +542,6 @@ AC_SUBST(GNC_RUNTIME_PERLLIBPATH) ABSOLUTE_TOP_SRCDIR=`pwd` AC_SUBST(ABSOLUTE_TOP_SRCDIR) -### Begin i18n - -AC_ARG_WITH( locale-dir, - [ --with-locale-dir=PATH specify where to look for locale-specific information], - LOCALE_DIR="$with_locale_dir", - LOCALE_DIR="$prefix/share/locale") -AC_SUBST(LOCALE_DIR) - -AC_CHECK_HEADER(locale.h, ac_cv_header_locale_h=yes, ac_cv_header_locale_h=no) -AC_CAN_USE_GNU_GETTEXT - -### End i18n - AC_CONFIG_HEADER(config.h) AC_OUTPUT(Makefile diff --git a/src/gnome/Makefile.in b/src/gnome/Makefile.in index 9ba3e9ba62..094e8f016c 100644 --- a/src/gnome/Makefile.in +++ b/src/gnome/Makefile.in @@ -42,7 +42,7 @@ LDFLAGS = @LDFLAGS@ GUILELIBS = @GUILELIBS@ LIBS = -L$(prefix)/lib @LIBS@ \ - $(shell ${GNOME_CONFIG_BIN} --libs gnomeui @GTK_XMHTML@) $(GUILELIBS) \ + $(shell ${GNOME_CONFIG_BIN} --libs gnomeui print @GTK_XMHTML@) $(GUILELIBS) \ @top_srcdir@/lib/g-wrap-install/lib/libgwrapguile.a ifeq (${HAVE_PLOTUTILS},1) @@ -70,8 +70,8 @@ GNOME_SRCS := top-level.c window-main.c window-register.c window-adjust.c \ dialog-add.c dialog-edit.c dialog-utils.c \ extensions.c query-user.c reconcile-list.c \ window-report.c global-options.c \ - dialog-qif-import.c glade-qif-import.c \ - dialog-account-picker.c glade-account-picker.c + dialog-qif-import.c glade-gnc-dialogs.c \ + dialog-account-picker.c print-session.c ###################################################################### all: gnome diff --git a/src/gnome/gnc-dialogs.glade b/src/gnome/gnc-dialogs.glade new file mode 100644 index 0000000000..87be81fa9e --- /dev/null +++ b/src/gnome/gnc-dialogs.glade @@ -0,0 +1,1148 @@ + + + + + gnc-dialogs + gnc-dialogs + + + pixmaps + C + True + True + False + False + True + False + False + glade-gnc-dialogs.c + glade-gnc-dialogs.h + glade-cb-gnc-dialogs.c + glade-cb-gnc-dialogs.h + glade-support-gnc-dialogs.c + glade-support-gnc-dialogs.h + + + + + GnomeDialog + QIF File Import Dialog + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + True + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox2 + False + 8 + + 4 + True + True + + + + GtkNotebook + notebook1 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkHBox + hbox1 + False + 0 + + + GtkFrame + frame2 + 200 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow1 + 150 + GTK_POLICY_AUTOMATIC + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkViewport + viewport1 + GTK_SHADOW_IN + + + GtkList + selected_file_list + + select_child + gnc_ui_qif_import_select_loaded_file_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:17:01 GMT + + GTK_SELECTION_SINGLE + + + + + + + GtkFrame + frame3 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox2 + False + 0 + + + GtkHBox + hbox10 + False + 0 + + 0 + True + True + + + + GtkVBox + vbox3 + True + 0 + + 5 + True + True + + + + GtkLabel + label1 + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label679 + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 5 + False + False + + + + + GtkLabel + currency_label + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + radix_format_label + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + date_format_label + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkVBox + vbox4 + True + 0 + + 5 + True + True + + + + GtkEntry + qif_filename_entry + True + True + True + True + True + 0 + + + 0 + False + False + + + + + GtkHBox + hbox11 + False + 0 + + 0 + True + True + + + + GtkCheckButton + qif_account_auto_check + True + + True + True + + 0 + False + False + + + + + GtkEntry + qif_account_entry + True + True + True + 0 + + + 0 + True + True + + + + + + GtkEntry + qif_currency_entry + True + True + True + 0 + + + 0 + False + False + + + + + GtkOptionMenu + qif_radix_picker + True + Autodetect +Decimal (1,000.00) +Comma (1.000,00) + + 0 + + 0 + False + False + + + + + GtkOptionMenu + qif_date_picker + True + Autodetect +MM/DD/YYYY +DD/MM/YYYY +YYYY/MM/DD +YYYY/DD/MM + + 0 + + 0 + False + False + + + + + + + GtkHBox + hbox9 + True + 0 + + 5 + False + False + + + + GtkButton + file_select_btn + True + + clicked + gnc_ui_qif_import_select_file_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:42:40 GMT + + + + 5 + True + True + + + + + GtkButton + add_file_button + True + + clicked + gnc_ui_qif_import_load_file_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:14:48 GMT + + + + 5 + True + True + + + + + + + + + GtkLabel + Notebook:tab + label69 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCList + account_page_list + True + + select_row + gnc_ui_qif_import_account_line_select_cb + Tue, 14 Mar 2000 14:58:13 GMT + + 4 + 116,80,204,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label682 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label683 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label684 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label685 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkLabel + Notebook:tab + label2 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkScrolledWindow + scrolledwindow3 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkCList + category_page_list + True + + select_row + gnc_ui_qif_import_category_line_select_cb + Tue, 14 Mar 2000 14:59:18 GMT + + 4 + 117,80,204,80 + GTK_SELECTION_SINGLE + True + GTK_SHADOW_IN + + + GtkLabel + CList:title + label686 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label687 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label688 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label689 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkLabel + Notebook:tab + foo6868 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_SPREAD + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button2 + True + True + + clicked + gnc_ui_qif_import_ok_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:08:23 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button3 + True + True + + clicked + gnc_ui_qif_import_cancel_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:08:04 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + GtkButton + button4 + True + True + + clicked + gnc_ui_qif_import_help_cb + QIF_File_Import_Dialog + Tue, 14 Mar 2000 15:08:59 GMT + + GNOME_STOCK_BUTTON_HELP + + + + + + + GnomeDialog + QIF Import Account Picker + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox1 + False + 8 + + 1 + True + True + + + + GtkVBox + vbox2 + False + 0 + + 0 + True + True + + + + GtkFrame + frame1 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkScrolledWindow + scrolledwindow1 + 250 + 200 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkViewport + viewport1 + GTK_SHADOW_IN + + + GtkTree + account_tree + + select_child + gnc_ui_account_picker_select_cb + QIF_Import_Account_Picker + Thu, 02 Mar 2000 21:32:14 GMT + + GTK_SELECTION_SINGLE + GTK_TREE_VIEW_LINE + True + + + + + + + + GtkHBox + hbox5 + False + 0 + + 0 + False + False + + + + GtkVBox + vbox4 + True + 0 + + 5 + True + True + + + + GtkLabel + label1 + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label2 + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label3 + + GTK_JUSTIFY_RIGHT + False + 1 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkVBox + vbox5 + True + 0 + + 0 + True + True + + + + GtkEntry + acct_entry + True + True + True + 0 + + + 0 + False + False + + + + + GtkEntry + acct_description_entry + True + True + True + 0 + + + 0 + False + False + + + + + GtkOptionMenu + acct_type_picker + 150 + 30 + True + Bank +Cash +Asset +Credit +Liability +Stock +Mutual +Currency +Income +Expense +Equity + + 0 + + 0 + False + False + + + + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox1 + GTK_BUTTONBOX_SPREAD + 8 + 85 + 27 + 7 + 0 + + 0 + False + False + GTK_PACK_END + + + + GtkButton + button1 + True + True + + clicked + gnc_ui_account_picker_ok_cb + QIF_Import_Account_Picker + Thu, 02 Mar 2000 23:02:59 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button2 + True + True + + clicked + gnc_ui_account_picker_cancel_cb + QIF_Import_Account_Picker + Thu, 02 Mar 2000 23:03:18 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + + + GnomeDialog + Print Preview Dialog + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + True + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox3 + False + 8 + + 4 + True + True + + + + GtkScrolledWindow + scrolledwindow4 + 1 + 500 + 250 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GnomeCanvas + preview_canvas + True + True + 0 + 0 + 100 + 100 + 1 + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area3 + GTK_BUTTONBOX_SPREAD + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button5 + True + True + + clicked + gnc_ui_print_preview_OK_cb + Print_Preview_Dialog + Wed, 22 Mar 2000 21:35:46 GMT + + GNOME_STOCK_BUTTON_OK + + + + + + + GnomeDialog + Print Dialog + Print Check + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox4 + False + 8 + + 4 + True + True + + + + GtkVBox + vbox6 + False + 0 + + 0 + True + True + + + + GtkButton + button12 + True + + clicked + gnc_ui_print_dialog_select_printer_cb + Print_Dialog + Wed, 22 Mar 2000 22:41:57 GMT + + + + 0 + False + False + + + + + GtkButton + button13 + True + + clicked + gnc_ui_print_dialog_preview_cb + Print_Dialog + Wed, 22 Mar 2000 22:42:05 GMT + + + + 0 + False + False + + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area4 + GTK_BUTTONBOX_SPREAD + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button9 + True + True + + clicked + gnc_ui_print_dialog_ok_cb + Print_Dialog + Wed, 22 Mar 2000 22:42:13 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button11 + True + True + + clicked + gnc_ui_print_dialog_cancel_cb + Print_Dialog + Wed, 22 Mar 2000 22:42:20 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + + diff --git a/src/gnome/window-register.c b/src/gnome/window-register.c index ee0baa5b55..52a4b22707 100644 --- a/src/gnome/window-register.c +++ b/src/gnome/window-register.c @@ -968,8 +968,8 @@ print_check_cb(GtkWidget * widget, gpointer data) gh_str02scm(memo))); } #else - gnc_info_dialog_parented(reg_data->dialog, - _"You need to install the gnome-print library."); + gnc_info_dialog_parented(GTK_WINDOW(reg_data->window), + _("You need to install the gnome-print library.")); #endif } diff --git a/src/scm/main.scm b/src/scm/main.scm index e009af6976..dbbd536466 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -25,7 +25,13 @@ "/scm/qif-import") (gnc:config-var-value-get gnc:*load-path*))) + (gnc:config-var-value-set! gnc:*load-path* #f + (cons (string-append gnc:_share-dir-default_ + "/scm/printing") + (gnc:config-var-value-get gnc:*load-path*))) + (gnc:depend "qif-import.scm") + (gnc:depend "print-check.scm") ;; Load the system configs (if (not (gnc:load-system-config-if-needed)) diff --git a/src/scm/printing/number-to-words.scm b/src/scm/printing/number-to-words.scm new file mode 100644 index 0000000000..ab906be1db --- /dev/null +++ b/src/scm/printing/number-to-words.scm @@ -0,0 +1,112 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; number-to-words.scm +;;; convert a number into a sentence for check printing +;;; +;;; Copyright 2000 Bill Gribble +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(gnc:support "number-to-words.scm") + +(define (integer-to-words val) + (let ((current-string "") + (small-numbers + #("zero" "one" "two" "three" "four" "five" + "six" "seven" "eight" "nine" "ten" + "eleven" "twelve" "thirteen" "fourteen" "fifteen" + "sixteen" "seventeen" "eighteen" "nineteen" "twenty")) + (medium-numbers + #("zero" "ten" "twenty" "thirty" "forty" "fifty" + "sixty" "seventy" "eighty" "ninety")) + (big-numbers + #("hundred" "thousand" "million" "billion" "trillion" + "quadrillion" "quintillion"))) + (cond + ((< val 20) + (vector-ref small-numbers val)) + + ((< val 100) + (let ((this-part (quotient val 10)) + (that-part (remainder val 10))) + (set! current-string (vector-ref medium-numbers this-part)) + (if (> that-part 0) + (set! current-string + (string-append current-string "-" + (vector-ref small-numbers that-part)))) + current-string)) + ((< val 1000) + (let ((this-part (quotient val 100)) + (that-part (remainder val 100))) + (set! current-string + (string-append current-string + (vector-ref small-numbers this-part) " " + (vector-ref big-numbers 0))) + (if (> that-part 0) + (set! current-string + (string-append current-string + " " (integer-to-words that-part)))) + current-string)) + (#t + (let* ((log-val (inexact->exact + (truncate (+ .00001 (/ (log10 val) 3))))) + (this-part (quotient val + (inexact->exact + (truncate + (+ .00001 (expt 10 (* 3 log-val))))))) + (that-part (remainder val + (inexact->exact + (+ .00001 + (truncate + (expt 10 (* 3 log-val)))))))) + (if (> this-part 0) + (set! current-string + (string-append (integer-to-words this-part) + " " (vector-ref big-numbers log-val)))) + (if (> that-part 0) + (set! current-string + (string-append current-string + " " (integer-to-words that-part)))) + current-string))))) + +;; return a string with the number properly truncated and zero padded +;; for check printing +(define (printable-value val frac-denom) + (let* ((int-part (inexact->exact (truncate val))) + (frac-part (inexact->exact + (truncate + (+ (/ .5 frac-denom) (* frac-denom + (- val int-part))))))) + (with-output-to-string + (lambda () + (write int-part) (display ".") + (if (< frac-part 10) (display "0")) + (write frac-part))))) + + +(define (number-to-words val frac-denom) + (let* ((negative? + (if (< val 0) + (begin (set! val (- val)) + #t) + #f)) + (int-part (inexact->exact (truncate val))) + (frac-part (inexact->exact + (truncate + (+ (/ .5 frac-denom) (* frac-denom (- val int-part)))))) + (result-string "")) + (set! result-string + (string-append (integer-to-words int-part) " and " + (with-output-to-string + (lambda () + (write frac-part) + (display "/") + (write frac-denom))))) + (string-set! result-string 0 + (char-upcase (string-ref result-string 0))) + result-string)) + + + + + + diff --git a/src/scm/printing/print-check.scm b/src/scm/printing/print-check.scm new file mode 100644 index 0000000000..3402145a9a --- /dev/null +++ b/src/scm/printing/print-check.scm @@ -0,0 +1,59 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; print-check.scm +;;; print a check from a transaction. +;;; +;;; Copyright 2000 Bill Gribble +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(gnc:support "print-check.scm") +(gnc:depend "number-to-words.scm") + +;; format notes (I found a GIF of the check form and am measuring from +;; that, so this is definitely not perfect) positions are lower-left +;; text origin, (0,0) at lower left of page, in inches, for +;; US-Letter format paper. +(define quicken-check-3up-at-top-us-letter + '((payee . (1.0625 9.625)) + (amount-words . (1.0625 9.325)) + (amount-number . (6.5 9.625)) + (date . (6.5 10.1)) + (memo . (1.0625 8.15)))) + +(define (gnc:print-check payee amount date memo) + (let* ((int-part (inexact->exact (truncate amount))) + (frac-part (inexact->exact + (truncate + (+ (/ .5 100) (* 100 (- amount int-part)))))) + (ps (gnc:print-session-create)) + (format quicken-check-3up-at-top-us-letter) + (inches-to-points + (lambda (inches) + (* inches 72)))) + + (let ((date-pos (assq 'date format))) + (gnc:print-session-moveto ps + (inches-to-points (cadr date-pos)) + (inches-to-points (caddr date-pos))) + (gnc:print-session-text ps date)) + + (let ((payee-pos (assq 'payee format))) + (gnc:print-session-moveto ps + (inches-to-points (cadr payee-pos)) + (inches-to-points (caddr payee-pos))) + (gnc:print-session-text ps payee)) + + (let ((number-pos (assq 'amount-number format))) + (gnc:print-session-moveto ps + (inches-to-points (cadr number-pos)) + (inches-to-points (caddr number-pos))) + (gnc:print-session-text ps (printable-value amount 100))) + + (let ((words-pos (assq 'amount-words format))) + (gnc:print-session-moveto ps + (inches-to-points (cadr words-pos)) + (inches-to-points (caddr words-pos))) + (gnc:print-session-text ps (number-to-words amount 100))) + + (gnc:print-session-done ps) + (gnc:print-dialog-create ps))) diff --git a/src/scm/qif-import/qif-file.scm b/src/scm/qif-import/qif-file.scm index 75a2372429..acb4db0aa6 100644 --- a/src/scm/qif-import/qif-file.scm +++ b/src/scm/qif-import/qif-file.scm @@ -28,9 +28,10 @@ (tag #f) (value #f) (heinous-error #f) - (valid-acct-types '(type:bank type:cash - type:ccard type:invst - #{type:oth\ a}# #{type:oth\ l}#))) + (valid-acct-types + '(type:bank type:cash + type:ccard type:invst + #{type:oth\ a}# #{type:oth\ l}#))) (with-input-from-file path (lambda () ;; loop over lines @@ -63,186 +64,196 @@ (set! current-xtn (make-qif-cat))) ((eq? qstate-type 'account) (set! current-xtn (make-qif-acct))))) -; (#t -; (display "qif-file:read-file can't handle ") -; (write qstate-type) -; (display " transactions yet.") -; (newline)))) +;;; (#t +;;; (display "qif-file:read-file can't handle ") +;;; (write qstate-type) +;;; (display " transactions yet.") +;;; (newline)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; account transactions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - + ((member qstate-type valid-acct-types) (case tag - ;; D : transaction date - ((#\D) - (qif-xtn:set-date! current-xtn - (qif-file:parse-date self value))) - - ;; T : total amount - ((#\T) - (qif-split:set-amount! default-split - (qif-file:parse-value self value))) - - ;; P : payee - ((#\P) - (qif-xtn:set-payee! current-xtn - (qif-file:parse-string self value))) - - ;; A : address - ;; multiple "A" lines are appended together with - ;; newlines; some Quicken files have a lot of - ;; A lines. - ((#\A) - (qif-xtn:set-address! - current-xtn - (let ((current (qif-xtn:address current-xtn))) - (if (not (string? current)) - (set! current "")) - (string-append - current "\n" - (qif-file:parse-string self value))))) - - ;; N : check number / transaction number /xtn direction - ;; this could be a number or a string; no point in - ;; keeping it numeric just yet. - ((#\N) - (qif-xtn:set-number! - current-xtn (qif-file:parse-string self value))) - - ;; C : cleared flag - ((#\C) - (qif-xtn:set-cleared! - current-xtn (qif-file:parse-cleared-field self value))) - - ;; M : memo - ((#\M) - (qif-split:set-memo! default-split + ;; D : transaction date + ((#\D) + (qif-xtn:set-date! current-xtn + (qif-file:parse-date self value))) + + ;; T : total amount + ((#\T) + (qif-split:set-amount! + default-split (qif-file:parse-value/decimal self value)) + (if (not (number? (qif-split:amount default-split))) + (begin + (display "value not a number : ") + (display value) (display " ") + (write (qif-split:amount default-split)) + (newline)))) + + ;; P : payee + ((#\P) + (qif-xtn:set-payee! current-xtn (qif-file:parse-string self value))) - - ;; I : share price (stock transactions) - ((#\I) - (qif-xtn:set-share-price! - current-xtn (qif-file:parse-value self value))) - - ;; Q : share price (stock transactions) - ((#\Q) - (qif-xtn:set-num-shares! - current-xtn (qif-file:parse-value self value)) - (qif-xtn:set-bank-xtn?! current-xtn #f)) - - ;; Y : name of security (stock transactions) - ((#\Y) - (qif-xtn:set-security-name! - current-xtn (qif-file:parse-string self value))) - - ;; O : adjustment (stock transactions) - ((#\O) - (qif-xtn:set-adjustment! - current-xtn (qif-file:parse-value/decimal self value))) - - ;; L : category - ((#\L) - (qif-split:set-category! - default-split (qif-file:parse-string self value))) - - ;; S : split category - ((#\S) - (set! current-split (make-qif-split)) - (qif-split:set-category! - current-split (qif-file:parse-string self value)) - (qif-xtn:set-splits! - current-xtn - (cons current-split (qif-xtn:splits current-xtn)))) - - ;; E : split memo (?) - ((#\E) - (qif-split:set-memo! - current-split (qif-file:parse-string self value))) - - ;; $ : split amount (if there are splits) - ((#\$) - ;; if this is 'Type:Invst, I can't figure out - ;; what the $ signifies. I'll do it later. - (if (not (eq? qstate-type 'type:invst)) - (qif-split:set-amount! - current-split - (qif-file:parse-value/decimal self value)))) - - ;; ^ : end-of-record - ((#\^) - (if (and (qif-xtn:date current-xtn) - (qif-split:amount default-split)) - (begin - (if (null? (qif-xtn:splits current-xtn)) - (qif-xtn:set-splits! current-xtn - (list default-split))) - (qif-file:add-xtn! self current-xtn)) - (begin - (display "qif-file:read-file : discarding xtn") - (newline) - (qif-xtn:print current-xtn))) - (if (and first-xtn - (string? (qif-xtn:payee current-xtn)) - (string=? (qif-xtn:payee current-xtn) - "Opening Balance") - (eq? (length (qif-xtn:splits current-xtn)) 1) - (qif-split:category-is-account? - (car (qif-xtn:splits current-xtn)))) - (begin - (qif-file:set-account! - self (qif-split:category - (car (qif-xtn:splits current-xtn)))) - (qif-split:set-category! - (car (qif-xtn:splits current-xtn)) - "Opening Balance"))) + ;; A : address + ;; multiple "A" lines are appended together with + ;; newlines; some Quicken files have a lot of + ;; A lines. + ((#\A) + (qif-xtn:set-address! + current-xtn + (let ((current (qif-xtn:address current-xtn))) + (if (not (string? current)) + (set! current "")) + (string-append + current "\n" + (qif-file:parse-string self value))))) - ;; some special love for stock transactions - (if (and (qif-xtn:security-name current-xtn) - (string? (qif-xtn:number current-xtn))) - (begin - (cond - ((and - (or (string=? (qif-xtn:number current-xtn) - "ReinvDiv") - (string=? (qif-xtn:number current-xtn) - "ReinvLg") - (string=? (qif-xtn:number current-xtn) - "ReinvSh") - (string=? (qif-xtn:number current-xtn) - "Div")) - (string=? - "" (qif-split:category - (car - (qif-xtn:splits current-xtn))))) - (qif-split:set-category! - (car (qif-xtn:splits current-xtn)) - "Dividend") - ;; KLUDGE! for brokerage accounts - ;; where Dividend pays into the - ;; brokerage account. - (if (and (qif-xtn:bank-xtn? current-xtn) - (string? - (qif-xtn:security-name - current-xtn))) - (qif-xtn:set-payee! - current-xtn (qif-xtn:security-name - current-xtn)))) - - ((or (string=? (qif-xtn:number current-xtn) - "SellX") - (string=? (qif-xtn:number current-xtn) - "Sell")) - (qif-xtn:set-num-shares! - current-xtn - (string-append - "-" (qif-xtn:num-shares current-xtn))))))) + ;; N : check number / transaction number /xtn direction + ;; this could be a number or a string; no point in + ;; keeping it numeric just yet. + ((#\N) + (qif-xtn:set-number! + current-xtn (qif-file:parse-string self value))) + + ;; C : cleared flag + ((#\C) + (qif-xtn:set-cleared! + current-xtn (qif-file:parse-cleared-field self value))) + + ;; M : memo + ((#\M) + (qif-split:set-memo! default-split + (qif-file:parse-string self value))) + + ;; I : share price (stock transactions) + ((#\I) + (qif-xtn:set-share-price! + current-xtn (qif-file:parse-value self value))) + + ;; Q : share price (stock transactions) + ((#\Q) + (qif-xtn:set-num-shares! + current-xtn (qif-file:parse-value self value)) + (qif-xtn:set-bank-xtn?! current-xtn #f)) - (set! first-xtn #f) - (set! current-xtn (make-qif-xtn)) - (set! default-split (make-qif-split))))) + ;; Y : name of security (stock transactions) + ((#\Y) + (qif-xtn:set-security-name! + current-xtn (qif-file:parse-string self value))) + + ;; O : adjustment (stock transactions) + ((#\O) + (qif-xtn:set-adjustment! + current-xtn (qif-file:parse-value/decimal self value))) + + ;; L : category + ((#\L) + (qif-split:set-category! + default-split (qif-file:parse-string self value))) + + ;; S : split category + ((#\S) + (set! current-split (make-qif-split)) + (qif-split:set-category! + current-split (qif-file:parse-string self value)) + (qif-xtn:set-splits! + current-xtn + (cons current-split (qif-xtn:splits current-xtn)))) + + ;; E : split memo (?) + ((#\E) + (qif-split:set-memo! + current-split (qif-file:parse-string self value))) + + ;; $ : split amount (if there are splits) + ((#\$) + ;; if this is 'Type:Invst, I can't figure out + ;; what the $ signifies. I'll do it later. + (if (not (eq? qstate-type 'type:invst)) + (qif-split:set-amount! + current-split + (qif-file:parse-value/decimal self value)))) + + ;; ^ : end-of-record + ((#\^) + (if (and (qif-xtn:date current-xtn) + (qif-split:amount default-split)) + (begin + (if (null? (qif-xtn:splits current-xtn)) + (qif-xtn:set-splits! current-xtn + (list default-split))) + (qif-file:add-xtn! self current-xtn)) + (begin + (display "qif-file:read-file : discarding xtn") + (newline) + (qif-xtn:print current-xtn))) + + (if (and first-xtn + (string? (qif-xtn:payee current-xtn)) + (string=? (qif-xtn:payee current-xtn) + "Opening Balance") + (eq? (length (qif-xtn:splits current-xtn)) 1) + (qif-split:category-is-account? + (car (qif-xtn:splits current-xtn)))) + (begin + (qif-file:set-account! + self (qif-split:category + (car (qif-xtn:splits current-xtn)))) + (qif-split:set-category! + (car (qif-xtn:splits current-xtn)) + "Opening Balance"))) + + ;; some special love for stock transactions + (if (and (qif-xtn:security-name current-xtn) + (string? (qif-xtn:number current-xtn))) + (begin + (cond + ((and + (or (string=? (qif-xtn:number current-xtn) + "ReinvDiv") + (string=? (qif-xtn:number current-xtn) + "ReinvLg") + (string=? (qif-xtn:number current-xtn) + "ReinvSh") + (string=? (qif-xtn:number current-xtn) + "Div")) + (string=? + "" (qif-split:category + (car + (qif-xtn:splits current-xtn))))) + (qif-split:set-category! + (car (qif-xtn:splits current-xtn)) + "Dividend") + ;; KLUDGE! for brokerage accounts + ;; where Dividend pays into the + ;; brokerage account. + (if (and (qif-xtn:bank-xtn? current-xtn) + (string? + (qif-xtn:security-name + current-xtn))) + (qif-xtn:set-payee! + current-xtn (qif-xtn:security-name + current-xtn)))) + + ((or (string=? (qif-xtn:number current-xtn) + "SellX") + (string=? (qif-xtn:number current-xtn) + "Sell")) + (let ((shrs (qif-xtn:num-shares current-xtn))) + (cond ((string? shrs) + (qif-xtn:set-num-shares! + current-xtn + (string-append "-" shrs))) + ((number? shrs) + (qif-xtn:set-num-shares! + current-xtn (- shrs))))))))) + + (set! first-xtn #f) + (set! current-xtn (make-qif-xtn)) + (set! default-split (make-qif-split))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -250,103 +261,103 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ((eq? qstate-type 'type:class) (case tag - ;; N : name - ((#\N) - (qif-class:set-name! current-xtn - (qif-file:parse-string self value))) - - ;; D : description - ((#\D) - (qif-class:set-description! - current-xtn (qif-file:parse-string self value))) - - ;; end-of-record - ((#\^) - (qif-file:add-class! self current-xtn) - (set! current-xtn (make-qif-class))) - - (else - (display "qif-file:read-file : unknown Class slot ") - (display tag) (newline)))) + ;; N : name + ((#\N) + (qif-class:set-name! current-xtn + (qif-file:parse-string self value))) + + ;; D : description + ((#\D) + (qif-class:set-description! + current-xtn (qif-file:parse-string self value))) + + ;; end-of-record + ((#\^) + (qif-file:add-class! self current-xtn) + (set! current-xtn (make-qif-class))) + + (else + (display "qif-file:read-file : unknown Class slot ") + (display tag) (newline)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Account definitions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ((eq? qstate-type 'account) (case tag - ((#\N) - (qif-acct:set-name! current-xtn - (qif-file:parse-string self value))) - ((#\D) - (qif-acct:set-description! - current-xtn (qif-file:parse-string self value))) - - ((#\T) - (qif-acct:set-type! - current-xtn (qif-file:parse-acct-type self value))) - - ((#\L) - (qif-acct:set-limit! - current-xtn (qif-file:parse-value/decimal self value))) - - ((#\^) - (qif-file:add-account! self current-xtn) -; (qif-acct:print current-xtn) - (set! current-xtn (make-qif-acct))) - - (else - (display "qif-file:read-file : unknown Account slot ") - (display tag) (newline)))) - + ((#\N) + (qif-acct:set-name! current-xtn + (qif-file:parse-string self value))) + ((#\D) + (qif-acct:set-description! + current-xtn (qif-file:parse-string self value))) + + ((#\T) + (qif-acct:set-type! + current-xtn (qif-file:parse-acct-type self value))) + + ((#\L) + (qif-acct:set-limit! + current-xtn (qif-file:parse-value/decimal self value))) + + ((#\^) + (qif-file:add-account! self current-xtn) +;;; (qif-acct:print current-xtn) + (set! current-xtn (make-qif-acct))) + + (else + (display "qif-file:read-file : unknown Account slot ") + (display tag) (newline)))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Category (Cat) transactions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ((eq? qstate-type 'type:cat) (case tag - ;; N : category name - ((#\N) - (qif-cat:set-name! current-xtn - (qif-file:parse-string self value))) - - ;; D : category description - ((#\D) - (qif-cat:set-description! current-xtn - (qif-file:parse-string - self value))) - - ;; E : is this a taxable category? - ((#\T) - (qif-cat:set-taxable! current-xtn #t)) - - ;; E : is this an expense category? - ((#\E) - (qif-cat:set-expense-cat! current-xtn #t)) - - ;; I : is this an income category? - ((#\I) - (qif-cat:set-income-cat! current-xtn #t)) - - ;; R : what is the tax rate (from some table? - ;; seems to be an integer) - ((#\R) - (qif-cat:set-tax-rate! - current-xtn (qif-file:parse-value/decimal self value))) - - ;; B : budget amount. not really supported. - ((#\B) - (qif-cat:set-budget-amt! - current-xtn (qif-file:parse-value/decimal self value))) - - ;; end-of-record - ((#\^) - (qif-file:add-cat! self current-xtn) -; (qif-cat:print current-xtn) - (set! current-xtn (make-qif-cat))) - - (else - (display "qif-file:read-file : unknown Cat slot ") - (display tag) (newline)))) + ;; N : category name + ((#\N) + (qif-cat:set-name! current-xtn + (qif-file:parse-string self value))) + + ;; D : category description + ((#\D) + (qif-cat:set-description! current-xtn + (qif-file:parse-string + self value))) + + ;; E : is this a taxable category? + ((#\T) + (qif-cat:set-taxable! current-xtn #t)) + + ;; E : is this an expense category? + ((#\E) + (qif-cat:set-expense-cat! current-xtn #t)) + + ;; I : is this an income category? + ((#\I) + (qif-cat:set-income-cat! current-xtn #t)) + + ;; R : what is the tax rate (from some table? + ;; seems to be an integer) + ((#\R) + (qif-cat:set-tax-rate! + current-xtn (qif-file:parse-value/decimal self value))) + + ;; B : budget amount. not really supported. + ((#\B) + (qif-cat:set-budget-amt! + current-xtn (qif-file:parse-value/decimal self value))) + + ;; end-of-record + ((#\^) + (qif-file:add-cat! self current-xtn) +;;; (qif-cat:print current-xtn) + (set! current-xtn (make-qif-cat))) + + (else + (display "qif-file:read-file : unknown Cat slot ") + (display tag) (newline)))) ;; trying to sneak one by, eh? (#t @@ -392,40 +403,33 @@ (if (eq? 'unknown (qif-file:account self)) (qif-file:set-account! self (qif-file:path-to-accountname self))) - + ;; reparse values and dates if we figured out the format. (let ((reparse-ok #t)) (for-each (lambda (xtn) - (set! reparse-ok - (and reparse-ok (qif-xtn:reparse xtn self)))) + (if (eq? reparse-ok #t) + (set! reparse-ok + (qif-xtn:reparse xtn self)))) (qif-file:xtns self)) - (if (not reparse-ok) - (begin - (display "xtn reparse failed") (newline))) - (for-each (lambda (cat) - (set! reparse-ok - (and reparse-ok (qif-cat:reparse cat self)))) + (if (eq? reparse-ok #t) + (set! reparse-ok + (qif-cat:reparse cat self)))) (qif-file:cats self)) - (if (not reparse-ok) - (begin - (display "cat reparse failed") (newline))) - (for-each (lambda (acct) - (set! reparse-ok - (and reparse-ok (qif-acct:reparse acct self)))) + (if (eq? reparse-ok #t) + (set! reparse-ok + (qif-acct:reparse acct self)))) (qif-file:accounts self)) - - (if (not reparse-ok) - (begin - (display "acct reparse failed") (newline))) + (display "reparse-ok == ") (write reparse-ok) (newline) reparse-ok)) (begin (display "There was a heinous error. Failed to read file.") (newline) #f)))) + diff --git a/src/scm/qif-import/qif-guess-map.scm b/src/scm/qif-import/qif-guess-map.scm index ebab258e82..f6bd287287 100644 --- a/src/scm/qif-import/qif-guess-map.scm +++ b/src/scm/qif-import/qif-guess-map.scm @@ -53,7 +53,9 @@ (let* ((name (gnc:account-get-name child-acct)) (fullname (if (string? root-name) - (string-append root-name ":" name) + (string-append root-name + (gnc:account-separator-char) + name) name))) (set! names (append (cons (list name fullname child-acct) diff --git a/src/scm/qif-import/qif-objects.scm b/src/scm/qif-import/qif-objects.scm index b0c7651061..9f070bd889 100644 --- a/src/scm/qif-import/qif-objects.scm +++ b/src/scm/qif-import/qif-objects.scm @@ -324,8 +324,12 @@ (if (or (string? (qif-xtn:share-price self)) (string? (qif-xtn:num-shares self)) (string? (qif-xtn:adjustment self))) - (set! reparse-ok #f)) - + (begin + (display "qif-import: failed to reparse stock info") + (newline) + (set! reparse-ok + (list #f "Could not autodetect radix format.")))) + ;; reparse the amount of each split (for-each (lambda (split) @@ -334,8 +338,11 @@ split (qif-file:parse-value qif-file (qif-split:amount split)))) (if (string? (qif-split:amount split)) - (set! reparse-ok #f))) - + (begin + (display "qif-import: failed to reparse value") + (write (qif-split:amount split)) (newline) + (set! reparse-ok + (list #f "Could not autodetect radix format."))))) (qif-xtn:splits self)) ;; reparse the date @@ -344,8 +351,11 @@ (qif-file:parse-date qif-file (qif-xtn:date self)))) (if (string? (qif-xtn:date self)) - (set! reparse-ok #f)) - + (begin + (display "qif-import: failed to reparse date") + (write (qif-xtn:date self)) (newline) + (set! reparse-ok + (list #f "Could not autodetect date format.")))) reparse-ok)) (define (qif-xtn:print self) @@ -403,7 +413,7 @@ self (qif-file:parse-value file (qif-acct:limit self)))) (if (or (string? (qif-acct:limit self)) (string? (qif-acct:type self))) - #f + (list #f "Could not autodetect radix for fields in Account record") #t)) @@ -518,7 +528,8 @@ (if (or (string? (qif-cat:tax-rate self)) (string? (qif-cat:budget-amt self))) - #f #t)) + (list #f "Could not autodetect radix for fields in Category record") + #t)) (define (qif-file:add-xtn! self xtn) diff --git a/src/scm/qif-import/qif-parse.scm b/src/scm/qif-import/qif-parse.scm index bd4505ccd0..36d718d380 100644 --- a/src/scm/qif-import/qif-parse.scm +++ b/src/scm/qif-import/qif-parse.scm @@ -1,4 +1,4 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; qif-parse.scm ;;; routines to parse values and dates in QIF files. ;;; @@ -199,11 +199,13 @@ (display "qif-import: Substituting 1/1/2999 for date.") (newline) (set! date-string "1/1/2999"))) + (set! date-string (string-remove-trailing-space date-string)) + (let ((date-parts '()) (numeric-date-parts '()) (retval date-string) (match - (string-match "([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+)" + (string-match "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+) *$" date-string))) (if match (set! date-parts (list (match:substring match 1) @@ -223,7 +225,7 @@ ((not (eq? 3 (length date-parts))) (begin (display "qif-file:parse-date : can't interpret date ") - (display date-string) (newline))) + (display date-string) (display " ") (write date-parts)(newline))) ;; if the format is unknown, don't try to fully interpret the ;; number, just look for a good guess or an inconsistency with @@ -254,7 +256,7 @@ (qif-file:set-guessed-date-format! self 'inconsistent)))) ;; current guess is y/d/m (is this really possible?) - ((eq? (qif-file:guessed-date-format self) 'y-m-d) + ((eq? (qif-file:guessed-date-format self) 'y-d-m) (let ((d (cadr numeric-date-parts)) (m (caddr numeric-date-parts))) (if (or (not (number? m)) (not (number? d)) (> m 12) (> d 31)) @@ -357,11 +359,11 @@ (define decimal-radix-regexp (make-regexp - "^-?[0-9]+$|^-?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)?$")) + "^\\$?-?\\$?[0-9]+$|^\\$?-?\\$?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)?$")) (define comma-radix-regexp (make-regexp - "^-?[0-9]+$|^-?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*)?$")) + "^\\$?-?\\$?[0-9]+$|^\\$?-?\\$?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*)?$")) (define (value-is-decimal-radix? value) (if (regexp-exec decimal-radix-regexp value) @@ -371,19 +373,35 @@ (if (regexp-exec comma-radix-regexp value) #t #f)) - (define (qif-file:parse-value/decimal self value-string) - (+ 0.0 - (with-input-from-string (string-remove-char value-string #\,) - (lambda () (read))))) - + (set! value-string (string-remove-trailing-space value-string)) + (if (value-is-decimal-radix? value-string) + (let ((read-val + (with-input-from-string + (string-remove-char + (string-remove-char value-string #\,) + #\$) + (lambda () (read))))) + (if (number? read-val) + (+ 0.0 read-val) + #f)) + #f)) (define (qif-file:parse-value/comma self value-string) - (+ 0.0 - (with-input-from-string - (string-replace-char! (string-remove-char value-string #\.) - #\, #\.) - (lambda () (read))))) + (set! value-string (string-remove-trailing-space value-string)) + (if (value-is-comma-radix? value-string) + (let ((read-val + (with-input-from-string + (string-remove-char + (string-replace-char! + (string-remove-char value-string #\.) + #\, #\.) + #\$) + (lambda () (read))))) + (if (number? read-val) + (+ 0.0 read-val) + #f)) + #f)) (define (qif-file:parse-value self value-string) (if (or (not (string? value-string)) diff --git a/src/scm/qif-import/qif-to-gnc.scm b/src/scm/qif-import/qif-to-gnc.scm index fda96b22c3..72a1f4767a 100644 --- a/src/scm/qif-import/qif-to-gnc.scm +++ b/src/scm/qif-import/qif-to-gnc.scm @@ -17,15 +17,16 @@ (define (qif-import:find-or-make-acct gnc-name gnc-acct-hash gnc-type qif-info acct-group) - (let ((existing-account (hash-ref gnc-acct-hash gnc-name)) - (same-gnc-account (gnc:get-account-from-full-name acct-group - gnc-name - #\:)) - (check-full-name #f) - (make-new-acct #f) - (default-currency - (gnc:option-value - (gnc:lookup-global-option "International" "Default Currency")))) + (let* ((separator (string-ref (gnc:account-separator-char) 0)) + (existing-account (hash-ref gnc-acct-hash gnc-name)) + (same-gnc-account (gnc:get-account-from-full-name acct-group + gnc-name + separator)) + (check-full-name #f) + (make-new-acct #f) + (default-currency + (gnc:option-value + (gnc:lookup-global-option "International" "Default Currency")))) (if (or (pointer-token-null? same-gnc-account) (and (not (pointer-token-null? same-gnc-account)) @@ -45,11 +46,11 @@ (parent-name #f) (acct-name #f) (last-colon #f)) - (set! last-colon (string-rindex gnc-name #\:)) - + (set! last-colon (string-rindex gnc-name separator)) + (gnc:init-account new-acct) (gnc:account-begin-edit new-acct 1) - + ;; if this is a copy of an existing gnc account, ;; copy the account properties (if (not make-new-acct) diff --git a/src/scm/qif-import/qif-utils.scm b/src/scm/qif-import/qif-utils.scm index 51d5eab31f..2a040b3466 100644 --- a/src/scm/qif-import/qif-utils.scm +++ b/src/scm/qif-import/qif-utils.scm @@ -39,9 +39,16 @@ (define (string-remove-char str char) (let ((rexpstr - (if (not (eq? char #\.)) - (make-string 1 char) - "\\."))) + (case char + ((#\.) "\\.") + ((#\^) "\\^") + ((#\$) "\\$") + ((#\*) "\\*") + ((#\+) "\\+") + ((#\\) "\\\\") + ((#\?) "\\?") + (else + (make-string 1 char))))) (regexp-substitute/global #f rexpstr str 'pre 'post))) (define (string-char-count str char)