Date: Mon, 2 Jun 2014 20:14:24 +0000 (UTC) From: Tijl Coosemans <tijl@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r356247 - in head/chinese/autoconvert: . files Message-ID: <201406022014.s52KEOtS002927@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tijl Date: Mon Jun 2 20:14:24 2014 New Revision: 356247 URL: http://svnweb.freebsd.org/changeset/ports/356247 QAT: https://qat.redports.org/buildarchive/r356247/ Log: Properly respect CFLAGS, LDFLAGS, etc. When building a port with base system make, variables like CC and CFLAGS need to be defined using '=' in the makefile. With '+=' values from make.conf can be picked up. Normally the ports system values for these variables are passed to a configure script which generates a makefile with them. If there's no configure script the makefile has to be patched to use the right values. Modified: head/chinese/autoconvert/Makefile head/chinese/autoconvert/files/patch-Makefile head/chinese/autoconvert/files/patch-hzconvert-Makefile Modified: head/chinese/autoconvert/Makefile ============================================================================== --- head/chinese/autoconvert/Makefile Mon Jun 2 18:57:55 2014 (r356246) +++ head/chinese/autoconvert/Makefile Mon Jun 2 20:14:24 2014 (r356247) @@ -3,9 +3,10 @@ PORTNAME= autoconvert PORTVERSION= 0.3.16 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= chinese MASTER_SITES= GOOGLE_CODE +PROJECTHOST= libhz DISTNAME= ${PKGNAMEPREFIX}${PORTNAME}-${PORTVERSION} MAINTAINER= ports@FreeBSD.org @@ -16,18 +17,18 @@ LICENSE_COMB= dual OPTIONS_DEFINE= DOCS -MAKE_ENV= CFLAG="${CPPFLAGS}" LIBS="${LDFLAGS}" -MAKE_ARGS= CC="${CC}" MAKE_JOBS_UNSAFE= yes USE_LDCONFIG= yes WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} -PROJECTHOST= libhz - .include <bsd.port.options.mk> post-patch: - @${REINPLACE_CMD} -e "s|^CFLAGS|#CFLAGS|" ${WRKSRC}/contrib/xchat-plugins/Makefile + @${REINPLACE_CMD} -e 's/CFLAG/CFLAGS/' -e 's/make/$$(MAKE)/' \ + ${WRKSRC}/Makefile + @${REINPLACE_CMD} -e 's/gcc/${CC}/' -e 's/LIBS=/&${LDFLAGS} /' \ + -e 's/CFLAGS=/&${CPPFLAGS} ${CFLAGS} /' \ + ${WRKSRC}/Makefile ${WRKSRC}/hzconvert/Makefile post-install: .if ${PORT_OPTIONS:MDOCS} Modified: head/chinese/autoconvert/files/patch-Makefile ============================================================================== --- head/chinese/autoconvert/files/patch-Makefile Mon Jun 2 18:57:55 2014 (r356246) +++ head/chinese/autoconvert/files/patch-Makefile Mon Jun 2 20:14:24 2014 (r356247) @@ -1,12 +1,11 @@ --- Makefile.orig 2001-04-28 09:45:46.000000000 +0800 +++ Makefile 2013-09-27 20:16:44.000000000 +0800 -@@ -1,11 +1,10 @@ +@@ -1,11 +1,11 @@ --CC=gcc + CC=gcc -CFLAG=-O2 -g -Wall -Iinclude --LIBS= -Llib -lhz -+CFLAG+=-Iinclude -+LIBS+=-Llib -lhz ++CFLAG=-Iinclude + LIBS= -Llib -lhz .PHONY: all hzlib clean install-home install @@ -15,7 +14,7 @@ autob5: autogb rm -f autob5;ln -s autogb autob5 -@@ -30,12 +29,9 @@ install-home: +@@ -30,12 +30,10 @@ install-home: ln -s $(HOME)/bin/autogb $(HOME)/bin/autob5 chmod 755 $(HOME)/bin/autogb install: @@ -28,9 +27,10 @@ - install -m 755 contrib/xchat-plugins/xchat-autob5.so $(DESTDIR)/usr/share/zh-autoconvert - install -m 644 include/*.h $(DESTDIR)/usr/include - ln -s autogb $(DESTDIR)/usr/bin/autob5 -+ ${BSD_INSTALL_PROGRAM} autogb $(DESTDIR)/$(PREFIX)/bin -+ ${BSD_INSTALL_PROGRAM} lib/libhz.so.0.0 $(DESTDIR)/$(PREFIX)/lib/libhz.so.0 -+ ln -sf libhz.so.0 $(DESTDIR)/$(PREFIX)//lib/libhz.so -+ ${BSD_INSTALL_PROGRAM} lib/libhz.a $(DESTDIR)/$(PREFIX)/lib -+ ${BSD_INSTALL_DATA} include/*.h $(DESTDIR)/$(PREFIX)/include -+ ln -sf autogb $(DESTDIR)/$(PREFIX)/bin/autob5 ++ ${BSD_INSTALL_PROGRAM} autogb $(DESTDIR)$(PREFIX)/bin ++ ${BSD_INSTALL_PROGRAM} lib/libhz.so.0.0 $(DESTDIR)$(PREFIX)/lib ++ ln -sf libhz.so.0.0 $(DESTDIR)$(PREFIX)/lib/libhz.so.0 ++ ln -sf libhz.so.0.0 $(DESTDIR)$(PREFIX)/lib/libhz.so ++ ${BSD_INSTALL_LIB} lib/libhz.a $(DESTDIR)$(PREFIX)/lib ++ ${BSD_INSTALL_DATA} include/*.h $(DESTDIR)$(PREFIX)/include ++ ln -sf autogb $(DESTDIR)$(PREFIX)/bin/autob5 Modified: head/chinese/autoconvert/files/patch-hzconvert-Makefile ============================================================================== --- head/chinese/autoconvert/files/patch-hzconvert-Makefile Mon Jun 2 18:57:55 2014 (r356246) +++ head/chinese/autoconvert/files/patch-hzconvert-Makefile Mon Jun 2 20:14:24 2014 (r356247) @@ -1,9 +1,10 @@ --- hzconvert/Makefile.orig 2001-01-08 18:03:21.000000000 +0800 +++ hzconvert/Makefile 2010-06-30 10:13:35.000000000 +0800 -@@ -1,18 +1,17 @@ --CC=gcc -I../include +@@ -1,18 +1,19 @@ + CC=gcc -I../include -CFLAGS=-O2 -Wall -g -+CFLAGS+=-fPIC -Wall -g -I../include ++CFLAGS=-fPIC -Wall -g -I../include ++LIBS= SHARED_LIB=libhz.so SHARED_LIB_MAJOR=$(SHARED_LIB).0 SHARED_LIB_MINOR=$(SHARED_LIB_MAJOR).0 @@ -19,7 +20,7 @@ libhzconvert: $(OBJS) ar rs ../lib/libhz.a $(OBJS) - gcc -fPIC -shared -Wl,-soname,$(SHARED_LIB_MAJOR) -o ../lib/$(SHARED_LIB_MINOR) $(OBJS) -ldl -+ $(CC) -fPIC -shared -Wl,-soname,$(SHARED_LIB_MAJOR) -o ../lib/$(SHARED_LIB_MINOR) $(OBJS) ++ $(CC) -shared -Wl,-soname,$(SHARED_LIB_MAJOR) -o ../lib/$(SHARED_LIB_MINOR) $(OBJS) $(LIBS) rm -f ../lib/$(SHARED_LIB_MAJOR) rm -f ../lib/$(SHARED_LIB) cd ../lib;ln -s $(SHARED_LIB_MINOR) $(SHARED_LIB_MAJOR)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406022014.s52KEOtS002927>