Ver Fonte

ENH: add support for the Syllable OS (http://www.syllable.org)
major issues:
-access() doesn't return false for an empty string (#ifdefed in cmake)
-dlopen() doesn't return 0 on failure (#ifdefed in cmake and fixed now in Syllable)
-the kwsys and Bootstrap tests fail with timeout due to the fact that I'm doing all that in qemu, which is quite slow
-RPATH is now supported, so without modifying the test adapting DLL_PATH in Syllable is required for the tests to succeed
-the Plugin test fails with an undefined reference to example_exe_function() in example_mod_1, it seems this isn't supported under Syllable

Alex

Alexander Neundorf há 18 anos atrás
pai
commit
e3c84cf5a6

+ 12 - 7
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)

+ 36 - 0
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 )
+

+ 8 - 0
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;

+ 7 - 2
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);

+ 54 - 33
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

+ 5 - 0
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)