Fix hard-coded endianness. Use <endian.h> instead

epel9
David Woodhouse 20 years ago
parent c5796ad5c1
commit 75b5986863

@ -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 <endian.h>
/* 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__

@ -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 # Endian: define either _LITTLE_ENDIAN or _BIG_ENDIAN
+CC = gcc +CC = gcc
ENDIAN = -D_LITTLE_ENDIAN -ENDIAN = -D_LITTLE_ENDIAN
+#ENDIAN = -D_LITTLE_ENDIAN
-CFLAGS = -g -I.. -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2 -CFLAGS = -g -I.. -DPROJ4 $(ENDIAN) -DDEBUG -DDEBUG2
+EXTRACFLAGS = -g +EXTRACFLAGS = -g

@ -2,11 +2,12 @@
Summary: API in "C" for Shapefile handling Summary: API in "C" for Shapefile handling
Name: shapelib Name: shapelib
Version: 1.2.10 Version: 1.2.10
Release: 5 Release: 6
Epoch: 0 Epoch: 0
URL: http://shapelib.maptools.org/ URL: http://shapelib.maptools.org/
Source: http://shapelib.maptools.org/dl/shapelib-%{version}.tar.gz Source: http://shapelib.maptools.org/dl/shapelib-%{version}.tar.gz
Patch0: shapelib-%{version}.patch Patch0: shapelib-%{version}.patch
Patch1: shapelib-1.2.10-endian.patch
License: LGPL/MIT License: LGPL/MIT
Group: Development/Libraries Group: Development/Libraries
Buildrequires: libtool Buildrequires: libtool
@ -30,6 +31,7 @@ This package contains libshp and the appropriate header files.
%prep %prep
%setup -q -T -b 0 %setup -q -T -b 0
%patch -p1 -b .buildroot %patch -p1 -b .buildroot
%patch1 -p1 -b .endian
%build %build
make %{?_smp_mflags} libdir=%{_libdir} CFLAGS="$RPM_OPT_FLAGS" lib make %{?_smp_mflags} libdir=%{_libdir} CFLAGS="$RPM_OPT_FLAGS" lib
@ -70,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_libdir}/libshp.la %exclude %{_libdir}/libshp.la
%changelog %changelog
* Sun Feb 13 2005 David Woodhouse <dwmw2@infradead.org> 0:1.2.10-6
- Don't hard-code endianness; just use endian.h
* Wed Dec 15 2004 David M. Kaplan <dmk@erizo.ucdavis.edu> 0:1.2.10-5 * Wed Dec 15 2004 David M. Kaplan <dmk@erizo.ucdavis.edu> 0:1.2.10-5
- Patched patch and spec file according to suggestions of Michael Schwendt - Patched patch and spec file according to suggestions of Michael Schwendt
- In particular, this separates the building from the installing in the rpm. - In particular, this separates the building from the installing in the rpm.

Loading…
Cancel
Save