diff --git a/.gitignore b/.gitignore index 45b238c..48d7622 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ config.guess config.sub libtool 4store-0.pc +build +root diff --git a/Makefile.am b/Makefile.am index 40a5567..20b2294 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,6 +7,7 @@ test: all (cd tests && $(MAKE) -w $@) macapp: all + app-aux/build-static.pl app-aux/build-app.sh macdmg: macapp diff --git a/app-aux/build-app.sh b/app-aux/build-app.sh index 7cbcdd1..4d2c30a 100755 --- a/app-aux/build-app.sh +++ b/app-aux/build-app.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -rf 4store.app -mkdir -p 4store.app/Contents/Resources 4store.app/Contents/MacOS/{bin,lib} +mkdir -p 4store.app/Contents/Resources 4store.app/Contents/MacOS/bin bv=`cat app-aux/bundle-version` bv=`expr $bv + 1` echo $bv > app-aux/bundle-version @@ -11,17 +11,8 @@ version=`git describe --tags --always | sed 's/^v//; s/-.*//'` sed -e 's/${AV}/'$version'/' -i "" 4store.app/Contents/Info.plist cp -r app-aux/Resources/* 4store.app/Contents/Resources/ cp app-aux/MacOS/* 4store.app/Contents/MacOS/ -for i in src/frontend/4s-* src/backend/4s-* src/utilities/4s-{backend,cluster}-* src/utilities/4s-{dump,restore} src/http/4s-*; do +for i in root/bin/4s-*; do if test -x $i ; then cp $i 4store.app/Contents/MacOS/bin/ fi done -cp -p /usr/local/lib/librasqal*.dylib /usr/local/lib/libraptor2*.dylib \ - /sw/lib/libxslt.1*.dylib \ - /sw/lib/libgthread-2*.dylib \ - /sw/lib/libglib-2*.dylib \ - /sw/lib/libintl.3*.dylib \ - /sw/lib/libpcre.0*.dylib \ - /sw/lib/libreadline.5*.dylib \ - /sw/lib/ncurses/libncurses*.dylib \ - 4store.app/Contents/MacOS/lib/ diff --git a/app-aux/build-static.pl b/app-aux/build-static.pl new file mode 100755 index 0000000..b643379 --- /dev/null +++ b/app-aux/build-static.pl @@ -0,0 +1,326 @@ +#!/usr/bin/perl + +use File::Basename; +use Cwd; +use strict; +use warnings; + +my $TOP_DIR = Cwd::realpath(dirname(__FILE__).'/..'); +my $BUILD_DIR = "$TOP_DIR/build"; +my $ROOT_DIR = "$TOP_DIR/root"; +my $DEFAULT_CONFIGURE_ARGS = "--enable-static --disable-shared --prefix=$ROOT_DIR ". + "--disable-gtk-doc --disable-dependency-tracking ". + "--disable-rebuilds"; + +my $packages = [ + { + 'url' => 'http://pkgconfig.freedesktop.org/releases/pkg-config-0.25.tar.gz', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --with-pc-path=${ROOT_DIR}/lib/pkgconfig", + 'checkfor' => 'bin/pkg-config', + }, + { + 'url' => 'http://curl.haxx.se/download/curl-7.21.7.tar.gz', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS ". + "--disable-ssh --disable-ldap --disable-ldaps --disable-rtsp ". + "--without-librtmp --disable-dict --disable-telnet --disable-pop3 ". + "--disable-imap --disable-smtp --disable-manual --without-libssh2", + 'checkfor' => 'lib/pkgconfig/libcurl.pc', + }, + { + 'url' => 'http://kent.dl.sourceforge.net/project/pcre/pcre/8.12/pcre-8.12.tar.bz2', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --enable-utf8 ". + "--enable-unicode-properties --enable-pcregrep-libz ". + "--enable-pcregrep-libbz2", + 'checkfor' => 'lib/pkgconfig/libpcre.pc' + }, + { + # NOTE: libxml2-2.7.8 doesn't seem to work with Mac OS 10.6 zlib + 'url' => 'http://xmlsoft.org/sources/libxml2-2.7.6.tar.gz', + 'checkfor' => 'lib/pkgconfig/libxml-2.0.pc', + }, + { + 'url' => 'http://xmlsoft.org/sources/libxslt-1.1.26.tar.gz', + 'checkfor' => 'lib/pkgconfig/libxslt.pc', + }, + { + 'url' => 'http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz', + 'patch' => 'gettext.patch', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --disable-debug ". + "--without-included-gettext --without-included-glib ". + "--without-included-libcroco --without-included-libxml ". + "--without-emacs --disable-java", + 'checkfor' => 'lib/libgettextlib.la', + }, +# { +# 'url' => 'http://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz', +# 'checkfor' => 'lib/libreadline.a', +# }, + { + 'url' => 'ftp://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.8.tar.bz2', + 'patch' => 'glib2.patch', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --disable-selinux && ". + "ed - config.h < ${TOP_DIR}/app-aux/glib2-config.h.ed", + 'checkfor' => 'lib/pkgconfig/glib-2.0.pc', + }, + { + 'url' => 'http://github.com/lloyd/yajl/tarball/1.0.12', + 'dirname' => 'lloyd-yajl-17b1790', + 'tarname' => 'yajl-1.0.12.tar.gz', + 'config' => "mkdir build && cd build && /usr/local/bin/cmake ..", + 'make' => "cd build && make yajl_s", + 'install' => "cd build/yajl-1.0.12 && ". + "cp -Rfv include/yajl ${ROOT_DIR}/include/ && ". + "cp -fv lib/libyajl_s.a ${ROOT_DIR}/lib/libyajl.a", + 'checkfor' => 'lib/libyajl.a', + }, + { + 'url' => 'http://download.librdf.org/source/raptor2-2.0.4.tar.gz', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --with-yajl=${ROOT_DIR}", + 'checkfor' => 'lib/pkgconfig/raptor2.pc', + }, + { + 'url' => 'http://download.librdf.org/source/rasqal-0.9.27.tar.gz', + 'config' => "./configure $DEFAULT_CONFIGURE_ARGS --enable-raptor2", + 'checkfor' => 'lib/pkgconfig/rasqal.pc', + }, + { + 'name' => '4store', + 'dirpath' => $TOP_DIR, + 'test' => 'make check', + 'checkfor' => 'lib/pkgconfig/4store-0.pc', + 'alwaysbuild' => 1, + }, +]; + +# Reset environment variables +$ENV{'CFLAGS'} = "-O2 -I${ROOT_DIR}/include"; +$ENV{'CPPFLAGS'} = "-I${ROOT_DIR}/include"; +$ENV{'ASFLAGS'} = "-I${ROOT_DIR}/include"; +$ENV{'LDFLAGS'} = "-L${ROOT_DIR}/lib"; +$ENV{'INFOPATH'} = "${ROOT_DIR}/share/info"; +$ENV{'MANPATH'} = "${ROOT_DIR}/share/man"; +$ENV{'M4PATH'} = "${ROOT_DIR}/share/aclocal"; +$ENV{'PATH'} = "${ROOT_DIR}/bin:/usr/bin:/bin"; +$ENV{'PKG_CONFIG_PATH'} = "${ROOT_DIR}/lib/pkgconfig"; +$ENV{'CLASSPATH'} = ''; + +# Add extra CFLAGS if this is Mac OS X +if (`uname` =~ /^Darwin/) { + die "Mac OS X Developer Tools are not available." unless (-e '/Developer/'); + + # Build x86_64 only binary against 10.5+ + my $SDK; + my $SDKver; + for my $ver ('10.5', '10.6') { + if (-d "/Developer/SDKs/MacOSX${ver}.sdk") { + $SDKver = $ver; + $SDK = "/Developer/SDKs/MacOSX${ver}.sdk"; + last; + } + } + die "Mac OS X SDK is not available." unless ($SDK); + my $ARCHES = '-arch x86_64'; + my $MINVER = "-mmacosx-version-min=$SDKver"; + + $ENV{'CFLAGS'} .= " -isysroot $SDK $ARCHES $MINVER"; + $ENV{'LDFLAGS'} .= " -Wl,-syslibroot,$SDK $ARCHES $MINVER"; + $ENV{'CFLAGS'} .= " -force_cpusubtype_ALL"; + $ENV{'LDFLAGS'} .= " -Wl,-headerpad_max_install_names"; + $ENV{'MACOSX_DEPLOYMENT_TARGET'} = $SDKver; + $ENV{'CMAKE_OSX_ARCHITECTURES'} = 'x86_64'; + + my $GCC_VER = '4.2'; + $ENV{'CC'} = "/Developer/usr/bin/gcc-$GCC_VER"; + $ENV{"CPP"} = "/Developer/usr/bin/cpp-$GCC_VER"; + $ENV{"CXX"} = "/Developer/usr/bin/g++-$GCC_VER"; + die "gcc version $GCC_VER is not available." unless (-e $ENV{'CC'}); +} + +$ENV{'CXXFLAGS'} = $ENV{'CFLAGS'}; + +print "Build directory: $BUILD_DIR\n"; +mkdir($BUILD_DIR); + +print "Root directory: $ROOT_DIR\n"; +mkdir($ROOT_DIR); +mkdir($ROOT_DIR.'/bin'); +mkdir($ROOT_DIR.'/include'); +mkdir($ROOT_DIR.'/lib'); +mkdir($ROOT_DIR.'/share'); + +gtkdoc_hack($ROOT_DIR); + + +foreach my $pkg (@$packages) { + if (defined $pkg->{'url'} and !defined $pkg->{'tarname'}) { + ($pkg->{'tarname'}) = ($pkg->{'url'} =~ /([^\/]+)$/); + } + if (defined $pkg->{'tarname'} and !defined $pkg->{'tarpath'}) { + $pkg->{'tarpath'} = $BUILD_DIR.'/'.$pkg->{'tarname'}; + } + if (defined $pkg->{'tarname'} and !defined $pkg->{'dirname'}) { + ($pkg->{'dirname'}) = ($pkg->{'tarname'} =~ /^([\w\.\-]+[\d\.\-]+\d)/); + $pkg->{'dirname'} =~ s/_/\-/g; + } + if (defined $pkg->{'dirname'} and !defined $pkg->{'dirpath'}) { + $pkg->{'dirpath'} = $BUILD_DIR.'/'.$pkg->{'dirname'}; + } + if (defined $pkg->{'dirname'} and !defined $pkg->{'name'}) { + $pkg->{'name'} = $pkg->{'dirname'}; + } + + unless ($pkg->{'alwaysbuild'} or defined $pkg->{'checkfor'}) { + die "Don't know how to check if ".$pkg->{'name'}." is already built."; + } + + if ($pkg->{'alwaysbuild'} or !-e $ROOT_DIR.'/'.$pkg->{'checkfor'}) { + download_package($pkg) if (defined $pkg->{'url'}); + extract_package($pkg) if (defined $pkg->{'tarpath'}); + clean_package($pkg); + patch_package($pkg); + config_package($pkg); + make_package($pkg); + test_package($pkg); + install_package($pkg); + + if (defined $pkg->{'checkfor'} && !-e $ROOT_DIR.'/'.$pkg->{'checkfor'}) { + die "Installing $pkg->{'name'} failed."; + } + } +} + +print "Finished compiling:\n"; +foreach my $pkg (sort {$a->{'name'} cmp $b->{'name'}} @$packages) { + print " * ".$pkg->{'name'}."\n"; +} + + +sub extract_package { + my ($pkg) = @_; + if (-e $pkg->{'dirpath'}) { + print "Deleting old: $pkg->{'dirpath'}\n"; + safe_system('rm', '-Rf', $pkg->{'dirpath'}); + } + + safe_chdir(); + print "Extracting: $pkg->{'tarname'} into $pkg->{'dirpath'}\n"; + if ($pkg->{'tarname'} =~ /bz2$/) { + safe_system('tar', '-jxf', $pkg->{'tarpath'}); + } elsif ($pkg->{'tarname'} =~ /gz$/) { + safe_system('tar', '-zxf', $pkg->{'tarpath'}); + } else { + die "Don't know how to decomress archive."; + } +} + +sub download_package { + my ($pkg) = @_; + + unless (-e $pkg->{'tarpath'}) { + safe_chdir(); + print "Downloading: ".$pkg->{'tarname'}."\n"; + safe_system('curl', '-L', '-k', '-o', $pkg->{'tarpath'}, $pkg->{'url'}); + } +} + +sub clean_package { + my ($pkg) = @_; + + safe_chdir($pkg->{'dirpath'}); + print "Cleaning: ".$pkg->{'name'}."\n"; + if ($pkg->{'clean'}) { + system($pkg->{'clean'}); + } else { + # this is allowed to fail + system('make', 'clean') if (-e 'Makefile'); + } +} + +sub patch_package { + my ($pkg) = @_; + if ($pkg->{'patch'}) { + safe_chdir($pkg->{'dirpath'}); + my $patchfile = $TOP_DIR.'/app-aux/'.$pkg->{'patch'}; + safe_system("patch -p0 < $patchfile"); + } +} + +sub config_package { + my ($pkg) = @_; + + safe_chdir($pkg->{'dirpath'}); + print "Configuring: ".$pkg->{'name'}."\n"; + if ($pkg->{'config'}) { + safe_system($pkg->{'config'}); + } else { + if (-e "./configure") { + safe_system("./configure $DEFAULT_CONFIGURE_ARGS"); + } elsif (-e "./autogen.sh") { + safe_system("./autogen.sh $DEFAULT_CONFIGURE_ARGS"); + } else { + die "Don't know how to configure ".$pkg->{'name'}; + } + } +} + +sub make_package { + my ($pkg) = @_; + + safe_chdir($pkg->{'dirpath'}); + print "Making: ".$pkg->{'name'}."\n"; + if ($pkg->{'make'}) { + safe_system($pkg->{'make'}); + } else { + safe_system('make'); + } +} + +sub test_package { + my ($pkg) = @_; + + safe_chdir($pkg->{'dirpath'}); + if ($pkg->{'test'}) { + print "Testing: ".$pkg->{'name'}."\n"; + safe_system($pkg->{'test'}); + } +} + +sub install_package { + my ($pkg) = @_; + + safe_chdir($pkg->{'dirpath'}); + print "Installing: ".$pkg->{'name'}."\n"; + if ($pkg->{'install'}) { + safe_system($pkg->{'install'}); + } else { + safe_system('make','install'); + } +} + +sub safe_chdir { + my ($dir) = @_; + $dir = $BUILD_DIR unless defined $dir; + print "Changing to: $dir\n"; + chdir($dir) or die "Failed to change directory: $!"; +} + +sub safe_system { + my (@cmd) = @_; + print "Running: ".join(' ',@cmd)."\n"; + if (system(@cmd)) { + die "Command failed"; + } +} + + +# HACK to fix bad gtkdoc detection +sub gtkdoc_hack { + my ($dir) = @_; + my $script = "$dir/bin/gtkdoc-rebase"; + + open(SCRIPT, ">$script") or die "Failed to open $script: $!"; + print SCRIPT "#/bin/sh\n"; + close(SCRIPT); + + chmod(0755, $script) or die "Failed to chmod 0755 $script: $!"; +} diff --git a/app-aux/bundle-version b/app-aux/bundle-version index 0234b51..9e42f3e 100644 --- a/app-aux/bundle-version +++ b/app-aux/bundle-version @@ -1 +1 @@ -162 +165 diff --git a/app-aux/gettext.patch b/app-aux/gettext.patch new file mode 100644 index 0000000..1be3404 --- /dev/null +++ b/app-aux/gettext.patch @@ -0,0 +1,24 @@ +--- gettext-tools/Makefile.in.orig 2010-06-03 16:38:55.000000000 -0500 ++++ gettext-tools/Makefile.in 2010-06-04 01:16:07.000000000 -0500 +@@ -1248,7 +1248,7 @@ + top_srcdir = @top_srcdir@ + AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies + ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 +-SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests examples ++SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests + + # Allow users to use "gnulib-tool --update". + +diff -Naurp gettext-0.18.1.1.orig/gettext-tools/configure gettext-0.18.1.1/gettext-tools/configure +--- gettext-tools/configure 2010-06-06 13:12:20.000000000 -0700 ++++ gettext-tools/configure 2010-08-13 23:24:09.000000000 -0700 +@@ -40606,7 +40606,9 @@ else + #include + #include /* for strcpy */ + /* The stpncpy prototype is missing in on AIX 4. */ ++#ifndef stpncpy + extern char *stpncpy (char *dest, const char *src, size_t n); ++#endif + int main () { + const char *src = "Hello"; + char dest[10]; diff --git a/app-aux/glib2-config.h.ed b/app-aux/glib2-config.h.ed new file mode 100644 index 0000000..38731d4 --- /dev/null +++ b/app-aux/glib2-config.h.ed @@ -0,0 +1,89 @@ +/ AC_APPLE_UNIVERSAL_BUILD /c +/* #undef AC_APPLE_UNIVERSAL_BUILD */ +. +/ ASM_NUMERIC_LABELS /c +#ifdef __BIG_ENDIAN__ +#define ASM_NUMERIC_LABELS 1 +#else +/* #undef ASM_NUMERIC_LABELS */ +#endif +. +/ GLIB_BYTE_CONTENTS_GMUTEX /c +#ifdef __LP64__ +#ifdef __BIG_ENDIAN__ +#define GLIB_BYTE_CONTENTS_GMUTEX 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +#else +#define GLIB_BYTE_CONTENTS_GMUTEX -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +#endif +#else +#ifdef __BIG_ENDIAN__ +#define GLIB_BYTE_CONTENTS_GMUTEX 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +#else +#define GLIB_BYTE_CONTENTS_GMUTEX -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +#endif +#endif +. +/ GLIB_SIZEOF_GMUTEX /c +#ifdef __LP64__ +#define GLIB_SIZEOF_GMUTEX 64 +#else +#define GLIB_SIZEOF_GMUTEX 44 +#endif +. +/ GLIB_SIZEOF_SYSTEM_THREAD /c +#ifdef __LP64__ +#define GLIB_SIZEOF_SYSTEM_THREAD 8 +#else +#define GLIB_SIZEOF_SYSTEM_THREAD 4 +#endif +. +/ G_ATOMIC_I486 /c +#if !defined(__BIG_ENDIAN__) && !defined(__LP64__) +#define G_ATOMIC_I486 +#else +/* #undef G_ATOMIC_I486 */ +#endif +. +/ G_ATOMIC_POWERPC /c +#ifdef __BIG_ENDIAN__ +#define G_ATOMIC_POWERPC 1 +#else +/* #undef G_ATOMIC_POWERPC */ +#endif +. +/ G_ATOMIC_X86_64 /c +#if !defined(__BIG_ENDIAN__) && defined(__LP64__) +#define G_ATOMIC_X86_64 +#else +/* #undef G_ATOMIC_X86_64 */ +#endif +. +/ G_VA_COPY_AS_ARRAY /c +#ifdef __LP64__ +#define G_VA_COPY_AS_ARRAY 1 +#else +/* #undef G_VA_COPY_AS_ARRAY */ +#endif +. +/ SIZEOF_LONG /c +#ifdef __LP64__ +#define SIZEOF_LONG 8 +#else +#define SIZEOF_LONG 4 +#endif +. +/ SIZEOF_SIZE_T /c +#ifdef __LP64__ +#define SIZEOF_SIZE_T 8 +#else +#define SIZEOF_SIZE_T 4 +#endif +. +/ SIZEOF_VOID_P /c +#ifdef __LP64__ +#define SIZEOF_VOID_P 8 +#else +#define SIZEOF_VOID_P 4 +#endif +. +w diff --git a/app-aux/glib2.patch b/app-aux/glib2.patch new file mode 100644 index 0000000..2269a3f --- /dev/null +++ b/app-aux/glib2.patch @@ -0,0 +1,316 @@ +--- configure.ac.orig 2011-06-05 18:18:49.000000000 -0500 ++++ configure.ac 2011-06-07 23:20:56.000000000 -0500 +@@ -2984,18 +2984,32 @@ + cat >>$outfile <<_______EOF + #define G_HAVE_GINT64 1 /* deprecated, always true */ + +-${glib_extension}typedef signed $gint64 gint64; +-${glib_extension}typedef unsigned $gint64 guint64; ++#ifdef __LP64__ ++${glib_extension}typedef signed long gint64; ++${glib_extension}typedef unsigned long guint64; + +-#define G_GINT64_CONSTANT(val) $gint64_constant +-#define G_GUINT64_CONSTANT(val) $guint64_constant ++#define G_GINT64_CONSTANT(val) (val##L) ++#define G_GUINT64_CONSTANT(val) (val##UL) ++#else ++${glib_extension}typedef signed long long gint64; ++${glib_extension}typedef unsigned long long guint64; ++ ++#define G_GINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##LL)) ++#define G_GUINT64_CONSTANT(val) (G_GNUC_EXTENSION (val##ULL)) ++#endif + _______EOF + + if test x$gint64_format != x ; then + cat >>$outfile <<_______EOF +-#define G_GINT64_MODIFIER $gint64_modifier +-#define G_GINT64_FORMAT $gint64_format +-#define G_GUINT64_FORMAT $guint64_format ++#ifdef __LP64__ ++#define G_GINT64_MODIFIER "l" ++#define G_GINT64_FORMAT "li" ++#define G_GUINT64_FORMAT "lu" ++#else ++#define G_GINT64_MODIFIER "ll" ++#define G_GINT64_FORMAT "lli" ++#define G_GUINT64_FORMAT "llu" ++#endif + _______EOF + else + cat >>$outfile <<_______EOF +@@ -3007,9 +3021,15 @@ + + cat >>$outfile <<_______EOF + +-#define GLIB_SIZEOF_VOID_P $glib_void_p +-#define GLIB_SIZEOF_LONG $glib_long +-#define GLIB_SIZEOF_SIZE_T $glib_size_t ++#ifdef __LP64__ ++#define GLIB_SIZEOF_VOID_P 8 ++#define GLIB_SIZEOF_LONG 8 ++#define GLIB_SIZEOF_SIZE_T 8 ++#else ++#define GLIB_SIZEOF_VOID_P 4 ++#define GLIB_SIZEOF_LONG 4 ++#define GLIB_SIZEOF_SIZE_T 4 ++#endif + + _______EOF + +@@ -3037,18 +3057,33 @@ + if test -z "$glib_unknown_void_p"; then + cat >>$outfile <<_______EOF + +-#define GPOINTER_TO_INT(p) ((gint) ${glib_gpi_cast} (p)) +-#define GPOINTER_TO_UINT(p) ((guint) ${glib_gpui_cast} (p)) ++#ifdef __LP64__ ++#define GPOINTER_TO_INT(p) ((gint) (glong) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (gulong) (p)) ++ ++#define GINT_TO_POINTER(i) ((gpointer) (glong) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u)) ++ ++typedef signed long gintptr; ++typedef unsigned long guintptr; ++ ++#define G_GINTPTR_MODIFIER "l" ++#define G_GINTPTR_FORMAT "li" ++#define G_GUINTPTR_FORMAT "lu" ++#else ++#define GPOINTER_TO_INT(p) ((gint) (p)) ++#define GPOINTER_TO_UINT(p) ((guint) (p)) + +-#define GINT_TO_POINTER(i) ((gpointer) ${glib_gpi_cast} (i)) +-#define GUINT_TO_POINTER(u) ((gpointer) ${glib_gpui_cast} (u)) ++#define GINT_TO_POINTER(i) ((gpointer) (i)) ++#define GUINT_TO_POINTER(u) ((gpointer) (u)) + +-typedef signed $glib_intptr_type_define gintptr; +-typedef unsigned $glib_intptr_type_define guintptr; ++typedef signed int gintptr; ++typedef unsigned int guintptr; + +-#define G_GINTPTR_MODIFIER $gintptr_modifier +-#define G_GINTPTR_FORMAT $gintptr_format +-#define G_GUINTPTR_FORMAT $guintptr_format ++#define G_GINTPTR_MODIFIER "" ++#define G_GINTPTR_FORMAT "i" ++#define G_GUINTPTR_FORMAT "u" ++#endif + _______EOF + else + echo '#error SIZEOF_VOID_P unknown - This should never happen' >>$outfile +@@ -3164,13 +3199,29 @@ + { + struct _GMutex *runtime_mutex; + union { +- char pad[[$g_mutex_sizeof]]; ++#ifdef __LP64__ ++ char pad[[64]]; ++#else ++ char pad[[44]]; ++#endif + double dummy_double; + void *dummy_pointer; + long dummy_long; + } static_mutex; + }; +-#define G_STATIC_MUTEX_INIT { NULL, { { $g_mutex_contents} } } ++#ifdef __LP64__ ++#ifdef __BIG_ENDIAN__ ++#define G_STATIC_MUTEX_INIT { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } } ++#else ++#define G_STATIC_MUTEX_INIT { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } } ++#endif ++#else ++#ifdef __BIG_ENDIAN__ ++#define G_STATIC_MUTEX_INIT { NULL, { { 50,-86,-85,-89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } } ++#else ++#define G_STATIC_MUTEX_INIT { NULL, { { -89,-85,-86,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} } } ++#endif ++#endif + #define g_static_mutex_get_mutex(mutex) \\ + (g_thread_use_default_impl ? ((GMutex*)(gpointer) ((mutex)->static_mutex.pad)) : \\ + g_static_mutex_get_mutex_impl_shortcut (&((mutex)->runtime_mutex))) +@@ -3194,7 +3245,11 @@ + typedef union _GSystemThread GSystemThread; + union _GSystemThread + { +- char data[[$g_system_thread_sizeof]]; ++#ifdef __LP64__ ++ char data[[8]]; ++#else ++ char data[[4]]; ++#endif + double dummy_double; + void *dummy_pointer; + long dummy_long; +@@ -3202,34 +3257,61 @@ + _______EOF + if test x"$g_memory_barrier_needed" != xno; then + echo >>$outfile ++ echo "#ifdef __BIG_ENDIAN__" >>$outfile + echo "#define G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 1" >>$outfile ++ echo "#endif" >>$outfile + fi + + echo >>$outfile + g_bit_sizes="16 32 64" + for bits in $g_bit_sizes; do + cat >>$outfile <<_______EOF +-#define GINT${bits}_TO_${g_bs_native}(val) ((gint${bits}) (val)) +-#define GUINT${bits}_TO_${g_bs_native}(val) ((guint${bits}) (val)) +-#define GINT${bits}_TO_${g_bs_alien}(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) +-#define GUINT${bits}_TO_${g_bs_alien}(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#ifdef __BIG_ENDIAN__ ++#define GINT${bits}_TO_BE(val) ((gint${bits}) (val)) ++#define GUINT${bits}_TO_BE(val) ((guint${bits}) (val)) ++#define GINT${bits}_TO_LE(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) ++#define GUINT${bits}_TO_LE(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#else ++#define GINT${bits}_TO_LE(val) ((gint${bits}) (val)) ++#define GUINT${bits}_TO_LE(val) ((guint${bits}) (val)) ++#define GINT${bits}_TO_BE(val) ((gint${bits}) GUINT${bits}_SWAP_LE_BE (val)) ++#define GUINT${bits}_TO_BE(val) (GUINT${bits}_SWAP_LE_BE (val)) ++#endif + _______EOF + done + + cat >>$outfile <<_______EOF +-#define GLONG_TO_LE(val) ((glong) GINT${glongbits}_TO_LE (val)) +-#define GULONG_TO_LE(val) ((gulong) GUINT${glongbits}_TO_LE (val)) +-#define GLONG_TO_BE(val) ((glong) GINT${glongbits}_TO_BE (val)) +-#define GULONG_TO_BE(val) ((gulong) GUINT${glongbits}_TO_BE (val)) ++#ifdef __LP64__ ++#define GLONG_TO_LE(val) ((glong) GINT64_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT64_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT64_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT64_TO_BE (val)) ++#else ++#define GLONG_TO_LE(val) ((glong) GINT32_TO_LE (val)) ++#define GULONG_TO_LE(val) ((gulong) GUINT32_TO_LE (val)) ++#define GLONG_TO_BE(val) ((glong) GINT32_TO_BE (val)) ++#define GULONG_TO_BE(val) ((gulong) GUINT32_TO_BE (val)) ++#endif + #define GINT_TO_LE(val) ((gint) GINT${gintbits}_TO_LE (val)) + #define GUINT_TO_LE(val) ((guint) GUINT${gintbits}_TO_LE (val)) + #define GINT_TO_BE(val) ((gint) GINT${gintbits}_TO_BE (val)) + #define GUINT_TO_BE(val) ((guint) GUINT${gintbits}_TO_BE (val)) +-#define GSIZE_TO_LE(val) ((gsize) GUINT${gsizebits}_TO_LE (val)) +-#define GSSIZE_TO_LE(val) ((gssize) GINT${gsizebits}_TO_LE (val)) +-#define GSIZE_TO_BE(val) ((gsize) GUINT${gsizebits}_TO_BE (val)) +-#define GSSIZE_TO_BE(val) ((gssize) GINT${gsizebits}_TO_BE (val)) +-#define G_BYTE_ORDER $g_byte_order ++#ifdef __LP64__ ++#define GSIZE_TO_LE(val) ((gsize) GUINT64_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT64_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT64_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT64_TO_BE (val)) ++#else ++#define GSIZE_TO_LE(val) ((gsize) GUINT32_TO_LE (val)) ++#define GSSIZE_TO_LE(val) ((gssize) GINT32_TO_LE (val)) ++#define GSIZE_TO_BE(val) ((gsize) GUINT32_TO_BE (val)) ++#define GSSIZE_TO_BE(val) ((gssize) GINT32_TO_BE (val)) ++#endif ++#ifdef __BIG_ENDIAN__ ++#define G_BYTE_ORDER G_BIG_ENDIAN ++#else ++#define G_BYTE_ORDER G_LITTLE_ENDIAN ++#endif + + #define GLIB_SYSDEF_POLLIN =$g_pollin + #define GLIB_SYSDEF_POLLOUT =$g_pollout +@@ -3514,10 +3596,10 @@ + *) glib_vacopy='' + esac + +-if test x$glib_cv_va_val_copy = xno; then + glib_vacopy="\$glib_vacopy +-#define G_VA_COPY_AS_ARRAY 1" +-fi ++#ifdef __LP64__ ++#define G_VA_COPY_AS_ARRAY 1 ++#endif" + + if test x$glib_cv_hasinline = xyes; then + glib_inline='#define G_HAVE_INLINE 1' +--- glib/gi18n.h.orig 2008-11-23 23:45:23.000000000 -0600 ++++ glib/gi18n.h 2008-11-25 23:59:29.000000000 -0600 +@@ -27,7 +27,9 @@ + + #define _(String) gettext (String) + #define Q_(String) g_dpgettext (NULL, String, 0) ++#ifndef N_ + #define N_(String) (String) ++#endif + #define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) + #define NC_(Context, String) (String) + +--- gio/gdbusprivate.c.orig 2011-02-15 19:47:39.000000000 -0600 ++++ gio/gdbusprivate.c 2011-02-18 15:12:29.000000000 -0600 +@@ -1760,12 +1760,12 @@ + gchar *ret; + /* TODO: use PACKAGE_LOCALSTATEDIR ? */ + ret = NULL; +- if (!g_file_get_contents ("/var/lib/dbus/machine-id", ++ if (!g_file_get_contents ("@@PREFIX@@/var/lib/dbus/machine-id", + &ret, + NULL, + error)) + { +- g_prefix_error (error, _("Unable to load /var/lib/dbus/machine-id: ")); ++ g_prefix_error (error, _("Unable to load @@PREFIX@@/var/lib/dbus/machine-id: ")); + } + else + { +--- gio/xdgmime/xdgmime.c.orig 2009-03-12 22:09:52.000000000 -0600 ++++ gio/xdgmime/xdgmime.c 2009-04-09 23:41:01.000000000 -0600 +@@ -257,7 +257,7 @@ + + xdg_data_dirs = getenv ("XDG_DATA_DIRS"); + if (xdg_data_dirs == NULL) +- xdg_data_dirs = "/usr/local/share/:/usr/share/"; ++ xdg_data_dirs = "@@PREFIX@@/share/:/usr/share/"; + + ptr = xdg_data_dirs; + +--- glib-2.0.pc.in.orig 2008-07-02 16:13:24.000000000 -0500 ++++ glib-2.0.pc.in 2008-07-05 15:57:19.000000000 -0500 +@@ -12,4 +12,4 @@ + Version: @VERSION@ + Libs: -L${libdir} -lglib-2.0 @INTLLIBS@ + Libs.private: @ICONV_LIBS@ +-Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include @GLIB_EXTRA_CFLAGS@ ++Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -I${includedir} @GLIB_EXTRA_CFLAGS@ +--- glib/gconvert.c.orig 2011-06-06 00:18:49.000000000 +0100 ++++ glib/gconvert.c 2011-09-18 14:08:27.000000000 +0100 +@@ -58,13 +58,14 @@ + + #include "glibintl.h" + ++/* This check fails on Mac OS X + #if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H) + #error GNU libiconv in use but included iconv.h not from libiconv + #endif + #if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) + #error GNU libiconv not in use but included iconv.h is from libiconv + #endif +- ++*/ + + /** + * SECTION:conversions +--- glib/gunicollate.c.orig 2009-03-31 18:04:20.000000000 -0500 ++++ glib/gunicollate.c 2010-03-06 17:59:08.000000000 -0600 +@@ -26,6 +26,9 @@ + #include + #endif + ++/* Carbon is not available on 64-bit */ ++#undef HAVE_CARBON ++ + #ifdef HAVE_CARBON + #include + #endif diff --git a/docs/release b/docs/release index 66efdb6..5a01be4 100644 --- a/docs/release +++ b/docs/release @@ -1,16 +1,16 @@ To make a release: -Make sure your git tree is in sync. -$ git tag -a 'vx.y.z' -m "Version x.y.z" -$ git push --tags -$ sh autogen.sh -$ ./configure -$ make dist +1) Make sure your git tree is in sync with master +2) $ git tag -a 'vx.y.z' -m "Version x.y.z" +3) $ git push --tags +4) $ sh autogen.sh +5) $ ./configure +6) $ make dist Copy tarball to 4store.org:/var/www/html/4store/download/ make macdmg -Copy dmg file to http-a +Copy dmg file to 4store.org:/var/www/html/4store/download/macosx/ -Mail 4store-support@googlegroups.com with release annoucememnt. +Mail 4store-support@googlegroups.com with release annoucememnt and changelog.