| 1 | Upstream-status: <https://github.com/pharo-project/pharo-vm/pull/1003>
|
| 2 |
|
| 3 | diff --git a/CMakeLists.txt b/CMakeLists.txt
|
| 4 | index 5ec39df40..57f58f515 100644
|
| 5 | |
| 6 | |
| 7 | @@ -37,6 +37,7 @@ option(DEPENDENCIES_FORCE_BUILD "Force build libraries" OFF)
|
| 8 | option(BUILD_WITH_GRAPHVIZ "Generate dependency graphs" ON)
|
| 9 | option(VERSION_UPDATE_FROM_GIT "Extract version information from git tags. Default to true. Follow vX.Y.Z-suffix" TRUE)
|
| 10 |
|
| 11 | +option(INSTALL_C_SOURCE "Install the generated C source files to `pharo-vm'" OFF)
|
| 12 |
|
| 13 | set(APPNAME "Pharo" CACHE STRING "VM Application name")
|
| 14 | set(FLAVOUR "CoInterpreter" CACHE STRING "The kind of VM to generate. Possible values: StackVM, CoInterpreter")
|
| 15 | @@ -105,6 +106,15 @@ endif()
|
| 16 | #This needs to be at this point, after setting the toolchain configuration
|
| 17 | project(PharoVM)
|
| 18 |
|
| 19 | +set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib" CACHE STRING "Install-time RPATH")
|
| 20 | +
|
| 21 | +# Provide a default value for the installation prefix, while
|
| 22 | +# preserving any user-specified CMAKE_INSTALL_PREFIX.
|
| 23 | +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
| 24 | + set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE
|
| 25 | + "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 26 | +endif()
|
| 27 | +
|
| 28 | include(cmake/versionExtraction.cmake)
|
| 29 |
|
| 30 | set(BUILT_FROM "${PharoVM_VERSION_STRING_FULL} - Commit: ${PharoVM_VERSION_GIT_SHA} - Date: ${PharoVM_VERSION_GIT_COMMIT_DATE}")
|
| 31 | @@ -407,7 +417,12 @@ message(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}")
|
| 32 | message(STATUS "Resource Compiler: ${CMAKE_RC_COMPILER}")
|
| 33 |
|
| 34 | set(VM_FRONTEND_APPLICATION_TYPE)
|
| 35 | -include(cmake/${CMAKE_SYSTEM_NAME}.cmake)
|
| 36 | +
|
| 37 | +if(UNIX AND NOT OSX AND NOT WIN)
|
| 38 | + include(cmake/Linux.cmake)
|
| 39 | +else() # WIN AND OSX
|
| 40 | + include(cmake/${CMAKE_SYSTEM_NAME}.cmake)
|
| 41 | +endif()
|
| 42 |
|
| 43 | set(GENERATED_SOURCES ${VMSOURCEFILES})
|
| 44 |
|
| 45 | diff --git a/cmake/Darwin.cmake b/cmake/Darwin.cmake
|
| 46 | index 9095313d2..e1d1ab77c 100644
|
| 47 | |
| 48 | |
| 49 | @@ -67,8 +67,6 @@ macro(add_third_party_dependencies_per_platform)
|
| 50 | endmacro()
|
| 51 |
|
| 52 | macro(configure_installables INSTALL_COMPONENT)
|
| 53 | - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 54 | -
|
| 55 | install(
|
| 56 | DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
|
| 57 | DESTINATION "${VM_EXECUTABLE_NAME}.app/Contents/MacOS/Plugins"
|
| 58 | diff --git a/cmake/FreeBSD.cmake b/cmake/FreeBSD.cmake
|
| 59 | deleted file mode 100644
|
| 60 | index 0d4386657..000000000
|
| 61 | |
| 62 | |
| 63 | @@ -1,97 +0,0 @@
|
| 64 | -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,wxneeded,-rpath=. -I/usr/local/include -I/usr/X11R6/include -lexecinfo")
|
| 65 | -set(PHARO_BIN_LOCATION "default" CACHE STRING "The default location of the PHARO bin, used by the launch.sh.in")
|
| 66 | -
|
| 67 | -if(${PHARO_BIN_LOCATION} STREQUAL "default")
|
| 68 | - set(PHARO_BIN_IN_ROOT "`/usr/bin/dirname \"\$0\"`/libexec")
|
| 69 | - set(PHARO_BIN_IN_BIN "`/usr/bin/dirname \"\$0\"`/../libexec")
|
| 70 | -else()
|
| 71 | - set(PHARO_BIN_IN_ROOT ${PHARO_BIN_LOCATION})
|
| 72 | - set(PHARO_BIN_IN_BIN ${PHARO_BIN_LOCATION})
|
| 73 | -endif()
|
| 74 | -
|
| 75 | -function(add_platform_headers)
|
| 76 | -target_include_directories(${VM_LIBRARY_NAME}
|
| 77 | -PUBLIC
|
| 78 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix
|
| 79 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/common
|
| 80 | -)
|
| 81 | -endfunction() #add_platform_headers
|
| 82 | -
|
| 83 | -set(EXTRACTED_SOURCES
|
| 84 | -#Common sources
|
| 85 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqHeapMap.c
|
| 86 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqVirtualMachine.c
|
| 87 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqNamedPrims.c
|
| 88 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqExternalSemaphores.c
|
| 89 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqTicker.c
|
| 90 | -
|
| 91 | -#Platform sources
|
| 92 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/unix/aio.c
|
| 93 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugUnix.c
|
| 94 | -
|
| 95 | -#Virtual Memory functions
|
| 96 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/memoryUnix.c
|
| 97 | -
|
| 98 | -# Support sources
|
| 99 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/fileDialogUnix.c
|
| 100 | -)
|
| 101 | -
|
| 102 | -set(VM_FRONTEND_SOURCES
|
| 103 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/unixMain.c)
|
| 104 | -
|
| 105 | -
|
| 106 | -macro(add_third_party_dependencies_per_platform)
|
| 107 | - if(${FEATURE_LIB_GIT2})
|
| 108 | - include(cmake/importLibGit2.cmake)
|
| 109 | - endif()
|
| 110 | -
|
| 111 | - if(${FEATURE_LIB_FREETYPE2})
|
| 112 | - include(cmake/importFreetype2.cmake)
|
| 113 | - endif()
|
| 114 | -
|
| 115 | - if(${FEATURE_LIB_CAIRO})
|
| 116 | - include(cmake/importCairo.cmake)
|
| 117 | - endif()
|
| 118 | -
|
| 119 | - if(${FEATURE_LIB_SDL2})
|
| 120 | - include(cmake/importSDL2.cmake)
|
| 121 | - endif()
|
| 122 | -endmacro()
|
| 123 | -
|
| 124 | -
|
| 125 | -macro(configure_installables INSTALL_COMPONENT)
|
| 126 | - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 127 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/launch.sh.in
|
| 128 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/${VM_EXECUTABLE_NAME} @ONLY)
|
| 129 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/bin/launch.sh.in
|
| 130 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/bin/${VM_EXECUTABLE_NAME} @ONLY)
|
| 131 | -
|
| 132 | -
|
| 133 | - install(
|
| 134 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/packaging/linux/"
|
| 135 | - DESTINATION "./"
|
| 136 | - USE_SOURCE_PERMISSIONS
|
| 137 | - COMPONENT ${INSTALL_COMPONENT})
|
| 138 | - install(
|
| 139 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/vm/"
|
| 140 | - DESTINATION "lib"
|
| 141 | - USE_SOURCE_PERMISSIONS
|
| 142 | - COMPONENT ${INSTALL_COMPONENT})
|
| 143 | - install(
|
| 144 | - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
|
| 145 | - DESTINATION "lib"
|
| 146 | - USE_SOURCE_PERMISSIONS
|
| 147 | - COMPONENT ${INSTALL_COMPONENT}
|
| 148 | - FILES_MATCHING PATTERN ${DYLIB_EXT})
|
| 149 | -
|
| 150 | -
|
| 151 | - install(
|
| 152 | - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix/"
|
| 153 | - DESTINATION include/pharovm
|
| 154 | - COMPONENT include
|
| 155 | - FILES_MATCHING PATTERN *.h)
|
| 156 | -endmacro()
|
| 157 | -
|
| 158 | -macro(add_required_libs_per_platform)
|
| 159 | - target_link_libraries(${VM_LIBRARY_NAME} m pthread)
|
| 160 | -endmacro()
|
| 161 | diff --git a/cmake/Linux.cmake b/cmake/Linux.cmake
|
| 162 | index 0b6b9d7c4..fb43bae6b 100644
|
| 163 | |
| 164 | |
| 165 | @@ -1,14 +1,3 @@
|
| 166 | -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-rpath=.")
|
| 167 | -set(PHARO_BIN_LOCATION "default" CACHE STRING "The default location of the PHARO bin, used by the launch.sh.in")
|
| 168 | -
|
| 169 | -if(${PHARO_BIN_LOCATION} STREQUAL "default")
|
| 170 | - set(PHARO_BIN_IN_ROOT "`/usr/bin/dirname \"\$0\"`/lib")
|
| 171 | - set(PHARO_BIN_IN_BIN "`/usr/bin/dirname \"\$0\"`/../lib")
|
| 172 | -else()
|
| 173 | - set(PHARO_BIN_IN_ROOT ${PHARO_BIN_LOCATION})
|
| 174 | - set(PHARO_BIN_IN_BIN ${PHARO_BIN_LOCATION})
|
| 175 | -endif()
|
| 176 | -
|
| 177 | function(add_platform_headers)
|
| 178 | target_include_directories(${VM_LIBRARY_NAME}
|
| 179 | PUBLIC
|
| 180 | @@ -39,7 +28,6 @@ set(EXTRACTED_SOURCES
|
| 181 | set(VM_FRONTEND_SOURCES
|
| 182 | ${CMAKE_CURRENT_SOURCE_DIR}/src/unixMain.c)
|
| 183 |
|
| 184 | -
|
| 185 | macro(add_third_party_dependencies_per_platform)
|
| 186 | if(${FEATURE_LIB_GIT2})
|
| 187 | include(cmake/importLibGit2.cmake)
|
| 188 | @@ -58,42 +46,21 @@ macro(add_third_party_dependencies_per_platform)
|
| 189 | endif()
|
| 190 | endmacro()
|
| 191 |
|
| 192 | -
|
| 193 | macro(configure_installables INSTALL_COMPONENT)
|
| 194 | - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 195 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/launch.sh.in
|
| 196 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/${VM_EXECUTABLE_NAME} @ONLY)
|
| 197 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/bin/launch.sh.in
|
| 198 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/bin/${VM_EXECUTABLE_NAME} @ONLY)
|
| 199 | -
|
| 200 | -
|
| 201 | install(
|
| 202 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/packaging/linux/"
|
| 203 | - DESTINATION "./"
|
| 204 | - USE_SOURCE_PERMISSIONS
|
| 205 | - COMPONENT ${INSTALL_COMPONENT})
|
| 206 | + TARGETS ${VM_EXECUTABLE_NAME}
|
| 207 | + COMPONENT ${INSTALL_COMPONENT})
|
| 208 | install(
|
| 209 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/vm/"
|
| 210 | - DESTINATION "lib"
|
| 211 | - USE_SOURCE_PERMISSIONS
|
| 212 | - COMPONENT ${INSTALL_COMPONENT})
|
| 213 | - install(
|
| 214 | - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
|
| 215 | - DESTINATION "lib"
|
| 216 | - USE_SOURCE_PERMISSIONS
|
| 217 | - COMPONENT ${INSTALL_COMPONENT}
|
| 218 | - FILES_MATCHING PATTERN ${DYLIB_EXT})
|
| 219 | -
|
| 220 | -
|
| 221 | - install(
|
| 222 | - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix/"
|
| 223 | - DESTINATION include/pharovm
|
| 224 | - COMPONENT include
|
| 225 | - FILES_MATCHING PATTERN *.h)
|
| 226 | + TARGETS ${VM_LIBRARY_NAME}
|
| 227 | + COMPONENT ${INSTALL_COMPONENT}
|
| 228 | + INCLUDES DESTINATION "include/pharovm")
|
| 229 | + install(
|
| 230 | + TARGETS ${VM_PLUGIN_TARGETS}
|
| 231 | + COMPONENT ${INSTALL_COMPONENT})
|
| 232 | endmacro()
|
| 233 |
|
| 234 | macro(add_required_libs_per_platform)
|
| 235 | target_link_libraries(${VM_LIBRARY_NAME} dl)
|
| 236 | target_link_libraries(${VM_LIBRARY_NAME} m)
|
| 237 | target_link_libraries(${VM_LIBRARY_NAME} pthread)
|
| 238 | -endmacro()
|
| 239 | \ No newline at end of file
|
| 240 | +endmacro()
|
| 241 | diff --git a/cmake/OpenBSD.cmake b/cmake/OpenBSD.cmake
|
| 242 | deleted file mode 100644
|
| 243 | index 19d26483b..000000000
|
| 244 | |
| 245 | |
| 246 | @@ -1,97 +0,0 @@
|
| 247 | -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-z,wxneeded,-rpath=. -I/usr/local/include -I/usr/X11R6/include")
|
| 248 | -set(PHARO_BIN_LOCATION "default" CACHE STRING "The default location of the PHARO bin, used by the launch.sh.in")
|
| 249 | -
|
| 250 | -if(${PHARO_BIN_LOCATION} STREQUAL "default")
|
| 251 | - set(PHARO_BIN_IN_ROOT "`/usr/bin/dirname \"\$0\"`/lib")
|
| 252 | - set(PHARO_BIN_IN_BIN "`/usr/bin/dirname \"\$0\"`/../lib")
|
| 253 | -else()
|
| 254 | - set(PHARO_BIN_IN_ROOT ${PHARO_BIN_LOCATION})
|
| 255 | - set(PHARO_BIN_IN_BIN ${PHARO_BIN_LOCATION})
|
| 256 | -endif()
|
| 257 | -
|
| 258 | -function(add_platform_headers)
|
| 259 | -target_include_directories(${VM_LIBRARY_NAME}
|
| 260 | -PUBLIC
|
| 261 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix
|
| 262 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/common
|
| 263 | -)
|
| 264 | -endfunction() #add_platform_headers
|
| 265 | -
|
| 266 | -set(EXTRACTED_SOURCES
|
| 267 | -#Common sources
|
| 268 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqHeapMap.c
|
| 269 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqVirtualMachine.c
|
| 270 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqNamedPrims.c
|
| 271 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqExternalSemaphores.c
|
| 272 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/common/sqTicker.c
|
| 273 | -
|
| 274 | -#Platform sources
|
| 275 | - ${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/src/unix/aio.c
|
| 276 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/debugUnix.c
|
| 277 | -
|
| 278 | -#Virtual Memory functions
|
| 279 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/memoryUnix.c
|
| 280 | -
|
| 281 | -# Support sources
|
| 282 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/fileDialogUnix.c
|
| 283 | -)
|
| 284 | -
|
| 285 | -set(VM_FRONTEND_SOURCES
|
| 286 | - ${CMAKE_CURRENT_SOURCE_DIR}/src/unixMain.c)
|
| 287 | -
|
| 288 | -
|
| 289 | -macro(add_third_party_dependencies_per_platform)
|
| 290 | - if(${FEATURE_LIB_GIT2})
|
| 291 | - include(cmake/importLibGit2.cmake)
|
| 292 | - endif()
|
| 293 | -
|
| 294 | - if(${FEATURE_LIB_FREETYPE2})
|
| 295 | - include(cmake/importFreetype2.cmake)
|
| 296 | - endif()
|
| 297 | -
|
| 298 | - if(${FEATURE_LIB_CAIRO})
|
| 299 | - include(cmake/importCairo.cmake)
|
| 300 | - endif()
|
| 301 | -
|
| 302 | - if(${FEATURE_LIB_SDL2})
|
| 303 | - include(cmake/importSDL2.cmake)
|
| 304 | - endif()
|
| 305 | -endmacro()
|
| 306 | -
|
| 307 | -
|
| 308 | -macro(configure_installables INSTALL_COMPONENT)
|
| 309 | - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 310 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/launch.sh.in
|
| 311 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/${VM_EXECUTABLE_NAME} @ONLY)
|
| 312 | - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/packaging/linux/bin/launch.sh.in
|
| 313 | - ${CMAKE_CURRENT_BINARY_DIR}/build/packaging/linux/bin/${VM_EXECUTABLE_NAME} @ONLY)
|
| 314 | -
|
| 315 | -
|
| 316 | - install(
|
| 317 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/packaging/linux/"
|
| 318 | - DESTINATION "./"
|
| 319 | - USE_SOURCE_PERMISSIONS
|
| 320 | - COMPONENT ${INSTALL_COMPONENT})
|
| 321 | - install(
|
| 322 | - DIRECTORY "${CMAKE_BINARY_DIR}/build/vm/"
|
| 323 | - DESTINATION "lib"
|
| 324 | - USE_SOURCE_PERMISSIONS
|
| 325 | - COMPONENT ${INSTALL_COMPONENT})
|
| 326 | - install(
|
| 327 | - DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/libffi/install/lib/"
|
| 328 | - DESTINATION "lib"
|
| 329 | - USE_SOURCE_PERMISSIONS
|
| 330 | - COMPONENT ${INSTALL_COMPONENT}
|
| 331 | - FILES_MATCHING PATTERN ${DYLIB_EXT})
|
| 332 | -
|
| 333 | -
|
| 334 | - install(
|
| 335 | - DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/extracted/vm/include/unix/"
|
| 336 | - DESTINATION include/pharovm
|
| 337 | - COMPONENT include
|
| 338 | - FILES_MATCHING PATTERN *.h)
|
| 339 | -endmacro()
|
| 340 | -
|
| 341 | -macro(add_required_libs_per_platform)
|
| 342 | - target_link_libraries(${VM_LIBRARY_NAME} m pthread)
|
| 343 | -endmacro()
|
| 344 | diff --git a/cmake/Windows.cmake b/cmake/Windows.cmake
|
| 345 | index 3082b697c..9be884ebc 100644
|
| 346 | |
| 347 | |
| 348 | @@ -98,8 +98,6 @@ macro(add_third_party_dependencies_per_platform)
|
| 349 | endmacro()
|
| 350 |
|
| 351 | macro(configure_installables INSTALL_COMPONENT)
|
| 352 | - set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/build/dist")
|
| 353 | -
|
| 354 | install(
|
| 355 | DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/build/vm/"
|
| 356 | DESTINATION "./"
|
| 357 | diff --git a/cmake/packaging.cmake b/cmake/packaging.cmake
|
| 358 | index 4727d56e0..54add1eb4 100644
|
| 359 | |
| 360 | |
| 361 | @@ -30,54 +30,52 @@ install(
|
| 362 | COMPONENT include
|
| 363 | FILES_MATCHING PATTERN *.h)
|
| 364 |
|
| 365 | -install(DIRECTORY
|
| 366 | - "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
| 367 | - "${CMAKE_CURRENT_SOURCE_DIR}/extracted"
|
| 368 | - "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
| 369 | - "${CMAKE_CURRENT_SOURCE_DIR}/packaging"
|
| 370 | - "${CMAKE_CURRENT_SOURCE_DIR}/plugins"
|
| 371 | - "${CMAKE_CURRENT_SOURCE_DIR}/resources"
|
| 372 | - "${CMAKE_CURRENT_SOURCE_DIR}/scripts"
|
| 373 | - "${CMAKE_CURRENT_SOURCE_DIR}/src"
|
| 374 | - "${CMAKE_CURRENT_SOURCE_DIR}/ffiTestLibrary"
|
| 375 | - "${CMAKE_CURRENT_SOURCE_DIR}/ffi"
|
| 376 | - "${CMAKE_CURRENT_SOURCE_DIR}/tty"
|
| 377 | - DESTINATION pharo-vm
|
| 378 | - USE_SOURCE_PERMISSIONS
|
| 379 | - COMPONENT c-src
|
| 380 | -)
|
| 381 | -
|
| 382 | -install(FILES
|
| 383 | +if(INSTALL_C_SOURCE)
|
| 384 | + install(DIRECTORY
|
| 385 | + "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
|
| 386 | + "${CMAKE_CURRENT_SOURCE_DIR}/extracted"
|
| 387 | + "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
| 388 | + "${CMAKE_CURRENT_SOURCE_DIR}/plugins"
|
| 389 | + "${CMAKE_CURRENT_SOURCE_DIR}/resources"
|
| 390 | + "${CMAKE_CURRENT_SOURCE_DIR}/scripts"
|
| 391 | + "${CMAKE_CURRENT_SOURCE_DIR}/src"
|
| 392 | + "${CMAKE_CURRENT_SOURCE_DIR}/ffiTestLibrary"
|
| 393 | + "${CMAKE_CURRENT_SOURCE_DIR}/ffi"
|
| 394 | + "${CMAKE_CURRENT_SOURCE_DIR}/tty"
|
| 395 | + DESTINATION pharo-vm
|
| 396 | + USE_SOURCE_PERMISSIONS
|
| 397 | + COMPONENT c-src)
|
| 398 | +
|
| 399 | + install(FILES
|
| 400 | "${CMAKE_CURRENT_BINARY_DIR}/version.info"
|
| 401 | DESTINATION pharo-vm
|
| 402 | COMPONENT c-src)
|
| 403 |
|
| 404 | + install(FILES
|
| 405 | + "CMakeLists.txt"
|
| 406 | + ${SUPPORT_CMAKE_FILES}
|
| 407 | + DESTINATION pharo-vm
|
| 408 | + COMPONENT c-src)
|
| 409 | +
|
| 410 | + #Define generated files as elements in the c-src component for packaging
|
| 411 | + install(
|
| 412 | + DIRECTORY "${GENERATED_SOURCE_DIR}/generated/"
|
| 413 | + DESTINATION pharo-vm/generated/
|
| 414 | + USE_SOURCE_PERMISSIONS
|
| 415 | + COMPONENT c-src)
|
| 416 | +
|
| 417 | + install(
|
| 418 | + DIRECTORY "${GENERATED_SOURCE_DIR}/generated/32/vm/include/"
|
| 419 | + DESTINATION include/pharovm
|
| 420 | + USE_SOURCE_PERMISSIONS
|
| 421 | + COMPONENT include
|
| 422 | + FILES_MATCHING PATTERN *.h)
|
| 423 | +endif(INSTALL_C_SOURCE)
|
| 424 | +
|
| 425 | #List all cmake files
|
| 426 | file(GLOB SUPPORT_CMAKE_FILES
|
| 427 | "${CMAKE_CURRENT_SOURCE_DIR}/*.cmake"
|
| 428 | )
|
| 429 | -
|
| 430 | -install(FILES
|
| 431 | - "CMakeLists.txt"
|
| 432 | - ${SUPPORT_CMAKE_FILES}
|
| 433 | - DESTINATION pharo-vm
|
| 434 | - COMPONENT c-src
|
| 435 | -)
|
| 436 | -
|
| 437 | -#Define generated files as elements in the c-src component for packaging
|
| 438 | -install(
|
| 439 | - DIRECTORY "${GENERATED_SOURCE_DIR}/generated/"
|
| 440 | - DESTINATION pharo-vm/generated/
|
| 441 | - USE_SOURCE_PERMISSIONS
|
| 442 | - COMPONENT c-src)
|
| 443 | -
|
| 444 | -install(
|
| 445 | - DIRECTORY "${GENERATED_SOURCE_DIR}/generated/32/vm/include/"
|
| 446 | - DESTINATION include/pharovm
|
| 447 | - USE_SOURCE_PERMISSIONS
|
| 448 | - COMPONENT include
|
| 449 | - FILES_MATCHING PATTERN *.h)
|
| 450 | -
|
| 451 | set(CPACK_PACKAGE_DESCRIPTION "${APPNAME} Headless VM for ${FULL_PLATFORM_NAME}")
|
| 452 | set(CPACK_PACKAGE_VENDOR "${APPNAME}")
|
| 453 | set(CPACK_PACKAGE_HOMEPAGE_URL "https://pharo.org")
|
| 454 | diff --git a/packaging/linux/bin/launch.sh.in b/packaging/linux/bin/launch.sh.in
|
| 455 | deleted file mode 100755
|
| 456 | index 0d7d656bb..000000000
|
| 457 | |
| 458 | |
| 459 | @@ -1,65 +0,0 @@
|
| 460 | -#!/bin/sh
|
| 461 | -# Run the VM, setting SQUEAK_PLUGINS if unset to the VM's containing directory
|
| 462 | -# if unset, and ensuring LD_LIBRARY_PATH includes the VM's containing directory.
|
| 463 | -BIN=@PHARO_BIN_IN_BIN@
|
| 464 | -GDB=
|
| 465 | -if [ "${SQUEAK_PLUGINS-unset}" = unset ]; then
|
| 466 | - export SQUEAK_PLUGINS="$BIN"
|
| 467 | -fi
|
| 468 | -if [ "$1" = '-gdb' ]; then
|
| 469 | - GDB=gdb
|
| 470 | - shift
|
| 471 | - echo;echo run $@; echo
|
| 472 | - set --
|
| 473 | -fi
|
| 474 | -# At least on linux LD_LIBRARY_PATH's components must be absolute path names
|
| 475 | -case "$BIN" in
|
| 476 | -/*) PLUGINS="$BIN";;
|
| 477 | -*) PLUGINS="`pwd`/$BIN"
|
| 478 | -esac
|
| 479 | -
|
| 480 | -if [ $(uname -s) = "OpenBSD" ]; then
|
| 481 | - LD_LIBRARY_PATH="$PLUGINS:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
|
| 482 | -fi
|
| 483 | -
|
| 484 | -# On some linuxes there multiple versions of the C library. If the image uses
|
| 485 | -# libc (e.g. through the FFI) then it must use the same version that the VM uses
|
| 486 | -# and so it should take precedence over /lib libc. This is done by setting
|
| 487 | -# LD_LIBRARY_PATH appropriately, based on ldd's idea of the libc use by the VM.
|
| 488 | -#Try extracting Libc
|
| 489 | -LIBC_SO="`/usr/bin/ldd "$BIN/@VM_EXECUTABLE_NAME@" | /bin/fgrep /libc. | sed 's/^.*=> \([^ ]*\).*/\1/'`"
|
| 490 | -PLATFORMLIBDIR=`expr "$LIBC_SO" : '\(.*\)/libc.*'`
|
| 491 | -
|
| 492 | -#If empty try extracting Musl
|
| 493 | -if [ "$PLATFORMLIBDIR" = "" ]; then
|
| 494 | -{
|
| 495 | - LIBC_SO="`/usr/bin/ldd "$BIN/@VM_EXECUTABLE_NAME@" | /bin/fgrep libc. | sed 's/^.*=> \([^ ]*\).*/\1/'`"
|
| 496 | - PLATFORMLIBDIR=`expr "$LIBC_SO" : '\(.*\)/ld-musl.*'`
|
| 497 | -}
|
| 498 | -fi
|
| 499 | -
|
| 500 | -if [ "$PLATFORMLIBDIR" = "" ]; then
|
| 501 | -{
|
| 502 | - echo "Error. Could not determine platform's libc path for VM. "
|
| 503 | - echo "Try forcing \$PLATFORMLIBDIR in $0, based on LIBC_SO."
|
| 504 | - echo "Please report what works to @VM_EXECUTABLE_NAME@ [vm-dev] mail list."
|
| 505 | - echo " LIBC_SO="$LIBC_SO
|
| 506 | - cat /etc/*-release* | grep -v // | sed 's/^/ /'
|
| 507 | - echo -n " UNAME=" ; uname -a
|
| 508 | - MACHINE=`uname -m`
|
| 509 | - case "$MACHINE" in
|
| 510 | - *64*)
|
| 511 | - echo " System seems to be 64 bit. You may need to (re)install the 32-bit libraries."
|
| 512 | - ;;
|
| 513 | - esac
|
| 514 | - exit 1
|
| 515 | -} 1>&2
|
| 516 | -fi
|
| 517 | -# prepending is less flexible but safer because it ensures we find the plugins
|
| 518 | -# in the same directory as the VM. We must include at least /lib and /usr/lib
|
| 519 | -# if libraries there-in are to be found. These directories are not implicit.
|
| 520 | -case $PLATFORMLIBDIR in
|
| 521 | -/lib|/usr/lib) SVMLLP=/lib:/usr/lib;;
|
| 522 | -*) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib"
|
| 523 | -esac
|
| 524 | -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
|
| 525 | diff --git a/packaging/linux/launch.sh.in b/packaging/linux/launch.sh.in
|
| 526 | deleted file mode 100755
|
| 527 | index 456444f27..000000000
|
| 528 | |
| 529 | |
| 530 | @@ -1,66 +0,0 @@
|
| 531 | -#!/bin/sh
|
| 532 | -# Run the VM, setting SQUEAK_PLUGINS if unset to the VM's containing directory
|
| 533 | -# if unset, and ensuring LD_LIBRARY_PATH includes the VM's containing directory.
|
| 534 | -BIN=@PHARO_BIN_IN_ROOT@
|
| 535 | -GDB=
|
| 536 | -if [ "${SQUEAK_PLUGINS-unset}" = unset ]; then
|
| 537 | - export SQUEAK_PLUGINS="$BIN"
|
| 538 | -fi
|
| 539 | -if [ "$1" = '-gdb' ]; then
|
| 540 | - GDB=gdb
|
| 541 | - shift
|
| 542 | - echo;echo run $@; echo
|
| 543 | - set --
|
| 544 | -fi
|
| 545 | -# At least on linux LD_LIBRARY_PATH's components must be absolute path names
|
| 546 | -case "$BIN" in
|
| 547 | -/*) PLUGINS="$BIN";;
|
| 548 | -*) PLUGINS="`pwd`/$BIN"
|
| 549 | -esac
|
| 550 | -
|
| 551 | -if [ $(uname -s) = "OpenBSD" ]; then
|
| 552 | - LD_LIBRARY_PATH="$PLUGINS:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
|
| 553 | -fi
|
| 554 | -
|
| 555 | -# On some linuxes there multiple versions of the C library. If the image uses
|
| 556 | -# libc (e.g. through the FFI) then it must use the same version that the VM uses
|
| 557 | -# and so it should take precedence over /lib libc. This is done by setting
|
| 558 | -# LD_LIBRARY_PATH appropriately, based on ldd's idea of the libc use by the VM.
|
| 559 | -
|
| 560 | -#Try extracting Libc
|
| 561 | -LIBC_SO="`/usr/bin/ldd "$BIN/@VM_EXECUTABLE_NAME@" | /bin/fgrep /libc. | sed 's/^.*=> \([^ ]*\).*/\1/'`"
|
| 562 | -PLATFORMLIBDIR=`expr "$LIBC_SO" : '\(.*\)/libc.*'`
|
| 563 | -
|
| 564 | -#If empty try extracting Musl
|
| 565 | -if [ "$PLATFORMLIBDIR" = "" ]; then
|
| 566 | -{
|
| 567 | - LIBC_SO="`/usr/bin/ldd "$BIN/@VM_EXECUTABLE_NAME@" | /bin/fgrep libc. | sed 's/^.*=> \([^ ]*\).*/\1/'`"
|
| 568 | - PLATFORMLIBDIR=`expr "$LIBC_SO" : '\(.*\)/ld-musl.*'`
|
| 569 | -}
|
| 570 | -fi
|
| 571 | -
|
| 572 | -if [ "$PLATFORMLIBDIR" = "" ]; then
|
| 573 | -{
|
| 574 | - echo "Error. Could not determine platform's libc path for VM. "
|
| 575 | - echo "Try forcing \$PLATFORMLIBDIR in $0, based on LIBC_SO."
|
| 576 | - echo "Please report what works to @VM_EXECUTABLE_NAME@ [vm-dev] mail list."
|
| 577 | - echo " LIBC_SO="$LIBC_SO
|
| 578 | - cat /etc/*-release* | grep -v // | sed 's/^/ /'
|
| 579 | - echo -n " UNAME=" ; uname -a
|
| 580 | - MACHINE=`uname -m`
|
| 581 | - case "$MACHINE" in
|
| 582 | - *64*)
|
| 583 | - echo " System seems to be 64 bit. You may need to (re)install the 32-bit libraries."
|
| 584 | - ;;
|
| 585 | - esac
|
| 586 | - exit 1
|
| 587 | -} 1>&2
|
| 588 | -fi
|
| 589 | -# prepending is less flexible but safer because it ensures we find the plugins
|
| 590 | -# in the same directory as the VM. We must include at least /lib and /usr/lib
|
| 591 | -# if libraries there-in are to be found. These directories are not implicit.
|
| 592 | -case $PLATFORMLIBDIR in
|
| 593 | -/lib|/usr/lib) SVMLLP=/lib:/usr/lib;;
|
| 594 | -*) SVMLLP="$PLATFORMLIBDIR:/lib:/usr$PLATFORMLIBDIR:/usr/lib"
|
| 595 | -esac
|
| 596 | -LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" exec $GDB "$BIN/@VM_EXECUTABLE_NAME@" "$@"
|
| 597 | diff --git a/plugins.cmake b/plugins.cmake
|
| 598 | index 5be40233c..809c55631 100644
|
| 599 | |
| 600 | |
| 601 | @@ -47,6 +47,7 @@ endif()
|
| 602 | addLibraryWithRPATH(FilePlugin
|
| 603 | ${FilePlugin_SOURCES}
|
| 604 | ${PHARO_CURRENT_GENERATED}/plugins/src/FilePlugin/FilePlugin.c)
|
| 605 | +list(APPEND VM_PLUGIN_TARGETS FilePlugin)
|
| 606 |
|
| 607 | if(OSX)
|
| 608 | target_link_libraries(FilePlugin PRIVATE "-framework CoreFoundation")
|
| 609 | @@ -75,6 +76,7 @@ if(NOT OPENBSD)
|
| 610 | )
|
| 611 |
|
| 612 | addLibraryWithRPATH(UUIDPlugin ${UUIDPlugin_SOURCES})
|
| 613 | + list(APPEND VM_PLUGIN_TARGETS UUIDPlugin)
|
| 614 | if(WIN)
|
| 615 | target_link_libraries(UUIDPlugin PRIVATE "-lole32")
|
| 616 | elseif(UNIX AND NOT OSX)
|
| 617 | @@ -147,6 +149,7 @@ set(BitBltPlugin_SOURCES
|
| 618 | )
|
| 619 |
|
| 620 | addLibraryWithRPATH(BitBltPlugin ${BitBltPlugin_SOURCES})
|
| 621 | +list(APPEND VM_PLUGIN_TARGETS BitBltPlugin)
|
| 622 |
|
| 623 | #
|
| 624 | # B2DPlugin
|
| 625 | @@ -193,6 +196,7 @@ else()
|
| 626 | endif()
|
| 627 |
|
| 628 | addLibraryWithRPATH(LocalePlugin ${LocalePlugin_SOURCES})
|
| 629 | +list(APPEND VM_PLUGIN_TARGETS LocalePlugin)
|
| 630 |
|
| 631 | if(OSX)
|
| 632 | target_link_libraries(LocalePlugin PRIVATE "-framework CoreFoundation")
|
| 633 | @@ -239,6 +243,7 @@ else()
|
| 634 | endif()
|
| 635 |
|
| 636 | addLibraryWithRPATH(SqueakSSL ${SqueakSSL_SOURCES})
|
| 637 | +list(APPEND VM_PLUGIN_TARGETS SqueakSSL)
|
| 638 |
|
| 639 | if(OSX)
|
| 640 | target_link_libraries(SqueakSSL PRIVATE "-framework CoreFoundation")
|
| 641 | diff --git a/plugins.macros.cmake b/plugins.macros.cmake
|
| 642 | index 8e7ff93c0..e68780cc3 100644
|
| 643 | |
| 644 | |
| 645 | @@ -1,3 +1,6 @@
|
| 646 | +# The list of VM_PLUGINS targets define.
|
| 647 | +set(VM_PLUGIN_TARGETS)
|
| 648 | +
|
| 649 | macro(add_vm_plugin NAME)
|
| 650 |
|
| 651 | set(${NAME}_SOURCES_EXTRA ${ARGN})
|
| 652 | @@ -36,4 +39,5 @@ macro(add_vm_plugin NAME)
|
| 653 | message(STATUS "Adding plugin: ${NAME}")
|
| 654 |
|
| 655 | addLibraryWithRPATH(${NAME} ${${NAME}_SOURCES} ${${NAME}_SOURCES_EXTRA})
|
| 656 | -endmacro()
|
| 657 | \ No newline at end of file
|
| 658 | + list(APPEND VM_PLUGIN_TARGETS ${NAME})
|
| 659 | +endmacro()
|