diff options
author | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-08-03 05:59:48 +0000 |
---|---|---|
committer | Edward O'Callaghan <eocallaghan@auroraux.org> | 2009-08-03 05:59:48 +0000 |
commit | 6c307f0ec927c9eb8bfcee8a4b7f7b8e12ef56be (patch) | |
tree | 854c1f23f0ba5d2f643a571d082d53cffdceff5c | |
parent | 880cafccfc68095d42cb61de71d1d31db330b705 (diff) | |
download | compiler-rt-6c307f0ec927c9eb8bfcee8a4b7f7b8e12ef56be.tar.gz compiler-rt-6c307f0ec927c9eb8bfcee8a4b7f7b8e12ef56be.tar.bz2 compiler-rt-6c307f0ec927c9eb8bfcee8a4b7f7b8e12ef56be.tar.xz |
Fix newlinew warning in floatundidf.c , Bulkout CMake system more, complete port to AuroraUX and Solaris.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@77958 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | ConfigureChecks.cmake | 16 | ||||
-rw-r--r-- | cmake/Modules/MacroEnsureOutOfSourceBuild.cmake | 18 | ||||
-rw-r--r-- | config.h.cmake | 3 | ||||
-rw-r--r-- | lib/CMakeLists.txt | 4 | ||||
-rw-r--r-- | lib/divdc3.c | 4 | ||||
-rw-r--r-- | lib/divsc3.c | 4 | ||||
-rw-r--r-- | lib/divxc3.c | 4 | ||||
-rw-r--r-- | lib/floatundidf.c | 2 | ||||
-rw-r--r-- | lib/int_lib.h | 28 | ||||
-rw-r--r-- | lib/muldc3.c | 4 | ||||
-rw-r--r-- | lib/mulsc3.c | 4 | ||||
-rw-r--r-- | lib/mulxc3.c | 4 |
13 files changed, 103 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f21a09..791ed6fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,13 @@ set(PACKAGE_VERSION 1.0svn) set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") set(PACKAGE_BUGREPORT "llvmbugs@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 @@ ADD_SUBDIRECTORY( lib ) # 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 ) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake new file mode 100644 index 00000000..24ec5571 --- /dev/null +++ b/ConfigureChecks.cmake @@ -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 diff --git a/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake b/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake new file mode 100644 index 00000000..a0669365 --- /dev/null +++ b/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake @@ -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 ) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 00000000..85049236 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,3 @@ +#cmakedefine HAVE_SYS_BYTEORDER_H ${HAVE_SYS_BYTEORDER} + +#Example config.h.cmake diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 56a9b94a..ec789504 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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 diff --git a/lib/divdc3.c b/lib/divdc3.c index 1b19e665..ccdf526a 100644 --- a/lib/divdc3.c +++ b/lib/divdc3.c @@ -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 diff --git a/lib/divsc3.c b/lib/divsc3.c index bea15cdc..f2529970 100644 --- a/lib/divsc3.c +++ b/lib/divsc3.c @@ -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 diff --git a/lib/divxc3.c b/lib/divxc3.c index 4ee09b9d..982397f5 100644 --- a/lib/divxc3.c +++ b/lib/divxc3.c @@ -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 diff --git a/lib/floatundidf.c b/lib/floatundidf.c index f019d693..708d614a 100644 --- a/lib/floatundidf.c +++ b/lib/floatundidf.c @@ -98,4 +98,4 @@ __floatundidf(du_int a) fb.u.low = (su_int)a; // mantissa-low return fb.f; } -#endif
\ No newline at end of file +#endif diff --git a/lib/int_lib.h b/lib/int_lib.h index 7d09c856..e8365506 100644 --- a/lib/int_lib.h +++ b/lib/int_lib.h @@ -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 diff --git a/lib/muldc3.c b/lib/muldc3.c index b945e8e3..3549823c 100644 --- a/lib/muldc3.c +++ b/lib/muldc3.c @@ -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 diff --git a/lib/mulsc3.c b/lib/mulsc3.c index bc47a47e..c723032c 100644 --- a/lib/mulsc3.c +++ b/lib/mulsc3.c @@ -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 diff --git a/lib/mulxc3.c b/lib/mulxc3.c index e38ab0dc..840e458b 100644 --- a/lib/mulxc3.c +++ b/lib/mulxc3.c @@ -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 |