[CMAKE]
authorJérôme Gardou <jerome.gardou@reactos.org>
Thu, 18 Nov 2010 21:32:10 +0000 (21:32 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Thu, 18 Nov 2010 21:32:10 +0000 (21:32 +0000)
  - use correct link script file for freeldr and setupldr
  - use correct definition file for advapi32
  - don't specify name to add_bootcd_target if not needed
  - portcls is not a kernel mode driver
  - Disable stcall fixup, except for mesa32 which requires it
  - remove an useless file from minihal, add a forgotten one to freeldr

svn path=/branches/cmake-bringup/; revision=49615

boot/CMakeLists.txt
dll/3rdparty/mesa32/CMakeLists.txt
dll/win32/advapi32/CMakeLists.txt
drivers/input/i8042prt/CMakeLists.txt
drivers/wdm/audio/backpln/portcls/CMakeLists.txt
gcc.cmake
hal/CMakeLists.txt
toolchain-mingw32.cmake

index e055866..04be39d 100644 (file)
@@ -60,6 +60,7 @@ list(APPEND FREELDR_BASE_SOURCE
     freeldr/freeldr/disk/disk.c
     freeldr/freeldr/disk/partition.c
     freeldr/freeldr/disk/ramdisk.c
+    freeldr/freeldr/disk/scsiport.c
     freeldr/freeldr/fs/ext2.c
     freeldr/freeldr/fs/fat.c
     freeldr/freeldr/fs/fs.c
@@ -178,7 +179,7 @@ add_library(freeldr SHARED
     ${FREELDR_SOURCE})
 
 if(NOT MSVC)
-set_target_properties(freeldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds" SUFFIX ".sys")
+set_target_properties(freeldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr/freeldr/freeldr_i386.lnk" SUFFIX ".sys")
 set_image_base(freeldr 0x8000)
 else()
 set_target_properties(freeldr PROPERTIES LINK_FLAGS "/DRIVER /FIXED /ALIGN:0x400 /SECTION:.text,ERW /SECTION:.data,RW /MERGE:.text16=.text /MERGE:.data=.text /MERGE:.rdata=.text /MERGE:.bss=.text /SUBSYSTEM:BOOT_APPLICATION" SUFFIX ".sys")
@@ -211,14 +212,14 @@ list(APPEND SETUPLDR_SOURCE
 add_library(setupldr SHARED ${SETUPLDR_SOURCE})
 
 if(NOT MSVC)
-set_target_properties(setupldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
+set_target_properties(setupldr PROPERTIES LINK_FLAGS "-Wl,--strip-all -Wl,--exclude-all-symbols -Wl,--file-alignment,0x1000 -Wl,-T,${CMAKE_CURRENT_SOURCE_DIR}/freeldr/freeldr/freeldr_i386.lnk" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
 set_image_base(setupldr 0x8000)
 else()
 set_target_properties(setupldr PROPERTIES LINK_FLAGS "/SECTION:.text,ERWP,ALIGN=0x1000" SUFFIX ".sys" COMPILE_DEFINITIONS "FREELDR_REACTOS_SETUP")
 endif()
 
 set_subsystem(setupldr native)
-set_entrypoint(freeldr mainCRTStartup)
+set_entrypoint(setupldr mainCRTStartup)
 
 if(ARCH MATCHES i386)
 target_link_libraries(setupldr mini_hal)
index 4ba97c7..dda1602 100644 (file)
@@ -15,6 +15,10 @@ else()
 add_definitions(-DGL_NO_STDCALL)
 endif(ARCH MATCHES i386)
 
+if(NOT MSVC)
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--enable-stdcall-fixup")
+endif()
+
 include_directories(
     BEFORE include
     src
index 98e8baa..cb2aa80 100644 (file)
@@ -43,7 +43,7 @@ list(APPEND SOURCE
     token/token.c
     advapi32_stubs.c
     advapi32.rc
-    advapi32.def)
+    ${CMAKE_CURRENT_BINARY_DIR}/advapi32.def)
     
 if(NOT MSVC)
     set_source_files_properties(advapi32.def PROPERTIES EXTERNAL_OBJECT TRUE)
index 331e8ea..2517d61 100644 (file)
@@ -1,4 +1,6 @@
 
+set_rc_compiler()
+
 add_library(i8042prt SHARED
     createclose.c
     i8042prt.c
@@ -15,5 +17,5 @@ add_library(i8042prt SHARED
 set_module_type(i8042prt kernelmodedriver)
 add_importlibs(i8042prt ntoskrnl hal)
 
-add_minicd_target(i8042prt reactos i8042prt.sys)
+add_minicd_target(i8042prt reactos)
 add_livecd_target(i8042prt reactos/system32/drivers)
\ No newline at end of file
index ec4ea6b..5250a78 100644 (file)
@@ -59,7 +59,10 @@ else()
     set_target_properties(portcls PROPERTIES COMPILE_FLAGS "-fno-exceptions -fno-rtti")
 endif(MSVC)
 
-set_module_type(portcls kernelmodedriver)
+set_entrypoint(portcls 0)
+set_image_base(portcls 0x00010000)
+set_subsystem(portcls native)
+set_target_properties(portcls PROPERTIES SUFFIX ".sys")
 
 add_importlibs(portcls ntoskrnl ks drmk hal stdc++ gcc msvcrt)
 
index aaa6d34..03fd1a4 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -11,6 +11,7 @@ set(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LI
 set(CMAKE_CXX_LINK_EXECUTABLE "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
 set(CMAKE_EXE_LINKER_FLAGS "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,--disable-auto-import")
 # -Wl,-T,${REACTOS_SOURCE_DIR}/global.lds
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup")
 
 # Compiler Core
 add_definitions(-pipe -fms-extensions)
@@ -112,7 +113,7 @@ macro(set_module_type MODULE TYPE)
         set_target_properties(${MODULE} PROPERTIES SUFFIX ".cpl")
     endif()
        if(${TYPE} MATCHES kernelmodedriver)
-           set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-Wl,--exclude-all-symbols" SUFFIX ".sys")
+           set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-Wl,--exclude-all-symbols -Wl,-file-alignment=0x1000 -Wl,-section-alignment=0x1000" SUFFIX ".sys")
            set_entrypoint(${MODULE} DriverEntry@8)
                set_subsystem(${MODULE} native)
         set_image_base(${MODULE} 0x00010000)
index c39baec..2520249 100644 (file)
@@ -72,7 +72,6 @@ list(APPEND MINI_HAL_SOURCE
     halx86/generic/legacy/bus/cmosbus.c
     halx86/generic/legacy/bus/isabus.c
     halx86/generic/legacy/bus/pcibus.c
-    halx86/generic/legacy/bus/pcidata.c
     halx86/generic/legacy/bus/sysbus.c
     halx86/generic/legacy/bussupp.c
     halx86/generic/beep.c
index c608409..003a186 100644 (file)
@@ -38,10 +38,10 @@ set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries")
 set(CMAKE_CXX_STANDARD_LIBRARIES "" CACHE STRING "Standard C++ Libraries")
 
 if(ARCH MATCHES i386)
-set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--enable-stdcall-fixup -Wl,--kill-at -Wl,--disable-auto-import")
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,--disable-auto-import")
 #-Wl,-T,${REACTOS_SOURCE_DIR}/global.lds
 elseif(ARCH MATCHES amd64)
-set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--enable-stdcall-fixup -Wl,--kill-at -Wl,--disable-auto-import")
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nodefaultlibs -nostdlib -Wl,--enable-auto-image-base -Wl,--kill-at -Wl,--disable-auto-import")
 endif(ARCH MATCHES i386)
 
 # adjust the default behaviour of the FIND_XXX() commands: