Manta Interactive Ray Tracer Development Mailing List

Text archives Help


Re: [Manta] r1799 - in trunk: . CMake


Chronological Thread 
  • From: Abe Stephens <abe@sci.utah.edu>
  • To: "'manta@sci.utah.edu'" <manta@sci.utah.edu>
  • Subject: Re: [Manta] r1799 - in trunk: . CMake
  • Date: Thu, 1 Nov 2007 18:13:46 -0600


This fix is implemented using the FIRST_TIME_SET macro, therefore you must configure inside a fresh build directory (or manually delete the PASSED_FIRST_CONFIGURE cache variable).

Also the swig build appears to use separate linker command argument variables, so the fix doesn't apply to that code yet.

Abe


On Nov 1, 2007, at 6:02 PM, abe@sci.utah.edu wrote:

Author: abe
Date: Thu Nov  1 18:02:40 2007
New Revision: 1799

Modified:
  trunk/CMake/ConfigCompilerFlags.cmake
  trunk/CMake/FindX11andGL.cmake
  trunk/CMakeLists.txt
Log:

Added cmake checks for the Leopard version of ld, which has a problem
telling the difference between two libraries with the same file name
at different paths.

Interestingly the ld version string for leopard is:
@(#)PROGRAM:ld  PROJECT:ld64-77

While the version string in tiger was somewhat more official looking:
Apple Computer, Inc. version cctools-622.5.obj~13

This script will set the flag APPLE_LD_LEOPARD
M    CMake/ConfigCompilerFlags.cmake

This script modifies the linker command link to workaround the defect in ld.
M    CMake/FindX11andGL.cmake

Modified the include order of ConfigCompilerFlags and FindXllandGL
M    CMakeLists.txt


Modified: trunk/CMake/ConfigCompilerFlags.cmake
= = = = = = = = ======================================================================
--- trunk/CMake/ConfigCompilerFlags.cmake       (original)
+++ trunk/CMake/ConfigCompilerFlags.cmake       Thu Nov  1 18:02:40 2007
@@ -126,6 +126,25 @@
  APPEND_TO_STRING(GCC_OPT "-msse -msse2 -msse3 -mfpmath=sse")
ENDIF (APPLE_X86)

+# Check for broken LD on Leopard.
+IF (APPLE)
+
+  # Note: In leopard the ld version string is:
+  # @(#)PROGRAM:ld  PROJECT:ld64-77
+  # while in previous versions it is:
+  # Apple Computer, Inc. version cctools-622.5.obj~13
+
+ EXEC_PROGRAM("/usr/bin/ld" ARGS "-v" OUTPUT_VARIABLE APPLE_LD_VERSION)
+
+  IF (APPLE_LD_VERSION MATCHES "ld64-77")
+ # Set a cmake variable that may be used during subsequent configuration
+    # to work around bugs with ld and X11 libraries.
+    # (e.g. FindX11andGL.cmake)
+    SET(APPLE_LEOPARD_LD TRUE)
+  ENDIF(APPLE_LD_VERSION MATCHES "ld64-77")
+
+ENDIF(APPLE)
+
##############################################################
## X86
##############################################################

Modified: trunk/CMake/FindX11andGL.cmake
= = = = = = = = ======================================================================
--- trunk/CMake/FindX11andGL.cmake      (original)
+++ trunk/CMake/FindX11andGL.cmake      Thu Nov  1 18:02:40 2007
@@ -16,6 +16,13 @@
  SET (OPENGL_INCLUDE_DIR               /usr/X11R6/include)
  SET (OPENGL_gl_LIBRARY                /usr/X11R6/lib/libGL.dylib)
  SET (OPENGL_glu_LIBRARY               /usr/X11R6/lib/libGLU.dylib)
+
+  # Workaround for Leopard ld cyclic re-export defect.
+  IF (APPLE_LEOPARD_LD)
+ FIRST_TIME_SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-dylib_file,/System/ Library/Frameworks/OpenGL.framework/Versions/A/Libraries/ libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/ Libraries/libGL.dylib" STRING "Leopard dylib workaround")
+ FIRST_TIME_SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,-dylib_file,/ System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/ libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/ Libraries/libGL.dylib" STRING "Leopard dylib workaround")
+  ENDIF (APPLE_LEOPARD_LD)
+
ENDIF (APPLE)

IF (CYGWIN)

Modified: trunk/CMakeLists.txt
= = = = = = = = ======================================================================
--- trunk/CMakeLists.txt        (original)
+++ trunk/CMakeLists.txt        Thu Nov  1 18:02:40 2007
@@ -61,6 +61,8 @@
INCLUDE (${CMAKE_CURRENT_SOURCE_DIR}/CMake/CheckSSE.cmake)
# Add a static library build info and license.
INCLUDE (${CMAKE_CURRENT_SOURCE_DIR}/CMake/About.cmake)
+# Check for specific machine/compiler options.
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/ConfigCompilerFlags.cmake)

###############################################
# Search for common dependencies.
@@ -72,9 +74,6 @@
# Locate pabst
INCLUDE (${CMAKE_CURRENT_SOURCE_DIR}/CMake/FindPabst.cmake)

-# Check for specific machine/compiler options.
-INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMake/ConfigCompilerFlags.cmake)
-
## We need SCI_NOPERSISTENT to be defined
FORCE_ADD_FLAGS(CMAKE_CXX_FLAGS "-DSCI_NOPERSISTENT")

@@ -152,4 +151,4 @@
# configuring at least once.
SET(PASSED_FIRST_CONFIGURE ON CACHE INTERNAL "Already Configured once?")
###############################################################################
- ###############################################################################
\ No newline at end of file
+ ###############################################################################






Archive powered by MHonArc 2.6.16.

Top of page