diff --git a/CMakeLists.txt b/CMakeLists.txt index ee1011752..59bcc3022 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,14 +319,19 @@ MACRO (CMAKE_BUILD_UTILITIES) #--------------------------------------------------------------------- # Use curses? IF (UNIX) - SET(CURSES_NEED_NCURSES TRUE) - FIND_PACKAGE(Curses QUIET) - IF (CURSES_LIBRARY) - OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) - ELSE (CURSES_LIBRARY) - MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.") + # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex + IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) + SET(CURSES_NEED_NCURSES TRUE) + FIND_PACKAGE(Curses QUIET) + IF (CURSES_LIBRARY) + OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) + ELSE (CURSES_LIBRARY) + MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.") + SET(BUILD_CursesDialog 0) + ENDIF (CURSES_LIBRARY) + ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) SET(BUILD_CursesDialog 0) - ENDIF (CURSES_LIBRARY) + ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) ELSE (UNIX) SET(BUILD_CursesDialog 0) ENDIF (UNIX) diff --git a/Modules/Platform/syllable.cmake b/Modules/Platform/syllable.cmake new file mode 100644 index 000000000..32b619768 --- /dev/null +++ b/Modules/Platform/syllable.cmake @@ -0,0 +1,36 @@ +# this is the platform file for the Syllable OS (http://www.syllable.org) +# Syllable is a free OS (GPL), which is mostly POSIX conform +# the linker accepts the rpath related arguments, but this is later on +# ignored by the runtime linker +# shared libs are found exclusively via the environment variable DLL_PATH, +# which may contain also dirs containing the special variable @bindir@ +# by default @bindir@/lib is part of DLL_PATH +# in order to run the cmake tests successfully it is required that also +# @bindir@/. and @bindir@/../lib are in DLL_PATH + + +SET(CMAKE_DL_LIBS "dl") +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib +SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,") +SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,") +#SET(CMAKE_EXE_EXPORTS_C_FLAG "-Wl,--export-dynamic") +#SET(CMAKE_EXE_EXPORTS_CXX_FLAG "-Wl,--export-dynamic") + +# Initialize C link type selection flags. These flags are used when +# building a shared library, shared module, or executable that links +# to other libraries to select whether to use the static or shared +# versions of the libraries. +FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE) + SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic") + SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic") +ENDFOREACH(type) + +INCLUDE(Platform/UnixPaths) + +# these are Syllable specific: +SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/indexes/include ) +SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/indexes/lib ) +SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} /usr/indexes/bin ) + diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 37562b1a9..28efd40b2 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -818,6 +818,14 @@ bool SystemTools::FileExists(const char* filename) #ifndef R_OK # define R_OK 04 #endif + +#ifdef __SYLLABLE__ + if ((filename !=0) && (*filename == 0)) + { + return false; + } +#endif + if ( access(filename, R_OK) != 0 ) { return false; diff --git a/Source/kwsys/testDynamicLoader.cxx b/Source/kwsys/testDynamicLoader.cxx index c7ddc2b5e..9021239d5 100644 --- a/Source/kwsys/testDynamicLoader.cxx +++ b/Source/kwsys/testDynamicLoader.cxx @@ -97,17 +97,22 @@ int testDynamicLoader(int argc, char *argv[]) #elif defined(__BEOS__) disable_debugger(1); #endif - int res; + int res = 0; if( argc == 3 ) { // User specify a libname and symbol to check. res = TestDynamicLoader(argv[1], argv[2],1,1,1); return res; } + +// dlopen() on Syllable before 11/22/2007 doesn't return 0 on error +#ifndef __SYLLABLE__ // Make sure that inexistant lib is giving correct result - res = TestDynamicLoader("azerty_", "foo_bar",0,0,0); + res += TestDynamicLoader("azerty_", "foo_bar",0,0,0); // Make sure that random binary file cannnot be assimilated as dylib res += TestDynamicLoader(TEST_SYSTEMTOOLS_BIN_FILE, "wp",0,0,0); +#endif + #ifdef __linux__ // This one is actually fun to test, since dlopen is by default loaded...wonder why :) res += TestDynamicLoader("foobar.lib", "dlopen",0,1,0); diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 81713e698..5e8a8a71e 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -443,30 +443,61 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel --test-command exec4 ) - ADD_TEST(JumpWithLibOut ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Jump" - "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable" - --build-project Jump - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-options - -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib - --test-command jumpExecutable - ) + IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + +# RPATH isn't supported under Syllable, so the tests don't +# find their libraries. In order to fix that LIBRARY_OUTPUT_DIR +# in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib . +# For now we just require on Syllable that the user adjusts the DLL_PATH +# environment variable, so except the two tests below all other tests will succeed. + + SET(_DLL_PATH "$ENV{DLL_PATH}") + IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\@bindir\@/\\.(:.*)?$") + MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\@bindir\@/.\" to the DLL_PATH environment variable") + ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\@bindir\@/\\.(:.*)?$") + IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\@bindir\@/\\.\\./lib(:.*)?$") + MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\@bindir\@/../lib\" to the DLL_PATH environment variable") + ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\@bindir\@/\\.\\./lib(:.*)?$") + + ELSE("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + + ADD_TEST(JumpWithLibOut ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Jump" + "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Executable" + --build-project Jump + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-options + -DLIBRARY_OUTPUT_PATH:PATH=${CMake_BINARY_DIR}/Tests/Jump/WithLibOut/Lib + --test-command jumpExecutable + ) + + ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Jump" + "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut" + --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" + --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" + --build-project Jump + --build-generator ${CMAKE_TEST_GENERATOR} + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --test-command jumpExecutable + ) + + ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/Plugin" + "${CMake_BINARY_DIR}/Tests/Plugin" + --build-generator ${CMAKE_TEST_GENERATOR} + --build-project Plugin + --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} + --build-two-config + --test-command bin/example) + + ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) - ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Jump" - "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut" - --build-exe-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" - --build-run-dir "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut/Executable" - --build-project Jump - --build-generator ${CMAKE_TEST_GENERATOR} - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --test-command jumpExecutable - ) ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test @@ -488,16 +519,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=CVS -P ${CMake_SOURCE_DIR}/Utilities/Rel --test-command Exec2 ) - ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND} - --build-and-test - "${CMake_SOURCE_DIR}/Tests/Plugin" - "${CMake_BINARY_DIR}/Tests/Plugin" - --build-generator ${CMAKE_TEST_GENERATOR} - --build-project Plugin - --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-two-config - --test-command bin/example) - IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND} --build-and-test diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt index 6450338f9..80137ca33 100644 --- a/Utilities/cmtar/CMakeLists.txt +++ b/Utilities/cmtar/CMakeLists.txt @@ -112,6 +112,11 @@ FOREACH(func CHECK_SYMBOL_EXISTS_EX("${func}") ENDFOREACH(func) +# on Syllable lchown() is there, but always returns "Not implemented" +IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + SET(HAVE_LCHOWN 0) +ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + CHECK_TYPE_SIZE("dev_t" SIZEOF_DEV_T) IF(HAVE_SIZEOF_DEV_T) SET (HAVE_DEV_T 1)