diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | autodeps/darwin.prov | 21 | ||||
-rw-r--r-- | autodeps/darwin.req | 26 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | lib/rpmsx.c | 6 | ||||
-rw-r--r-- | rpmio/rpmsq.c | 11 | ||||
-rw-r--r-- | rpmrc.in | 20 |
7 files changed, 79 insertions, 8 deletions
@@ -6,6 +6,7 @@ - upgrade to db-4.3.27. - revert MAGIC_COMPRESS, real fix is in libmagic (#143782). - upgrade to file-4.12 internal. + - mac os x patches (#131943,#131944,#132924,#132926). 4.3.3 -> 4.4: - pentium3/pentium4 arch support (pluto@PLD). diff --git a/autodeps/darwin.prov b/autodeps/darwin.prov new file mode 100644 index 000000000..5064414be --- /dev/null +++ b/autodeps/darwin.prov @@ -0,0 +1,21 @@ +#!/bin/bash +# ---------------------------------------------------------- +# find-provides for Darwin/MacOSX +# ---------------------------------------------------------- +# This script reads filenames from STDIN and outputs any relevant provides +# information that needs to be included in the package. + +filelist=$(sed -n -e '/\.dylib/p' -e '/\.so/p' -e '/\.bundle/p' | sort | uniq | xargs file -L 2>/dev/null | grep "Mach-O.*ppc" | cut -d: -f1) + +for f in $filelist; do + libname=$(basename $f | sed -e 's;\..*;;') + soname=$(otool -l $f | grep $libname | awk '/ name/ {print $2}') + + if [ "$soname" != "" ]; then + if [ ! -L $f ]; then + basename $soname + fi + else + echo ${f##*/} + fi +done | sort -u diff --git a/autodeps/darwin.req b/autodeps/darwin.req new file mode 100644 index 000000000..9bb08b753 --- /dev/null +++ b/autodeps/darwin.req @@ -0,0 +1,26 @@ +#!/bin/sh +# ---------------------------------------------------------------- +# find-requires for Darwin/MacOSX +# ---------------------------------------------------------------- +ulimit -c 0 + +filelist=`sed "s/['\"]/\\\&/g"` +exelist=`echo $filelist | xargs file | fgrep Mach-O | cut -d: -f1 ` +scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 ` + +for f in $exelist; do + if [ -x $f ]; then + otool -L $f \ + | awk '/^\t/ { print }' \ + | sed -n -e '/ (compatibility version .* current version .*)/p' \ + | sed -e 's/ (compatibility version .* current version .*)//' + fi +done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u + +for f in $scriptlist; do + if [ -x $f ]; then + head -1 $f | sed -e 's/^\#\![ ]*//' \ + | sed -n -e '/^\/bin/!p' | sed -n -e '/^\/usr\/bin/!p' | uniq \ + | cut -d" " -f1 + fi +done diff --git a/configure.ac b/configure.ac index 50d418074..edc0a24fd 100644 --- a/configure.ac +++ b/configure.ac @@ -732,7 +732,7 @@ dnl XXX AC_CHECK_FUNCS(gethostname mkdir mkfifo rmdir select uname) AC_CHECK_FUNCS(basename getcwd getwd inet_aton mtrace putenv realpath setenv) AC_CHECK_FUNCS(stpcpy stpncpy strcspn) -AC_CHECK_FUNCS(strdup strerror strtol strtoul strspn strstr) +AC_CHECK_FUNCS(strdup strndup strerror strtol strtoul strspn strstr) AC_CHECK_FUNCS(__secure_getenv) diff --git a/lib/rpmsx.c b/lib/rpmsx.c index 2eeae09e3..59087d9dd 100644 --- a/lib/rpmsx.c +++ b/lib/rpmsx.c @@ -160,7 +160,13 @@ static int rpmsxAdd(rpmsx sx, const char ** bpp) } sxs = sx->sxs + sx->nsxs; sxs->len = stem_len; +#ifdef HAVE_STRNDUP /*@i@*/ sxs->stem = strndup(*bpp, stem_len); +#else + sxs->stem = xmalloc(stem_len+1); + strncpy(sxs->stem, *bpp, stem_len); +#endif + sx->nsxs++; *bpp += stem_len; return sx->nsxs - 1; diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c index 56a0fd0b9..1b59c36af 100644 --- a/rpmio/rpmsq.c +++ b/rpmio/rpmsq.c @@ -126,10 +126,15 @@ extern int pthread_cond_signal(pthread_cond_t *cond) #include <pthread.h> +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +/*@unchecked@*/ +static pthread_mutex_t rpmsigTbl_lock = PTHREAD_MUTEX_INITIALIZER; +#else /*@unchecked@*/ /*@-type@*/ static pthread_mutex_t rpmsigTbl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; /*@=type@*/ +#endif #define DO_LOCK() pthread_mutex_lock(&rpmsigTbl_lock); #define DO_UNLOCK() pthread_mutex_unlock(&rpmsigTbl_lock); @@ -147,7 +152,7 @@ static pthread_mutex_t rpmsigTbl_lock = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; (void) pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, (__oldtypeptr));\ pthread_cleanup_push((__handler), (__arg)); #define CLEANUP_RESET(__execute, __oldtype) \ - (void) pthread_cleanup_pop(__execute); \ + pthread_cleanup_pop(__execute); \ (void) pthread_setcanceltype ((__oldtype), &(__oldtype)); #define SAME_THREAD(_a, _b) pthread_equal(((pthread_t)_a), ((pthread_t)_b)) @@ -604,6 +609,10 @@ rpmsqExecve (const char ** argv) sigset_t newMask, oldMask; rpmsq sq = memset(alloca(sizeof(*sq)), 0, sizeof(*sq)); +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP + INIT_LOCK (); +#endif + (void) DO_LOCK (); if (ADD_REF (rpmsigTbl_sigchld) == 0) { if (rpmsqEnable(SIGINT, NULL) < 0) { @@ -1,7 +1,7 @@ #/*! \page config_rpmrc Default configuration: /usr/lib/rpm/rpmrc # \verbatim # -# $Id: rpmrc.in,v 2.65.2.1 2004/11/22 21:41:28 jbj Exp $ +# $Id: rpmrc.in,v 2.65.2.2 2005/01/04 17:46:10 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -11,6 +11,9 @@ ############################################################# # Values for RPM_OPT_FLAGS for various platforms +# "fat" binary with both archs, for Darwin +optflags: fat -O2 -g -arch i386 -arch ppc + optflags: i386 -O2 -g -march=i386 -mcpu=i686 optflags: i486 -O2 -g -march=i486 optflags: i586 -O2 -g -march=i586 @@ -171,6 +174,9 @@ os_canon: VM/ESA: VM/ESA 19 os_canon: Linux/390: OS/390 20 os_canon: Linux/ESA: VM/ESA 20 +os_canon: Darwin: darwin 21 +os_canon: MacOSX: macosx 21 + ############################################################# # For a given uname().machine, the default build arch @@ -242,7 +248,7 @@ arch_compat: pentium3: i686 arch_compat: i686: i586 arch_compat: i586: i486 arch_compat: i486: i386 -arch_compat: i386: noarch +arch_compat: i386: noarch fat arch_compat: osfmach3_i686: i686 osfmach3_i586 arch_compat: osfmach3_i586: i586 osfmach3_i486 @@ -259,7 +265,7 @@ arch_compat: ppciseries: ppc arch_compat: ppcpseries: ppc arch_compat: ppc64: ppc arch_compat: ppc: rs6000 -arch_compat: rs6000: noarch +arch_compat: rs6000: noarch fat arch_compat: ppc64pseries: ppc64 arch_compat: ppc64iseries: ppc64 @@ -330,6 +336,8 @@ os_compat: TOS: FreeMiNT MiNT mint os_compat: BSD_OS: bsdi os_compat: bsdi4.0: bsdi +os_compat: Darwin: MacOSX + buildarch_compat: ia64: noarch buildarch_compat: athlon: i686 @@ -338,7 +346,7 @@ buildarch_compat: pentium3: i686 buildarch_compat: i686: i586 buildarch_compat: i586: i486 buildarch_compat: i486: i386 -buildarch_compat: i386: noarch +buildarch_compat: i386: noarch fat buildarch_compat: sun4c: noarch buildarch_compat: sun4d: noarch @@ -362,8 +370,8 @@ buildarch_compat: ppc8560: noarch buildarch_compat: ppc32dy4: noarch buildarch_compat: ppciseries: noarch buildarch_compat: ppcpseries: noarch -buildarch_compat: ppc: noarch -buildarch_compat: ppc64: noarch +buildarch_compat: ppc: noarch fat +buildarch_compat: ppc64: noarch fat buildarch_compat: ppc64pseries: ppc64 buildarch_compat: ppc64iseries: ppc64 |