Initial commit

This commit is contained in:
matt
2020-09-20 12:16:44 +00:00
parent 09a4460ddb
commit 408c005d3e
839 changed files with 190481 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
>From 7a15d1c9a908afe429c1aba1c27516d18bdea299 Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 03:37:12 -0600
Subject: [PATCH 1/4] Add BUILD_STATIC feature from TigerVNC to (optionally)
prevent FLTK from depending on libgcc and libstdc++
---
CMakeLists.txt | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a1ee285..7d9d94b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -150,6 +150,49 @@ mark_as_advanced(LIB_CAIRO LIB_fontconfig LIB_freetype)
mark_as_advanced(LIB_GL LIB_MesaGL)
mark_as_advanced(LIB_jpeg LIB_png LIB_zlib)
+# This ensures that we don't depend on libstdc++ or libgcc
+if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE AND NOT CYGWIN)
+ option(BUILD_STATIC
+ "Link statically against libgcc and libstdc++, if possible" OFF)
+ if(BUILD_STATIC)
+ # For some reason, simply passing ${CMAKE_CXX_FLAGS} to the compiler in
+ # execute_process() doesn't work. Grrr...
+ if(CMAKE_SIZEOF_VOID_P MATCHES 8)
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m64
+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS
+ RESULT_VARIABLE RESULT)
+ else()
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -m32
+ --print-file-name=libstdc++.a OUTPUT_VARIABLE LIBSTDCPLUSPLUS
+ RESULT_VARIABLE RESULT)
+ endif()
+ string(REGEX REPLACE "\n" "" LIBSTDCPLUSPLUS ${LIBSTDCPLUSPLUS})
+ if(RESULT MATCHES 0 AND LIBSTDCPLUSPLUS)
+ message(STATUS "Linking with static libstdc++:\n ${LIBSTDCPLUSPLUS}")
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/staticlib)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E remove
+ ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ if(MINGW)
+ execute_process(COMMAND ${CMAKE_COMMAND} -E copy
+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ else()
+ execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink
+ ${LIBSTDCPLUSPLUS} ${CMAKE_BINARY_DIR}/staticlib/libstdc++.a)
+ endif()
+ set(CMAKE_EXE_LINKER_FLAGS
+ "${CMAKE_EXE_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib")
+ set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -L${CMAKE_BINARY_DIR}/staticlib")
+ else()
+ message(WARNING Cannot find static libstdc++. TigerVNC will depend on dynamic libstdc++.)
+ endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc")
+ set(CMAKE_SHARED_LINKER_FLAGS
+ "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc")
+ endif()
+endif()
+
#######################################################################
# functions
include(CheckFunctionExists)
--
1.8.1.3

View File

@@ -0,0 +1,26 @@
>From bf06cdf83375c11a47bddc3683143b3e2c0fdfcb Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 03:38:45 -0600
Subject: [PATCH 2/4] Fl_cocoa.mm depends on some Carbon functions, so we need
to include that framework.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7d9d94b..cae895e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,7 +51,7 @@ if(APPLE)
set(HAVE_STRTOLL 1)
set(HAVE_STRCASECMP 1)
set(HAVE_DIRENT_H 1)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Cocoa -framework Carbon")
endif(APPLE)
if(WIN32)
--
1.8.1.3

View File

@@ -0,0 +1,30 @@
>From bb02d8426a9a279df76376313349c17774030753 Mon Sep 17 00:00:00 2001
From: DRC <information@virtualgl.org>
Date: Tue, 26 Feb 2013 04:01:36 -0600
Subject: [PATCH 3/4] We need to unset CMAKE_REQUIRED_LIBRARIES after checking
for the libpng functions. Otherwise, under certain circumstances (known to
be an issue when building on OS X with the in-tree libpng implementation),
the scandir() function check will fail, leaving HAVE_SCANDIR unset, and the
build will subsequently fail.
---
CMakeLists.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cae895e..0984aae 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -210,6 +210,9 @@ if(LIB_png)
endif(LIB_png)
CHECK_FUNCTION_EXISTS(png_get_valid HAVE_PNG_GET_VALID)
CHECK_FUNCTION_EXISTS(png_set_tRNS_to_alpha HAVE_PNG_SET_TRNS_TO_ALPHA)
+if(LIB_png)
+ set(CMAKE_REQUIRED_LIBRARIES "")
+endif(LIB_png)
CHECK_FUNCTION_EXISTS(scandir HAVE_SCANDIR)
CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF)
--
1.8.1.3

View File

@@ -0,0 +1,11 @@
--- fltk-1.3.2.org/src/Fl_cocoa.mm 2013-01-16 11:32:11.788478228 +0100
+++ fltk-1.3.2/src/Fl_cocoa.mm 2013-01-16 11:32:55.824101285 +0100
@@ -3727,7 +3727,7 @@ CGImageRef Fl_X::CGImage_from_window_rec
CGImageRef img;
if (fl_mac_os_version >= 100500) {
NSBitmapImageRep *bitmap = rect_to_NSBitmapImageRep(win, x, y, w, h);
- img = [bitmap CGImage]; // requires Mac OS 10.5
+ img = (CGImageRef)[bitmap CGImage]; // requires Mac OS 10.5
CGImageRetain(img);
[bitmap release];
}