From b34874574db58f9abc92e0161fc509ff028ca187 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 24 Feb 2011 13:20:48 +0100 Subject: [PATCH] pcc-libs: use custom CFLAGS, build PIC objects. --- srcpkgs/pcc-libs/patches/build_PIC.patch | 33 ++++++++++++++++++++++++ srcpkgs/pcc-libs/template | 14 +++++++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/pcc-libs/patches/build_PIC.patch diff --git a/srcpkgs/pcc-libs/patches/build_PIC.patch b/srcpkgs/pcc-libs/patches/build_PIC.patch new file mode 100644 index 00000000000..a11fcff6c3a --- /dev/null +++ b/srcpkgs/pcc-libs/patches/build_PIC.patch @@ -0,0 +1,33 @@ +Respect passed CFLAGS to configure and force PIC object generation. + +--- csu/linux/Makefile.orig 2011-02-24 12:59:36.988078869 +0100 ++++ csu/linux/Makefile 2011-02-24 13:01:29.434007771 +0100 +@@ -4,7 +4,7 @@ VERSION ?= 0.9.9 + PCCLIBDIR ?= /usr/local/lib/pcc/$(TARGET)/$(VERSION)/lib + SRCDIR ?= . + +-CFLAGS = -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes ++CFLAGS += -fpic -fPIC -I$(SRCDIR)/$(MACH) -I$(SRCDIR) -Wall -Wstrict-prototypes -Wmissing-prototypes + + OBJS = crt0.o crt1.o gcrt1.o crti.o crtn.o crtbegin.o crtend.o + +--- libpcc/Makefile.in.orig 2011-02-24 13:02:15.570566278 +0100 ++++ libpcc/Makefile.in 2011-02-24 13:02:33.577393664 +0100 +@@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@ + libdir = @libdir@ + + CC = @CC@ ++CFLAGS = @CFLAGS@ -fpic -fPIC + TARGMACH = @targmach@ + TARGOS = @targos@ + TARGET = @target@ +--- libsoftfloat/Makefile.in.orig 2011-02-24 13:02:54.937188695 +0100 ++++ libsoftfloat/Makefile.in 2011-02-24 13:03:09.281050924 +0100 +@@ -12,6 +12,7 @@ exec_prefix = @exec_prefix@ + libdir = @libdir@ + + CC = @CC@ ++CFLAGS = @CFLAGS@ -fpic -fPIC + TARGET = @target@ + TARGMACH = @targmach@ + VERSION = @version@ diff --git a/srcpkgs/pcc-libs/template b/srcpkgs/pcc-libs/template index 9f5d0bb21c1..bd2d226a455 100644 --- a/srcpkgs/pcc-libs/template +++ b/srcpkgs/pcc-libs/template @@ -2,7 +2,7 @@ pkgname=pcc-libs version=20110224 distfiles="http://pcc.ludd.ltu.se/ftp/pub/$pkgname/$pkgname-$version.tgz" -build_style=gnu_configure +build_style=custom-install short_desc="Portable C Compiler - Support Libraries" maintainer="Juan RP " checksum=35624e4fc195da82ebb1b7d54b695918a7ec81079f7b44d8a769f45df34cd4d2 @@ -15,3 +15,15 @@ long_desc=" Add_dependency run glibc Add_dependency build flex + +do_build() +{ + # Force gcc compiler. + env CC=gcc ./configure --prefix=/usr + make ${makejobs} +} + +do_install() +{ + make DESTDIR=${DESTDIR} install +}