ports/comms/wspr/files/patch-Makefile.in
Diane Bruce 7ce1d917d3 Fix build under gfortran7
Bug 222560: comms/wspr: fails to build with lang/gcc7 or later
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222560

PR:		ports/222560
Reported by:	Jan Beich <jbeich@FreeBSD.org>
2017-09-27 23:29:43 +00:00

132 lines
4.9 KiB
Text

--- Makefile.in.orig 2017-09-27 19:55:15 UTC
+++ Makefile.in
@@ -25,7 +25,8 @@ SHELL := @SHELL@
MKDIR := @MKDIR@
# Install locations
-INATALL := install
+INSTALL := install
+PREFIX := @PREFIX@
BINDIR := @BINDIR@
DOCDIR := @DOCDIR@
HOMEDIR := @HOMEDIR@
@@ -45,7 +46,7 @@ F2PY := @F2PY@
# Libs and Flags
LIBS := @LIBS@
-CPPFLAGS += ${DEFS}
+CPPFLAGS := @CPPFLAGS@
LDFLAGS += @LDFLAGS@
CFLAGS += @CFLAGS@
FFLAGS += @FFLAGS@
@@ -71,24 +72,24 @@ all: libwspr.a thnix.o WsprMod/w.so fmte
# Default Rules
%.o: %.c
- ${CC} ${CPPFLAGS} ${CFLAGS} -c $<
+ ${CC} ${CFLAGS} ${CPPFLAGS} ${DEFS} -c $<
%.o: %.f
- ${FC} ${FFLAGS} -c $<
+ ${FC} ${DEFS} ${CFLAGS} ${FFLAGS} -c $<
%.o: %.F
- ${FC} ${FFLAGS} -c $<
+ ${FC} ${DEFS} ${CFLAGS} ${FFLAGS} -c $<
%.o: %.f90
- ${FC} ${FFLAGS} -c $<
+ ${FC} ${DEFS} ${CFLAGS} ${FFLAGS} -c $<
%.o: %.F90
- ${FC} ${FFLAGS} -c $<
+ ${FC} ${DEFS} ${CFLAGS} ${FFLAGS} -c $<
# Objects
OBJS1 = wspr0.o wspr0init.o wspr0_rx.o wspr0_tx.o thnix_stub.o
wspr0: ${OBJS1}
- ${FC} ${FFLAGS} -o wspr0 ${FFLAGS} ${OBJS1} libwspr.a -lfftw3f -lportaudio
+ ${FC} ${PORTAUDIO_LIBDIR} ${FFLAGS} ${LDFLAGS} -o wspr0 ${FFLAGS} ${OBJS1} libwspr.a -lfftw3f -lportaudio
wsprcode: wsprcode.o thnix_stub.o
- ${FC} ${FFLAGS} -o wsprcode wsprcode.o thnix_stub.o libwspr.a -pthread
+ ${FC} ${PORTAUDIO_INCLUDE} ${FFLAGS} -o wsprcode wsprcode.o thnix_stub.o libwspr.a -pthread
OBJS3 = azdist.o ccf2.o chklevel.o db.o decode.o decode162.o deg2grid.o \
encode232.o fano232.o fchisq.o fil1.o flat3.o four2a.o\
@@ -105,21 +106,22 @@ OBJS3 = azdist.o ccf2.o chklevel.o db.o
# Build Library: libwspr.a
libwspr.a: ${OBJS3} acom1.f90 acom2.f90
- ${AR} cr libwspr.a ${OBJS3}
ranlib libwspr.a
+ ar cr libwspr.a ${OBJS3}
+# ${AR} cr libwspr.a ${OBJS3}
# Build FMT Applications
fmtest: fmtest.f90 libwspr.a
- ${FC} ${FFLAGS} -o fmtest fmtest.f90 libwspr.a -lfftw3f -lportaudio
+ ${FC} ${CFLAGS} ${FFLAGS} ${PORTAUDIO_LIBDIR} ${LDFLAGS} -o fmtest fmtest.f90 libwspr.a -lfftw3f -lportaudio
fmtave: fmtave.f90
- ${FC} ${FFLAGS} -o fmtave fmtave.f90
+ ${FC} ${PORTAUDIO_INCLUDE} ${CFLAGS} ${FFLAGS} ${PORTAUDIO_LIBDIR} ${LDFLAGS} -o fmtave fmtave.f90
fcal: fcal.f90
- ${FC} ${FFLAGS} -o fcal fcal.f90
+ ${FC} ${PORTAUDIO_INCLUDE} ${CFLAGS} ${FFLAGS} ${PORTAUDIO_LIBDIR} ${LDFLAGS} -o fcal fcal.f90
fmeasure: fmeasure.f90
- ${FC} ${FFLAGS} -o fmeasure fmeasure.f90
+ ${FC} ${PORTAUIO_INCLUDE} ${CFLAGS} ${FFLAGS} ${PORTAUDIO_LIBDIR} ${LDFLAGS} -o fmeasure fmeasure.f90
# SRC for w.so
F2PYSRCS = wspr1.f90 getfile.f90 paterminate.f90 audiodev.f90
@@ -127,30 +129,34 @@ F2PYSRCS = wspr1.f90 getfile.f90 patermi
# Build W.SO & MV to WsprMod/
WsprMod/w.so: libwspr.a ${F2PYSRCS} acom1.f90
${F2PY} -c --quiet --fcompiler=${FCV} --f77exec=${FC} --f90exec=${FC} \
- --opt="${FCOPT}" thnix.o ${LDFLAGS} ${LIBS} libwspr.a -m w ${F2PYSRCS}
+ --opt="${FCOPT}" thnix.o ${PORTAUDIO_LIBDIR} ${LDFLAGS} ${LIBS} libwspr.a -m w ${F2PYSRCS}
${MV} w*.so WsprMod/w.so
# Install target wspr
install:
- @clear
+# tput has no TERM under automated install
+# @clear
@echo '-----------------------------------'
@echo " Installing ${PROGRAM}"
@echo '-----------------------------------'
@echo ''
- @${MKDIR} -p ${DOCDIR}/examples
- @${MKDIR} -p ${SHARED}/save/Samples
- @${MKDIR} -p ${WSPRLIB}/WsprMod
- @install -m 755 --strip fmtest fcal fmeasure fmtave wspr0 wsprcode ${BINDIR}
- @install -m 644 manpages/man1/*.1 ${MANDIR}
- @install -m 644 save/Samples/* ${SHARED}/save/Samples/
- @install -m 755 ./{gocal,Pmw*.py,wspr.py,wspr.sh,wsprrc} ${SHARED}
- @install -m 644 ./{AUTHORS,README,NEWS,COPYING,COPYRIGHT} ${DOCDIR}
- @install -m 644 ./hamlib_rig* ${SHARED}
- @install -m 755 WsprMod/* ${WSPRLIB}/WsprMod
- @${MV} -T ${SHARED}/wspr.sh ${BINDIR}/wspr
- @${CHMOD} 755 ${BINDIR}/wspr
- @${CP} -r doc/examples/* ${DOCDIR}/examples/
- @${CHMOD} -R 644 ${DOCDIR}/examples/*
+ @${MKDIR} -p ${DESTDIR}${DOCDIR}/examples
+ @${MKDIR} -p ${DESTDIR}${SHARED}/save/Samples
+ @${MKDIR} -p ${DESTDIR}${WSPRLIB}/WsprMod
+ @install -m 655 fmtest fcal fmeasure fmtave wspr0 wsprcode ${DESTDIR}${BINDIR}
+ @strip ${DESTDIR}${BINDIR}/fmtest ${DESTDIR}${BINDIR}/fcal \
+ ${DESTDIR}${BINDIR}/fmeasure ${DESTDIR}${BINDIR}/fmtave \
+ ${DESTDIR}${BINDIR}/wspr0 ${DESTDIR}${BINDIR}/wsprcode
+ @install -m 644 manpages/man1/*.1 ${DESTDIR}${MANDIR}
+ @install -m 644 save/Samples/* ${DESTDIR}${SHARED}/save/Samples/
+ @install -m 755 gocal Pmw*.py wspr.py wspr.sh wsprrc ${DESTDIR}${SHARED}
+ @install -m 644 AUTHORS README NEWS COPYING COPYRIGHT ${DESTDIR}${DOCDIR}
+ @install -m 644 hamlib_rig* ${DESTDIR}${SHARED}
+ @install -m 755 WsprMod/* ${DESTDIR}${WSPRLIB}/WsprMod
+ @install -m 755 wspr.sh ${DESTDIR}${BINDIR}/wspr
+ @${CHMOD} 755 ${DESTDIR}${BINDIR}/wspr
+ @${CP} -r doc/examples/* ${DESTDIR}${DOCDIR}/examples/
+ @${CHMOD} -R 644 ${DESTDIR}${DOCDIR}/examples/*
@echo "Finished Installing ${PROGRAM}"
@echo ''
@echo '..To run, type..: wspr'