- mac os x patches (#133611, #133612, #134637).
authorjbj <devnull@localhost>
Tue, 4 Jan 2005 19:31:31 +0000 (19:31 +0000)
committerjbj <devnull@localhost>
Tue, 4 Jan 2005 19:31:31 +0000 (19:31 +0000)
CVS patchset: 7673
CVS date: 2005/01/04 19:31:31

12 files changed:
CHANGES
configure.ac
file/src/Makefile.am
lib/signature.c
lua/local/lposix.c
misc/putenv.c
popt/Makefile.am
rpmdb/Makefile.am
rpmdb/merge.c
rpmdb/rpmdb.h
rpmio/Makefile.am
system.h

diff --git a/CHANGES b/CHANGES
index c99c422..8047195 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,7 @@
        - revert MAGIC_COMPRESS, real fix is in libmagic (#143782).
        - upgrade to file-4.12 internal.
        - mac os x patches (#131943,#131944,#132924,#132926).
+       - mac os x patches (#133611, #133612, #134637).
 
 4.3.3 -> 4.4:
        - pentium3/pentium4 arch support (pluto@PLD).
index edc0a24..188f880 100644 (file)
@@ -115,6 +115,7 @@ if test X"$GCC" = Xyes ; then
        case "$target" in
                *-*-solaris*)   LDFLAGS_STATIC="-static";;
                *-*-hpux*)      LDFLAGS_STATIC="-static";;
+               *-*-darwin*)    LDFLAGS_STATIC="";; # Mac OS X does not do static binaries.
                *-*-sysv5uw*)   LDFLAGS_STATUS="-static";; # Unixware has no shared libthread.
                *-*-*)          LDFLAGS_STATIC="-all-static";;
        esac
index 1977b88..2120601 100644 (file)
@@ -23,7 +23,7 @@ libmagic_la_LDFLAGS = -version-info 1:0:0
 
 noinst_PROGRAMS = file
 file_SOURCES = file.c
-file_LDFLAGS = -all-static
+file_LDFLAGS = -all-static
 file_LDADD = libmagic.la
 
 listobjs:
index f30eb7e..0112929 100644 (file)
@@ -26,7 +26,7 @@
 /*@access pgpDig@*/
 /*@access pgpDigParams@*/
 
-#if !defined(__GLIBC__)
+#if !defined(__GLIBC__) && !defined(__APPLE__)
 char ** environ = NULL;
 #endif
 
index 64b0301..5c1566f 100644 (file)
@@ -438,7 +438,12 @@ static int Pgetenv(lua_State *L)           /** getenv([name]) */
        if (lua_isnone(L, 1))
        {
 /*@-nestedextern -shadow@*/
+       #ifdef __APPLE__
+               #include <crt_externs.h>
+               #define environ (*_NSGetEnviron())
+       #else
                extern char **environ;
+       #endif /* __APPLE__ */
 /*@=nestedextern =shadow@*/
                char **e;
                if (*environ==NULL) lua_pushnil(L); else lua_newtable(L);
index ee3ccc0..c13e03c 100644 (file)
@@ -49,6 +49,9 @@ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #if HAVE_GNU_LD
 # define environ __environ
+#elif defined (__APPLE__)
+# include <crt_externs.h>
+# define environ (*_NSGetEnviron())
 #else
 extern char **environ;
 #endif
index 5d9862c..3c2e618 100644 (file)
@@ -17,13 +17,13 @@ noinst_HEADERS = findme.h poptint.h system.h
 
 noinst_PROGRAMS = test1 test2 test3
 test1_SOURCES = test1.c
-test1_LDFLAGS = -all-static
+test1_LDFLAGS = 
 test1_LDADD = $(usrlib_LTLIBRARIES)
 test2_SOURCES = test2.c
-test2_LDFLAGS = -all-static
+test2_LDFLAGS = 
 test2_LDADD = $(usrlib_LTLIBRARIES)
 test3_SOURCES = test3.c
-test3_LDFLAGS = -all-static
+test3_LDFLAGS = 
 test3_LDADD = $(usrlib_LTLIBRARIES)
 
 noinst_SCRIPTS = testit.sh
index f3c17bb..e5391f4 100644 (file)
@@ -18,7 +18,7 @@ EXTRA_DIST = db3.c
 EXTRA_PROGRAMS = tjfn
 
 tjfn_SOURCES = tjfn.c
-tjfn_LDFLAGS = -all-static
+tjfn_LDFLAGS = @LDFLAGS_STATIC@
 tjfn_LDADD = librpmdb.la
 
 pkgincdir = $(pkgincludedir)
@@ -186,4 +186,4 @@ lint:
        $(LINT) $(DEFS) $(INCLUDES) $(librpmdb_la_SOURCES)
 
 tdbi: librpmdb.la tdbi.o
-       $(LINK) -all-static $@.o $< $(mylibpaths) $(mylibs) $(LIBS)
+       $(LINK) @LDFLAGS_STATIC@ $@.o $< $(mylibpaths) $(mylibs) $(LIBS)
index 531d633..d185ac9 100644 (file)
@@ -1,4 +1,5 @@
 /*@-bounds -mustmod -sizeoftype @*/
+#ifndef __APPLE__
 /*-
  * Copyright (c) 1992, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -353,4 +354,7 @@ COPY:                               b = t;
 /*@=usereleased@*/
        return (0);
 }
+#else
+/* mergesort is implemented in System on Mac OS X */
+#endif /* __APPLE__ */
 /*@=bounds =mustmod =sizeoftype @*/
index 6407c27..096f38c 100644 (file)
@@ -1098,6 +1098,7 @@ int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts,
        /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
        /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
 
+#ifndef __APPLE__
 /**
  * Mergesort, same arguments as qsort(2).
  */
@@ -1106,6 +1107,9 @@ int mergesort(void *base, size_t nmemb, size_t size,
                 int (*cmp) (const void *, const void *))
        /*@globals errno @*/
        /*@modifies base, errno @*/;
+#else
+/* mergesort is defined in stdlib.h on Mac OS X */
+#endif /* __APPLE__ */
 
 #ifdef __cplusplus
 }
index 21e1a74..ca7a0b9 100644 (file)
@@ -73,40 +73,40 @@ tdigest_SOURCES = tdigest.c
 tdigest_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la -lgcrypt
 
 tdir_SOURCES = tdir.c
-tdir_LDFLAGS = -all-static
+tdir_LDFLAGS = @LDFLAGS_STATIC@
 tdir_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tfts_SOURCES = tfts.c
-tfts_LDFLAGS = -all-static
+tfts_LDFLAGS = @LDFLAGS_STATIC@
 tfts_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tget_SOURCES = tget.c
-tget_LDFLAGS = -all-static
+tget_LDFLAGS = @LDFLAGS_STATIC@
 tget_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 thkp_SOURCES = thkp.c
-thkp_LDFLAGS = -all-static
+thkp_LDFLAGS = @LDFLAGS_STATIC@
 thkp_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tput_SOURCES = tput.c
-tput_LDFLAGS = -all-static
+tput_LDFLAGS = @LDFLAGS_STATIC@
 tput_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 
 tglob_SOURCES = tglob.c
-tglob_LDFLAGS = -all-static
+tglob_LDFLAGS = @LDFLAGS_STATIC@
 tglob_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tinv_SOURCES = tinv.c
-tinv_LDFLAGS = -all-static
+tinv_LDFLAGS = @LDFLAGS_STATIC@
 tinv_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tkey_SOURCES = tkey.c
-tkey_LDFLAGS = -all-static
+tkey_LDFLAGS = @LDFLAGS_STATIC@
 tkey_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 tring_SOURCES = tring.c
-tring_LDFLAGS = -all-static
+tring_LDFLAGS = @LDFLAGS_STATIC@
 tring_LDADD = librpmio.la $(top_builddir)/popt/libpopt.la
 
 trpmio_SOURCES = trpmio.c
index 841999e..1a26fa3 100644 (file)
--- a/system.h
+++ b/system.h
@@ -49,7 +49,12 @@ extern int chroot (const char *__path)
 /*@=superuser =declundef =incondefs @*/
 #endif
 #if !defined(__GLIBC__) && !defined(__LCLINT__)
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
 extern char ** environ;
+#endif /* __APPLE__ */
 #endif
 #endif