Changes between Version 7 and Version 8 of UsingTheRightCompiler
- Timestamp:
- Apr 30, 2010, 2:47:42 AM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsingTheRightCompiler
v7 v8 16 16 or on Tiger to downgrade to gcc 3.3 to compile old software that is not compatible with gcc 4. 17 17 18 Software by default builds using "`gcc`" and this can be a problem if the user has changed what "`gcc`"is.18 Software by default builds using "`gcc`" (or, equivalently, "`cc`") and this can be a problem if the user has changed what this is. 19 19 On the one hand, gcc 4 may be too new to compile some very old software, 20 20 but on the other hand gcc 3.3 is probably too old to compile a lot of modern software. … … 51 51 unless that compiler doesn't work with that port for some reason. 52 52 In that case, 53 youcan select a different compiler for that port by overwriting ${configure.cc} and friends,53 the maintainer can select a different compiler for that port by overwriting ${configure.cc} and friends, 54 54 but what you probably want to do instead is overwrite the ${configure.compiler} variable, 55 which sets everything for you as a group.55 which sets all the related variables for you simultaneously. 56 56 MacPorts knows about a handful of compilers: 57 57 … … 78 78 (e.g. "apple-gcc-4.0" corresponds to the apple-gcc40 port). 79 79 The remaining compiler names refer to compilers installed by Xcode 80 (e.g. "gcc-4.0" is the gcc 4.0.1 compiler installed by Xcode 81 which is the default compiler on Mac OS X 10.4 and 10.5). 80 (e.g. "gcc-4.0" is the gcc 4.0.1 compiler installed by Xcode). 82 81 Note that if you set ${configure.compiler} to a compiler provided by a MacPorts port, 83 you must also declare a builddependency on that port.82 you must also declare a library dependency on that port. 84 83 85 84 For the MacPorts gcc 4 compilers, … … 100 99 Setting the CC, CXX and CPP environment variables at configure time 101 100 is all that most software needs in order to use the compiler we want. 102 But some ports have unusual configure scripts that don't obey these settings .103 Some ports don't have a configure phaseat all.101 But some ports have unusual configure scripts that don't obey these settings, 102 and some ports don't have a configure script at all. 104 103 For such ports, it can be necessary to set the variables at build time: 105 104 106 105 {{{ 107 build. env-appendCC=${configure.cc} \106 build.args-append CC=${configure.cc} \ 108 107 CXX=${configure.cxx} \ 109 108 CPP=${configure.cpp} … … 113 112 In these cases, patches are needed. 114 113 For example, "`gcc`" or "`cc`" can be replaced with "$(CC)" in the Makefile, 115 possibly in combination with setting ${build. env} as above.114 possibly in combination with setting ${build.args} as above. 116 115 Such patches should usually be sent upstream for inclusion in the next version of the software. 117 116