Make fortran support an option and enable it only on supported platforms.

Fixes build failure on platforms that are not supported by g95,
including NetBSD/arm 6.1.  PR/47965

Ok'ed by wiz@.
This commit is contained in:
tsutsui 2013-06-29 18:59:43 +00:00
parent 3e1073f11d
commit 35ab0f85cd
2 changed files with 21 additions and 6 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.44 2013/06/07 13:28:56 gdt Exp $
# $NetBSD: Makefile,v 1.45 2013/06/29 18:59:43 tsutsui Exp $
DISTNAME= fftw-3.3.3
PKGREVISION= 1
@ -19,11 +19,7 @@ USE_TOOLS+= gmake
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-shared
# The next lines are fodder for a fortran option.
# Swapping the comments doesn't change the PLIST. So what's the
# benefit of not?
USE_LANGUAGES+= fortran77
# CONFIGURE_ARGS+= --disable-fortran
.include "options.mk"
PKGCONFIG_OVERRIDE+= fftw.pc.in
INFO_FILES= yes

19
math/fftw/options.mk Normal file
View file

@ -0,0 +1,19 @@
# $NetBSD: options.mk,v 1.1 2013/06/29 18:59:43 tsutsui Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.fftw
PKG_SUPPORTED_OPTIONS= fftw-fortran
# Enable fortran support by default on platforms supported by lang/g95.
.if (!empty(MACHINE_ARCH:Mi386) || !empty(MACHINE_ARCH:Mx86_64) || \
!empty(MACHINE_ARCH:Mia64) || !empty(MACHINE_ARCH:Mpowerpc*) || \
!empty(MACHINE_ARCH:Mhppa) || !empty(MACHINE_ARCH:Msparc*) || \
!empty(MACHINE_ARCH:Malpha) || !empty(MACHINE_ARCH:Mmips*))
PKG_SUGGESTED_OPTIONS= fftw-fortran
.endif
.include "../../mk/bsd.options.mk"
.if !empty(PKG_OPTIONS:Mfftw-fortran)
USE_LANGUAGES+= fortran77
.else
CONFIGURE_ARGS+= --disable-fortran
.endif