mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Mac OS X support, round 2.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6878 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
094b57930f
commit
59e52d8714
19
ChangeLog
19
ChangeLog
@ -1,3 +1,22 @@
|
|||||||
|
2002-05-18 David Hampton <hampton@employees.org>
|
||||||
|
|
||||||
|
* configure.in: Work around incompatibilities between autoconf
|
||||||
|
2.52 and 2.53 wrt creating the LIBLTOBJS variable.
|
||||||
|
|
||||||
|
* ltmain.sh: Mac OS X tweaks.
|
||||||
|
|
||||||
|
* libc/Makefile.am: Use LIBLTOBJS instead of LIBOBJS.
|
||||||
|
|
||||||
|
* src/backend/file/sixtp-utils.c (string_to_gint64):
|
||||||
|
(string_to_gint32): (string_to_timespec_nsecs): Work around bugs
|
||||||
|
in Mac OS X version of sscanf.
|
||||||
|
|
||||||
|
* src/gnome/druid-hierarchy.c (gnc_get_ea_locale_dir): Work around
|
||||||
|
lack of LC_MESSAGES on Mac OS X.
|
||||||
|
|
||||||
|
* src/scm/main.scm (local-prefixes): Work around
|
||||||
|
lack of LC_MESSAGES on Mac OS X.
|
||||||
|
|
||||||
2002-05-14 David Hampton <hampton@employees.org>
|
2002-05-14 David Hampton <hampton@employees.org>
|
||||||
|
|
||||||
* configure.in (AC_CANONICAL_HOST): Remove redundant command.
|
* configure.in (AC_CANONICAL_HOST): Remove redundant command.
|
||||||
|
34
configure.in
34
configure.in
@ -805,6 +805,40 @@ chmod u+x src/bin/overrides/gnucash-make-guids
|
|||||||
### --------------------------------------------------------------------------
|
### --------------------------------------------------------------------------
|
||||||
### Makefile creation
|
### Makefile creation
|
||||||
|
|
||||||
|
#
|
||||||
|
# God, this is ugly....
|
||||||
|
#
|
||||||
|
# The libtool 2.52 and 2.53 info pages specify two different
|
||||||
|
# *incompatible* ways to create the LTLIBOBJS variable. 2.53 makes it
|
||||||
|
# an error to directly access the LIBOBJS variable, but then provides
|
||||||
|
# a hack to get past this test by introducing the four character
|
||||||
|
# sequence '@&t@' that expands to the empty string. This expansion
|
||||||
|
# occurs *after* the LIBOBJS usage test has taken place.
|
||||||
|
# Unfortunately, the '@&t@' sequence doesn't exist in 2.52, so we're
|
||||||
|
# stuck with this big ugly version check. Sigh! At some point in the
|
||||||
|
# future, Autoconf 2.53 can be made a required version and this code
|
||||||
|
# can be cleaned up.
|
||||||
|
#
|
||||||
|
# This is necessary so that .o files in LIBOBJS are also built via
|
||||||
|
# the ANSI2KNR-filtering rules.
|
||||||
|
|
||||||
|
AUTOCONF_VERSION=`autoconf --version`
|
||||||
|
autoconf_major_version=`echo ${AUTOCONF_VERSION} | \
|
||||||
|
sed 's/^.*GNU Autoconf.* \([[0-9]]*\)\.\([[0-9]]*\).*$/\1/'`
|
||||||
|
autoconf_minor_version=`echo ${AUTOCONF_VERSION} | \
|
||||||
|
sed 's/^.*GNU Autoconf.* \([[0-9]]*\)\.\([[0-9]]*\).*$/\2/'`
|
||||||
|
if test $autoconf_major_version -gt 2 -o \
|
||||||
|
\( $autoconf_major_version -eq 2 -a \
|
||||||
|
$autoconf_minor_version -gt 52 \) ; then
|
||||||
|
LIB@&t@OBJS=`echo "$LIB@&t@OBJS" |
|
||||||
|
sed 's,\.[[^.]]* ,$U&,g;s,\.[[^.]]*$,$U&,'`
|
||||||
|
LTLIBOBJS=`echo "$LIB@&t@OBJS" |
|
||||||
|
sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
|
||||||
|
else
|
||||||
|
LTLIBOBJS=`echo "$LIBOBJS" | sed 's,\.[[^.]]* ,.lo ,g;s,\.[[^.]]*$,.lo,'`
|
||||||
|
fi
|
||||||
|
AC_SUBST(LTLIBOBJS)
|
||||||
|
|
||||||
AC_OUTPUT( m4/Makefile intl/Makefile
|
AC_OUTPUT( m4/Makefile intl/Makefile
|
||||||
dnl # Makefiles
|
dnl # Makefiles
|
||||||
Makefile
|
Makefile
|
||||||
|
@ -9,7 +9,7 @@ libc_missing_la_SOURCES = libc-missing-noop.c
|
|||||||
|
|
||||||
# This will automatically be filled in with the necessary object file
|
# This will automatically be filled in with the necessary object file
|
||||||
# names. Configure does this based upon the AC_REPLACE_FUNCS macros.
|
# names. Configure does this based upon the AC_REPLACE_FUNCS macros.
|
||||||
libc_missing_la_LIBADD = @LIBOBJS@
|
libc_missing_la_LIBADD = @LTLIBOBJS@
|
||||||
|
|
||||||
# Not currently used. If added to AC_REPLACE_FUNCS then this line
|
# Not currently used. If added to AC_REPLACE_FUNCS then this line
|
||||||
# should be removed.
|
# should be removed.
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#if !HAVE_LOCALTIME_R
|
#if !HAVE_LOCALTIME_R
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "localtime_r.h"
|
||||||
|
|
||||||
#if HAVE_PTHREAD_MUTEX_INIT
|
#if HAVE_PTHREAD_MUTEX_INIT
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
11
ltmain.sh
11
ltmain.sh
@ -3296,7 +3296,18 @@ EOF
|
|||||||
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
|
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
|
||||||
eval cmds=\"$archive_expsym_cmds\"
|
eval cmds=\"$archive_expsym_cmds\"
|
||||||
else
|
else
|
||||||
|
save_deplibs="$deplibs"
|
||||||
|
for conv in $convenience; do
|
||||||
|
tmp_deplibs=
|
||||||
|
for test_deplib in $deplibs; do
|
||||||
|
if test "$test_deplib" != "$conv"; then
|
||||||
|
tmp_deplibs="$tmp_deplibs $test_deplib"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
deplibs="$tmp_deplibs"
|
||||||
|
done
|
||||||
eval cmds=\"$archive_cmds\"
|
eval cmds=\"$archive_cmds\"
|
||||||
|
deplibs="$save_deplibs"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if len=`expr "X$cmds" : ".*"` &&
|
if len=`expr "X$cmds" : ".*"` &&
|
||||||
|
@ -8,6 +8,7 @@ AM_CFLAGS = \
|
|||||||
-I${top_srcdir}/src/engine \
|
-I${top_srcdir}/src/engine \
|
||||||
-I${top_srcdir}/src/gnc-module \
|
-I${top_srcdir}/src/gnc-module \
|
||||||
-I${top_srcdir}/src/core-utils\
|
-I${top_srcdir}/src/core-utils\
|
||||||
|
-I${top_srcdir}/lib/libc\
|
||||||
${GLIB_CFLAGS}
|
${GLIB_CFLAGS}
|
||||||
|
|
||||||
libgncmod_backend_file_la_SOURCES = \
|
libgncmod_backend_file_la_SOURCES = \
|
||||||
|
@ -41,6 +41,12 @@
|
|||||||
#include "guid.h"
|
#include "guid.h"
|
||||||
#include "gnc-numeric.h"
|
#include "gnc-numeric.h"
|
||||||
#include "gnc-engine-util.h"
|
#include "gnc-engine-util.h"
|
||||||
|
#ifndef HAVE_STRPTIME
|
||||||
|
#include "strptime.h"
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_LOCALTIME_R
|
||||||
|
#include "localtime_r.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
static short module = MOD_IO;
|
static short module = MOD_IO;
|
||||||
|
|
||||||
@ -214,10 +220,19 @@ string_to_gint64(const gchar *str, gint64 *v)
|
|||||||
g_return_val_if_fail(str, FALSE);
|
g_return_val_if_fail(str, FALSE);
|
||||||
|
|
||||||
/* must use "<" here because %n's effects aren't well defined */
|
/* must use "<" here because %n's effects aren't well defined */
|
||||||
if(sscanf(str, " " GNC_SCANF_LLD " %n", &v_in, &num_read) < 1) {
|
if(sscanf(str, " " GNC_SCANF_LLD "%n", &v_in, &num_read) < 1) {
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mac OS X version 10.1 and under has a silly bug where scanf
|
||||||
|
* returns bad values in num_read if there is a space before %n. It
|
||||||
|
* is fixed in the next release 10.2 afaik
|
||||||
|
*/
|
||||||
|
while( (*((gchar*)str + num_read)!='\0') &&
|
||||||
|
isspace(*((char*)str + num_read)))
|
||||||
|
num_read++;
|
||||||
|
|
||||||
if (v)
|
if (v)
|
||||||
*v = v_in;
|
*v = v_in;
|
||||||
|
|
||||||
@ -237,9 +252,12 @@ string_to_gint32(const gchar *str, gint32 *v)
|
|||||||
int v_in;
|
int v_in;
|
||||||
|
|
||||||
/* must use "<" here because %n's effects aren't well defined */
|
/* must use "<" here because %n's effects aren't well defined */
|
||||||
if(sscanf(str, " %d %n", &v_in, &num_read) < 1) {
|
if(sscanf(str, " %d%n", &v_in, &num_read) < 1) {
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
while( (*((gchar*)str + num_read)!='\0') &&
|
||||||
|
isspace(*((char*)str + num_read)))
|
||||||
|
num_read++;
|
||||||
|
|
||||||
if (v)
|
if (v)
|
||||||
*v = v_in;
|
*v = v_in;
|
||||||
@ -475,14 +493,17 @@ string_to_timespec_secs(const gchar *str, Timespec *ts) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
string_to_timespec_nsecs(const gchar *str, Timespec *ts) {
|
string_to_timespec_nsecs(const gchar *str, Timespec *ts)
|
||||||
|
{
|
||||||
long int nanosecs;
|
long int nanosecs;
|
||||||
int charcount;
|
int charcount;
|
||||||
|
|
||||||
if (!str || !ts) return FALSE;
|
if (!str || !ts) return FALSE;
|
||||||
|
|
||||||
sscanf(str, " %ld %n", &nanosecs, &charcount);
|
sscanf(str, " %ld%n", &nanosecs, &charcount);
|
||||||
|
while( (*((gchar*)str + charcount)!='\0') &&
|
||||||
|
isspace(*((char*)str + charcount)))
|
||||||
|
charcount++;
|
||||||
|
|
||||||
if(charcount != strlen(str)) return(FALSE);
|
if(charcount != strlen(str)) return(FALSE);
|
||||||
|
|
||||||
|
@ -2,7 +2,10 @@ SUBDIRS = . test-core test
|
|||||||
|
|
||||||
pkglib_LTLIBRARIES = libgw-engine.la libgw-kvp.la libgncmod-engine.la
|
pkglib_LTLIBRARIES = libgw-engine.la libgw-kvp.la libgncmod-engine.la
|
||||||
|
|
||||||
AM_CFLAGS = -I${top_srcdir}/src/gnc-module ${GNUCASH_ENGINE_CFLAGS}
|
AM_CFLAGS = \
|
||||||
|
-I${top_srcdir}/lib/libc \
|
||||||
|
-I${top_srcdir}/src/gnc-module \
|
||||||
|
${GNUCASH_ENGINE_CFLAGS}
|
||||||
|
|
||||||
libgncmod_engine_la_SOURCES = \
|
libgncmod_engine_la_SOURCES = \
|
||||||
Account.c \
|
Account.c \
|
||||||
|
@ -46,6 +46,13 @@
|
|||||||
#include "date.h"
|
#include "date.h"
|
||||||
#include "gnc-engine-util.h"
|
#include "gnc-engine-util.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_STRPTIME
|
||||||
|
#include "strptime.h"
|
||||||
|
#endif
|
||||||
|
#ifndef HAVE_LOCALTIME_R
|
||||||
|
#include "localtime_r.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NANOS_PER_SECOND 1000000000
|
#define NANOS_PER_SECOND 1000000000
|
||||||
|
|
||||||
#ifdef HAVE_LANGINFO_D_FMT
|
#ifdef HAVE_LANGINFO_D_FMT
|
||||||
|
@ -312,7 +312,16 @@ gnc_get_ea_locale_dir(const char *top_dir)
|
|||||||
gchar *locale;
|
gchar *locale;
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
|
|
||||||
|
#ifdef HAVE_LC_MESSAGES
|
||||||
locale = g_strdup(setlocale(LC_MESSAGES, NULL));
|
locale = g_strdup(setlocale(LC_MESSAGES, NULL));
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* Mac OS X 10.1 and earlier, not only doesn't have LC_MESSAGES
|
||||||
|
* setlocale can sometimes return NULL instead of "C"
|
||||||
|
*/
|
||||||
|
locale = g_strdup(setlocale(LC_ALL, NULL) ?
|
||||||
|
setlocale(LC_ALL, NULL) : "C");
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
ret = g_strdup_printf("%s/%s", top_dir, locale);
|
||||||
|
|
||||||
|
@ -314,7 +314,10 @@ string and 'directories' must be a list of strings."
|
|||||||
;; thereof.
|
;; thereof.
|
||||||
|
|
||||||
(define (locale-prefixes)
|
(define (locale-prefixes)
|
||||||
(let* ((locale (setlocale LC_MESSAGES))
|
;; Mac OS X. 10.1 and earlier don't have LC_MESSAGES. Fall back to
|
||||||
|
;; LC_ALL for those systems.
|
||||||
|
(let* ((locale (or (false-if-exception (setlocale LC_MESSAGES))
|
||||||
|
(setlocale LC_ALL)))
|
||||||
(strings (cond ((not (string? locale)) ())
|
(strings (cond ((not (string? locale)) ())
|
||||||
((equal? locale "C") ())
|
((equal? locale "C") ())
|
||||||
((<= (string-length locale) 4) (list locale))
|
((<= (string-length locale) 4) (list locale))
|
||||||
|
Loading…
Reference in New Issue
Block a user