Browse Source

Extra work to make dmmlib work with P2012 Encore compiler.

Ioannis Koutras 14 years ago
parent
commit
d681e3be37
3 changed files with 27 additions and 23 deletions
  1. 4 4
      CMakeLists.txt
  2. 0 19
      toolchain-stxp70.cmake
  3. 23 0
      toolchain-stxp70v4.cmake

+ 4 - 4
CMakeLists.txt

@@ -10,10 +10,10 @@ 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.")
 
 
-if(CMAKE_COMPILER_IS_GNUCC)
-  add_definitions(-std=c99)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes")  
-endif(CMAKE_COMPILER_IS_GNUCC)
+#if(CMAKE_COMPILER_IS_GNUCC)
+#  add_definitions(-std=c99)
+#  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wconversion -Wstrict-prototypes")  
+#endif(CMAKE_COMPILER_IS_GNUCC)
 
 configure_file (
 	"${PROJECT_SOURCE_DIR}/dmm_config.h.in"

+ 0 - 19
toolchain-stxp70.cmake

@@ -1,19 +0,0 @@
-include(CMakeForceCompiler)
-
-SET(CMAKE_SYSTEM_NAME STxP70)
-
-# The environment variables should be already set
-# in order to do proper cross compiling
-set (CMAKE_FORCE_C_COMPILER $ENV{CC})
-
-set (CMAKE_C_FLAGS $ENV{CFLAGS}) 
-set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS $ENV{LDFLAGS})
-
-set (CMAKE_AR $ENV{AR})
-set (CMAKE_RANLIB $ENV{RANLIB})
-
-# search for programs in the build host directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-# for libraries and headers in the target directories
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

+ 23 - 0
toolchain-stxp70v4.cmake

@@ -0,0 +1,23 @@
+include(CMakeForceCompiler)
+
+SET(CMAKE_SYSTEM_NAME STxP70v4)
+
+# The environment variables should be already set
+# in order to do proper cross compiling
+CMAKE_FORCE_C_COMPILER(stxp70cc GNU)
+CMAKE_FORCE_CXX_COMPILER(stxp70c++ GNU)
+
+set (CMAKE_C_FLAGS $ENV{CFLAGS}) 
+set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS $ENV{LDFLAGS})
+
+set (CMAKE_AR stxp70-ar)
+set (CMAKE_RANLIB stxp70-ranlib)
+
+SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> -mcore=stxp70v4 <LINK_FLAGS> cr <TARGET> <OBJECTS>")
+SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> -mcore=stxp70v4 <TARGET>")
+
+# search for programs in the build host directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)