summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
AgeCommit message (Collapse)AuthorFilesLines
2013-07-07compiler.mk: Fix Ada packages when PKGSRC_COMPILER=clangmarino1-1/+7
Only one compiler is used when "ada" is listed in LANGUAGES, and that is the one built by the lang/gcc-aux source package. When PKGSRC_COMPILER is defined as anything else other than "gcc", the Ada packages fail to build. This can be seen when clang is used with CLANGBASE=${LOCALBASE}. This straight-forward fix is to override the user specification of PKGSRC_COMPILER when Ada is specified and define it as "gcc" in all cases. Tested on NetBSD 6.1 amd64 with CLANGBASE=${LOCALBASE}
2012-12-12compiler.mk, gcc.mk: Implement DRAGONFLY_CCVERmarino1-1/+5
DragonFly has two compilers in base, GCC 4.4.7 and GCC 4.7.2. The way one switches between them for userland programs is to set CCVER in the environment. However, to set this via make.conf is tricky. I've been using the low level "ALL_ENV+= CCVER=gcc47", but this trick fails to properly identify the compiler which results in _GCC_VERSION being incorrectly defined. Additionally, there are some prominent packages that do not build on gcc 4.7 and the fix is either not fully understood or would require a large amount of work to implement. In these cases, it is desireable to specify the package be built on gcc 4.4 regardless of CCVER setting. To address these issues, a new directive is added: DRAGONFLY_CCVER. It is only effective if OPSYS equals "DragonFly", and it will properly set CCVER and properly define _GCC_VERSION. It will also allow a per package specification of a particular compiler in the pkg makefile.
2012-08-09_LINKER_ABI_FLAG.* is not set anywhere in pkgsrc, remove to avoid confusion.jperkin1-2/+1
2012-08-09Ensure the Fortran wrappers specify the correct ABI if necessary. Fixes ajperkin1-1/+2
bunch of packages on Solaris when ABI=32 with 64-bit compilers.
2012-07-08compiler.mk/gcc.mk: Add support for USE_LANGUAGES+= adamarino1-4/+10
All recent packages featuring Ada code have a hard dependency on the lang/gnat-aux compiler package. The valid values for USE_LANGUAGES are c, c99, c++, fortran, fortran77, java, objc, so specifying a specific compiler was necessary up into now. One problem with lang/gnat-aux is that it is installed at ${LOCALBASE} where the lang/gccXX compilers are installed at ${LOCALBASE}/gccXX. The latter compilers have no possibility of sharing conflicting files unlike lang/gnat-aux. Rather than fundamentally update the GCC 4.6-based lang/gnat-aux to avoid these conflicts, a new Ada-capable compiler based on GCC 4.7 was created with the intent of being supported by mk/compiler.mk and mk/compiler/gcc.mk. The Ada packages will be effectively migrated from lang/gnat-aux to the new lang/gcc-aux compiler, but lang/gcc-aux will remain as a standalone package as it is the only GCC 4.6-based compiler that builds on DragonFly and serves it as a world and kernel compile option. In addition to the current language wrappers, lang/gcc-aux adds wrappers for "ada" (unique to gcc-aux, hardlinked to gcc driver), and the gnat, gnatmake, gnatbind, gnatlink, gnatchop, gnatprep, and gnatls programs. Supporting all of these allows the wrapper system to be used with Ada packages; currently wrappers are mostly disabled on them. The lang/gcc47 implicitly adds support for the "objc-c++" language by adding it to the USE_LANGUAGES list, but it wasn't really supported. An attempt was made to better support objc-c++, but this new enumeration probably still needs work or needs to be removed completely. Logic for Ada support: 1) All lang/gccXX compilers have version numbers ranging from 2.8.1 to 9. 2) lang/gcc-aux uses the release date as its version number in the form of YYYYMMDD with a minimum value of 20120614, so there is no version overlap. 3) When at least one element of USE_LANGUAGES is "ada", the value of 20120614 is added to the set of GCC_REQD which selects lang/gcc-aux. 4) The _NEED_NEWER_GCC check is disabled. It fails and isn't relevant; unless a package sets GCC_REQD over 20120614, the only way to select lang/gcc-aux is to specify the Ada language and only one compiler known to gcc.mk can support it.
2012-06-27Ensure the Solaris native linker is used by default, avoids conflictsjperkin1-1/+10
where GNU ld is picked up first via $PATH.
2012-04-13Move USE_PKGSRC_GCC from compler.mk to compler/gcc.mk and make it a yes/nosbd1-24/+1
check. At the same time cleanup GCC_REQD.
2010-11-17Revert unwanted part (uncompleted msc support) from last commit.obache1-3/+1
2010-11-17Replaced with ASCII char `-'.obache1-2/+4
2010-09-23Add support for clang.ahoka1-2/+4
2010-07-30Implement "fortran77" as alias for "fortran".asau1-4/+4
2009-07-08Add g95 support to the compiler framework, based on the existing f2cmarkd1-2/+2
support.
2009-05-30Rename GCC_USE_SYMLINKS to COMPILER_USE_SYMLINKS, implement it for thejoerg1-2/+10
other compiler drivers and enable it by default. Saves at least a percent of build time even for trivial packages like lang/lua.
2008-10-20Grammar fix in error message.wiz1-2/+2
2008-10-20Sanitise the error message of the fail-wrapper:ahoka1-3/+3
- Use PGKSRC-WARNING to note it's coming from pkgsrc and not always fatal. - Describe more precisely what's happening when you get this warning. Hopefuly this will stop the misundersanding of the error message I could see quite often amongst users.
2008-02-13Added a keyword for "bmake help".rillig1-1/+2
2008-02-07Replaced _PKG_SILENT and _PKG_DEBUG with RUN.rillig1-4/+4
2007-10-17Made the .include lines simpler.rillig1-3/+3
2007-09-20Added variable descriptions.rillig1-1/+6
2007-09-18For Portable C Compiler.reed1-2/+3
Add beginning of PKGSRC_COMPILER=pcc support. Based on "sunpro". Please help improve this. I have not tested with C++ or fortan.
2007-06-09There was one ">" too much, so the fail-wrapper warning was printedrillig1-2/+2
multiple times.
2007-06-08Changed the wording of the warning messages when a compiler-fail-wrapperrillig1-3/+7
is run. As a new feature, an error message is printed when the wrapper is called, so that there is a better trace to it than a completely empty output. See also: http://mail-index.netbsd.org/tech-pkg/2007/06/08/0017.html
2007-04-17add support for the HP-UX C/aC++ compilerstnn1-2/+3
2006-12-03If 'c99' is in USE_LANGUAGES also add 'c'.seb1-1/+6
I bet 'c99' support in USE_LANGUAGES was only tested on -current. On -current there is no g77 command so mk/compiler/gcc.mk includes mk/compiler/f2c.mk which adds 'c' to USE_LANGUAGES ;)
2006-12-02Instead of setting compiler flags in each package if it uses C99,jschauma1-3/+3
allow USE_LANGUAGES+=c99 and let gcc and mipspro do the right thing. May need to be reviewed/added for other compilers. ok rillig@
2006-11-16Allow CPP to be set to something not on the PATH (as used to work inmarkd1-1/+5
pre wrapper days). Especially useful for Solaris where cpp tends to live in /usr/css/lib/cpp.
2006-07-27Make the language warning a bit less forceful, since it is often a falsejoerg1-3/+3
warning.
2006-07-22The C compiler is also used for Objective C, so the c-fail-wrapper isrillig1-3/+3
only created if none of these languages is mentioned in USE_LANGUAGE.
2006-07-20Up to now, the language "c" has always been enabled, no matter if therillig1-5/+9
package said USE_LANGUAGES=#none or USE_LANGUAGES=fortran. Added a c-fail-wrapper that works like the other fail-wrappers. The default value for USE_LANGUAGES is still "c". Some problems are expected with packages that say USE_LANGUAGES+=c++ or with packages containing GNU configure scripts and setting USE_LANGUAGES=c++, as those scripts always need a working C compiler.
2006-07-02Reordered the variables in the interface comment so that allrillig1-8/+8
user-settable variables come first.
2006-06-09Introduce the capability to gather all the warnings and errors thatjlam1-2/+8
are generated for a target and output them all at once at the conclusion of the target's invocation. The implementation is in bsd.pkg.error.mk, which defines a macro target "error-check" that will print out any non-empty warning and error files in ${WARNING_DIR} and ${ERROR_DIR} and exit appropriately if there were errors. Convert some targets that were just long sequences of ${ERROR_MSG} or ${WARNING_MSG} within a single shell statement to use the new delayed error output via error-check. Modify the compiler "fail" wrappers for C++ and Fortran to be less verbose during invocation. Instead collect the warnings and only print them at the end of the completed phase, e.g. after "configure" and/or "build" completes.
2006-05-12Fix a problem that occurs if compiler.mk is included in a package'sjlam1-5/+6
Makefile, which means it occurs before bsd.tools.mk is included and thus misses the definition of TOOLS_DIR. We now create a new subdirectory of ${WRKDIR} to house the wrappers instead of re-using ${TOOLS_DIR}. Problem noted by Roland Illig on tech-pkg: http://mail-index.netbsd.org/tech-pkg/2006/05/12/0011.html
2006-05-11Make build failures due to the previous commit less mysterious by usingjlam1-3/+16
a wrapper script that emits a hint of what went wrong.
2006-05-06Force unrequested languages to be unavailable by setting them to ${FALSE}.tv1-1/+12
This way, missing language dependencies will be caught at build time. (Tested without problems on several C++ packages by unsetting LANGUAGES in them. I don't have a machine fast enough to bulk build, but I shall be watching the next round on pkgsrc-bulk to fix what I may not know about right now.)
2005-10-16added support for the SGI IDO (IRIX Development Option) cc used by IRIX 5.3.schwarz1-2/+3
changes approved by jschauma and recht.
2005-02-16note that xlc support is on Darwin.grant1-2/+2
2005-02-15add support for icc, the Intel C++ Compiler (Linux).grant1-2/+3
icc is a high performance compiler suite for Linux/i386 and ia64, and is free for non-commercial use. see: http://www.intel.com/software/products/compilers/clin/ for more information. tested with icc version 8.0 and 8.1 on Slackware 10/i386.
2005-01-24Merge down janitorial change from tv-derecurse branch:tv1-4/+1
Move definition of PKGSRC_COMPILER to defaults/mk.conf, to make it more readily seen by the user.
2005-01-12Nuke USE_FORTRAN and bring the f2c handling within the mk/compilerjlam1-8/+15
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.
2005-01-10Sort the compiler list in the comments.jlam1-3/+3
2004-11-30Remove the trailing whitespace in the values of the toolchain variablesjlam1-1/+5
(CC, LD, CXX, etc.) if the default values have no arguments. Now, CC == "cc" and not "cc ".
2004-11-30Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc.,jlam1-8/+10
are handled. The idea now is to simply remove the paths in the values of these variables, leaving behind only the basename plus any arguments, e.g.: CC= /usr/local/bin/gcc becomes CC= gcc CPP= /usr/local/bin/gcc -E becomes CPP= gcc -E The wrapper scripts are generated for every unique executable mentioned by the toolchain variables, so for the example above, only a "gcc" wrapper script is generated for ${CC} and ${CPP}. PKG_{CC,CPP,CXX,etc.} are the paths to the executables wrapped by the wrapper scripts. Note that it's now possible to set "CC" to something more than just the path to the compiler, e.g. CC= cc -ffast-math -funroll-loops -fomit-frame-pointer and the full value of ${CC} will be passed through via CONFIGURE_ENV and MAKE_ENV.
2004-11-28Set initial values for PKG_{CC,CPP,CXX,FC} which are used within thejlam1-1/+9
${compiler}.mk files to discover the short names of the compilers. This allows ccache.mk to properly create symlinks when CC is set explicitly within /etc/mk.conf.
2004-11-22Now that no package uses USE_GCC_SHLIB any longer, remove supportwiz1-14/+1
for it from compiler.mk. Move the variable of the same name used by compiler/gcc.mk and the gcc* buildlink3 files into private namespace (_USE_GCC_SHLIB).
2004-11-20add framework support for Tru64 and the Compaq C compiler.grant1-2/+3
patches provided by Tobias Nygren <tnn at netilium dot org> with minor changes by me.
2004-10-06add initial support for IBM's XL C/C++ compiler. tested with versiongrant1-2/+3
6.0 on Mac OS X 10.3.5. to use XL C, set PKGSRC_COMPILER=xlc in mk.conf. XLCBASE defaults to /opt/ibmcmp/vacpp/6.0 (the default installation location on OS X), this can be overridden in mk.conf too. this is a work in progress - some simple packages can be built, but there are still lots of issues that need to be worked through.
2004-09-21Initial commit of a new wrapper script framework that encapsulatesjlam1-1/+7
the non-buildlink-related code and moves it out of mk/buildlink3 into mk/wrapper. The buildlink3 code is modified to simply hook its transformations into the wrapper script framework. The wrapper script framework has some new features: * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by <tv>). * Much improved debugging output. It's possible to output the wrapper work log in-line with normal output by setting WRAPPER_LOG to "stderr". Important differences in behaviour from the old buildlink3 code include: * Only move the -l options to the end of the command line, leaving the -L options in-place. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la The old --fix-la syntax no longer works. 20040818 ======== * Initial release of a new wrapper script framework that encapsulates the non-buildlink-related code and moves it out of mk/buildlink3. These features include: * making MIPSpro accept GCC options * making MIPSpro "ucode" accept GCC options * making SunPro accept GCC options * making "ld" accept -Wl,* options and silently removing the "-Wl," * (NEW) making UnixWare GCC accept -rpath options and silently converting them into an appropriate LD_RUN_PATH One major benefit of this is that the buildlink3 code is now much tighter and easier to understand since it concerns itself solely with buildlink-related details. I haven't yet optimized the wrapper cache, so the new wrapper scripts may take slightly longer to execute than the old buildlink3 wrapper scripts, but I'll be improving this over time. 20040821 ======== * Move the inclusion of $cmd_sink outside of the main loop in wrapper.sh so that the $cmd_sink script can be used to globally scan and process the arguments. Move the LD_RUN_PATH code to a cmd-sink-unixware-gcc script. Garbage-collect the now unused export_vars-related code. * Add cmd-sink-aix-xlc for AIX xlc that munges -Wl,-R* into an appropriate -blibpath option. * Add cmd-sink-interix-gcc and cmd-sink-interix-ld that errors out when it sees -fpic/-fPIC and -shared/-Bshareable, respectively (requested by <tv>). * Move the code that converts full paths to shared libraries into the "-Ldir -llib" equivalents from the buildlink3 code into wrapper/logic. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Move the code that checks for absolute rpaths from the buildlink3 code into wrapper/arg-source. Remove the same from bsd.buildlink3.mk and gen-transform.sh. * Only move the -l options to the end of the command line, leaving the -L options in-place. * Add more debugging code. 20040824 ======== * Fix quoting problems after arguments are transformed. Remove the hack that was inserted that magically made almost everything work because we do it the right way now. * Move the inclusion of $logic outside of the main loop in wrapper.sh so that the $logic script doesn't have to worry about underflowing the argument buffer. * Encapsulate the loop in wrapper.sh that fills the argument buffer entirely within the arg-source script. * Move from the logic script into the arg-source script the transformations that merge or split arguments. * Fix bug where skipargs was effectively being ignored if it was more than 1. * Handle the whitespace in transformations in the logic script that turn one library option into multiple library options, e.g. "-lreadline" -> "-ledit -ltermcap". * Allow you to specify an environment variable WRAPPER_SKIP_TRANSFORM for whether you wish to skip the transformation step in the logic script. This is intended for testing purposes. * Added check_prog() and init_lib() functions to the shell code library to make it more reusable outside of the wrapper framework. * Allow the msg_log() function to output to "stdout" or "stderr". If you want to have all of the logging appear on the screen, then you can now set WRAPPER_LOG=stderr. * Make some of the script components not overridable on a per-wrapper basis. * Add a gen-transform.sh script that generates transformation sedfiles. The "transform" script is used to transform arguments, while the "untransform" script is used to unwrap files. Move the no-rpath logic from buildlink3/gen-transform.sh into wrapper/gen-transform.sh since it's not buildlink3-specific. * Check for a non-empty blibpath before adding the option in cmd-sink-aix-xlc. * Extend the autodetection of the libtool mode to detect "compile" and "uninstall". * Add a cmd-sink-libtool script that doesn't pass linker options to libtool unless we're in "link" mode. * Set _USE_RPATH to "yes" for UnixWare so that the wrappers will see the rpath options and convert them to a LD_RUN_PATH definition. * Add more debugging code. 20040826 ======== * Rewrite buildlink3/gen-transform.sh to produce more precise sed commands. Drop some unused commands from the mini-language, and add a few more that are more restrictive in their scope. * Fix problem where repeated options weren't properly handled by some of sed commands. It's not enough that they're "global replace", since some patterns match separator characters before and after each option. We must repeat those patterns twice to catch all instances correctly. * Fix problem noted in both PR pkg/24760 and PR pkg/25500, where -L/usr/lib/* was being mangled improperly. * Remove the top-level "buildlink" target; instead, make buildlinking occur as part of the "wrapper" target. * Add more debugging code. 20040828 ======== * Added a head_queue function to shell-lib that returns the head of the named queue without popping it off the front of the queue. * Strip consecutive, repeated library options from the command line when we read it in the logic script. * Be more careful about not underflowing the argument buffer. 20040906 ======== * shell-lib was moved into pkgsrc/mk/scripts; correct references to that file in the wrapper code. * Use opt-sub instead of sub-mangle when protecting -I/usr/include/* and -L/usr/lib/* from buildlink transformations. This avoids adding lines that look like "-I-I..." in the transformation sedfiles. * mangle and sub-mangle are only meant to transform directories in -I, -L, and rpath options, so remove the lines in buildlink3/gen-transform.sh that transformed bare directories. * Fix bug in strip-slashdot where the "." wasn't backquoted and thus matched all characters instead of only the "." character. * Change the libtool wrapper to use a modified buildcmd script that doesn't rearrange any of the arguments. This should fix spurious problems where libtool doesn't understand how to parse the command line when the -l options are moved to the end of the argument list. * Fix bug in the logic script where the $cachearg and $cachedarg weren't being properly set at all times, which caused the cache to contain the wrong transformed argument. 20040907 ======== * Support automatically passing "ABI" flags to the compiler and linker depending on the value of ${ABI}. Currently supports the SunPro compiler with ${ABI} == 64 and the MIPSPro compiler with ${ABI} as any of 32, n32, o32, and 64. * Move back the code that splits absolute paths to shared libraries from arg-source back into logic. This allows us to correctly skip splitting those paths based on the previous option. Also add a sanity check that the library name in the split argument doesn't contain a "/" since shell globs are not as precise as REs. * Don't transform the path given after --dynamic-linker (used by GNU ld for ELF linkage). * Add the ability for the libtool wrapper to be called just to unwrap an existing libtool archive by running: libtool --mode=unwrap -o libfoo.la 20040914 ======== * Add a loop in libtool-fix-la to ensure that all of the options listed in the dependency_libs lines of *.lai files are processed. This fixes a buildlink3 leakage bug. * Merge the gen-transform.sh scripts between buildlink3 and wrapper and place them all in wrapper. This makes sense since the commands simply allow for many types of transformations, which buildlink3 takes advantage of, but there is nothing inherently buildlink-ish about those commands. * Don't directly manipulate SUBST_SED.unwrap. Instead, create the value of SUBST_SED.unwrap by combining several other variables (currently just _UNWRAP_SED) to ensure that the correct ordering is preserved. * Correct some confusing debugging messages.
2004-07-04Re-add USE_PKGSRC_GCC, and document it should only bewiz1-2/+9
used in /etc/mk.conf. Requested by Klaus Heinz.
2004-07-04Retire USE_GCC2, USE_GCC3, USE_SUNPRO, USE_MIPSPRO, and USE_PKGSRC_GCC,wiz1-22/+2
now that all instances of packages using it have been fixed.
2004-05-12Change date of when deprecated USE_GCC2, USE_GCC3, USE_PKGSRC_GCC,reed1-2/+2
USE_SUNPRO, USE_MIPSPRO variables would be removed. (According to jlam@.) mk/compiler.mk CVS: ----------------------------------------------------------------------