diff options
author | Brad King <brad.king@kitware.com> | 2008-01-22 14:13:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-22 14:13:04 (GMT) |
commit | 96fd5909d9dd1ffe740230ce652d574cd01c62d5 (patch) | |
tree | e83b3ce2d5066660256a69cacb6caa7d2d95c416 /Modules/Platform/AIX.cmake | |
parent | 0df9e6904cd2416336a85d6d7972ce84dcbab417 (diff) | |
download | CMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.zip CMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.tar.gz CMake-96fd5909d9dd1ffe740230ce652d574cd01c62d5.tar.bz2 |
ENH: Implement linking with paths to library files instead of -L and -l separation. See bug #3832
- This is purely an implementation improvement. No interface has changed.
- Create cmComputeLinkInformation class
- Move and re-implement logic from:
cmLocalGenerator::ComputeLinkInformation
cmOrderLinkDirectories
- Link libraries to targets with their full path (if it is known)
- Dirs specified with link_directories command still added with -L
- Make link type specific to library names without paths
(name libfoo.a without path becomes -Wl,-Bstatic -lfoo)
- Make directory ordering specific to a runtime path computation feature
(look for conflicting SONAMEs instead of library names)
- Implement proper rpath support on HP-UX and AIX.
Diffstat (limited to 'Modules/Platform/AIX.cmake')
-rw-r--r-- | Modules/Platform/AIX.cmake | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 13a00a0..d6b6af0 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -1,15 +1,23 @@ SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so SET(CMAKE_DL_LIBS "-lld") -SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bexpall") # +s, flag for exe link to use shared lib + +# RPATH support on AIX is called libpath. By default the runtime +# libpath is paths specified by -L followed by /usr/lib and /lib. In +# order to prevent the -L paths from being used we must force use of +# -Wl,-blibpath:/usr/lib:/lib whether RPATH support is on or not. +# When our own RPATH is to be added it may be inserted before the +# "always" paths. +SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib) +SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # CXX Compiler IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,-G") # -shared ELSE(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bexpall") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ") SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ") SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") @@ -22,8 +30,8 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared ELSE(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bexpall") # +s, flag for exe link to use shared lib + SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared + SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ") SET(CMAKE_SHARED_MODULE_C_FLAGS " ") SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") |