From 093ed8383a3805c3d7168cf9e4fb8f7e315bd149 Mon Sep 17 00:00:00 2001 From: Rex Tsai Date: Thu, 1 Sep 2011 22:05:31 +0800 Subject: [PATCH 1/5] cmake: Install keymap data files. --- CMakeLists.txt | 1 + keymaps/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 keymaps/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 68bf75096..a2ca7b900 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,3 +138,4 @@ endif() add_subdirectory(client) add_subdirectory(server) +add_subdirectory(keymaps) diff --git a/keymaps/CMakeLists.txt b/keymaps/CMakeLists.txt new file mode 100644 index 000000000..b6a6c4f3c --- /dev/null +++ b/keymaps/CMakeLists.txt @@ -0,0 +1,3 @@ +install(FILES aliases amiga ataritt empty evdev fujitsu hp ibm macintosh macosx sony sun xfree86 xfree98 xkb.pl DESTINATION share/freerdp/keymaps) +install(DIRECTORY digital_vndr DESTINATION share/freerdp/keymaps FILES_MATCHING PATTERN "*") +install(DIRECTORY sgi_vndr DESTINATION share/freerdp/keymaps FILES_MATCHING PATTERN "*") From ecbe24ca9ac4b1ca3cb12b17bd1b2f2391f19b70 Mon Sep 17 00:00:00 2001 From: Rex Tsai Date: Thu, 1 Sep 2011 22:18:58 +0800 Subject: [PATCH 2/5] cmake: make linking type as option. --- CMakeLists.txt | 5 +++++ channels/cliprdr/CMakeLists.txt | 2 +- channels/drdynvc/CMakeLists.txt | 2 +- channels/rail/CMakeLists.txt | 2 +- channels/rdpdbg/CMakeLists.txt | 2 +- channels/rdpdr/CMakeLists.txt | 2 +- channels/rdpdr/disk/CMakeLists.txt | 2 +- channels/rdpdr/printer/CMakeLists.txt | 2 +- channels/rdpsnd/CMakeLists.txt | 2 +- channels/rdpsnd/alsa/CMakeLists.txt | 2 +- channels/rdpsnd/pulse/CMakeLists.txt | 2 +- libfreerdp-cache/CMakeLists.txt | 2 +- libfreerdp-chanman/CMakeLists.txt | 2 +- libfreerdp-core/CMakeLists.txt | 2 +- libfreerdp-gdi/CMakeLists.txt | 2 +- libfreerdp-kbd/CMakeLists.txt | 2 +- libfreerdp-rail/CMakeLists.txt | 2 +- libfreerdp-rfx/CMakeLists.txt | 2 +- libfreerdp-rfx/sse2/CMakeLists.txt | 2 +- libfreerdp-utils/CMakeLists.txt | 2 +- 20 files changed, 24 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2ca7b900..1380dae90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,11 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") endif() +# build shared libs +if(NOT BUILD_SHARED_LIBS) + set(BUILD_SHARED_LIBS ON) +endif() + # Compiler-specific flags if(CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable") diff --git a/channels/cliprdr/CMakeLists.txt b/channels/cliprdr/CMakeLists.txt index d74f823f2..03fb0ba20 100644 --- a/channels/cliprdr/CMakeLists.txt +++ b/channels/cliprdr/CMakeLists.txt @@ -25,7 +25,7 @@ set(CLIPRDR_SRCS cliprdr_main.h ) -add_library(cliprdr SHARED ${CLIPRDR_SRCS}) +add_library(cliprdr ${CLIPRDR_SRCS}) set_target_properties(cliprdr PROPERTIES PREFIX "") target_link_libraries(cliprdr freerdp-utils) diff --git a/channels/drdynvc/CMakeLists.txt b/channels/drdynvc/CMakeLists.txt index a21e4fa50..c3bdbb0b4 100644 --- a/channels/drdynvc/CMakeLists.txt +++ b/channels/drdynvc/CMakeLists.txt @@ -25,7 +25,7 @@ set(DRDYNVC_SRCS dvcman.h ) -add_library(drdynvc SHARED ${DRDYNVC_SRCS}) +add_library(drdynvc ${DRDYNVC_SRCS}) set_target_properties(drdynvc PROPERTIES PREFIX "") target_link_libraries(drdynvc freerdp-utils) diff --git a/channels/rail/CMakeLists.txt b/channels/rail/CMakeLists.txt index b1ce55797..316411118 100644 --- a/channels/rail/CMakeLists.txt +++ b/channels/rail/CMakeLists.txt @@ -23,7 +23,7 @@ set(RAIL_SRCS rail_orders.c rail_orders.h) -add_library(rail SHARED ${RAIL_SRCS}) +add_library(rail ${RAIL_SRCS}) set_target_properties(rail PROPERTIES PREFIX "") target_link_libraries(rail freerdp-utils) diff --git a/channels/rdpdbg/CMakeLists.txt b/channels/rdpdbg/CMakeLists.txt index d8159b576..db562a047 100644 --- a/channels/rdpdbg/CMakeLists.txt +++ b/channels/rdpdbg/CMakeLists.txt @@ -21,7 +21,7 @@ set(RDPDBG_SRCS rdpdbg_main.c ) -add_library(rdpdbg SHARED ${RDPDBG_SRCS}) +add_library(rdpdbg ${RDPDBG_SRCS}) set_target_properties(rdpdbg PROPERTIES PREFIX "") target_link_libraries(rdpdbg freerdp-utils) diff --git a/channels/rdpdr/CMakeLists.txt b/channels/rdpdr/CMakeLists.txt index be54ca647..7eda1144c 100644 --- a/channels/rdpdr/CMakeLists.txt +++ b/channels/rdpdr/CMakeLists.txt @@ -30,7 +30,7 @@ set(RDPDR_SRCS rdpdr_main.h ) -add_library(rdpdr SHARED ${RDPDR_SRCS}) +add_library(rdpdr ${RDPDR_SRCS}) set_target_properties(rdpdr PROPERTIES PREFIX "") target_link_libraries(rdpdr freerdp-utils) diff --git a/channels/rdpdr/disk/CMakeLists.txt b/channels/rdpdr/disk/CMakeLists.txt index 5a44c8185..c1acd8058 100644 --- a/channels/rdpdr/disk/CMakeLists.txt +++ b/channels/rdpdr/disk/CMakeLists.txt @@ -25,7 +25,7 @@ set(DISK_SRCS include_directories(..) -add_library(disk SHARED ${DISK_SRCS}) +add_library(disk ${DISK_SRCS}) set_target_properties(disk PROPERTIES PREFIX "") target_link_libraries(disk freerdp-utils) diff --git a/channels/rdpdr/printer/CMakeLists.txt b/channels/rdpdr/printer/CMakeLists.txt index fc7784f1e..d70eb02e5 100644 --- a/channels/rdpdr/printer/CMakeLists.txt +++ b/channels/rdpdr/printer/CMakeLists.txt @@ -33,7 +33,7 @@ endif() include_directories(..) -add_library(printer SHARED ${PRINTER_SRCS}) +add_library(printer ${PRINTER_SRCS}) set_target_properties(printer PROPERTIES PREFIX "") target_link_libraries(printer freerdp-utils) diff --git a/channels/rdpsnd/CMakeLists.txt b/channels/rdpsnd/CMakeLists.txt index c1b0862ed..c5413ee38 100644 --- a/channels/rdpsnd/CMakeLists.txt +++ b/channels/rdpsnd/CMakeLists.txt @@ -22,7 +22,7 @@ set(RDPSND_SRCS rdpsnd_main.h ) -add_library(rdpsnd SHARED ${RDPSND_SRCS}) +add_library(rdpsnd ${RDPSND_SRCS}) set_target_properties(rdpsnd PROPERTIES PREFIX "") target_link_libraries(rdpsnd freerdp-utils) diff --git a/channels/rdpsnd/alsa/CMakeLists.txt b/channels/rdpsnd/alsa/CMakeLists.txt index 73a9f4e07..4d6deb43e 100644 --- a/channels/rdpsnd/alsa/CMakeLists.txt +++ b/channels/rdpsnd/alsa/CMakeLists.txt @@ -24,7 +24,7 @@ set(RDPSND_ALSA_SRCS include_directories(..) include_directories(${ALSA_INCLUDE_DIRS}) -add_library(rdpsnd_alsa SHARED ${RDPSND_ALSA_SRCS}) +add_library(rdpsnd_alsa ${RDPSND_ALSA_SRCS}) set_target_properties(rdpsnd_alsa PROPERTIES PREFIX "") target_link_libraries(rdpsnd_alsa freerdp-utils) diff --git a/channels/rdpsnd/pulse/CMakeLists.txt b/channels/rdpsnd/pulse/CMakeLists.txt index 0c6c200cf..4460dafbf 100644 --- a/channels/rdpsnd/pulse/CMakeLists.txt +++ b/channels/rdpsnd/pulse/CMakeLists.txt @@ -24,7 +24,7 @@ set(RDPSND_PULSE_SRCS include_directories(..) include_directories(${PULSE_INCLUDE_DIRS}) -add_library(rdpsnd_pulse SHARED ${RDPSND_PULSE_SRCS}) +add_library(rdpsnd_pulse ${RDPSND_PULSE_SRCS}) set_target_properties(rdpsnd_pulse PROPERTIES PREFIX "") target_link_libraries(rdpsnd_pulse freerdp-utils) diff --git a/libfreerdp-cache/CMakeLists.txt b/libfreerdp-cache/CMakeLists.txt index 413c600f0..7feb8fad0 100644 --- a/libfreerdp-cache/CMakeLists.txt +++ b/libfreerdp-cache/CMakeLists.txt @@ -26,7 +26,7 @@ set(FREERDP_CACHE_SRCS glyph.c cache.c) -add_library(freerdp-cache SHARED ${FREERDP_CACHE_SRCS}) +add_library(freerdp-cache ${FREERDP_CACHE_SRCS}) set_target_properties(freerdp-cache PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") diff --git a/libfreerdp-chanman/CMakeLists.txt b/libfreerdp-chanman/CMakeLists.txt index dae990491..f4d334c88 100644 --- a/libfreerdp-chanman/CMakeLists.txt +++ b/libfreerdp-chanman/CMakeLists.txt @@ -21,7 +21,7 @@ set(FREERDP_CHANMAN_SRCS libchanman.c libchanman.h) -add_library(freerdp-chanman SHARED ${FREERDP_CHANMAN_SRCS}) +add_library(freerdp-chanman ${FREERDP_CHANMAN_SRCS}) set_target_properties(freerdp-chanman PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") target_link_libraries(freerdp-chanman freerdp-utils) diff --git a/libfreerdp-core/CMakeLists.txt b/libfreerdp-core/CMakeLists.txt index ec44fe287..f3c592a1f 100644 --- a/libfreerdp-core/CMakeLists.txt +++ b/libfreerdp-core/CMakeLists.txt @@ -92,7 +92,7 @@ set(LIBFREERDP_CORE_SRCS peer.h ) -add_library(freerdp-core SHARED ${LIBFREERDP_CORE_SRCS}) +add_library(freerdp-core ${LIBFREERDP_CORE_SRCS}) set_target_properties(freerdp-core PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") diff --git a/libfreerdp-gdi/CMakeLists.txt b/libfreerdp-gdi/CMakeLists.txt index c04c93ef6..ae3f4fdb3 100644 --- a/libfreerdp-gdi/CMakeLists.txt +++ b/libfreerdp-gdi/CMakeLists.txt @@ -34,7 +34,7 @@ set(FREERDP_GDI_SRCS shape.c gdi.c) -add_library(freerdp-gdi SHARED ${FREERDP_GDI_SRCS}) +add_library(freerdp-gdi ${FREERDP_GDI_SRCS}) target_link_libraries(freerdp-gdi freerdp-cache) target_link_libraries(freerdp-gdi freerdp-rfx) diff --git a/libfreerdp-kbd/CMakeLists.txt b/libfreerdp-kbd/CMakeLists.txt index d5dfec87c..3f6f1e42e 100644 --- a/libfreerdp-kbd/CMakeLists.txt +++ b/libfreerdp-kbd/CMakeLists.txt @@ -27,7 +27,7 @@ set(FREERDP_KBD_SRCS libkbd.c libkbd.h) -add_library(freerdp-kbd SHARED ${FREERDP_KBD_SRCS}) +add_library(freerdp-kbd ${FREERDP_KBD_SRCS}) find_suggested_package(XKBFile) if(XKBFILE_FOUND) diff --git a/libfreerdp-rail/CMakeLists.txt b/libfreerdp-rail/CMakeLists.txt index 1dbcad709..aaa2b6cc2 100644 --- a/libfreerdp-rail/CMakeLists.txt +++ b/libfreerdp-rail/CMakeLists.txt @@ -23,7 +23,7 @@ set(FREERDP_RAIL_SRCS icon.c rail.c) -add_library(freerdp-rail SHARED ${FREERDP_RAIL_SRCS}) +add_library(freerdp-rail ${FREERDP_RAIL_SRCS}) set_target_properties(freerdp-rail PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") diff --git a/libfreerdp-rfx/CMakeLists.txt b/libfreerdp-rfx/CMakeLists.txt index d45c4336e..fa7cea0c9 100644 --- a/libfreerdp-rfx/CMakeLists.txt +++ b/libfreerdp-rfx/CMakeLists.txt @@ -39,7 +39,7 @@ set(LIBFREERDP_RFX_SRCS librfx.c ) -add_library(freerdp-rfx SHARED ${LIBFREERDP_RFX_SRCS}) +add_library(freerdp-rfx ${LIBFREERDP_RFX_SRCS}) set_target_properties(freerdp-rfx PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") diff --git a/libfreerdp-rfx/sse2/CMakeLists.txt b/libfreerdp-rfx/sse2/CMakeLists.txt index a81678eee..8382e4318 100644 --- a/libfreerdp-rfx/sse2/CMakeLists.txt +++ b/libfreerdp-rfx/sse2/CMakeLists.txt @@ -24,7 +24,7 @@ set(LIBFREERDP_RFX_SSE2_SRCS include_directories(..) -add_library(freerdp-rfx-sse2 STATIC ${LIBFREERDP_RFX_SSE2_SRCS}) +add_library(freerdp-rfx-sse2 ${LIBFREERDP_RFX_SSE2_SRCS}) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") set_target_properties(freerdp-rfx-sse2 PROPERTIES COMPILE_FLAGS "-fPIC") diff --git a/libfreerdp-utils/CMakeLists.txt b/libfreerdp-utils/CMakeLists.txt index b869f5de9..12b84e3f0 100644 --- a/libfreerdp-utils/CMakeLists.txt +++ b/libfreerdp-utils/CMakeLists.txt @@ -46,7 +46,7 @@ set(FREERDP_UTILS_SRCS add_definitions(-DPLUGIN_PATH="${FREERDP_PLUGIN_PATH}") -add_library(freerdp-utils SHARED ${FREERDP_UTILS_SRCS}) +add_library(freerdp-utils ${FREERDP_UTILS_SRCS}) set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION} PREFIX "lib") From a75b4f81628b5c462df168b93c4c75c2aff44c87 Mon Sep 17 00:00:00 2001 From: Rex Tsai Date: Thu, 1 Sep 2011 22:28:48 +0800 Subject: [PATCH 3/5] cmake: Install all extra headres. --- include/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 463315557..5c61383f5 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -17,5 +17,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -file(GLOB HEADERS "freerdp/*") +file(GLOB HEADERS "freerdp/*.h") install_files(/include/freerdp FILES ${HEADERS}) + +install(DIRECTORY freerdp/utils DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/chanman DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/cache DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/gdi DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/kbd DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/rali DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/rfx DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") +install(DIRECTORY freerdp/plugins DESTINATION include/freerdp FILES_MATCHING PATTERN "*.h") From dcfeedaa6c9503c8309af4bf0178d1ebe931e920 Mon Sep 17 00:00:00 2001 From: Rex Tsai Date: Thu, 1 Sep 2011 22:29:27 +0800 Subject: [PATCH 4/5] cmake: install freerdp-rfx-sse2.so --- libfreerdp-rfx/sse2/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/libfreerdp-rfx/sse2/CMakeLists.txt b/libfreerdp-rfx/sse2/CMakeLists.txt index 8382e4318..671d3a13d 100644 --- a/libfreerdp-rfx/sse2/CMakeLists.txt +++ b/libfreerdp-rfx/sse2/CMakeLists.txt @@ -29,3 +29,4 @@ add_library(freerdp-rfx-sse2 ${LIBFREERDP_RFX_SSE2_SRCS}) if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") set_target_properties(freerdp-rfx-sse2 PROPERTIES COMPILE_FLAGS "-fPIC") endif() +install(TARGETS freerdp-rfx-sse2 DESTINATION ${CMAKE_INSTALL_LIBDIR}) From 96b7418e561fec0e10fc04b6889ec648f6397d2d Mon Sep 17 00:00:00 2001 From: Rex Tsai Date: Thu, 1 Sep 2011 22:36:26 +0800 Subject: [PATCH 5/5] rdpsnd/pulse: Fix default device name. --- channels/rdpsnd/pulse/rdpsnd_pulse.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/channels/rdpsnd/pulse/rdpsnd_pulse.c b/channels/rdpsnd/pulse/rdpsnd_pulse.c index 1b2c59473..8a6434398 100644 --- a/channels/rdpsnd/pulse/rdpsnd_pulse.c +++ b/channels/rdpsnd/pulse/rdpsnd_pulse.c @@ -58,7 +58,7 @@ static void rdpsnd_pulse_context_state_callback(pa_context* context, void* userd case PA_CONTEXT_FAILED: case PA_CONTEXT_TERMINATED: - DEBUG_SVC("state %d", (int)state); + DEBUG_SVC("PA_CONTEXT_FAILED/PA_CONTEXT_TERMINATED %d", (int)state); pa_threaded_mainloop_signal(pulse->mainloop, 0); break; @@ -224,13 +224,21 @@ static void rdpsnd_pulse_open(rdpsndDevicePlugin* device, rdpsndFormat* format) { rdpsndPulsePlugin* pulse = (rdpsndPulsePlugin*)device; pa_stream_state_t state; - pa_buffer_attr buffer_attr = { 0 }; + char ss[PA_SAMPLE_SPEC_SNPRINT_MAX]; - if (!pulse->context || pulse->stream) + if (!pulse->context || pulse->stream) { + DEBUG_WARN("pulse stream has been created."); return; + } rdpsnd_pulse_set_format_spec(pulse, format); + if (pa_sample_spec_valid(&pulse->sample_spec) == 0) { + pa_sample_spec_snprint(ss, sizeof(ss), &pulse->sample_spec); + DEBUG_WARN("Invalid sample spec %s", ss); + return; + } + pa_threaded_mainloop_lock(pulse->mainloop); pulse->stream = pa_stream_new(pulse->context, "freerdp", &pulse->sample_spec, NULL); @@ -241,17 +249,15 @@ static void rdpsnd_pulse_open(rdpsndDevicePlugin* device, rdpsndFormat* format) pa_context_errno(pulse->context)); return; } + + /* install essential callbacks */ pa_stream_set_state_callback(pulse->stream, rdpsnd_pulse_stream_state_callback, pulse); pa_stream_set_write_callback(pulse->stream, rdpsnd_pulse_stream_request_callback, pulse); - buffer_attr.maxlength = (uint32_t) -1; - buffer_attr.tlength = (uint32_t) -1; /* pa_usec_to_bytes(2000000, &pulse->sample_spec); */ - buffer_attr.prebuf = (uint32_t) -1; - buffer_attr.minreq = (uint32_t) -1; - buffer_attr.fragsize = (uint32_t) -1; + if (pa_stream_connect_playback(pulse->stream, - pulse->device_name, &buffer_attr, 0, NULL, NULL) < 0) + pulse->device_name, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0) { pa_threaded_mainloop_unlock(pulse->mainloop); DEBUG_WARN("pa_stream_connect_playback failed (%d)", @@ -452,7 +458,10 @@ int FreeRDPRdpsndDeviceEntry(PFREERDP_RDPSND_DEVICE_ENTRY_POINTS pEntryPoints) data = pEntryPoints->plugin_data; if (data && strcmp((char*)data->data[0], "pulse") == 0) { + if(strlen((char*)data->data[1]) > 0) pulse->device_name = xstrdup((char*)data->data[1]); + else + pulse->device_name = NULL; } pulse->mainloop = pa_threaded_mainloop_new();