Commit babdfe72 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

[osx] Improve automatic build system for OS X

parent 879f0d59
.build
.home
updater/.cache
updater/.gtk-osx
updater/modulesets
#!/bin/bash
pushd $(dirname $(dirname "$0")) > /dev/null
D=$(pwd -P)
popd > /dev/null
BASED="$D/.build"
HOMED="$D/.home"
SOURCED="$HOMED/source"
INSTALLD="$HOMED/.local"
GTK_OSX_BASE_URL="https://git.gnome.org/browse/gtk-osx/plain/"
JHBUILD_SOURCED="$SOURCED/jhbuild"
if [ -z "$GEDIT_SDK" ]; then
export GEDIT_SDK=10.7
fi
export PATH="$INSTALLD/bin:$PATH"
function do_exit() {
echo "$1"
exit 1
}
if [ ! which git &>/dev/null ]; then
do_exit "You need to have git installed to build gedit for OS X"
fi
if [ ! xcodebuild -version &>/dev/null ]; then
do_exit "You need to have Xcode installed to build gedit for OS X"
fi
function checkout_jhbuild() {
#JHBUILD_REVISION=$(curl -ks "$GTK_OSX_BASE_URL/jhbuild-revision")
#if test x"$JHBUILD_REVISION" = x; then
# do_exit "Could not find jhbuild revision to use."
#fi
mkdir -p $(dirname "$JHBUILD_SOURCED")
git clone git://git.gnome.org/jhbuild "$JHBUILD_SOURCED" || do_exit "Failed to clone jhbuild."
#git --work-tree "$JHBUILD_SOURCED" checkout -b stable $JHBUILD_REVISION || do_exit "Failed to checkout stable jhbuild revision."
}
function build_jhbuild() {
echo "Building jhbuild..."
(cd "$JHBUILD_SOURCED" && ./autogen.sh --prefix="$INSTALLD" && make -f Makefile.plain DISABLE_GETTEXT=1 install) >/dev/null || do_exit "Jhbuild installation failed";
rm -f "$INSTALLD/bin/python2"
cat << PYTHON2 > "$INSTALLD/bin/python2"
#!/bin/bash
exec /usr/bin/python "\$@"
PYTHON2
chmod +x "$INSTALLD/bin/python2"
}
function setup_jhbuildrc() {
echo "Installing jhbuild configuration..."
mkdir -p "$HOMED"
curl -ks "$GTK_OSX_BASE_URL/jhbuildrc-gtk-osx" | \
sed -e 's/^.*PYTHONPATH.*$//g' -e 's/^.*PYTHON_SITE_PACKAGES.*$//g' > "$HOMED/.jhbuildrc" || do_exit "Failed to get jhbuildrc."
rm -f "$HOMED/.jhbuildrc-gedit"
ln -s "$D/config/jhbuildrc-gedit" "$HOMED/.jhbuildrc-gedit" || exit 1
}
function cmd_init() {
mkdir -p "$SOURCED"
if [ ! -d "$JHBUILD_SOURCED" ]; then
checkout_jhbuild
fi
build_jhbuild
setup_jhbuildrc
}
function cmd_bootstrap() {
# Built python once
cmd_jh bootstrap -q python || exit 1
# Built python twice! There is a bug where python somehow manages to link
# its main binary to the system framework library, which then doesn't work...
# Building python again seems to resolve the issue...
cmd_jh bootstrap -q -f -t python python || exit 1
# Bootstrap all the rest
cmd_jh bootstrap -q || exit 1
}
function cmd_jh() {
# Setup our jhbuild environment
export GEDIT_OSX_SOURCE_BASE="$D"
export GEDIT_OSX_BUILD_BASE="$BASED"
export HOME="$HOMED"
export JHB=gedit
"$INSTALLD/bin/jhbuild" -f "$HOMED/.jhbuildrc" "$@"
}
function cmd_shell() {
cmd_jh shell
}
function cmd_all() {
if [ ! -d "$JHBUILD_SOURCED" ]; then
echo "init..."
cmd_init || exit 1
fi
if [ ! -f "$BASED/$GEDIT_SDK/inst/bin/python" ]; then
echo "bootstrap"
cmd_bootstrap || exit 1
fi
cmd_jh build -q
}
commands=()
while read line
do
cmd=${line#declare -f }
if [[ "$cmd" = cmd_* ]]; then
commands+=(${cmd#cmd_})
fi
done < <(declare -F)
cmds=$(printf ", %s" "${commands[@]}")
cmds=${cmds:2}
if [ -z "$1" ]; then
cmd_all
exit 0
fi
cmd="cmd_$1"
if [[ $(type -t "$cmd") != "function" ]]; then
do_exit "Invalid command $1, available commands are: $cmds"
fi
shift 1
"$cmd" "$@"
# -*- mode: python -*-
import sys, os
_gsdk = os.environ.get('GEDIT_SDK', None)
if not _gsdk:
sys.stderr.write("No GEDIT_SDK environment given. Please provide 10.x\n")
sys.exit(1)
_basedir = os.environ['GEDIT_OSX_BUILD_BASE']
if not _basedir:
sys.stderr.write("No GEDIT_OSX_BASE environment given. Please provide the base build directory\n")
sys.exit(1)
_sourcedir = os.environ['GEDIT_OSX_SOURCE_BASE']
if not _sourcedir:
sys.stderr.write("No GEDIT_OSX_SOURCE_BASE environment given. Please provide the base source directory\n")
sys.exit(1)
checkoutroot = os.path.join(_basedir, _gsdk, "source")
prefix = os.path.join(_basedir, _gsdk, "inst")
tarballdir = os.path.join(_basedir, "pkgs")
# Main setup
setup_sdk(target=_gsdk, sdk_version=_gsdk, architectures=['x86_64'])
# Main module set
modulesets_dir = os.path.join(_sourcedir, "modulesets")
moduleset = "gedit.modules"
modules = ["gedit"]
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
<moduleset><repository type="tarball" name="xmlsoft.org" href="ftp://xmlsoft.org/libxml2/"/>
<repository type="tarball" name="intltool" href="http://launchpad.net/intltool/trunk/"/>
<repository type="tarball" name="cmake" href="http://www.cmake.org/files/"/>
<repository type="tarball" name="python" href="http://www.python.org/ftp/python/"/>
<repository type="tarball" name="apache.org" href="http://archive.apache.org/dist/"/>
<repository type="tarball" name="pkgconfig" href="http://pkgconfig.freedesktop.org/releases/"/>
<repository type="tarball" name="tukaani.org" href="http://tukaani.org/"/>
<repository type="tarball" name="itstool.org" href="http://files.itstool.org/itstool/"/>
<repository type="tarball" name="sourceforge" href="http://downloads.sourceforge.net/sourceforge/"/>
<repository type="tarball" name="cpan" href="http://search.cpan.org/CPAN/"/>
<repository type="tarball" name="ftp.gnome.org" default="yes" href="ftp://ftp.gnome.org/pub/gnome/sources/"/>
<repository type="tarball" name="oracle" href="http://download.oracle.com/"/>
<repository type="tarball" name="ftp.gnu.org" href="ftp://ftp.gnu.org/gnu/"/>
<autotools id="berkeleydb-nonsrctree" autogen-sh="configure" autogen-template="%(srcdir)s/dist/%(autogen-sh)s --prefix %(prefix)s --libdir %(libdir)s %(autogenargs)s">
<branch module="berkeley-db/db-4.8.30.NC.tar.gz" version="4.8.30" repo="oracle">
<patch file="berkeleydb-nonsrctree/atomic.patch" strip="1"/>
</branch>
</autotools>
<autotools id="berkeleydb" autogen-sh="configure" supports-non-srcdir-builds="no" makeargs="-C build_unix" autogen-template="cd build_unix; ../dist/%(autogen-sh)s --prefix %(prefix)s --libdir %(libdir)s %(autogenargs)s" makeinstallargs="-C build_unix install">
<branch module="berkeley-db/db-4.8.30.NC.tar.gz" version="4.8.30" repo="oracle">
<patch file="berkeleydb/atomic.patch" strip="1"/>
</branch>
</autotools>
<autotools id="readline" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="readline/readline-6.2.tar.gz" version="6.2">
<patch file="readline/readline62-001" strip="0"/>
<patch file="readline/readline62-002" strip="0"/>
<patch file="readline/readline62-003" strip="0"/>
<patch file="readline/readline62-004" strip="0"/>
</branch>
</autotools>
<autotools id="gettext-runtime" autogen-sh="configure" autogenargs="--without-emacs --disable-java --disable-native-java --disable-libasprintf --disable-csharp">
<branch repo="ftp.gnu.org" source-subdir="gettext-runtime" module="gettext/gettext-0.18.1.1.tar.gz" version="0.18.1.1" size="15139737" md5sum="3dd55b952826d2b32f51308f2f91aa89">
<patch file="gettext-runtime/gettext-bug33999-stpncpy.patch" strip="1"/>
</branch>
</autotools>
<autotools id="python" autogenargs="--enable-shared" autogen-sh="configure">
<branch repo="python" module="2.7.6/Python-2.7.6.tar.xz" version="2.7.6">
</branch>
<dependencies>
<dep package="gettext-runtime"/>
<dep package="readline"/>
</dependencies>
<after>
<dep package="berkeleydb"/>
<dep package="berkeleydb-nonsrctree"/>
</after>
</autotools>
<autotools id="itstool" autogen-sh="autoreconf">
<branch repo="itstool.org" module="itstool-2.0.2.tar.bz2" version="2.0.2" hash="sha256:bf909fb59b11a646681a8534d5700fec99be83bb2c57badf8c1844512227033a" size="96748">
<patch file="itstool/itstool.use-correct-libxml.patch" strip="1"/>
</branch>
</autotools>
<autotools id="yelp-xsl" autogen-sh="configure">
<branch module="yelp-xsl/3.12/yelp-xsl-3.12.0.tar.xz" version="3.12.0" hash="sha256:dd0b8af338b1cdae50444273d7c761e3f511224421487311103edc95a4493656" repo="ftp.gnome.org"/>
<dependencies>
<dep package="libxslt"/>
<dep package="libxml2"/>
<dep package="intltool"/>
<dep package="itstool"/>
</dependencies>
</autotools>
<autotools id="libxml2" autogen-sh="configure" autogenargs="--with-python">
<branch version="2.9.0" module="libxml2-2.9.0.tar.gz" repo="xmlsoft.org">
<patch file="libxml2/libxml2-Bug-686118-pthreads_once_init.patch" strip="1"/>
</branch>
<dependencies>
<dep package="python"/>
</dependencies>
</autotools>
<autotools id="apr">
<branch repo="apache.org" module="apr/apr-1.4.5.tar.bz2" version="1.4.5"/>
</autotools>
<autotools id="yelp-tools" autogen-sh="configure">
<branch module="yelp-tools/3.13/yelp-tools-3.13.3.tar.xz" version="3.13.3" hash="sha256:20067061736e3d4ec05fc364a71d8e5d06b230528b6b7a16cb41e03c9bf3b8c6" repo="ftp.gnome.org"/>
<dependencies>
<dep package="libxslt"/>
<dep package="libxml2"/>
<dep package="intltool"/>
<dep package="yelp-xsl"/>
<dep package="itstool"/>
</dependencies>
</autotools>
<autotools id="libxslt" autogen-sh="configure">
<branch version="1.1.27" module="libxslt-1.1.27.tar.gz" repo="xmlsoft.org"/>
<dependencies>
<dep package="libxml2"/>
</dependencies>
</autotools>
<autotools id="apr-util" autogenargs="--with-apr=$PREFIX/bin/apr-1-config">
<branch repo="apache.org" module="apr/apr-util-1.3.12.tar.bz2" version="1.3.12"/>
<dependencies>
<dep package="apr"/>
</dependencies>
</autotools>
<autotools id="intltool" autogen-sh="configure">
<branch repo="intltool" module="0.50.2/+download/intltool-0.50.2.tar.gz" version="0.50.2" hash="md5:23fbd879118253cb99aeac067da5f591"/>
<dependencies>
<dep package="gnome-common"/>
<dep package="perl-xml-parser"/>
</dependencies>
</autotools>
<autotools id="gnome-common">
<branch module="gnome-common/3.12/gnome-common-3.12.0.tar.xz" version="3.12.0" hash="sha256:18712bc2df6b2dd88a11b9f7f874096d1c0c6e7ebc9cfc0686ef963bd590e1d8" repo="ftp.gnome.org"/>
</autotools>
<autotools id="gtk-doc" autogenargs="--disable-scrollkeeper --with-xml-catalog=$JHBUILD_PREFIX/etc/xml/catalog" makeargs="-k -i" makeinstallargs="-k -i install" autogen-sh="configure">
<branch version="1.21" module="gtk-doc/1.21/gtk-doc-1.21.tar.xz" hash="sha256:5d934d012ee08edd1585544792efa80da271652587ba5b843d2cea8e8b80ee3e" repo="ftp.gnome.org"/>
<dependencies>
<dep package="libxslt"/>
<dep package="yelp-tools"/>
</dependencies>
</autotools>
<autotools id="gtk-osx-docbook" autogen-sh="configure" supports-non-srcdir-builds="no">
<branch repo="sourceforge" module="gtk-osx/gtk-osx-docbook-1.1.tar.gz" version="1.1"/>
</autotools>
<perl id="perl-xml-simple">
<branch repo="cpan" module="authors/id/G/GR/GRANTM/XML-Simple-2.20.tar.gz" version="2.20" size="75993" md5sum="4d10964e123b76eca36678464daa63cd"/>
<dependencies>
<dep package="perl-xml-parser"/>
</dependencies>
</perl>
<perl id="perl-xml-parser" makeargs="EXPATLIBPATH=${prefix}/lib EXPATINCPATH=${prefix}/include">
<branch repo="cpan" module="authors/id/T/TO/TODDR/XML-Parser-2.41.tar.gz" version="2.41"/>
<dependencies>
<dep package="expat"/>
</dependencies>
</perl>
<autotools id="expat" autogen-sh="configure">
<branch module="expat/expat-2.1.0.tar.gz" version="2.1.0" repo="sourceforge"/>
</autotools>
<autotools id="flex" autogen-sh="configure">
<branch repo="sourceforge" module="flex/flex-2.5.37.tar.bz2" version="2.5.37"/>
</autotools>
<autotools id="bison" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="bison/bison-2.6.3.tar.bz2" version="2.6.3"/>
</autotools>
<autotools id="pkg-config" autogen-sh="configure">
<branch repo="pkgconfig" module="pkg-config-0.25.tar.gz" version="0.25"/>
</autotools>
<autotools id="automake-1.13" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="automake/automake-1.13.1.tar.xz" version="1.13.1"/>
</autotools>
<autotools id="automake-1.12" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="automake/automake-1.12.6.tar.xz" version="1.12.6"/>
</autotools>
<autotools id="automake-1.11" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="automake/automake-1.11.6.tar.xz" version="1.11.6"/>
</autotools>
<autotools id="automake-1.10" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="automake/automake-1.10.3.tar.bz2" version="1.10.3" size="957505" md5sum="b8e67fb458da396bc35555af7ef2b49f"/>
</autotools>
<autotools id="libtool" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="libtool/libtool-2.4.2.tar.gz" version="2.4.2"/>
</autotools>
<autotools id="autoconf" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="autoconf/autoconf-2.69.tar.xz" version="2.69"/>
<dependencies>
<dep package="m4"/>
</dependencies>
</autotools>
<autotools id="m4" autogen-sh="configure">
<branch repo="ftp.gnu.org" module="m4/m4-1.4.16.tar.bz2" version="1.4.16"/>
</autotools>
<autotools id="cmake" autogen-sh="bootstrap" autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s %(autogenargs)s">
<branch repo="cmake" module="v2.8/cmake-2.8.12.tar.gz" version="2.8.12"/>
</autotools>
<autotools id="gettext-tools" autogen-sh="configure" autogenargs="--without-emacs --disable-java --disable-native-java --disable-libasprintf --disable-csharp --with-included-glib">
<branch repo="ftp.gnu.org" source-subdir="gettext-tools" module="gettext/gettext-0.18.1.1.tar.gz" version="0.18.1.1" size="15139737" md5sum="3dd55b952826d2b32f51308f2f91aa89">
<patch file="gettext-tools/gettext-bug33999-stpncpy.patch" strip="1"/>
</branch>
</autotools>
<autotools id="subversion">
<branch repo="apache.org" module="subversion/subversion-1.5.9.tar.bz2" version="1.5.9"/>
<dependencies>
<dep package="apr-util"/>
</dependencies>
</autotools>
<autotools id="make">
<branch repo="ftp.gnu.org" module="make/make-3.82.tar.gz" version="3.82"/>
</autotools>
<autotools id="xz" autogen-sh="configure">
<branch repo="tukaani.org" module="xz/xz-5.0.4.tar.bz2" version="5.0.4"/>
</autotools>
<metamodule id="meta-bootstrap">
<dependencies>
<dep package="xz"/>
<dep package="make"/> <!-- Needed for Tiger, skipped otherwise -->
<dep package="subversion"/> <!-- Needed for Tiger, skipped otherwise -->
<dep package="gettext-tools"/> <!-- Needed for 64-bit -->
<dep package="cmake"/>
<dep package="m4"/> <!-- Can be skipped for Leopard and later -->
<dep package="autoconf"/>
<dep package="libtool"/>
<dep package="automake-1.10"/>
<dep package="automake-1.11"/>
<dep package="automake-1.12"/>
<dep package="automake-1.13"/>
<dep package="pkg-config"/>
<dep package="bison"/> <!-- included for Tiger, skipped otherwise -->
<dep package="flex"/> <!-- included for Tiger, skipped otherwise -->
<dep package="expat"/>
<dep package="perl-xml-parser"/>
<dep package="perl-xml-simple"/>
<dep package="gtk-osx-docbook"/>
<dep package="gtk-doc"/>
<dep package="gnome-common"/>
<dep package="intltool"/>
</dependencies>
</metamodule>
</moduleset>
This diff is collapsed.
--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
+++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
@@ -144,7 +144,7 @@
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __atomic_compare_exchange_db((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
int temp;
@@ -176,7 +176,7 @@
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
* which configure could be changed to use.
*/
-static inline int __atomic_compare_exchange(
+static inline int __atomic_compare_exchange_db(
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
{
atomic_value_t was;
--- src/dbinc/atomic.h 2013-03-12 14:07:22.000000000 -0400
+++ src/dbinc/atomic.h.change 2013-03-12 14:06:35.000000000 -0400
@@ -144,7 +144,7 @@
#define atomic_inc(env, p) __atomic_inc(p)
#define atomic_dec(env, p) __atomic_dec(p)
#define atomic_compare_exchange(env, p, o, n) \
- __atomic_compare_exchange((p), (o), (n))
+ __atomic_compare_exchange_db((p), (o), (n))
static inline int __atomic_inc(db_atomic_t *p)
{
int temp;
@@ -176,7 +176,7 @@
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
* which configure could be changed to use.
*/
-static inline int __atomic_compare_exchange(
+static inline int __atomic_compare_exchange_db(
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
{
atomic_value_t was;
--- a/src/ispell/ispell_checker.cpp Thu Apr 1 13:53:37 2010
+++ b/src/ispell/ispell_checker.cpp Mon Feb 24 15:35:49 2014
@@ -162,7 +162,7 @@
else
{
/* convert to 8bit string and null terminate */
- size_t len_in, len_out, result;
+ gsize len_in, len_out, result;
// the 8bit encodings use precomposed forms
char *normalizedWord = g_utf8_normalize (utf8Word, length, G_NORMALIZE_NFC);
char *In = normalizedWord;
@@ -172,7 +172,7 @@
len_out = sizeof( szWord ) - 1;
result = g_iconv(m_translate_in, &In, &len_in, &Out, &len_out);
g_free(normalizedWord);
- if ((size_t)-1 == result)
+ if ((gsize)-1 == result)
return false;
*Out = '\0';
}
@@ -210,7 +210,7 @@
{
/* convert to 8bit string and null terminate */
- size_t len_in, len_out, result;
+ gsize len_in, len_out, result;
// the 8bit encodings use precomposed forms
char *normalizedWord = g_utf8_normalize (utf8Word, length, G_NORMALIZE_NFC);
char *In = normalizedWord;
@@ -219,7 +219,7 @@
len_out = sizeof( word8 ) - 1;
result = g_iconv(m_translate_in, &In, &len_in, &Out, &len_out);
g_free(normalizedWord);
- if ((size_t)-1 == result)
+ if ((gsize)-1 == result)
return NULL;
*Out = '\0';
}
@@ -252,13 +252,13 @@
{
/* convert to 32bit string and null terminate */
- size_t len_in, len_out;
+ gsize len_in, len_out;
char *In = m_possibilities[c];
char *Out = reinterpret_cast<char *>(utf8Sugg);
len_in = l;
len_out = INPUTWORDLEN + MAXAFFIXLEN;
- if ((size_t)-1 == g_iconv(m_translate_out, &In, &len_in, &Out, &len_out)) {
+ if ((gsize)-1 == g_iconv(m_translate_out, &In, &len_in, &Out, &len_out)) {
*out_n_suggestions = c;
return sugg_arr;
}
--- a/src/myspell/myspell_checker.cpp Thu Apr 1 13:53:37 2010
+++ b/src/myspell/myspell_checker.cpp Mon Feb 24 15:37:56 2014
@@ -159,11 +159,11 @@
char *in = normalizedWord;
char word8[MAXWORDLEN + 1];
char *out = word8;
- size_t len_in = strlen(in);
- size_t len_out = sizeof( word8 ) - 1;
- size_t result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
+ gsize len_in = strlen(in);
+ gsize len_out = sizeof( word8 ) - 1;
+ gsize result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
g_free(normalizedWord);
- if ((size_t)-1 == result)
+ if ((gsize)-1 == result)
return false;
*out = '\0';
if (myspell->spell(word8))
@@ -185,11 +185,11 @@
char *in = normalizedWord;
char word8[MAXWORDLEN + 1];
char *out = word8;
- size_t len_in = strlen(in);
- size_t len_out = sizeof(word8) - 1;
- size_t result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
+ gsize len_in = strlen(in);
+ gsize len_out = sizeof(word8) - 1;
+ gsize result = g_iconv(m_translate_in, &in, &len_in, &out, &len_out);
g_free(normalizedWord);
- if ((size_t)-1 == result)
+ if ((gsize)-1 == result)
return NULL;
*out = '\0';
@@ -203,7 +203,7 @@
len_out = MAXWORDLEN;
char *word = g_new0(char, len_out + 1);
out = reinterpret_cast<char *>(word);
- if ((size_t)-1 == g_iconv(m_translate_out, &in, &len_in, &out, &len_out)) {
+ if ((gsize)-1 == g_iconv(m_translate_out, &in, &len_in, &out, &len_out)) {
for (size_t j = i; j < *nsug; j++)
free(sugMS[j]);
free(sugMS);
--- a/gettext-tools/libgettextpo/string.in.h Sun Apr 25 02:22:40 2010
+++ b/gettext-tools/libgettextpo/string.in.h Tue Oct 4 14:36:31 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
Rename module 'memxfrm' to 'amemxfrm'.
--- a/gettext-tools/gnulib-lib/string.in.h Mon May 24 02:42:47 2010
+++ b/gettext-tools/gnulib-lib/string.in.h Tue Oct 4 14:35:46 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
--- a/gettext-runtime/gnulib-lib/string.in.h Sun Apr 25 02:20:42 2010
+++ b/gettext-runtime/gnulib-lib/string.in.h Tue Oct 4 14:34:57 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
--- a/gettext-tools/configure Sun Jun 6 13:12:20 2010
+++ b/gettext-tools/configure Tue Oct 4 16:29:27 2011
@@ -40562,6 +40562,16 @@
+ ac_fn_c_check_decl "$LINENO" "stpncpy" "ac_cv_have_decl_stpncpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpncpy" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STPNCPY $ac_have_decl
+_ACEOF
@@ -40606,7 +40616,9 @@
#include <stdlib.h>
#include <string.h> /* for strcpy */
/* The stpncpy prototype is missing in <string.h> on AIX 4. */
+#if !HAVE_DECL_STPNCPY
extern char *stpncpy (char *dest, const char *src, size_t n);
+#endif
int main () {
const char *src = "Hello";
char dest[10];
--- a/gettext-tools/libgettextpo/string.in.h Sun Apr 25 02:22:40 2010
+++ b/gettext-tools/libgettextpo/string.in.h Tue Oct 4 14:36:31 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
Rename module 'memxfrm' to 'amemxfrm'.
--- a/gettext-tools/gnulib-lib/string.in.h Mon May 24 02:42:47 2010
+++ b/gettext-tools/gnulib-lib/string.in.h Tue Oct 4 14:35:46 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
--- a/gettext-runtime/gnulib-lib/string.in.h Sun Apr 25 02:20:42 2010
+++ b/gettext-runtime/gnulib-lib/string.in.h Tue Oct 4 14:34:57 2011
@@ -229,6 +229,7 @@
#if @GNULIB_STPNCPY@
# if @REPLACE_STPNCPY@
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef stpncpy
# define stpncpy rpl_stpncpy
# endif
_GL_FUNCDECL_RPL (stpncpy, char *,
--- a/gettext-tools/configure Sun Jun 6 13:12:20 2010
+++ b/gettext-tools/configure Tue Oct 4 16:29:27 2011
@@ -40562,6 +40562,16 @@
+ ac_fn_c_check_decl "$LINENO" "stpncpy" "ac_cv_have_decl_stpncpy" "$ac_includes_default"
+if test "x$ac_cv_have_decl_stpncpy" = x""yes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STPNCPY $ac_have_decl
+_ACEOF
@@ -40606,7 +40616,9 @@
#include <stdlib.h>
#include <string.h> /* for strcpy */
/* The stpncpy prototype is missing in <string.h> on AIX 4. */
+#if !HAVE_DECL_STPNCPY
extern char *stpncpy (char *dest, const char *src, size_t n);
+#endif
int main () {
const char *src = "Hello";
char dest[10];
From 1b21a85f1914eecc107319cb94e8c8517291599b Mon Sep 17 00:00:00 2001
From: John Ralls <jralls@ceridwen.us>
Date: Mon, 17 Feb 2014 15:51:38 -0800
Subject: [PATCH] Bug 724590 - GSlice slab_stack corruption
Dereference allocation->contention_counters before trying to take the
address of an element.
---
glib/gslice.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)