Commit Graph

565 Commits

Author SHA1 Message Date
David Cole dfb307fef5 Merge topic 'fix-old-VisualAge-Fortran'
ad542d8 XL: Fix old VisualAge branding of Fortran compiler
2011-08-16 17:01:47 -04:00
Brad King ad542d821d XL: Fix old VisualAge branding of Fortran compiler
Commit 6d434ee6 (Split XL compiler information files, 2009-09-30)
added Platform/AIX-(XL|VisualAge)-(C|CXX|Fortran).cmake modules
to support the old and new compiler branding for all languages.
Add the "AIX-VisualAge-Fortran" combination that was left out
accidentally.
2011-08-02 17:26:29 -04:00
David Cole bd54141d5d Merge topic 'fix-11866-add-watcom-sys-libs'
ff59716 Watcom: Use correct args for execute_process call (#11866)
80769cd Add Watcom support to InstallRequiredSystemLibraries (#11866)
2011-08-02 15:11:35 -04:00
David Cole ff59716351 Watcom: Use correct args for execute_process call (#11866)
I botched an exec_program to execute_process translation on Friday.
RESULT_VARIABLE is the correct argument to execute_process.
2011-08-01 15:29:13 -04:00
David Cole a0974ae2e6 Watcom: Add -c flag to wlib calls (#12245)
Allows wlib to generate proper exports if two routines have
the same spelling, but different case (like Scale and scale).

Thanks to J Decker for the patch.
2011-07-29 13:52:23 -04:00
David Cole 80769cdd1e Add Watcom support to InstallRequiredSystemLibraries (#11866)
Also adds code to determine the version of the Watcom compiler
in use.

Thanks to J Decker for the patch.
2011-07-29 13:28:54 -04:00
Matej Hribernik aed92ccea6 Add VisualStudio 9 and 10 generators for Itanium platform 2011-06-20 08:31:13 -04:00
Modestas Vainius 1ed19bcb25 multiarch: Set CMAKE_LIBRARY_ARCHITECTURE_REGEX for Linux|Hurd|kFreeBSD
* Fix linux CMAKE_LIBRARY_ARCHITECTURE_REGEX to support armel-linux-gnueabi.
* Add CMAKE_LIBRARY_ARCHITECTURE_REGEX on kFreeBSD.
* Add CMAKE_LIBRARY_ARCHITECTURE_REGEX on GNU (Hurd).

Also regex is improved to support quadlets.  Even if I have not seen this
in the wild yet, reportedly they are possible.
2011-06-13 11:12:23 -04:00
Brad King b41ad3b399 Teach find_(library|package) about Linux multiarch (#12037)
Implement support for multiarch as specified here:

  http://wiki.debian.org/Multiarch
  https://wiki.ubuntu.com/MultiarchSpec

Detect the <arch> part of <prefix>/lib/<arch> from the implicit library
search path from each compiler to set CMAKE_<lang>_LIBRARY_ARCHITECTURE.
Define CMAKE_LIBRARY_ARCHITECTURE using one of these values (they should
all be the same).  Teach the find_library and find_package commands to
search <prefix>/lib/<arch> whenever they would search <prefix>/lib.
2011-06-08 10:04:44 -04:00
Brad King 1605784f47 Merge topic 'absoft-fortran-compiler'
8bd3e51 Absoft: Enable FortranCInterface check in Fortran test
d7b376b Absoft: Detect implicit link libraries on Linux and Mac
ac5b999 Add Absoft Fortran compiler id and basic flags
2011-05-24 14:34:40 -04:00
Brad King d7b376b3a7 Absoft: Detect implicit link libraries on Linux and Mac
Use the "-X -v" flag to the Absoft front-end to pass "-v" to the gcc it
invokes under the hood.  Teach CMakeParseImplicitLinkInfo to exclude
linker version lines from consideration as link lines.  Fix parsing of
Sun's linker search path option "-Y..." to avoid conflict with the Mac
linker option "-Y<num>".
2011-05-20 08:57:51 -04:00
Brad King 1c3233a850 Merge topic 'include-flags-response-file'
86cb17b Pass include directories with response files to GNU on Windows
9a0b9bc Optionally pass include directories with response files
6e8a67f Generate target-wide flags before individual build rules
d099546 Factor old-style -D flags out from -I flag generation
2011-03-22 14:45:44 -04:00
Brad King 86cb17b18d Pass include directories with response files to GNU on Windows
The GNU 4.x toolchain on MinGW (and therefore MSYS) allows compiler
options to be passed via response files.  Use this to pass include
directory -I options.  This allows the include file search path to be
very long despite shell and mingw32-make command line length limits.
2011-03-17 17:56:14 -04:00
Brad King d0f71e2545 Add ASM platform information for HP compiler on HP
Among other flags this sets RPATH flags correctly so that CMake knows
how to treat CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH for the ASM language.
2011-03-02 17:49:17 -05:00
Brad King bd580be526 Merge branch 'hp-compiler-info' into ReworkedAsmSupport 2011-03-02 17:40:55 -05:00
Brad King 5f0a25955f Factor HP compiler flags into per-platform/per-compiler files
Move HP flags out of Platform/HP-UX.cmake into platform-specific
compiler information files "Platform/HP-UX-HP-<lang>.cmake".  Factor
common values into "Platform/HP-UX-HP.cmake" and load it from the
per-language files.
2011-03-02 17:24:36 -05:00
Brad King a0bab7ae69 Add ASM platform information for XL compiler on AIX
Among other flags this sets RPATH flags correctly so that CMake knows
how to treat CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH for the ASM language.
2011-03-02 13:48:04 -05:00
Brad King c03b610c0a Merge branch 'aix-xl-platform-info' into ReworkedAsmSupport 2011-03-02 13:47:11 -05:00
Brad King d30dcf18b9 Move RPATH flags to AIX per-compiler information files
Move RPATH flags out of Platform/AIX.cmake into platform-specific
compiler information files Platform/AIX-XL and Platform/AIX-GNU.
The flags need to be set for each compiler of each language.
2011-03-02 11:21:54 -05:00
Brad King 89ea7a3d3c Factor AIX and XL compiler flags into common module
Factor duplicate flag information from Platform/AIX-XL-*.cmake into
Platform/AIX-XL.cmake and load it from the original files.
2011-03-02 11:20:50 -05:00
Alex Neundorf 17c658f819 Add support for the Intel compiler used for ASM under Windows
Alex
2011-03-02 16:46:25 +01:00
Brad King 307bdadadc Merge topic 'mingw-module-definition'
6c4b249 Fix Fortran test .def file symbol mangling
7616216 Pass .def files directly to MinGW tools (#9997)
2011-02-24 08:30:26 -05:00
Brad King 761621645c Pass .def files directly to MinGW tools (#9997)
Commit 6a61a8a5 (Honor module .def files with MinGW tools, 2011-02-21)
set CMAKE_LINK_DEF_FILE_FLAG to "-Wl," to enable passing .def files to
the linker on MinGW.  However, older GNU tools in the MSYS shell do not
know how to translate "-Wl,/c/..." to "c:/..." and complain that the
file does not exist.  Instead set the flag to just "" which tells CMake
it can pass the file through the front-end with no special flag.
2011-02-23 11:04:17 -05:00
Brad King 521d244531 Merge topic 'mingw-module-definition'
6a61a8a Honor module .def files with MinGW tools (#9997)
2011-02-22 14:33:04 -05:00
Brad King 6a61a8a538 Honor module .def files with MinGW tools (#9997)
Since commit 024d05ad (Fix use of module .def files for MS tools,
2009-09-29) module .def files work for any platform that sets
CMAKE_LINK_DEF_FILE_FLAG correctly.  Set it in the Windows-GNU platform
information file to enable support with MinGW tools.  Also enable the
test added by commit 0db2c850 (Test use of module .def files for MS
tools, 2009-09-29) for MinGW and MSYS generators.
2011-02-21 14:34:54 -05:00
David Cole d421a433a8 Strip trailing space from xcode-select output (#10723)
Otherwise, subsequent use of the output does not work
as intended.
2011-02-01 14:16:30 -05:00
Brad King e60c8ec6c7 Factor SCO compiler info out of platform file (#11700)
Move these flags out of the SCO_SV platform file so that other compilers
may be used on that platform without interference.
2011-01-17 09:57:17 -05:00
Brad King 3556ab9f72 Merge topic 'add_support_for_windres'
971692c Build enable_language command during bootstrap
960ace1 Add testing for windows resources for mingw/msys/cygwin and remove for watcom.
060d6e8 Add support for windres to cygwin.
b2f308c Add support for windows resources with mingw/msys.
2011-01-04 15:44:07 -05:00
Bill Hoffman 90b0f2c624 Enable resource building with the intel compiler on windows. 2011-01-03 14:02:22 -05:00
Brad King 9ffe22b2eb Merge topic 'mac-headerpad_max_install_names-passthru'
e498527 Pass Mac linker flag through all compilers with -Wl,
2010-12-28 15:26:00 -05:00
Bill Hoffman 060d6e885e Add support for windres to cygwin. 2010-12-23 17:04:50 -05:00
Bill Hoffman b2f308c8f9 Add support for windows resources with mingw/msys. 2010-12-23 17:04:49 -05:00
Brad King e498527f1d Pass Mac linker flag through all compilers with -Wl,
The Mac linker defines flag -headerpad_max_install_names but not all
front-ends recognize the flag and pass it through (many did in the past,
such as the Apple port of GCC).  Use the -Wl, option prefix to tell
front-ends to pass it through without trying to interpret it.
2010-12-22 16:28:54 -05:00
Brad King 9f46051490 Merge topic 'cygwin'
85c0a69 Cygwin: Do not define 'WIN32' (#10122)
62c6d2d Merge branch 'cmake_--system-information_min-version' into cygwin
72db20f Merge branch 'tests-if-CYGWIN' into cygwin
5adef16 Merge branch 'cygwin-module-prefix' into cygwin
cbc3258 Merge branch 'try-compile-min-version' into cygwin
2010-12-21 14:06:32 -05:00
Brad King 98d9611ffa Merge topic 'gnu-compiler-windows-info'
e8d380f Remove unused old-style g++ info file
2010-12-21 13:58:46 -05:00
Brad King 6f2482aa97 Merge topic 'intel-compiler-windows-info'
cd43636 Modernize Intel compiler info on Windows
58c73c4 Detect Fortran target architecture on Windows
2010-12-21 13:58:39 -05:00
Brad King 92631c14d9 Merge topic 'intel-config-definitions'
3fb088e Make Intel defines consistent with MSVC on Windows (#9904)
2010-12-21 13:58:29 -05:00
Brad King 85c0a69a92 Cygwin: Do not define 'WIN32' (#10122)
One of Cygwin's goals is to build projects using the POSIX API with no
Windows awareness.  Many CMake-built projects have been written to test
for UNIX and WIN32 but not CYGWIN.  The preferred behavior under Cygwin
in such projects is to take the UNIX path but not the WIN32 path.

Unfortunately this change is BACKWARDS INCOMPATIBLE for Cygwin-aware
CMake projects!  Some projects that previously built under Cygwin and
are Cygwin-aware when they test for WIN32 may now behave differently.
Eventually these projects will need to be updated, but to help users
build them in the meantime we print a warning about the change in
behavior.  Furthermore, one may set CMAKE_LEGACY_CYGWIN_WIN32 to request
old behavior during the transition.

Normally we avoid backwards incompatible changes, but we make an
exception in this case for a few reasons:

(1) This behavior is preferred by Cygwin's design goals.

(2) A warning provides a clear path forward for everyone who may see
incompatible behavior, and CMAKE_LEGACY_CYGWIN_WIN32 provides a
compatibility option.  The warning and compatibility option both
disappear when the minimum required version of CMake in a project is
sufficiently new, so this issue will simply go away over time as
projects are updated to account for the change.

(3) The fixes required to update projects are fairly insignificant.
Furthermore, the Cygwin distribution has no releases itself so project
versions that predate said fixes tend to be difficult to build anyway.

(4) This change enables many CMake-built projects that did not
previously build under Cygwin to work out-of-the-box.  From bug #10122:

  "I have built over 120 different source packages with (my patched)
   CMake, including most of KDE4, and have found that NOT defining
   WIN32 on Cygwin is much more accurate." -- Yaakov Selkowitz

A fully compatible change would require patches on top of these project
releases for Cygwin even though they otherwise need not be aware of it.

(5) Yaakov has been maintaining a fork of CMake with this change for the
Cygwin Ports distribution.  It works well in practice.  By accepting the
change in upstream CMake we avoid confusion between the versions.

CMake itself builds without WIN32 defined on Cygwin.  Simply disable
CMAKE_LEGACY_CYGWIN_WIN32 explicitly in our own CMakeLists.txt file.
2010-12-17 14:19:58 -05:00
Brad King 3a6c480908 Merge topic 'cygwin-module-prefix'
1dcc977 Cygwin: Use 'cyg' prefix for module DLLs (#10122)
2010-12-16 14:00:06 -05:00
Brad King 72163de0a5 Merge topic 'NAG-Fortran'
09d1c10 FortranCInterface: Recognize NAG Fortran module symbols
af2ad90 Add NAG Fortran compiler information files
24cc3d4 Recognize the NAG Fortran compiler
83892c4 Allow Fortran platform files to set empty values
fe3f878 Detect object files in implicit link information
2010-12-16 13:59:52 -05:00
Brad King e8d380f90d Remove unused old-style g++ info file
Since commit aff31479 (Modernize GNU compiler info on Windows,
2009-12-02) the file Modules/Platform/Windows-g++.cmake has been unused.
It just includes the non-existent Modules/Platform/Windows-gcc.cmake so
remove it outright.
2010-12-16 10:09:29 -05:00
Brad King cd43636c95 Modernize Intel compiler info on Windows
This moves Intel compiler info on Windows into new-style modules

  Platform/Windows-Intel-<lang>.cmake

using language-independent helper module

  Platform/Windows-Intel.cmake

to define macros consolidating the information.
2010-12-16 09:50:05 -05:00
Brad King 58c73c43f6 Detect Fortran target architecture on Windows
Commit 4430bccc (Change the way 32/64 bit compiles are detected with
MSVC and intel, 2009-11-19) added detection of the target processor to C
and CXX language builds with MS and Intel tools.  Do the same for Intel
Fortran for Windows (ifort).  Use /machine:<arch> to link executables.
2010-12-16 09:33:06 -05:00
Brad King 3fb088e521 Make Intel defines consistent with MSVC on Windows (#9904)
Add /DWIN32 and /D_WINDOWS to default config-independent flags.
Add /D[_N]DEBUG to default flags for each configuration.
2010-12-15 17:56:24 -05:00
Yaakov Selkowitz 1dcc9777a7 Cygwin: Use 'cyg' prefix for module DLLs (#10122)
Cygwin now uses the prefix 'cyg' for plugin DLLs instead of 'lib'.
2010-12-13 14:21:07 -05:00
Brad King af2ad90991 Add NAG Fortran compiler information files
On Linux the NAG Fortran compiler uses gcc under the hood to link.  Use
"-Wl,-v" to pass "-v" to the underlying gcc compiler to get verbose link
output.  Detect the NAG Fortran directory (using -dryrun) and then honor
object files in the directory referenced in the implicit link line.
Pass real linker options with "-Wl,-Xlinker,".  The -Wl, gets through
the NAG front-end and the -Xlinker gets through the gcc front-end.
2010-12-09 18:12:34 -05:00
Bill Hoffman cddcad5102 Fix incremental linking for VS2010 with nmake or make.
VS2010 deprecated /INCREMENTAL:YES.  This change makes
/INCREMENTAL the flag to use for incremental linking with
VS2010.
2010-12-09 13:32:48 -05:00
Brad King eda7841fd2 Pass Mac linker flag through PGI compiler using "-Wl,"
The Mac linker defines -headerpad_max_install_names and the GCC
front-end passes this flag through.  The PGI compiler does not know
about this flag, so we must use -Wl,-headerpad_max_install_names to pass
it to the linker instead.
2010-11-22 08:43:13 -05:00
Brad King 14d5ea7438 Merge topic 'mingw-long-object-lists'
5f05a3c MinGW: Support long object file lists
2d9bb33 Evaluate <OBJECT_DIR> rule variable for executables
2010-09-22 13:52:24 -04:00
Brad King b7539e3832 Merge topic 'compaq-fortran-moddir-flag'
c04af06 Add module-dir flag for Compaq Visual Fortran (#11248)
2010-09-21 10:41:02 -04:00
Brad King c04af06009 Add module-dir flag for Compaq Visual Fortran (#11248)
This compiler uses "-module:" to specify where modules should be placed.
2010-09-20 09:53:45 -04:00
Brad King 5f05a3c25e MinGW: Support long object file lists
Use a combination of response files and the archiver to support long
object file lists that do not fit in the Windows command-line length
limit.  This can work only with GCC >= 4 because the MinGW GCC 3.x
front-ends do not support response-file syntax.
2010-09-17 09:25:36 -04:00
Brad King 048c905f05 Merge topic 'hpux-required-runtime-path-10571'
11a917d HP-UX: Always add /usr/lib to rpath (#10571)
2010-09-08 11:08:13 -04:00
Brad King 02e3f42a6a Merge topic 'watcom_fixes'
3b7da53 Fix for bug 10388, fix various default flags.
2010-09-08 11:08:01 -04:00
Brad King 11a917d04e HP-UX: Always add /usr/lib to rpath (#10571)
Set CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH in the HP-UX platform file to
tell CMake to pass -Wl,+b,/usr/lib no matter whether RPATH is enabled or
not.  This corrects the behavior of -Wl,+nodefaultrpath to look in this
default library path as documented.
2010-09-07 08:44:19 -04:00
Bill Hoffman 3b7da5396d Fix for bug 10388, fix various default flags. 2010-09-02 14:35:17 -04:00
Brad King eae45a67e7 Search MacPorts /opt/local prefix on Mac
Include this prefix in CMAKE_SYSTEM_PREFIX_PATH so that it will be used
for all find* commands.  Previously only find_library and find_path
would look under /opt/local/lib and /opt/local/include, respectively.
2010-09-01 08:50:51 -04:00
Brad King da6fc97f19 Merge topic 'tg/BlueGeneP'
7083c81 Add platform files for BlueGene/P systems
2010-08-17 15:14:07 -04:00
Brad King 32ebe21ad8 Merge topic 'intel-response-files'
4b1e5f0 Pass objects to Intel linker using a response file
2010-08-17 15:09:12 -04:00
Todd Gamblin 7083c81db7 Add platform files for BlueGene/P systems
BlueGeneP-base:    Internal base shared by static and dynamic files
BlueGeneP-static:  Platform file for all-static builds
BlueGeneP-dynamic: Platform file for "default" dynamic builds
2010-08-13 12:17:57 -04:00
Brad King cc31f89c17 Merge topic 'module-header-spelling'
2cde67a Modules: Fix spelling 'To distributed' -> 'To distribute'
2010-08-10 14:33:47 -04:00
Brad King 4b432328a2 Merge topic 'mingw-response-files'
b03f4ec No response files with GNU ld <= 2.16 (#10913)
2010-08-10 14:33:01 -04:00
Arjen Verweij 4b1e5f0152 Pass objects to Intel linker using a response file
Use response files for C and CXX languages with the Intel compiler on
Windows.  We already used them for Fortran.  This enables creation of
libraries and executables with a very large number of object files.
2010-08-10 09:34:12 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Brad King b03f4ec09d No response files with GNU ld <= 2.16 (#10913)
Older GNU ld does not support the @FILE syntax for response files.
Check the ld version on MinGW and MSYS before enabling the syntax.
2010-08-06 09:34:53 -04:00
Pino Toscano 90467d6294 GNU/Hurd platform support fixes (#9873)
Define use of -rpath-link and --export-dynamic flags.  The toolchain on
Hurd is GNU-based so we can use the values from Linux.
2010-07-29 10:43:03 -04:00
Brad King 5444bd6ca3 Merge branch 'tru64-make-includes' 2010-06-15 14:03:26 -04:00
Brad King d9b2da139d Merge branch 'mingw-response-files' 2010-06-15 13:58:58 -04:00
Brad King c592df8377 Tru64: Use full-path include directives in Makefiles (#10569)
Tru64's make(1) resolves relative paths in "include" directives with
respect to the includer.  This is inconsistent with all other known make
tools.  Note that this make tool treats the path literally so we cannot
use our standard FULL path code which escapes spaces.  Instead qualify
the paths with $(CMAKE_BINARY_DIR) to avoid the problem.
2010-06-14 13:06:39 -04:00
Brad King 6f9bb934d4 Merge branch 'sunCC-5.11-rpath-link' 2010-06-08 09:23:11 -04:00
Brad King 6cf1ccd632 Merge branch 'per-config-link-flags' 2010-06-07 14:36:28 -04:00
Brad King ec66c9db8c Merge branch 'cygwin-exe-export-all' 2010-06-07 14:30:21 -04:00
Brad King 693f98c105 Fix rpath-link flag for SunPro C++ 5.11 on Linux
Commit 82c081ba (Fix rpath-link flag for SunPro C++ on Linux,
2009-07-13) taught CMake to pass '-rpath-link' because SunPro C++ 5.9
does not support '-Wl,'.  Now SunPro C++ 5.11 does not recognize the
option without using '-Wl,'.  Detect whether to use '-Wl,' based on the
output of "sunCC -flags".
2010-06-07 10:15:58 -04:00
Brad King 9622fe5e9a Watcom: Use LINK_FLAGS and STATIC_LIBRARY_FLAGS
Add the <LINK_FLAGS> rule variable in Watcom command lines.
2010-06-01 14:40:28 -04:00
Yaakov Selkowitz cd3a4f0025 Cygwin: Export all symbols with ENABLE_EXPORTS
The ENABLE_EXPORTS property exports all symbols from executables on
UNIX-like platforms, typically for use by plugins.  Honor this behavior
on Cygwin.  See issue #10122.
2010-05-27 14:41:38 -04:00
Brad King 571dc74891 Recognize Clang C and C++ compilers (see #10693)
Map to the platform and compiler information for GNU because the
compilers are command-line compatible for common operations.  Later we
can add Clang-specific features as necessary.  We honor the preferred
capitalization is "Clang", not the common mis-spelling "CLang".
2010-05-17 14:11:20 -04:00
David Cole e0acb6ca5f Fix Windows-cl.cmake so that at most one MSVC** variable is defined.
The expectation of users of the MSVC60, MSVC70, MSVC71, MSVC80, MSVC90
and the new MSVC10 variables is that at most one of them will be set
for any given build tree. This change enforces that expectation for
build trees using Makefile generators. It also fixes the one mismatch
in that expectation to be found in the Visual Studio generator world:
previously, the VS 7.1 generator would set *both* MSVC70 and MSVC71;
now, it only sets MSVC71.

With these changes, user expectations are now met, and the recently
introduced CheckCompilerRelatedVariables test should pass everywhere.
2010-05-05 17:08:06 -04:00
David Cole 2938263636 Fix missing set of MSVC10 and add CheckCompilerRelatedVariables test. 2010-04-30 00:46:24 -04:00
Alex Neundorf d827b9f21d -add basic search directories for the "Generic" platform
As reported on the mailing list, find_path/file/library/program() basically don't work
at all if CMAKE_FIND_ROOT_PATH is set and searching in the host system directories
is disabled. This patch adds /include, /lib and /bin to the search directories, so they
will be appended to CMAKE_FIND_ROOT_PATH so this will work for the "Generic" platform (embedded
systems without OS)

Alex
2010-04-14 22:09:19 +02:00
Chuck Atkins e750761857 OpenBSD: Work-around static/runtime linker inconsistency
Detect the runtime linker's search path and add to the compile time
linker's search path.  This is needed because OpenBSD's static linker
does not search for shared library dependencies in the same places as
the runtime linker.
2010-03-26 09:33:28 -04:00
Bill Hoffman 570ceeb4a4 Teach CMake how to work with G95 on mingw. 2010-03-23 11:32:40 -04:00
Brad King 00477de1c9 Use response file for objects on MinGW and MSYS
Windows command lines are limited to about 32K so we need to use
response files for linking very large lists of object files.

See issue #10401.
2010-03-11 09:46:18 -05:00
Brad King 4eba05de42 Suppress GNU flag -fPIC on Windows
Commit "Modernize GNU compiler info on Windows" (2009-12-02) reorganized
GNU flags on Windows but let -fPIC slip through for compilation of
objects in shared libraries.  While this flag is valid on most GNU
compiler platforms we need to suppress it in Windows-GNU.cmake just as
we already do in CYGWIN-GNU.cmake.
2010-02-19 08:23:31 -05:00
David Cole 6ee87b2e5c Fix issue #10155 - default value of CMAKE_OSX_DEPLOYMENT_TARGET should always be the empty string. When the value of CMAKE_OSX_DEPLOYMENT_TARGET is the empty string, the -mmacosx-version-min flag should not show up on the compiler command line. The logic for selecting default value of CMAKE_OSX_SYSROOT is orthogonal to and independent of the value of the deployment target. The default value for CMAKE_OSX_SYSROOT is the SDK that corresponds to the current version of Mac OSX on which cmake is running. 2010-01-29 11:56:35 -05:00
Brad King 3684f62340 Do not export all symbols from DLLs on Cygwin
In commit "use export all symbols on cygwin" (2003-01-21) we started
passing -Wl,--export-all-symbols when linking shared libraries.  Now
cygwin exports all symbols automatically if no symbols are explicitly
exported.  When symbols are explicitly exported we want to honor that
narrow interface.  Therefore this flag should not be passed.

Change based on patch from issue #10122.
2010-01-21 15:03:32 -05:00
Brad King 41024b006b Fix CMAKE_DL_LIBS on Cygwin
The variable should contain the name of a library needed to link the
symbol equivalent to dlopen.  On Cygwin no special library is needed,
and certainly not "gdi32".

Change based on patch from issue #10122.
2010-01-21 15:03:17 -05:00
Brad King 1804c6bfe2 Add PathScale shared library flags on Linux
We add platform-specific compiler information files

  Platform/Linux-PathScale-<lang>.cmake

to enable -fPIC and -shared flags for shared libraries.
2010-01-21 09:09:27 -05:00
Brad King e46e8fb937 Do not find cyg*.dll on Cygwin
While Cygwin supports linking directly to .dll files, the behavior is
now discouraged.  All Cygwin packages now provide import libraries of
the form lib*.dll.a and CMake has built the import libraries for years.

We believe it is now safe to stop explicitly searching for .dll files
because their import libraries will always be available when the
corresponding header files are available.  Users can always set
find_library cache entries to point at a .dll file by hand if they
really must use one.

Change based on patch from issue #10122.
2010-01-13 14:12:29 -05:00
Brad King 12dcf9e4fb Search prefix /usr before root prefix /
Commit "Find locally installed software first" made /usr/local the first
prefix searched to be consistent with the Filesystem Hierarchy Standard:

  http://www.pathname.com/fhs/

The standard also implies that the root prefix "/" should not have any
package or development files.  The "/bin" and "/lib" directories should
have only minimal contents to boot the system.  No "/include" ever
exists.  This commit re-orders the search path prefix list from

  /usr/local
  /
  /usr

to

  /usr/local
  /usr
  /

to prefer package and development files over low-level system files.
See issue #10136.

On Cygwin /usr/lib == /lib and /usr/bin == /bin.  This change also makes
search results report locations as "/usr/..." instead of "/lib/...".
See issue #10122.
2010-01-13 13:36:03 -05:00
Brad King 9ef3f8e820 Restore -rdynamic in Linux build rules
The commit "Drop -rdynamic from Linux build rules" removed default use
of the flag on Linux.  It was expected to be compatible because any
project using plugins should set ENABLE_EXPORTS on its executables to
export their symbols for use by the plugins in a cross-platform way.
However, it is possible to build without ENABLE_EXPORTS and load plugins
that do not link to any symbols from the executable explicitly.  These
plugins may need to see RTTI and other executable symbols needed by the
language implementation.  Executables using such plugins were broken by
the change.

If we want to remove the -rdynamic flag in the future we should do so in
a compatible way.  At that time we should also remove equivalent flags
on other platforms (like -bexpall on AIX).  We will either need a policy
or an explicit API to disable symbol exports on executables.

The primary purpose of the above-mentioned commit was to avoid passing
the -rdynamic flag to compilers on Linux that do not support it.  In
this commit we restore the flag but only on GNU and Intel compilers
which are known to support it.

See issue #9985.
2010-01-13 08:13:46 -05:00
Brad King 7b106a6fb3 Create Linux GNU compiler flag consolidation macro
This macro will be used for GNU compiler flags that are specific to
Linux but not to any language.
2010-01-13 08:13:19 -05:00
David Cole 8d88de4b4a Fix issue with SDK not matching initial deployment target chosen by setting the MACOSX_DEPLOYMENT_TARGET environment variable. The problem was that we were setting the initial SDK value based on our own internal default value for deplyment target rather than the user's environment variable choice. The solution is to base the default value for the SDK on the deployment target variable after initially caching the deployment target... Every time I'm in this code I think I leave it cleaner, only to be proven otherwise. Let's give this one a whirl. Bleh. 2009-12-23 12:08:25 -05:00
David Cole a830786c44 Fix issues #9959 and #9898 - do not set CMAKE_OSX_DEPLOYMENT_TARGET if CMAKE_OSX_SYSROOT is set.
Default to "" for CMAKE_OSX_DEPLOYMENT_TARGET if CMAKE_OSX_SYSROOT is set. Also, add new error message to detect the case where there is a deployment target, but no SDK has been set. Fix args to STRING REGEX call so that it works even if _sdk_path variable is empty inside sanity check function.
2009-12-15 11:10:15 -05:00
Brad King af14f1f2c3 Remove GNU-specific flags from Linux.cmake
We remove the shared library compile/link flags "-fPIC" and "-shared"
because they are not provided by all compilers on Linux.  This allows us
to drop code from the Linux-XL-*.cmake files that erases the bad flags.
All other supported compilers already provide their correct flags for
Linux in their own platform information files.
2009-12-04 10:22:30 -05:00
Brad King c106cb2e2f Generalize support for Portland Group Compiler
We factor flags from Platform/Linux-PGI-Fortran.cmake into language
independent helper modules

  Compiler/PGI.cmake
  Platform/Linux-PGI.cmake

and invoke the macros from

  Compiler/PGI-<lang>.cmake
  Platform/Linux-PGI-<lang>.cmake

This enables general support for the PGI compilers.
2009-12-04 10:21:57 -05:00
Brad King 2d948e94bf Remove duplicate info from Linux SunPro info files
The CMAKE_DL_LIBS variable is set platform-wide by Linux.cmake so we do
not need to duplicate it in Linux-SunPro-<lang>.cmake files.
2009-12-04 09:20:59 -05:00
Brad King e208397976 Consolidate Linux Intel compiler information
We consolidate duplicate code from Platform/Linux-Intel-<lang>.cmake
files into a macro defined in Platform/Linux-Intel.cmake.
2009-12-04 09:20:24 -05:00
Brad King 77ded39645 Fix GNU C and Fortran flags on SunOS
The commit "Split GNU compiler information files" intended to move GNU
flags from the platform-wide Platform/SunOS.cmake module into

  Platform/SunOS-GNU-<lang>.cmake

using a helper module Platform/SunOS-GNU.cmake to consolidate flags.
However, it accidentally put Fortran flags in the C language module and
left out the Fortran module altogether.  This fixes those mistakes.
2009-12-04 08:51:46 -05:00
Brad King 3e37ca8ecc Move GNU flags from SunOS.cmake to SunOS-GNU.cmake
The GNU-specific link-type flags do not belong in the platform-wide
file.
2009-12-02 16:58:52 -05:00
Brad King 4d72006bd6 Reduce duplication in Platform/<os>.cmake files
Several platform-wide linker flag variables are defined in
Modules/Platform/<os>.cmake files for C and then copied by the
Modules/CMake<lang>Information.cmake file for each language.
We now use this approach for the variables

  CMAKE_EXE_EXPORTS_${lang}_FLAG
  CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG
  CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS

to avoid duplication for multiple languages in each platform file.
2009-12-02 15:17:53 -05:00