summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
diff options
context:
space:
mode:
authorjlam <jlam>2005-01-12 15:31:58 +0000
committerjlam <jlam>2005-01-12 15:31:58 +0000
commit5937043cc1cdd52848b52103904de7cee12ad3be (patch)
treec0c77d22dc6d7622e4196a9cf79e6fc77ed93ceb /mk/compiler.mk
parentd476dee04f2dafe646b6b0b363b0517ce6053be7 (diff)
downloadpkgsrc-5937043cc1cdd52848b52103904de7cee12ad3be.tar.gz
Nuke USE_FORTRAN and bring the f2c handling within the mk/compiler
framework. The list of changes include: * Modify compiler.mk so that "c" is always prepended to USE_LANGUAGES, so we no longer need to say it in package Makefiles. Packages should now append to USE_LANGUAGES instead of setting it. * Create mk/compiler/f2c.mk which implements another pseudo-compiler "f2c" that may be used with any C compiler backend, e.g. PKGSRC_COMPILER= f2c ccache gcc * Teach the various "real" compiler files, e.g., sunpro.mk, mipspro.mk, etc., to use f2c if the native Fortran compiler isn't present. Packages that use Fortran should now simply include the line: USE_LANGUAGES+= fortran in the package Makefile.
Diffstat (limited to 'mk/compiler.mk')
-rw-r--r--mk/compiler.mk23
1 files changed, 15 insertions, 8 deletions
diff --git a/mk/compiler.mk b/mk/compiler.mk
index 342694b4798..08854fae6bf 100644
--- a/mk/compiler.mk
+++ b/mk/compiler.mk
@@ -1,4 +1,4 @@
-# $NetBSD: compiler.mk,v 1.42 2005/01/10 09:05:01 jlam Exp $
+# $NetBSD: compiler.mk,v 1.43 2005/01/12 15:32:01 jlam Exp $
#
# This Makefile fragment implements handling for supported C/C++/Fortran
# compilers.
@@ -13,6 +13,7 @@
# ccc Compaq C Compilers (Tru64)
# ccache compiler cache (chainable)
# distcc distributed C/C++ (chainable)
+# f2c Fortran 77 to C compiler (chainable)
# gcc GNU
# mipspro Silicon Graphics, Inc. MIPSpro (n32/n64)
# mipspro-ucode Silicon Graphics, Inc. MIPSpro (o32)
@@ -20,10 +21,12 @@
# ONE Studio
# xlc IBM's XL C/C++ compiler suite
#
-# The default is "gcc". You can use ccache and/or distcc with an
-# appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
-# The chain should always end in a real compiler. This should only
-# be set in /etc/mk.conf.
+# The default is "gcc". You can use ccache and/or distcc with
+# an appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc
+# gcc". You can also use "f2c" to overlay the lang/f2c package
+# over the C compiler instead of using the system Fortran
+# compiler. The chain should always end in a real compiler.
+# This should only be set in /etc/mk.conf.
#
# GCC_REQD
# A list of version numbers used to determine the minimum
@@ -45,7 +48,7 @@
# Lists the languages used in the source code of the package,
# and is used to determine the correct compilers to install.
# Valid values are: c, c++, fortran, java, objc. The default
-# is "c".
+# is "c" ("c" is actually _always_ implicitly in this list).
#
# The following variables are defined, and available for testing in
# package Makefiles:
@@ -65,20 +68,24 @@ BSD_COMPILER_MK= defined
.include "../../mk/bsd.prefs.mk"
-# By default, assume that the package requires a C compiler.
+# Always require a C compiler for proper compiler detection.
USE_LANGUAGES?= c
+.if empty(USE_LANGUAGES:Mc)
+USE_LANGUAGES:= c ${USE_LANGUAGES}
+.endif
# Default to using gcc.
PKGSRC_COMPILER?= gcc
# For environments where there is an external gcc too, but pkgsrc
# should use the pkgsrc one for consistency.
+#
.if defined(USE_PKGSRC_GCC)
_USE_PKGSRC_GCC= yes
.endif
_COMPILERS= ccc gcc mipspro mipspro-ucode sunpro xlc
-_PSEUDO_COMPILERS= ccache distcc
+_PSEUDO_COMPILERS= ccache distcc f2c
.if defined(NOT_FOR_COMPILER) && !empty(NOT_FOR_COMPILER)
. for _compiler_ in ${_COMPILERS}