a9220e6634
The wrong C++ flag, --no-exceptions, was being passed to these ports. The correct flag is "-fno-exceptions". Apparently gcc accepts the former, but clang does not. The current code states that clang version 3.2 will accept --no-exceptions, but this isn't the case either. However, both of these ports will build without a no-exceptions flag with clang. GCC still requires it. Rework the clang detection code. If code is not detected, -fno-exceptions is added to CXXFLAGS, otherwise nothing is done. Besides fixing the flag handling, this implemention avoids the bmake errors that _CLANG!= was generating. Approved by: bapt (mentor), maintainer
52 lines
1.2 KiB
Makefile
52 lines
1.2 KiB
Makefile
# Created by: Emanuel Haupt <ehaupt@critical.ch>
|
|
# $FreeBSD$
|
|
|
|
PORTNAME= penguinsap
|
|
PORTVERSION= 0.1
|
|
CATEGORIES= audio
|
|
MASTER_SITES= CRITICAL
|
|
|
|
MAINTAINER= ehaupt@FreeBSD.org
|
|
COMMENT= Command-line Atari(TM) .sap player
|
|
|
|
USE_DOS2UNIX= yes
|
|
|
|
SOURCES= sapPokey pokey1 sapCpu sapEngine main pokey0
|
|
|
|
.if defined(WITH_OPTIMIZED_CFLAGS)
|
|
EXTRAFLAGS= -ffast-math -malign-double -finline-limit-1000000 \
|
|
-funroll-loops -fstrength-reduce -finline-functions
|
|
.endif
|
|
|
|
PLIST_FILES= bin/sap
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
_CLANG!= ${CXX} --version | ${HEAD} -1 | ${SED} -e 's/.*clang version \([0-9]\)\.\([0-9]\).*/\1\2/'
|
|
ISCLANG= ${_CLANG:M[34][0-9]}
|
|
|
|
# clang can build this without -fno-exceptions
|
|
.if empty(ISCLANG)
|
|
CXXFLAGS+= -fno-exceptions
|
|
.endif
|
|
|
|
post-patch:
|
|
@${REINPLACE_CMD} -e 's|linux/soundcard\.h|sys/soundcard\.h|' \
|
|
${WRKSRC}/main.cpp
|
|
@${REINPLACE_CMD} -e 's|--no-exceptions||' ${WRKSRC}/build.inc
|
|
|
|
do-build:
|
|
.for f in ${SOURCES}
|
|
${CXX} ${CXXFLAGS} ${EXTRAFLAGS} -c ${WRKSRC}/${f}.cpp \
|
|
-o ${WRKSRC}/${f}.o
|
|
.endfor
|
|
${CC} ${CFLAGS} ${EXTRAFLAGS} ${SOURCES:C/(.*)/${WRKSRC}\/\1.o/} \
|
|
-o ${WRKSRC}/sap
|
|
|
|
do-install:
|
|
${INSTALL_PROGRAM} ${WRKSRC}/sap ${PREFIX}/bin
|
|
|
|
post-install:
|
|
@${CAT} ${PKGMESSAGE}
|
|
|
|
.include <bsd.port.post.mk>
|