fix the clang build

This commit is contained in:
Brendan Fabeny
2011-08-20 11:28:54 +00:00
parent 509a931849
commit 81711c866d
2 changed files with 38 additions and 2 deletions

View File

@@ -22,8 +22,17 @@ BINFILES= busgen capgen cubegen fastcap pipedgen pyragen
post-patch:
@${REINPLACE_CMD} -e 's,TYPE=other,TYPE=4,' \
${WRKSRC}/config
@${REINPLACE_CMD} -e 's,CFLAGS =,CFLAGS +=,' \
@${REINPLACE_CMD} -Ee '/CFLAGS =/{s/=/+=/;s/-O[[:digit:]]*//;}' \
${WRKSRC}/src/Makefile.4
#minimal changes to fix the clang build (there should be a more thorough
#clean-up, to correct types of functions, remove implicit declarations, fix
#formatting, add missing returns, etc.)
@${REINPLACE_CMD} -E -e 's,^mul(Up|Down),void &,' \
${WRKSRC}/src/mulDo.c
@${REINPLACE_CMD} -e 's,^mulMatUp,void &,' \
${WRKSRC}/src/mulMats.c
@${REINPLACE_CMD} -e 's,^static getnbrs,static void getnbrs,' \
${WRKSRC}/src/mulSetup.c
do-install:
.for b in ${BINFILES}

View File

@@ -18,9 +18,36 @@ CONFIGURE_SCRIPT= config
WRKSRC = ${WRKDIR}/fasthenry-3.0wr
post-patch:
@${REINPLACE_CMD} -e 's,CFLAGS =, CFLAGS +=,' \
@${REINPLACE_CMD} -Ee '/CFLAGS =/{s/=/+=/;s/-O[[:digit:]]*//;}' \
${WRKSRC}/src/fasthenry/Makefile.default \
${WRKSRC}/src/fasthenry/sparse/Makefile \
${WRKSRC}/src/zbuf/Makefile.default
#minimal changes to fix the clang build (there should be a more thorough
#clean-up, to correct types of functions, remove implicit declarations, fix
#formatting, add missing returns, etc.)
@${REINPLACE_CMD} -e 's,return;,return 0;,' \
${WRKSRC}/src/fasthenry/barnoldi.c \
${WRKSRC}/src/fasthenry/contact.c \
${WRKSRC}/src/fasthenry/findpaths.c \
${WRKSRC}/src/fasthenry/fillM.c \
${WRKSRC}/src/fasthenry/hole.c \
${WRKSRC}/src/fasthenry/induct.c \
${WRKSRC}/src/fasthenry/joelself.c \
${WRKSRC}/src/fasthenry/mulSetup.c \
${WRKSRC}/src/fasthenry/read_tree.c
@${REINPLACE_CMD} -Ee \
'/^(AllocateBlockOfAllocationList|InitializeElementBlocks|RecordAllocation)/,/^\}/s/return;/return 0;/' \
${WRKSRC}/src/fasthenry/sparse/spAllocate.c
@${REINPLACE_CMD} -Ee \
'/^(EnlargeMatrix|ExpandTranslationArrays|spcLinkRows)/,/^\}/s/return;/return 0;/' \
${WRKSRC}/src/fasthenry/sparse/spBuild.c
@${REINPLACE_CMD} -Ee \
'/^(ComplexRowColElimination|CountMarkowitz|CreateInternalVectors|ExchangeColElements|ExchangeRowElements|ExchangeRowsAndCols|MarkowitzProducts|RealRowColElimination|UpdateMarkowitzNumbers|spcColExchange|spcRowExchange)/,/^\}/s/return;/return 0;/' \
${WRKSRC}/src/fasthenry/sparse/spFactor.c
@${REINPLACE_CMD} -Ee 's,^mul(Up|Down),void &,' \
${WRKSRC}/src/fasthenry/mulDo.c
@${REINPLACE_CMD} -e 's,^mulMatUp,void &,' \
${WRKSRC}/src/fasthenry/mulMats.c
do-install:
@${INSTALL_PROGRAM} ${WRKSRC}/bin/fasthenry ${PREFIX}/bin/