[Cmake-commits] [cmake-commits] king committed HP-UX.cmake 1.33 1.34

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Jun 19 17:09:39 EDT 2009


Update of /cvsroot/CMake/CMake/Modules/Platform
In directory public:/mounts/ram/cvs-serv526/Modules/Platform

Modified Files:
	HP-UX.cmake 
Log Message:
BUG: Look in arch-specific HPUX implicit link dirs

On HP-UX machines some system libraries appear in architecture-specific
implicit linker search paths.  We need to add these paths to our system
library search path.  However, at the time we construct the search path
we do not know the target architecture.

A full solution requires re-organizing platform configuration files so
that the target architecture can be known when needed.  Until that
happens we can avoid the problem by searching in both 32-bit and 64-bit
implicit link directories.  By telling CMake that they are implicit
directories the generated link lines will never pass the paths, leaving
the linker free to find the library of the proper architecture even if
the find_library call finds the wrong one.


Index: HP-UX.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/Platform/HP-UX.cmake,v
retrieving revision 1.33
retrieving revision 1.34
diff -C 2 -d -r1.33 -r1.34
*** HP-UX.cmake	15 Jun 2009 17:17:54 -0000	1.33
--- HP-UX.cmake	19 Jun 2009 21:09:36 -0000	1.34
***************
*** 89,99 ****
  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
  # set flags for gcc support
- IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
-   LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
- ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4)
-   LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
- ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)
  INCLUDE(Platform/UnixPaths)
  
  
  IF(NOT CMAKE_COMPILER_IS_GNUCC)
--- 89,105 ----
  ENDIF(CMAKE_COMPILER_IS_GNUCXX)
  # set flags for gcc support
  INCLUDE(Platform/UnixPaths)
  
+ # Look in both 32-bit and 64-bit implict link directories, but tell
+ # CMake not to pass the paths to the linker.  The linker will find the
+ # library for the proper architecture.  In the future we should detect
+ # which path will be used by the linker.  Since the pointer type size
+ # CMAKE_SIZEOF_VOID_P is not set until after this file executes, we
+ # would need to append to CMAKE_SYSTEM_LIBRARY_PATH at a later point
+ # (after CMakeTest(LANG)Compiler.cmake runs for at least one language).
+ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux32)
+ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64)
+ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
+   /usr/lib/hpux32 /usr/lib/hpux64)
  
  IF(NOT CMAKE_COMPILER_IS_GNUCC)



More information about the Cmake-commits mailing list