pkgsrc/devel/libffi/Makefile
dsainty 59afafc1a4 Revert portions of PR/48587 - applied in 2014 to resolve some issue
with building on Irix.  The changes applied to 'configure' introduce
some quite ugly quote nesting that not all shells (E.g. ksh) can
comprehend.

After discussion, prefer to roll back what looks like undesirable and
unnecessary changes, and drop the 'bash' dependency.  My suspicion is
that the old 'configure' patch is unhelpful even for Irix.

The reason for the PR/48587 changes are not clear, given that part of
that patch also selected 'bash' as the shell to use - which should
have made editing the script unnecessary in the first place.

Demonstrating the problem bringing all this to attention, this is what
happens if you are using ksh as the Pkgsrc shell on MacOS X:

===> Building for libffi-3.3nb2
/bin/ksh: : cannot execute [Is a directory]
<hangs>

The cause is this ugly looking quote nesting that was introduced by
patch-configure in PR/48587...

$ BUILD="` grep "^#### $HOST " Makefile | sed -e 's/.*|//' `"
ksh: : cannot execute [Is a directory]
^C
% bash
bash-5.0$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
bash-5.0$ exit
% sh
sh-3.2$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
sh-3.2$ exit

Removing patch-configure results in this much simpler, portable looking
script:

$ BUILD=` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `

No PKGREVISION bump, this change is not anticipated to affect the
package contents, only the success or failure of the build.
2020-04-24 10:19:32 +00:00

51 lines
1.4 KiB
Makefile

# $NetBSD: Makefile,v 1.42 2020/04/24 10:19:32 dsainty Exp $
DISTNAME= libffi-3.3
PKGREVISION= 2
CATEGORIES= devel
MASTER_SITES= ftp://sourceware.org/pub/libffi/
MAINTAINER= asau@inbox.ru
HOMEPAGE= https://www.sourceware.org/libffi/
COMMENT= Foreign function interface
LICENSE= mit
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
USE_TOOLS+= gmake pkg-config
USE_TOOLS.SunOS+= perl
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --disable-multi-os-directory
CONFIGURE_ARGS+= --includedir=${PREFIX}/include
PKGCONFIG_OVERRIDE+= libffi.pc.in
INFO_FILES= yes
TEST_DEPENDS+= dejagnu-[0-9]*:../../devel/dejagnu
TEST_TARGET= check
.include "../../mk/compiler.mk"
# The Compaq C frontend groks .s, but not .S. Assemble osf.S directly w/ as(1).
pre-build:
.if !empty(PKGSRC_COMPILER:Mccc)
cd ${WRKSRC} && ./libtool --mode=compile --tag=CC as -I. -Iinclude -o src/alpha/osf.lo -c src/alpha/osf.S
.endif
.include "../../mk/bsd.prefs.mk"
# patch-src_m68k_ffi.c uses m68k_sync_icache(2)
.if !empty(MACHINE_PLATFORM:MNetBSD-*-m68k)
LIBS+= -lm68k
.endif
# fix http://gnats.netbsd.org/42865
.if !empty(MACHINE_PLATFORM:MSunOS-*-i386) && !empty(CC_VERSION:Mgcc-[23]*)
CPPFLAGS+= -D__PIC__
.endif
# On platforms where ld(1) is LLVM ld, relocations against read-only
# segments has to be explicitly allowed.
.if !empty(MACHINE_PLATFORM:MFreeBSD-1[2-9].*-*)
CFLAGS+= -Wl,-z,notext
.endif
.include "../../mk/pthread.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"