summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rwxr-xr-xcmake/config-ix.cmake35
-rwxr-xr-xcmake/config-w32.cmake9
-rw-r--r--include/llvm/Config/config.h.cmake30
4 files changed, 52 insertions, 30 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 837e8c1aaf..76ed06cad6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -65,13 +65,7 @@ endif( EXISTS ${LLVM_TOOLS_BINARY_DIR}/llvm-config )
# find_file(HAVE_LLVM_CONFIG llvm-config ${LLVM_TOOLS_BINARY_DIR})
# message(STATUS ${HAVE_LLVM_CONFIG})
-if( MSVC )
- message(STATUS "Configuring using MSVC hack.")
- include(config-w32)
-else( MSVC )
- message(STATUS "Configuring traditional style.")
- include(config-ix)
-endif( MSVC )
+include(config-ix)
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR} )
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LLVM_BINARY_DIR}/lib )
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 6cd88da0bc..58db002d79 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -23,6 +23,7 @@ check_include_file(signal.h HAVE_SIGNAL_H)
check_include_file(stdint.h HAVE_STDINT_H)
check_include_file(stdio.h HAVE_STDIO_H)
check_include_file(stdlib.h HAVE_STDLIB_H)
+check_include_file(string.h HAVE_STRING_H)
check_include_file(sys/dir.h HAVE_SYS_DIR_H)
check_include_file(sys/dl.h HAVE_SYS_DL_H)
check_include_file(sys/mman.h HAVE_SYS_MMAN_H)
@@ -34,6 +35,7 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H)
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(utime.h HAVE_UTIME_H)
+check_include_file(windows.h HAVE_WINDOWS_H)
# function checks
include(CheckSymbolExists)
@@ -44,8 +46,11 @@ check_symbol_exists(isinf cmath HAVE_ISINF_IN_CMATH)
check_symbol_exists(isinf math.h HAVE_ISINF_IN_MATH_H)
check_symbol_exists(isnan cmath HAVE_ISNAN_IN_CMATH)
check_symbol_exists(isnan math.h HAVE_ISNAN_IN_MATH_H)
+check_symbol_exists(ceilf math.h HAVE_CEILF)
+check_symbol_exists(floorf math.h HAVE_FLOORF)
check_symbol_exists(mallinfo malloc.h HAVE_MALLINFO)
check_symbol_exists(pthread_mutex_lock pthread.h HAVE_PTHREAD_MUTEX_LOCK)
+check_symbol_exists(strtoll stdlib.h HAVE_STRTOLL)
if( MINGW )
# tbi: Comprobar que existen las librerias:
@@ -55,11 +60,31 @@ if( MINGW )
# CHECK_LIBRARY_EXISTS(imagehlp ??? . HAVE_LIBIMAGEHLP)
endif( MINGW )
-# Classes
-include(CheckCxxHashmap)
-include(CheckCxxHashset)
-check_hashmap()
-check_hashset()
+if( MSVC )
+ set(error_t int)
+ set(LTDL_SHLIBPATH_VAR "PATH")
+ set(LTDL_SYSSEARCHPATH "")
+ set(LTDL_DLOPEN_DEPLIBS 1)
+ set(SHLIBEXT ".lib")
+ set(LTDL_OBJDIR "_libs")
+ set(HAVE_STRTOLL 1)
+ set(strtoll "_strtoi64")
+ set(strtoull "_strtoui64")
+ set(stricmp "_stricmp")
+ set(strdup "_strdup")
+else( MSVC )
+ set(LTDL_SHLIBPATH_VAR "LD_LIBRARY_PATH")
+ set(LTDL_SYSSEARCHPATH "") # TODO
+ set(LTDL_DLOPEN_DEPLIBS 0) # TODO
+endif( MSVC )
+
+if( NOT MSVC )
+ # hash_map.h.in and hash_set.h.in contain a special case for MSVC
+ include(CheckCxxHashmap)
+ include(CheckCxxHashset)
+ check_hashmap()
+ check_hashset()
+endif( NOT MSVC )
# FIXME: Signal handler return type, currently hardcoded to 'void'
set(RETSIGTYPE void)
diff --git a/cmake/config-w32.cmake b/cmake/config-w32.cmake
deleted file mode 100755
index d971d2a137..0000000000
--- a/cmake/config-w32.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-# tbi: Configurar ficheros.
-configure_file(${llvm_include_path}/llvm/ADT/hash_map.h.in ${llvm_builded_incs_dir}/ADT/hash_map.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/ADT/hash_set.h.in ${llvm_builded_incs_dir}/ADT/hash_set.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/ADT/iterator.h.in ${llvm_builded_incs_dir}/ADT/iterator.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/Support/DataTypes.h.in ${llvm_builded_incs_dir}/Support/DataTypes.h COPYONLY)
-configure_file(${llvm_include_path}/llvm/Config/config.h.in ${llvm_builded_incs_dir}/Config/config.h COPYONLY)
-
-file(READ ${llvm_include_path}/../win32/config.h vc_config_text)
-file(APPEND ${llvm_builded_incs_dir}/Config/config.h ${vc_config_text})
diff --git a/include/llvm/Config/config.h.cmake b/include/llvm/Config/config.h.cmake
index 028e6076e7..9d0265a551 100644
--- a/include/llvm/Config/config.h.cmake
+++ b/include/llvm/Config/config.h.cmake
@@ -61,7 +61,7 @@
#undef HAVE_BI_ITERATOR
/* Define to 1 if you have the `ceilf' function. */
-#undef HAVE_CEILF
+#cmakedefine HAVE_CEILF ${HAVE_CEILF}
/* Define to 1 if you have the `closedir' function. */
#undef HAVE_CLOSEDIR
@@ -116,7 +116,7 @@
#undef HAVE_FINITE_IN_IEEEFP_H
/* Define to 1 if you have the `floorf' function. */
-#undef HAVE_FLOORF
+#cmakedefine HAVE_FLOORF ${HAVE_FLOORF}
/* Does not have forward iterator */
#undef HAVE_FWD_ITERATOR
@@ -367,13 +367,13 @@
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+#cmakedefine HAVE_STRING_H ${HAVE_STRING_H}
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
+#cmakedefine HAVE_STRTOLL ${HAVE_STRTOLL}
/* Define to 1 if you have the `strtoq' function. */
#undef HAVE_STRTOQ
@@ -426,7 +426,7 @@
#undef HAVE_U_INT64_T
/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
+#cmakedefine HAVE_WINDOWS_H ${HAVE_WINDOWS_H}
/* Installation directory for binary executables */
#undef LLVM_BINDIR
@@ -477,7 +477,7 @@
#undef LLVM_PREFIX
/* Define if the OS needs help to load dependent libraries for dlopen(). */
-#undef LTDL_DLOPEN_DEPLIBS
+#cmakedefine LTDL_DLOPEN_DEPLIBS ${LTDL_DLOPEN_DEPLIBS}
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
@@ -485,13 +485,13 @@
/* Define to the name of the environment variable that determines the dynamic
library search path. */
-#undef LTDL_SHLIBPATH_VAR
+#cmakedefine LTDL_SHLIBPATH_VAR "${LTDL_SHLIBPATH_VAR}"
/* Define to the extension used for shared libraries, say, ".so". */
#cmakedefine LTDL_SHLIB_EXT "${LTDL_SHLIB_EXT}"
/* Define to the system default library search path. */
-#undef LTDL_SYSSEARCHPATH
+#cmakedefine LTDL_SYSSEARCHPATH "${LTDL_SYSSEARCHPATH}"
/* Define if /dev/zero should be used when mapping RWX memory, or undefine if
its not necessary */
@@ -549,10 +549,22 @@
#undef const
/* Define to a type to use for `error_t' if it is not otherwise available. */
-#undef error_t
+#cmakedefine error_t ${error_t}
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
+
+/* Define to a function replacing strtoll */
+#cmakedefine strtoll ${strtoll}
+
+/* Define to a function implementing strtoull */
+#cmakedefine strtoull ${strtoull}
+
+/* Define to a function implementing stricmp */
+#cmakedefine stricmp ${stricmp}
+
+/* Define to a function implementing strdup */
+#cmakedefine strdup ${strdup}