Skip to content

Commit

Permalink
channels: merging with master
Browse files Browse the repository at this point in the history
  • Loading branch information
awakecoding committed Aug 1, 2012
2 parents fa6ff1f + 4a36916 commit baeafc5
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 19 deletions.
19 changes: 15 additions & 4 deletions CMakeLists.txt
Expand Up @@ -44,6 +44,9 @@ set(FREERDP_VERSION_MINOR "0")
set(FREERDP_VERSION_REVISION "1")
set(FREERDP_VERSION "${FREERDP_VERSION_MAJOR}.${FREERDP_VERSION_MINOR}")
set(FREERDP_VERSION_FULL "${FREERDP_VERSION}.${FREERDP_VERSION_REVISION}")
include(GetGitRevisionDescription)
git_describe(GIT_REVISION --match "[0-9]*" --abbrev=4 --tags --always)
message(STATUS "Git Revision ${GIT_REVISION}")

# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -105,10 +108,18 @@ endif()

# Mac OS X
if(APPLE)
include_directories(/opt/local/include)
link_directories(/opt/local/lib)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -mmacosx-version-min=10.4")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework CoreFoundation")
if(IS_DIRECTORY /opt/local/include)
include_directories(/opt/local/include)
link_directories(/opt/local/lib)
endif()

option(WITH_CLANG "Build using clang" OFF)
if(WITH_CLANG)
set(CMAKE_C_COMPILER "clang")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.4")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl-framework,CoreFoundation")
endif()

if(NOT WIN32)
Expand Down
10 changes: 10 additions & 0 deletions channels/rdpsnd/rdpsnd_main.c
Expand Up @@ -505,12 +505,22 @@ static void rdpsnd_process_connect(rdpSvcPlugin* plugin)
{
default_data[0].data[0] = "alsa";
default_data[0].data[1] = "default";

if (!rdpsnd_load_device_plugin(rdpsnd, "alsa", default_data))
{
default_data[0].data[0] = "macaudio";
default_data[0].data[1] = "default";

rdpsnd_load_device_plugin(rdpsnd, "macaudio", default_data);
}
else
{
printf("rdpsnd: successfully loaded alsa plugin\n");
}
}
else
{
printf("rdpsnd: successfully loaded pulseaudio plugin\n");
}
}
if (rdpsnd->device == NULL)
Expand Down
3 changes: 2 additions & 1 deletion cmake/AutoVersioning.cmake
Expand Up @@ -40,7 +40,8 @@ else()
endif()

# Check if has not commited changes
execute_process(COMMAND git update-index -q --refresh)
execute_process(COMMAND git update-index -q --refresh
ERROR_QUIET)
execute_process(COMMAND git diff-index --name-only HEAD --
OUTPUT_VARIABLE CHANGED_SOURCE
OUTPUT_STRIP_TRAILING_WHITESPACE
Expand Down
106 changes: 106 additions & 0 deletions cmake/GetGitRevisionDescription.cmake
@@ -0,0 +1,106 @@
# - Returns a version string from Git
#
# These functions force a re-configure on each git commit so that you can
# trust the values of the variables in your build system.
#
# get_git_head_revision(<refspecvar> <hashvar> [<additional arguments to git describe> ...])
#
# Returns the refspec and sha hash of the current head revision
#
# git_describe(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe on the source tree, and adjusting
# the output so that it tests false if an error occurs.
#
# git_get_exact_tag(<var> [<additional arguments to git describe> ...])
#
# Returns the results of git describe --exact-match on the source tree,
# and adjusting the output so that it tests false if there was no exact
# matching tag.
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

if(__get_git_revision_description)
return()
endif()
set(__get_git_revision_description YES)

# We must run the following at "include" time, not at function call time,
# to find the path to this module rather than the path to a calling list file
get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH)

function(get_git_head_revision _refspecvar _hashvar)
set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories
set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH)
if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
# We have reached the root directory, we are not in git
set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
return()
endif()
set(GIT_DIR "${GIT_PARENT_DIR}/.git")
endwhile()
set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
if(NOT EXISTS "${GIT_DATA}")
file(MAKE_DIRECTORY "${GIT_DATA}")
endif()

if(NOT EXISTS "${GIT_DIR}/HEAD")
return()
endif()
set(HEAD_FILE "${GIT_DATA}/HEAD")
configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY)

configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in"
"${GIT_DATA}/grabRef.cmake"
@ONLY)
include("${GIT_DATA}/grabRef.cmake")

set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE)
set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE)
endfunction()

function(git_describe _var)
if(NOT GIT_FOUND)
find_package(Git QUIET)
endif()
if(NOT GIT_FOUND)
set(${_var} "n/a" PARENT_SCOPE)
return()
endif()
get_git_head_revision(refspec hash)
if(NOT hash)
set(${_var} "n/a" PARENT_SCOPE)
return()
endif()

execute_process(COMMAND "${GIT_EXECUTABLE}" describe ${hash} ${ARGN}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE res
OUTPUT_VARIABLE out
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT res EQUAL 0)
set(out "n/a")
endif()

set(${_var} "${out}" PARENT_SCOPE)
endfunction()

function(git_get_exact_tag _var)
git_describe(out --exact-match ${ARGN})
set(${_var} "${out}" PARENT_SCOPE)
endfunction()
38 changes: 38 additions & 0 deletions cmake/GetGitRevisionDescription.cmake.in
@@ -0,0 +1,38 @@
#
# Internal file for GetGitRevisionDescription.cmake
#
# Requires CMake 2.6 or newer (uses the 'function' command)
#
# Original Author:
# 2009-2010 Ryan Pavlik <rpavlik@iastate.edu> <abiryan@ryand.net>
# http://academic.cleardefinition.com
# Iowa State University HCI Graduate Program/VRAC
#
# Copyright Iowa State University 2009-2010.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)

set(HEAD_HASH)

file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024)

string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS)
if(HEAD_CONTENTS MATCHES "ref")
# named branch
string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}")
if(EXISTS "@GIT_DIR@/${HEAD_REF}")
configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}")
configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY)
set(HEAD_HASH "${HEAD_REF}")
endif()
else()
# detached HEAD
configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY)
endif()

if(NOT HEAD_HASH)
file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024)
string(STRIP "${HEAD_HASH}" HEAD_HASH)
endif()
1 change: 1 addition & 0 deletions config.h.in
Expand Up @@ -6,6 +6,7 @@
#define FREERDP_VERSION_MAJOR ${FREERDP_VERSION_MAJOR}
#define FREERDP_VERSION_MINOR ${FREERDP_VERSION_MINOR}
#define FREERDP_VERSION_REVISION ${FREERDP_VERSION_REVISION}
#define GIT_REVISION "${GIT_REVISION}"

#define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}"
#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}"
Expand Down
29 changes: 20 additions & 9 deletions libfreerdp-core/nego.c
Expand Up @@ -73,15 +73,25 @@ boolean nego_connect(rdpNego* nego)
if (!nego->security_layer_negotiation_enabled)
{
DEBUG_NEGO("Security Layer Negotiation is disabled");
/* attempt only the highest enabled protocol (see nego_attempt_*) */
nego->enabled_protocols[PROTOCOL_NLA] = 0;
nego->enabled_protocols[PROTOCOL_TLS] = 0;
nego->enabled_protocols[PROTOCOL_RDP] = 0;
if(nego->state == NEGO_STATE_NLA)
{
nego->enabled_protocols[PROTOCOL_NLA] = 1;
nego->selected_protocol = PROTOCOL_NLA;
}
else if (nego->state == NEGO_STATE_TLS)
{
nego->enabled_protocols[PROTOCOL_TLS] = 1;
nego->selected_protocol = PROTOCOL_TLS;
}
else if (nego->state == NEGO_STATE_RDP)
{
nego->enabled_protocols[PROTOCOL_RDP] = 1;
nego->selected_protocol = PROTOCOL_RDP;
}
}

if(!nego_send_preconnection_pdu(nego))
Expand Down Expand Up @@ -140,24 +150,25 @@ boolean nego_security_connect(rdpNego* nego)
}
else if (!nego->security_connected)
{
if (nego->enabled_protocols[PROTOCOL_NLA] > 0
&& nego->selected_protocol == PROTOCOL_NLA)
if (nego->selected_protocol == PROTOCOL_NLA)
{
DEBUG_NEGO("nego_security_connect with PROTOCOL_NLA\n");
DEBUG_NEGO("nego_security_connect with PROTOCOL_NLA");
nego->security_connected = transport_connect_nla(nego->transport);
}
else if (nego->enabled_protocols[PROTOCOL_TLS] > 0
&& nego->selected_protocol == PROTOCOL_TLS )
else if (nego->selected_protocol == PROTOCOL_TLS )
{
DEBUG_NEGO("nego_security_connect with PROTOCOL_TLS\n");
DEBUG_NEGO("nego_security_connect with PROTOCOL_TLS");
nego->security_connected = transport_connect_tls(nego->transport);
}
else if (nego->enabled_protocols[PROTOCOL_RDP] > 0
&& nego->selected_protocol == PROTOCOL_RDP)
else if (nego->selected_protocol == PROTOCOL_RDP)
{
DEBUG_NEGO("nego_security_connect with PROTOCOL_RDP\n");
DEBUG_NEGO("nego_security_connect with PROTOCOL_RDP");
nego->security_connected = transport_connect_rdp(nego->transport);
}
else
{
DEBUG_NEGO("cannot connect security layer because no protocol has been selected yet.");
}
}
return nego->security_connected;
}
Expand Down
3 changes: 0 additions & 3 deletions libfreerdp-core/timezone.c
Expand Up @@ -143,12 +143,10 @@ void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
rdp_write_system_time(s, &clientTimeZone->standardDate); /* StandardDate */

sbias = clientTimeZone->standardBias - clientTimeZone->bias;

if (sbias < 0)
bias2c = (uint32) sbias;
else
bias2c = ~((uint32) sbias) + 1;

stream_write_uint32(s, bias2c); /* StandardBias */

/* daylightName (64 bytes) */
Expand All @@ -163,7 +161,6 @@ void rdp_write_client_time_zone(STREAM* s, rdpSettings* settings)
bias2c = (uint32) sbias;
else
bias2c = ~((uint32) sbias) + 1;

stream_write_uint32(s, bias2c); /* DaylightBias */

xfree(standardName);
Expand Down
5 changes: 4 additions & 1 deletion libfreerdp-locale/timezone.c
Expand Up @@ -1635,10 +1635,12 @@ TIME_ZONE_RULE_ENTRY* freerdp_get_current_time_zone_rule(TIME_ZONE_RULE_ENTRY* r
{
if ((rules[i].TicksStart <= windows_time) && (windows_time >= rules[i].TicksEnd))
{
/*printf("Got rule %d from table at %p with count %u\n", i, rules, count);*/
return &rules[i];
}
}

printf("Unable to get current timezone rule\n");
return NULL;
}

Expand Down Expand Up @@ -1671,7 +1673,6 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
#else
clientTimeZone->bias = 0;
#endif

if (local_time->tm_isdst > 0)
{
clientTimeZone->standardBias = clientTimeZone->bias - 60;
Expand All @@ -1696,6 +1697,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
TIME_ZONE_RULE_ENTRY* rule;
rule = freerdp_get_current_time_zone_rule(tz->RuleTable, tz->RuleTableCount);

/* issue #574 -- temporarily disabled this block as it seems to be setting the wrong time
if (rule != NULL)
{
clientTimeZone->standardBias = 0;
Expand All @@ -1719,6 +1721,7 @@ void freerdp_time_zone_detect(TIME_ZONE_INFO* clientTimeZone)
clientTimeZone->daylightDate.wSecond = rule->DaylightDate.wSecond;
clientTimeZone->daylightDate.wMilliseconds = rule->DaylightDate.wMilliseconds;
}
*/
}

xfree(tz);
Expand Down
2 changes: 1 addition & 1 deletion libfreerdp-utils/args.c
Expand Up @@ -790,7 +790,7 @@ int freerdp_parse_args(rdpSettings* settings, int argc, char** argv,
}
else if (strcmp("--version", argv[index]) == 0)
{
printf("This is FreeRDP version %s\n", FREERDP_VERSION_FULL);
printf("This is FreeRDP version %s (git %s)\n", FREERDP_VERSION_FULL, GIT_REVISION);
return FREERDP_ARGS_PARSE_VERSION;
}
else if (argv[index][0] != '-')
Expand Down
6 changes: 6 additions & 0 deletions winpr/CMakeLists.txt
Expand Up @@ -17,6 +17,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

if (APPLE)
# flat_namespace should be avoided, but is required for -undefined warning. Since WinPR currently has
# a lot of undefined symbols in use, use this hack until they're filled out.
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-flat_namespace,-undefined,warning")
endif()

add_subdirectory(crt)
add_subdirectory(utils)
add_subdirectory(heap)
Expand Down

0 comments on commit baeafc5

Please sign in to comment.