Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2012 13:23:04 +1100
From:      "Dewayne" <dewayne.geraghty@heuristicsystems.com.au>
To:        <doceng@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Ghostscript9 build fails - patch included.
Message-ID:  <BC6CEEDDAA1E4EBD81A6745CD92C2B60@white>

next in thread | raw e-mail | index | archive | help
The following patch enables ghostscript9-nox11 to build cleanly on FreeBSD 9.0Stable (patched to r231556)

--- openjpeg/libopenjpeg/opj_malloc.h.orig      2012-02-13 11:51:18.000000000 +1100
+++ openjpeg/libopenjpeg/opj_malloc.h   2012-02-13 11:50:11.000000000 +1100
@@ -85,8 +85,8 @@
                #define HAVE_MEMALIGN
        /* Linux x86_64 and OSX always align allocations to 16 bytes */
        #elif !defined(__amd64__) && !defined(__APPLE__)
-               #define HAVE_MEMALIGN
-               #include <malloc.h>
+               #define HAVE_POSIX_MEMALIGN
+               #include <stdlib.h>
        #endif
 #endif

I copied the patch to /usr/ports/print/ghostscript9/files/ as patch-ghostscript9-nox11-opj_malloc.h.  

This patch addresses two compilation failures:

cc -O2 -pipe -pipe -O2 -g0 -ggdb0 -DSTRIP_FBSDID -UDEBUGGING -UEBUGGING -fno-strict-aliasing -g -fPIC -DUPD_SIGNAL=0 -I.
-I/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05/lcms/include  -I/usr/local/include/libpng
-I/usr/local/include -I/usr/local/include/freetype2  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common
-DHAVE_STDINT_H=1 -DHAVE_SYS_TIME_H=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -O2 -pipe -pipe -O2 -g0 -ggdb0 -DSTRIP_FBSDID
-UDEBUGGING -UEBUGGING -fno-strict-aliasing -I/usr/local/include   -DGS_DEVS_SHARED
-DGS_DEVS_SHARED_DIR=\"/usr/local/lib/ghostscript/9.05\"  -DA4 -DOPJ_STATIC -I./soobj/ -Iopenjpeg/libopenjpeg
-Iopenjpeg/libopenjpeg/.. -DUSE_OPENJPEG_JP2 -o ./soobj/opj_bio.o -c openjpeg/libopenjpeg/bio.c
In file included from openjpeg/libopenjpeg/bio.c:32:
openjpeg/libopenjpeg/opj_includes.h:80:6: warning: "__STDC_VERSION__" is not defined In file included from
openjpeg/libopenjpeg/opj_malloc.h:89,
                 from openjpeg/libopenjpeg/opj_includes.h:108,
                 from openjpeg/libopenjpeg/bio.c:32:
/usr/include/malloc.h:3:2: error: #error "<malloc.h> has been replaced by <stdlib.h>"
gmake[2]: *** [soobj/opj_bio.o] Error 1
gmake[2]: Leaving directory `/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05'
gmake[1]: *** [so-subtarget] Error 2
gmake[1]: Leaving directory `/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05'
gmake: *** [so] Error 2
*** Error code 1

And after addressing this one, the following turned-up
cc  -DHAVE_MKSTEMP   -DHAVE_FONTCONFIG  -DHAVE_SETLOCALE     -O2 -pipe -pipe -O2 -g0 -ggdb0 -DSTRIP_FBSDID -UDEBUGGING
-UEBUGGING -fno-strict-aliasing -g -DUPD_SIGNAL=0 -I.
-I/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05/lcms/include  -I/usr/local/include/libpng
-I/usr/local/include -I/usr/local/include/freetype2  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations
-Wmissing-prototypes -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement -fno-builtin -fno-common
-DHAVE_STDINT_H=1 -DHAVE_SYS_TIME_H=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -O2 -pipe -pipe -O2 -g0 -ggdb0 -DSTRIP_FBSDID
-UDEBUGGING -UEBUGGING -fno-strict-aliasing -I/usr/local/include   -DGS_DEVS_SHARED
-DGS_DEVS_SHARED_DIR=\"/usr/local/lib/ghostscript/9.05\"  -DA4 -I./soobj -I./base  -DWHICH_CMS="lcms2" -g -o ./sobin/gsc
./psi/dxmainc.c \
-L./sobin -lgs
./sobin/libgs.so: undefined reference to `memalign'
gmake[2]: *** [sobin/gsc] Error 1
gmake[2]: Leaving directory `/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05'
gmake[1]: *** [so-subtarget] Error 2
gmake[1]: Leaving directory `/var/ports/usr/ports/print/ghostscript9-nox11/work/ghostscript-9.05'
gmake: *** [so] Error 2
*** Error code 1

I trust that this assists.

Regards, Dewayne.
Sydney, Australia (GMT +11 hours)
M: +61 (0)409-337-196  T: +61 (0)2-8206-9468 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BC6CEEDDAA1E4EBD81A6745CD92C2B60>