while trying to emerge rzip 2.0-r1 I ran into the following problem checking for BZ2_bzBuffToBuffCompress in -lbz2... yes checking for errno in errno.h... yes checking for mmap... yes checking for strerror... yes checking for getopt_long... yes updating cache ./config.cache creating ./config.status creating Makefile creating config.h gcc -I. -I. -O2 -pipe -c rzip.c -o rzip.o gcc -I. -I. -O2 -pipe -c runzip.c -o runzip.o gcc -I. -I. -O2 -pipe -c main.c -o main.o main.c: In function 'write_magic': main.c:50: error: 'uint32_t' undeclared (first use in this function) main.c:50: error: (Each undeclared identifier is reported only once main.c:50: error: for each function it appears in.) main.c:50: error: parse error before "v" main.c:62: error: 'v' undeclared (first use in this function) main.c: In function 'read_magic': main.c:78: error: 'uint32_t' undeclared (first use in this function) main.c:78: error: parse error before "v" main.c:92: error: 'v' undeclared (first use in this function) main.c: In function 'decompress_file': main.c:143: warning: assignment makes pointer from integer without a cast make: *** [main.o] Error 1 make: *** Waiting for unfinished jobs.... !!! ERROR: app-arch/rzip-2.0-r1 failed. !!! Function src_compile, Line 567, Exitcode 2 !!! emake failed Reproducible: Always Steps to Reproduce: 1. 2. 3. !!! Relying on the shell to locate gcc, this may break !!! DISTCC, installing gcc-config and setting your current gcc !!! profile will fix this Portage 2.0.52-r1 (default-darwin/macos/10.4, gcc-4.0.0, libsystem-7.1-r0, 8.2.0 Power Macintosh) =============================================================== == System uname: 8.2.0 Power Macintosh powerpc macos-20041118 distcc 2.0.1-zeroconf powerpc-apple-darwin7.0 (protocol 1) (default port 3632) [disabled] dev-lang/python: [Not Present] sys-apps/sandbox: [Not Present] sys-devel/autoconf: [Not Present] sys-devel/automake: [Not Present] sys-devel/binutils: [Not Present] sys-devel/libtool: [Not Present] virtual/os-headers: 7.1 ACCEPT_KEYWORDS="ppc-macos ~ppc-macos" AUTOCLEAN="yes" CBUILD="powerpc-apple-darwin" CFLAGS="-O2 -pipe" CHOST="powerpc-apple-darwin" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/ qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O2 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig collision-protect distlocks sfperms strict" GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/Linux/distributions/ gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="ppc emboss imagemagick nls png ppc-macos sdl userland_Darwin kernel_Darwin elibc_Darwin" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Created attachment 68517 [details, diff] rzip-2.0-darwin.patch Weird. I didn't get the error you report, though I got a problem with strndup which is not available on BSD it seems. So I made a simple patch which appears to work for me, attached here. I'd like to find out why you have those errors which I don't have.
> Weird. I didn't get the error you report, though I got a problem with strndup > which is not available on BSD it seems. So I made a simple patch which appears > to work for me, attached here. I'd like to find out why you have those errors > which I don't have. Didn't work for me ;( However, I could get it at least to compile if I add a #include <stdint.h> in main.c or rzip.h
do you have the latest XCode tools installed?
> do you have the latest XCode tools installed? XCode 2.0 (came with my Tiger CD) Build 514, I suppose. Latest is XCode 2.1, I think.
but which one do you have installed? I use XCode 2.1, build 621
> but which one do you have installed? XCode 2.0 (came with my Tiger CD) Build 514
Do you care about upgrading? We only support the latest XCode tools, because it also solves a lot of linker problems.
> Do you care about upgrading? We only support the latest XCode tools, because it > also solves a lot of linker problems. Done upgrading to XCode 2.1 With the patch rzip emerges fine.
Ok, then I will check this one on Pather today, and see if it works there too with the latest Xcode available there. I think I can check this in later today. Thanks for trying Dirk.
compiled and worked on Panther also. I am hestitant to put this in portage in the same ebuild. ferringb, could you advise on this patch whether to apply is unconditional or not, and put it in the current ebuild, or in a -r2? And do you agree with it?
Yuck. Conditionally pull in a strndup function is my preferred solution.
Created attachment 68679 [details, diff] extended patch that uses autoconf to check fort strndup this patch uses autoconf to check for strndup and uses replacement code only when not available.
Created attachment 68680 [details, diff] patches applied to the sources Another attempt to fix the issue, this time a little bit decent. I created a separate file that holds the strndup implementation. It's header file is now included by the main.c file. The strndup code is optional based on the existence of strndup according to configure.
Created attachment 68681 [details] strutils.c strutils.c file which implements strndup
Created attachment 68682 [details] strutils.h header file for strutils.c
Created attachment 68688 [details, diff] patched ebuild these are my changes to the ebuild to get the previously supplied files and patches working
> these are my changes to the ebuild to get the previously supplied files and > patches working I think the code looks good, and the package emerges fine.
Created attachment 68987 [details, diff] cleaned up patch Hola. cleaned up the patch a bit, fixing up lot of old/icky autoconf crap with it, and lack of DESTDIR make support. please take it for a spin;
Created attachment 68988 [details, diff] updated ebuild patch.
> Hola. cleaned up the patch a bit, fixing up lot of old/icky autoconf crap with > it, and lack of DESTDIR make support. > please take it for a spin; Emerges fine here.
patch is in as rzip-2.0-r1, keyword at your leisure. ;)
-r2 I assume/know for sure. now also available for ~ppc-macos-xians Brian, thanks for your additional patching/efforts!
This "cleaned up" patch that is "fixing up lot of old/icky autoconf crap with it" broke rzip on at least x86. See bug [217552]. And yes, I choose ugly but working over nice but breaking silently every time.