freerdp: various missing link dependencies and symbol exports

This commit is contained in:
Marc-André Moreau 2013-09-03 21:48:26 -04:00
parent b480ce1830
commit 7edfe66274
23 changed files with 102 additions and 62 deletions

6
.gitignore vendored
View File

@ -16,6 +16,12 @@ _CPack_Packages
external/*
!external/README
*.a.objlist.cmake
*.a.objlist
*.a.objdir
*_dummy.c
*_dummy.c.base
# Packages
*.zip
*.exe

View File

@ -24,6 +24,8 @@ project(FreeRDP C)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${ALSA_LIBRARIES})

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${PULSE_LIBRARY})

View File

@ -28,7 +28,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${PULSE_LIBRARY})

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${ALSA_LIBRARIES})

View File

@ -30,7 +30,7 @@ set_target_properties(${MODULE_NAME} PROPERTIES PREFIX "")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE freerdp
MODULES freerdp-utils)
MODULES freerdp-codec freerdp-utils)
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${PULSE_LIBRARY})

View File

@ -85,7 +85,6 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI
MODULE winpr
MODULES winpr-input winpr-crt winpr-utils)
set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
# Set a list of the dependent targets used by the application. There should be a way to get this list automatically

View File

@ -20,6 +20,7 @@
#ifndef __XF_MONITOR_H
#define __XF_MONITOR_H
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
#include <freerdp/rail/rail.h>
@ -43,8 +44,8 @@ typedef struct _VIRTUAL_SCREEN VIRTUAL_SCREEN;
#include "xf_client.h"
#include "xfreerdp.h"
int xf_list_monitors(xfContext* xfc);
BOOL xf_detect_monitors(xfContext* xfc, rdpSettings* settings);
void xf_monitors_free(xfContext *xfc, rdpSettings *settings);
FREERDP_API int xf_list_monitors(xfContext* xfc);
FREERDP_API BOOL xf_detect_monitors(xfContext* xfc, rdpSettings* settings);
FREERDP_API void xf_monitors_free(xfContext *xfc, rdpSettings *settings);
#endif /* __XF_MONITOR_H */

View File

@ -22,6 +22,8 @@
typedef struct xf_context xfContext;
#include <freerdp/api.h>
#include "xf_window.h"
#include "xf_monitor.h"
#include "xf_channels.h"
@ -215,7 +217,7 @@ void xf_unlock_x11(xfContext* xfc, BOOL display);
void xf_draw_screen_scaled(xfContext* xfc, int x, int y, int w, int h, BOOL scale);
void xf_transform_window(xfContext* xfc);
DWORD xf_exit_code_from_disconnect_reason(DWORD reason);
FREERDP_API DWORD xf_exit_code_from_disconnect_reason(DWORD reason);
#endif /* __XFREERDP_H */

View File

@ -52,8 +52,6 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS MONOLITHIC ${MONOLITHI
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Client/Common")

View File

@ -23,8 +23,8 @@
#include <freerdp/api.h>
#include <freerdp/freerdp.h>
int freerdp_detect_old_command_line_syntax(int argc, char** argv, int* count);
int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSettings* settings);
FREERDP_API int freerdp_detect_old_command_line_syntax(int argc, char** argv, int* count);
FREERDP_API int freerdp_client_parse_old_command_line_arguments(int argc, char** argv, rdpSettings* settings);
#endif /* FREERDP_CLIENT_COMPATIBILITY */

View File

@ -12,16 +12,19 @@
# You should have received a copy of the FMILIB_License.txt file
# along with this program. If not, contact Modelon AB <http://www.modelon.com>.
# Merge_static_libs(outlib lib1 lib2 ... libn) merges a number of static
# Merge_static_libs(output_library lib1 lib2 ... libn) merges a number of static
# libs into a single static library
function(merge_static_libs outlib)
function(merge_static_libs output_library)
set(output_target "${output_library}")
string(REGEX REPLACE "-" "_" output_library ${output_library})
set(libs ${ARGV})
list(REMOVE_AT libs 0)
# Create a dummy file that the target will depend on
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${outlib}_dummy.c)
# Create a dummy file that the target will depend on
set(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/${output_library}_dummy.c)
file(WRITE ${dummyfile} "const char * dummy = \"${dummyfile}\";")
add_library(${outlib} STATIC ${dummyfile})
add_library(${output_target} STATIC ${dummyfile})
if("${CMAKE_CFG_INTDIR}" STREQUAL ".")
set(multiconfig FALSE)
@ -29,7 +32,7 @@ function(merge_static_libs outlib)
set(multiconfig TRUE)
endif()
# First get the file names of the libraries to be merged
# First get the file names of the libraries to be merged
foreach(lib ${libs})
get_target_property(libtype ${lib} TYPE)
if(NOT libtype STREQUAL "STATIC_LIBRARY")
@ -45,8 +48,8 @@ function(merge_static_libs outlib)
list(APPEND libfiles "${libfile}")
endif(multiconfig)
endforeach()
#message(STATUS "will be merging ${libfiles}")
# Just to be sure: cleanup from duplicates
# Just to be sure: cleanup from duplicates
if(multiconfig)
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
list(REMOVE_DUPLICATES libfiles_${CONFIG_TYPE})
@ -55,7 +58,7 @@ function(merge_static_libs outlib)
endif()
list(REMOVE_DUPLICATES libfiles)
# Now the easy part for MSVC and for MAC
# Now the easy part for MSVC and for MAC
if(MSVC)
# lib.exe does the merging of libraries just need to conver the list into string
foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
@ -64,7 +67,7 @@ function(merge_static_libs outlib)
set(flags "${flags} ${lib}")
endforeach()
string(TOUPPER "STATIC_LIBRARY_FLAGS_${CONFIG_TYPE}" PROPNAME)
set_target_properties(${outlib} PROPERTIES ${PROPNAME} "${flags}")
set_target_properties(${output_target} PROPERTIES ${PROPNAME} "${flags}")
endforeach()
elseif(APPLE)
@ -72,8 +75,8 @@ function(merge_static_libs outlib)
if(multiconfig)
message(FATAL_ERROR "Multiple configurations are not supported")
endif()
get_target_property(outfile ${outlib} LOCATION)
add_custom_command(TARGET ${outlib} POST_BUILD
get_target_property(outfile ${output_target} LOCATION)
add_custom_command(TARGET ${output_target} POST_BUILD
COMMAND rm ${outfile}
COMMAND /usr/bin/libtool -static -o ${outfile}
${libfiles}
@ -83,48 +86,66 @@ function(merge_static_libs outlib)
if(multiconfig)
message(FATAL_ERROR "Multiple configurations are not supported")
endif()
get_target_property(outfile ${outlib} LOCATION)
message(STATUS "outfile location is ${outfile}")
get_target_property(outfile ${output_target} LOCATION)
message(STATUS "output file location is ${outfile}")
foreach(lib ${libfiles})
# objlistfile will contain the list of object files for the library
# objlistfile will contain the list of object files for the library
set(objlistfile ${lib}.objlist)
set(objdir ${lib}.objdir)
set(objlistcmake ${objlistfile}.cmake)
# we only need to extract files once
get_filename_component(libname ${lib} NAME_WE)
if(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/cmake.check_cache IS_NEWER_THAN ${objlistcmake})
#---------------------------------
FILE(WRITE ${objlistcmake}
"# Extract object files from the library
message(STATUS \"Extracting object files from ${lib}\")
EXECUTE_PROCESS(COMMAND ${CMAKE_AR} -x ${lib}
WORKING_DIRECTORY ${objdir})
# save the list of object files
EXECUTE_PROCESS(COMMAND ls .
OUTPUT_FILE ${objlistfile}
WORKING_DIRECTORY ${objdir})")
#---------------------------------
file(WRITE ${objlistcmake} "
# delete previous object files
message(STATUS \"Removing previous object files from ${lib}\")
EXECUTE_PROCESS(COMMAND ls .
WORKING_DIRECTORY ${objdir}
COMMAND xargs -I {} rm {}
WORKING_DIRECTORY ${objdir})
# Extract object files from the library
message(STATUS \"Extracting object files from ${lib}\")
EXECUTE_PROCESS(COMMAND ${CMAKE_AR} -x ${lib}
WORKING_DIRECTORY ${objdir})
# Prefixing object files to avoid conflicts
message(STATUS \"Prefixing object files to avoid conflicts\")
EXECUTE_PROCESS(COMMAND ls .
WORKING_DIRECTORY ${objdir}
COMMAND xargs -I {} mv {} ${libname}_{}
WORKING_DIRECTORY ${objdir})
# save the list of object files
EXECUTE_PROCESS(COMMAND ls .
OUTPUT_FILE ${objlistfile}
WORKING_DIRECTORY ${objdir})
")
file(MAKE_DIRECTORY ${objdir})
add_custom_command(
OUTPUT ${objlistfile}
COMMAND ${CMAKE_COMMAND} -P ${objlistcmake}
DEPENDS ${lib})
endif()
list(APPEND extrafiles "${objlistfile}")
# relative path is needed by ar under MSYS
file(RELATIVE_PATH objlistfilerpath ${objdir} ${objlistfile})
add_custom_command(TARGET ${outlib} POST_BUILD
add_custom_command(TARGET ${output_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Running: ${CMAKE_AR} ru ${outfile} @${objlistfilerpath}"
COMMAND ${CMAKE_AR} ru "${outfile}" @"${objlistfilerpath}"
WORKING_DIRECTORY ${objdir})
#COMMAND ld -r -static -o "${outfile}" --whole-archive @"${objlistfilerpath}"
WORKING_DIRECTORY ${objdir})
endforeach()
add_custom_command(TARGET ${outlib} POST_BUILD
add_custom_command(TARGET ${output_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "Running: ${CMAKE_RANLIB} ${outfile}"
COMMAND ${CMAKE_RANLIB} ${outfile})
endif()
file(WRITE ${dummyfile}.base "const char* ${outlib}_sublibs=\"${libs}\";")
file(WRITE ${dummyfile}.base "const char* ${output_library}_sublibs=\"${libs}\";")
add_custom_command(
OUTPUT ${dummyfile}
COMMAND ${CMAKE_COMMAND} -E copy ${dummyfile}.base ${dummyfile}
OUTPUT ${dummyfile}
COMMAND ${CMAKE_COMMAND} -E copy ${dummyfile}.base ${dummyfile}
DEPENDS ${libs} ${extrafiles})
endfunction()

View File

@ -59,11 +59,7 @@ if(MONOLITHIC_BUILD)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
if(NOT WITH_WAYK)
install(TARGETS ${MODULE_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT libraries)
endif()
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
endif()

View File

@ -136,7 +136,7 @@ set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD}
MODULE winpr
MODULES winpr-registry winpr-utils winpr-interlocked winpr-dsparse winpr-sspi winpr-rpc winpr-crt)
MODULES winpr-registry winpr-utils winpr-interlocked winpr-dsparse winpr-sspi winpr-rpc winpr-handle winpr-crt)
if(MONOLITHIC_BUILD)
set(FREERDP_LIBS ${FREERDP_LIBS} ${${MODULE_PREFIX}_LIBS} PARENT_SCOPE)

View File

@ -1,5 +1,5 @@
int dummy()
int freerdp_dummy()
{
return 0;
}

View File

@ -917,10 +917,20 @@ void gdi_register_update_callbacks(rdpUpdate* update)
void gdi_init_primary(rdpGdi* gdi)
{
gdi->primary = gdi_bitmap_new_ex(gdi, gdi->width, gdi->height, gdi->dstBpp, gdi->primary_buffer);
gdi->primary = (gdiBitmap*) malloc(sizeof(gdiBitmap));
gdi->primary->hdc = gdi_CreateCompatibleDC(gdi->hdc);
if (!gdi->primary_buffer)
gdi->primary->bitmap = gdi_CreateCompatibleBitmap(gdi->hdc, gdi->width, gdi->height);
else
gdi->primary->bitmap = gdi_CreateBitmap(gdi->width, gdi->height, gdi->dstBpp, gdi->primary_buffer);
gdi_SelectObject(gdi->primary->hdc, (HGDIOBJECT) gdi->primary->bitmap);
gdi->primary->org_bitmap = NULL;
gdi->primary_buffer = gdi->primary->bitmap->data;
if (gdi->drawing == NULL)
if (!gdi->drawing)
gdi->drawing = gdi->primary;
gdi->primary->hdc->hwnd = (HGDI_WND) malloc(sizeof(GDI_WND));

View File

@ -133,6 +133,7 @@ static void svc_plugin_process_received(rdpSvcPlugin* plugin, void* pData, UINT3
}
plugin->data_in = NULL;
Stream_SealLength(data_in);
Stream_SetPosition(data_in, 0);
MessageQueue_Post(plugin->MsgPipe->In, NULL, 0, (void*) data_in, NULL);

View File

@ -38,7 +38,6 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS}
${FREERDP_CHANNELS_SERVER_LIBS})
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES LINK_INTERFACE_LIBRARIES "")
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)

View File

@ -1,5 +1,5 @@
int dummy()
int winpr_dummy()
{
return 0;
}

View File

@ -28,10 +28,15 @@ add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
set_complex_link_libraries(VARIABLE ${MODULE_PREFIX}_LIBS
MONOLITHIC ${MONOLITHIC_BUILD} INTERNAL
MODULE winpr
MODULES winpr-crt winpr-heap winpr-environment)
if(MONOLITHIC_BUILD)
else()
target_link_libraries(${MODULE_NAME} winpr-crt winpr-heap winpr-environment)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()