From 75b598686366d96ab2678b82fbd4ca5e1d6f683e Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 13 Feb 2005 12:11:03 +0000 Subject: [PATCH] Fix hard-coded endianness. Use instead --- shapelib-1.2.10-endian.patch | 24 ++++++++++++++++++++++++ shapelib-1.2.10.patch | 3 ++- shapelib.spec | 7 ++++++- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 shapelib-1.2.10-endian.patch diff --git a/shapelib-1.2.10-endian.patch b/shapelib-1.2.10-endian.patch new file mode 100644 index 0000000..fd8892f --- /dev/null +++ b/shapelib-1.2.10-endian.patch @@ -0,0 +1,24 @@ +--- shapelib-1.2.10/contrib/my_nan.h.orig 2005-02-13 12:04:41.484914852 +0000 ++++ shapelib-1.2.10/contrib/my_nan.h 2005-02-13 12:07:03.306704589 +0000 +@@ -21,16 +21,18 @@ + + #define _GNU_NAN_H 1 + ++#include + + /* hacked to define NAN on Solaris 2.7 if it wasn't defined */ + + /* IEEE Not A Number. */ + +-#ifdef _BIG_ENDIAN ++#if __BYTE_ORDER == __BIG_ENDIAN + # define __nan_bytes { 0x7f, 0xf8, 0, 0, 0, 0, 0, 0 } +-#endif +-#ifdef _LITTLE_ENDIAN ++#elif __BYTE_ORDER == __LITTLE_ENDIAN + # define __nan_bytes { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f } ++#else ++#error No endianness? + #endif + + #ifdef __GNUC__ diff --git a/shapelib-1.2.10.patch b/shapelib-1.2.10.patch index b410340..ee9a975 100644 --- a/shapelib-1.2.10.patch +++ b/shapelib-1.2.10.patch @@ -91,7 +91,8 @@ diff -Naur shapelib-1.2.10.orig/contrib/Makefile shapelib-1.2.10/contrib/Makefil # Endian: define either _LITTLE_ENDIAN or _BIG_ENDIAN +CC = gcc - ENDIAN = -D_LITTLE_ENDIAN +-ENDIAN = -D_LITTLE_ENDIAN ++#ENDIAN = -D_LITTLE_ENDIAN -CFLAGS = -g -I.. -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2 +EXTRACFLAGS = -g diff --git a/shapelib.spec b/shapelib.spec index 282e5c5..9e4df57 100644 --- a/shapelib.spec +++ b/shapelib.spec @@ -2,11 +2,12 @@ Summary: API in "C" for Shapefile handling Name: shapelib Version: 1.2.10 -Release: 5 +Release: 6 Epoch: 0 URL: http://shapelib.maptools.org/ Source: http://shapelib.maptools.org/dl/shapelib-%{version}.tar.gz Patch0: shapelib-%{version}.patch +Patch1: shapelib-1.2.10-endian.patch License: LGPL/MIT Group: Development/Libraries Buildrequires: libtool @@ -30,6 +31,7 @@ This package contains libshp and the appropriate header files. %prep %setup -q -T -b 0 %patch -p1 -b .buildroot +%patch1 -p1 -b .endian %build make %{?_smp_mflags} libdir=%{_libdir} CFLAGS="$RPM_OPT_FLAGS" lib @@ -70,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT %exclude %{_libdir}/libshp.la %changelog +* Sun Feb 13 2005 David Woodhouse 0:1.2.10-6 +- Don't hard-code endianness; just use endian.h + * Wed Dec 15 2004 David M. Kaplan 0:1.2.10-5 - Patched patch and spec file according to suggestions of Michael Schwendt - In particular, this separates the building from the installing in the rpm.