[llvm-commits] [compiler-rt] r77958 - in /compiler-rt/trunk: CMakeLists.txt ConfigureChecks.cmake cmake/ cmake/Modules/ cmake/Modules/MacroEnsureOutOfSourceBuild.cmake config.h.cmake lib/CMakeLists.txt lib/divdc3.c lib/divsc3.c lib/divxc3.c lib/floatundidf.c lib/int_lib.h lib/muldc3.c lib/mulsc3.c lib/mulxc3.c

Edward O'Callaghan eocallaghan at auroraux.org
Sun Aug 2 22:59:48 PDT 2009


Author: evocallaghan
Date: Mon Aug  3 00:59:48 2009
New Revision: 77958

URL: http://llvm.org/viewvc/llvm-project?rev=77958&view=rev
Log:
Fix newlinew warning in floatundidf.c , Bulkout CMake system more, complete port to AuroraUX and Solaris.

Added:
    compiler-rt/trunk/ConfigureChecks.cmake
    compiler-rt/trunk/cmake/
    compiler-rt/trunk/cmake/Modules/
    compiler-rt/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
    compiler-rt/trunk/config.h.cmake
Modified:
    compiler-rt/trunk/CMakeLists.txt
    compiler-rt/trunk/lib/CMakeLists.txt
    compiler-rt/trunk/lib/divdc3.c
    compiler-rt/trunk/lib/divsc3.c
    compiler-rt/trunk/lib/divxc3.c
    compiler-rt/trunk/lib/floatundidf.c
    compiler-rt/trunk/lib/int_lib.h
    compiler-rt/trunk/lib/muldc3.c
    compiler-rt/trunk/lib/mulsc3.c
    compiler-rt/trunk/lib/mulxc3.c

Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Aug  3 00:59:48 2009
@@ -8,14 +8,13 @@
 set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
 set(PACKAGE_BUGREPORT "llvmbugs at cs.uiuc.edu")
 
-if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
-  message(FATAL_ERROR "In-source builds are not allowed.
-CMake would overwrite the makefiles distributed with Compiler-RT.
-Please create a directory and run cmake from there, passing the path
-to this source directory as the last argument.
-This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
-Please delete them.")
-endif()
+SET( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules )
+
+# Disallow in-source build
+INCLUDE( MacroEnsureOutOfSourceBuild )
+MACRO_ENSURE_OUT_OF_SOURCE_BUILD(
+ "${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there."
+ )
 
 install(DIRECTORY include
   DESTINATION .
@@ -30,3 +29,5 @@
 # Tests are being ignored for until the very basics are working.
 # ADD_SUBDIRECTORY( test )
 
+INCLUDE( ConfigureChecks.cmake )
+CONFIGURE_FILE( config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )

Added: compiler-rt/trunk/ConfigureChecks.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/ConfigureChecks.cmake?rev=77958&view=auto

==============================================================================
--- compiler-rt/trunk/ConfigureChecks.cmake (added)
+++ compiler-rt/trunk/ConfigureChecks.cmake Mon Aug  3 00:59:48 2009
@@ -0,0 +1,16 @@
+INCLUDE( CheckIncludeFile )
+INCLUDE( CheckFunctionExists )
+
+SET( PACKAGE ${PACKAGE_NAME} )
+SET( VERSION ${PACKAGE_VERSION} )
+
+SET( BINARYDIR ${CMAKE_BINARY_DIR} )
+SET( SOURCEDIR ${CMAKE_SOURCE_DIR} )
+
+# HEADER FILES
+CHECK_INCLUDE_FILE( sys/byteorder.h HAVE_SYS_BYTEORDER_H )
+
+# FUNCTIONS
+#CHECK_FUNCTION_EXISTS( strlcpy HAVE_STRLCPY )
+
+#Example ConfigureChecks.cmake

Added: compiler-rt/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake?rev=77958&view=auto

==============================================================================
--- compiler-rt/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake (added)
+++ compiler-rt/trunk/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake Mon Aug  3 00:59:48 2009
@@ -0,0 +1,18 @@
+# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>)
+
+macro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage )
+
+string( COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource )
+if( _insource )
+ message( SEND_ERROR "${_errorMessage}" )
+ message( FATAL_ERROR
+ "In-source builds are not allowed.
+ CMake would overwrite the makefiles distributed with Compiler-RT.
+ Please create a directory and run cmake from there, passing the path
+ to this source directory as the last argument.
+ This process created the file `CMakeCache.txt' and the directory `CMakeFiles'.
+ Please delete them."
+ )
+endif( _insource )
+
+endmacro( MACRO_ENSURE_OUT_OF_SOURCE_BUILD )

Added: compiler-rt/trunk/config.h.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/config.h.cmake?rev=77958&view=auto

==============================================================================
--- compiler-rt/trunk/config.h.cmake (added)
+++ compiler-rt/trunk/config.h.cmake Mon Aug  3 00:59:48 2009
@@ -0,0 +1,3 @@
+#cmakedefine HAVE_SYS_BYTEORDER_H ${HAVE_SYS_BYTEORDER}
+
+#Example config.h.cmake

Modified: compiler-rt/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/CMakeLists.txt?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/CMakeLists.txt Mon Aug  3 00:59:48 2009
@@ -1,6 +1,10 @@
 #
 # Create a library called "CompilerRT" which includes the source files.
 
+#INCLUDE_DIRECTORIES(
+# ${CMAKE_CURRENT_BINARY_DIR}
+#)
+
 # Generic functions needed for each architecture
 
 SET( SRCS

Modified: compiler-rt/trunk/lib/divdc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/divdc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/divdc3.c (original)
+++ compiler-rt/trunk/lib/divdc3.c Mon Aug  3 00:59:48 2009
@@ -15,6 +15,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the quotient of (a + ib) / (c + id)
 
 double _Complex

Modified: compiler-rt/trunk/lib/divsc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/divsc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/divsc3.c (original)
+++ compiler-rt/trunk/lib/divsc3.c Mon Aug  3 00:59:48 2009
@@ -15,6 +15,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the quotient of (a + ib) / (c + id)
 
 float _Complex

Modified: compiler-rt/trunk/lib/divxc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/divxc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/divxc3.c (original)
+++ compiler-rt/trunk/lib/divxc3.c Mon Aug  3 00:59:48 2009
@@ -17,6 +17,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the quotient of (a + ib) / (c + id)
 
 long double _Complex

Modified: compiler-rt/trunk/lib/floatundidf.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/floatundidf.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/floatundidf.c (original)
+++ compiler-rt/trunk/lib/floatundidf.c Mon Aug  3 00:59:48 2009
@@ -98,4 +98,4 @@
     fb.u.low = (su_int)a;                         // mantissa-low
     return fb.f;
 }
-#endif
\ No newline at end of file
+#endif

Modified: compiler-rt/trunk/lib/int_lib.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/int_lib.h?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/int_lib.h (original)
+++ compiler-rt/trunk/lib/int_lib.h Mon Aug  3 00:59:48 2009
@@ -20,6 +20,34 @@
 
 #include <limits.h>
 
+// TODO: Improve this to minimal pre-processor hackish'ness.
+#if defined (__SVR4) && defined (__sun)
+// config.h build via CMake.
+//#include <config.h>
+
+// Solaris header for endian and byte swap
+//#if defined HAVE_SYS_BYTEORDER_H
+#include <sys/byteorder.h>
+
+// Solaris defines endian by setting _LITTLE_ENDIAN or _BIG_ENDIAN
+#ifdef _BIG_ENDIAN
+# define IS_BIG_ENDIAN
+#endif
+#ifdef _LITTLE_ENDIAN
+# define IS_LITTLE_ENDIAN
+#endif
+
+#ifdef IS_BIG_ENDIAN
+#define __BIG_ENDIAN__ 1
+#define __LITTLE_ENDIAN__ 0
+#endif
+#ifdef IS_LITTLE_ENDIAN
+#define __BIG_ENDIAN__ 0
+#define __LITTLE_ENDIAN__ 1
+#endif
+
+#endif //End of Solaris ifdef.
+
 #ifdef __LITTLE_ENDIAN__
 #if __LITTLE_ENDIAN__
 #define _YUGA_LITTLE_ENDIAN 1

Modified: compiler-rt/trunk/lib/muldc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/muldc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/muldc3.c (original)
+++ compiler-rt/trunk/lib/muldc3.c Mon Aug  3 00:59:48 2009
@@ -15,6 +15,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the product of a + ib and c + id
 
 double _Complex

Modified: compiler-rt/trunk/lib/mulsc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/mulsc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/mulsc3.c (original)
+++ compiler-rt/trunk/lib/mulsc3.c Mon Aug  3 00:59:48 2009
@@ -15,6 +15,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the product of a + ib and c + id
 
 float _Complex

Modified: compiler-rt/trunk/lib/mulxc3.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/mulxc3.c?rev=77958&r1=77957&r2=77958&view=diff

==============================================================================
--- compiler-rt/trunk/lib/mulxc3.c (original)
+++ compiler-rt/trunk/lib/mulxc3.c Mon Aug  3 00:59:48 2009
@@ -17,6 +17,10 @@
 #include <math.h>
 #include <complex.h>
 
+#if !defined(INFINITY) && defined(HUGE_VAL)
+#define INFINITY HUGE_VAL
+#endif
+
 // Returns: the product of a + ib and c + id
 
 long double _Complex





More information about the llvm-commits mailing list