summaryrefslogtreecommitdiff
path: root/mk/compiler.mk
AgeCommit message (Collapse)AuthorFilesLines
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: ----------------------------------------------------------------------
2004-05-09add mipspro-ucode to _COMPILERS which was missed the first time.grant1-2/+2
2004-05-08correctly preserve the user-specified order of pseudo-compilers. patchgrant1-6/+5
from jlam@.
2004-05-08_PKGSRC_COMPILER needs to contain the real compiler first, thengrant1-2/+2
pseudo-compilers such as ccache and distcc. fixes problem where lang/gcc{,3} would be incorrectly pulled in when it should not be.
2004-05-08implement {NOT,ONLY}_FOR_COMPILER so that packages can be marked asgrant1-5/+39
requiring a specific compiler (most often those which use gcc-specific hacks^wfeatures). this allows users to define PKGSRC_COMPILER to multiple real compilers in order to implement a compiler preference. for example, PKGSRC_COMPILER="sunpro gcc" will use sunpro as the default compiler, and fall back to gcc where a package is marked NOT_FOR_COMPILER=sunpro or ONLY_FOR_COMPILER=gcc.
2004-03-31Since revision 1.155 of bsd.prefs.mk, compiler.mk is required in packagesketch1-2/+2
Makefiles for testing CC_VERSION, not bsd.prefs.mk. Reflect that change in the provided example.
2004-02-18* Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc/mk/compiler.mk.jlam1-0/+115
Package Makefiles may now directly include compiler.mk. * Don't include compiler.mk within bsd.prefs.mk any longer. It was only included for the purposes of defining CC_VERSION. Packages that want to test the value of CC_VERSION should now first include "../../mk/compiler.mk". Any GCC_REQD statements in package Makefiles should be set before compiler.mk is included. * Simpllfy pkgsrc/mk/compiler/*.mk files as a result of not needing to be included indirectly by bsd.prefs.mk. We remove the special handling associated with detecting whether the file was included from within bsd.prefs.mk. These files are now much more straightforward to write and understand. * G/C the BSD_PREFS_MK stack mechanism as the only users (compiler/*) no longer need it. * Ensure that directories are prepended to the PATH only from within bsd.pkg.mk.
2004-02-01Garbage collect compiler.mk as it's superseded by the new compilerjlam1-272/+0
selection framework in pkgsrc/mk/compiler.
2003-12-10Ensure CPP is defined to use the Sun compiler when building packagessketch1-1/+2
under USE_SUNPRO, to avoid the possibility of picking up "cpp" from a local GCC installation.
2003-11-12backout previous, it is no longer needed.grant1-2/+2
2003-10-24Remove '-' from the version part of _GCC_IN_USE so that pkg_admin can dealcube1-2/+2
with the installed gcc when it has a localized version (such as our gcc-3.3.2-nb1).
2003-10-18move the libstdc++ fake libtool archive stuff out ofgrant1-14/+20
!defined(COMPILER_MK) for now. some packages include bsd.prefs.mk before defining USE_BUILDLINK2, which resulted in the libstdc++ fake-la target being missed. XXX the real fix is to include compiler.mk from both bsd.prefs.mk and XXX bsd.pkg.mk, and have compiler.mk make the right decisions based on XXX where it was included from.
2003-10-12fix logic error introduced in last, sync comments about CC_VERSIONgrant1-7/+8
with reality.
2003-10-11set CC_VERSION for non-gcc and use it in the BUILD_INFO file.grant1-4/+6
2003-10-11don't hardcode the -DHasGcc2... flags to imake, pass them only ifgrant1-1/+8
we're actually using gcc on Solaris. fixes building of imake PIC code when the compiler is not gcc.
2003-10-06allow lang/gcc{,3} to be used to build themselves by only adding thegrant1-24/+35
(build) dependency if the package being built is not the package which is providing the compiler.
2003-10-06avoid F77/PKG_FC being recursively defined.grant1-3/+3
reported by krister. XXX the Fortran gunk in bsd.pkg.mk will be moved to here later.
2003-09-28sync comments with reality.grant1-6/+20
note once again that USE_GCC2/USE_GCC3 must not be defined in package Makefiles. also note CC_VERSION and provide a usage example.
2003-09-28if /usr/lib/libstdc++.la exists, create the corresponding fake libtoolgrant1-1/+14
archive in ${BUILDLINK_DIR}/lib so packages can find and use it. fixes some build problems seen on Slackware Linux 9.
2003-09-27set CC and CXX defaults for SunPro when USE_SUNPRO is defined.grant1-1/+9
the path to cc and CC can be overridden in /etc/mk.conf or on the command line.
2003-09-24make CC_VERSION available to packages by including bsd.prefs.mk.grant1-3/+18
it is of the form 'gcc-<version>' if gcc is being used, or empty otherwise (for now). requested by tron.
2003-09-24remove redefine of _GCC_PREFIX, whitespace fix.grant1-4/+3
2003-09-23Work out _GCC_ARCHSUBDIR correctly, using the method fromgavan1-2/+10
lang/gcc3/buildlink2.mk
2003-09-21Test for egcs needs to come first, since egcs -v output alsowiz1-5/+5
contains "gcc". From Greg A. Woods in PR 22866.
2003-09-17explain why including this file in pkg Makefiles is useless.grant1-1/+4
2003-09-17honour GCC_REQD by testing $CC -v against it, and only pull in pkgsrcgrant1-9/+82
gcc if required. see the comments for how to use the variables which influence the decision. eliminate some spurious shell warnings while I'm here.
2003-09-12Sync comments with reality.salo1-6/+6
2003-09-12remove redundant comment about USE_GCC2 and USE_GCC3 until they aregrant1-5/+3
better handled.
2003-09-12move a SunPro tweak to compiler.mk.grant1-1/+10
2003-09-12tidy up handling of LDFLAGS wrt USE_GCC_SHLIB a little.grant1-5/+12
2003-09-12Typos/punctuation/caps.salo1-2/+2
2003-09-12start of improved compiler handling, mostly derived from the existinggrant1-0/+97
gcc buildlink2.mk files and splitting the non-buildlink2.mk bits out into compiler.mk. this allows USE_GCC2 and USE_GCC3 to work with non-buildlink2 packages again.