From c46e4999715d905b0e28e451a686a21183ebc711 Mon Sep 17 00:00:00 2001 From: James Muehlner Date: Thu, 16 Nov 2023 22:00:57 +0000 Subject: [PATCH] Buildy buildy --- configure.ac | 4 ++-- src/common-ssh/Makefile.am | 1 - src/common-ssh/tests/Makefile.am | 1 - src/common/Makefile.am | 1 - src/common/tests/Makefile.am | 1 - src/guacd/Makefile.am | 1 - src/libguac/Makefile.am | 13 ++++++++----- src/libguac/client.c | 9 +++++---- src/libguac/guacamole/client.h | 2 ++ src/libguac/guacamole/socket-handle.h | 0 src/libguac/id.c | 5 +++-- src/libguac/tests/Makefile.am | 1 - src/libguac/wait-fd.c | 5 +++-- src/libguac/wol.c | 8 +++++++- src/protocols/kubernetes/tests/Makefile.am | 1 - src/protocols/rdp/tests/Makefile.am | 1 - src/protocols/vnc/Makefile.am | 1 - src/pulse/Makefile.am | 1 - 18 files changed, 30 insertions(+), 26 deletions(-) mode change 100755 => 100644 src/libguac/guacamole/socket-handle.h diff --git a/configure.ac b/configure.ac index 3b6d7e6f8..72f773507 100644 --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/socket.h time.h sys/time.h syslo # Cygwin build CYWGIN_LDFLAGS= -CYGWIN_CFLAGS= +CYGWIN_CFLAGS=-Werror -Wall -pedantic AC_ARG_WITH([cygwin], [AS_HELP_STRING([--with-cygwin], [use Cygwin to build under Windows @<:@default=no@:>@])], @@ -53,7 +53,7 @@ AM_CONDITIONAL([CYGWIN_BUILD], [test "x${with_cygwin}" = "xyes"]) if test "x$with_cygwin" = "xyes" then CYWGIN_LDFLAGS=-no-undefined - CYGWIN_CFLAGS=-Wno-error=expansion-to-defined + CYGWIN_CFLAGS=-Werror -Wall -Wno-error=expansion-to-defined AC_DEFINE([CYGWIN_BUILD],,[Build against Cygwin on Windows]) fi diff --git a/src/common-ssh/Makefile.am b/src/common-ssh/Makefile.am index 19a0333ad..23dcb073a 100644 --- a/src/common-ssh/Makefile.am +++ b/src/common-ssh/Makefile.am @@ -44,7 +44,6 @@ noinst_HEADERS = \ common-ssh/user.h libguac_common_ssh_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/common-ssh/tests/Makefile.am b/src/common-ssh/tests/Makefile.am index b5d330bf4..3c77a6c39 100644 --- a/src/common-ssh/tests/Makefile.am +++ b/src/common-ssh/tests/Makefile.am @@ -37,7 +37,6 @@ test_common_ssh_SOURCES = \ sftp/normalize_path.c test_common_ssh_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @COMMON_SSH_INCLUDE@ \ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index 6baa4aea8..380d7dd99 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -63,7 +63,6 @@ libguac_common_la_SOURCES = \ surface.c libguac_common_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@ diff --git a/src/common/tests/Makefile.am b/src/common/tests/Makefile.am index 049397a45..ca39288e9 100644 --- a/src/common/tests/Makefile.am +++ b/src/common/tests/Makefile.am @@ -49,7 +49,6 @@ test_common_SOURCES = \ string/split.c test_common_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ diff --git a/src/guacd/Makefile.am b/src/guacd/Makefile.am index c1ea25810..59eb8591d 100644 --- a/src/guacd/Makefile.am +++ b/src/guacd/Makefile.am @@ -60,7 +60,6 @@ guacd_SOURCES += move-pipe.c endif guacd_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/libguac/Makefile.am b/src/libguac/Makefile.am index 08f21d8ac..5f1aaf64e 100644 --- a/src/libguac/Makefile.am +++ b/src/libguac/Makefile.am @@ -77,6 +77,7 @@ libguacinc_HEADERS = \ guacamole/user-constants.h \ guacamole/user-fntypes.h \ guacamole/user-types.h \ + guacamole/wait-fd.h \ guacamole/wol.h \ guacamole/wol-constants.h @@ -85,8 +86,7 @@ noinst_HEADERS = \ encode-png.h \ palette.h \ user-handlers.h \ - raw_encoder.h \ - wait-fd.h + raw_encoder.h libguac_la_SOURCES = \ argv.c \ @@ -116,7 +116,7 @@ libguac_la_SOURCES = \ user.c \ user-handlers.c \ user-handshake.c \ - wait-fd.c \ + wait-fd.c \ wol.c # Compile WebP support if available @@ -145,11 +145,14 @@ libguac_la_SOURCES += wait-handle.c libguacinc_HEADERS += guacamole/handle-helpers.h libguacinc_HEADERS += guacamole/socket-handle.h libguacinc_HEADERS += guacamole/wait-handle.h +else +libguac_la_SOURCES += wait-fd.c +libguac_la_SOURCES += socket-fd.c +libguacinc_HEADERS += guacamole/wait-fd.h endif libguac_la_CFLAGS = \ - @CYGWIN_CFLAGS@ \ - -Werror -Wall -pedantic + @CYGWIN_CFLAGS@ libguac_la_LDFLAGS = \ -version-info 22:0:1 \ diff --git a/src/libguac/client.c b/src/libguac/client.c index 6c3b3aedd..84adf9a82 100644 --- a/src/libguac/client.c +++ b/src/libguac/client.c @@ -48,6 +48,7 @@ #ifdef CYGWIN_BUILD #include +#include #endif /** @@ -518,13 +519,13 @@ static int guac_client_start_pending_users_timer(guac_client* client) { #ifdef CYGWIN_BUILD if (!CreateTimerQueueTimer( - &(client->__pending_users_timer)), + &(client->__pending_users_timer), NULL, guac_client_promote_pending_users, client, GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL, - GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL - 0) { + GUAC_CLIENT_PENDING_USERS_REFRESH_INTERVAL, + 0)) { // oh noes error return 1; @@ -545,7 +546,6 @@ static int guac_client_start_pending_users_timer(guac_client* client) { pthread_mutex_unlock(&(client->__pending_users_timer_mutex)); return 1; } -#endif /* Configure the pending users timer to run on the defined interval */ struct itimerspec time_config = { @@ -560,6 +560,7 @@ static int guac_client_start_pending_users_timer(guac_client* client) { pthread_mutex_unlock(&(client->__pending_users_timer_mutex)); return 1; } +#endif /* Mark the timer as registered but not yet running */ client->__pending_users_timer_state = GUAC_CLIENT_PENDING_TIMER_REGISTERED; diff --git a/src/libguac/guacamole/client.h b/src/libguac/guacamole/client.h index 9da16e2ab..89df8bdaf 100644 --- a/src/libguac/guacamole/client.h +++ b/src/libguac/guacamole/client.h @@ -26,6 +26,8 @@ * @file client.h */ +#include "config.h" + #include "client-fntypes.h" #include "client-types.h" #include "client-constants.h" diff --git a/src/libguac/guacamole/socket-handle.h b/src/libguac/guacamole/socket-handle.h old mode 100755 new mode 100644 diff --git a/src/libguac/id.c b/src/libguac/id.c index c42bdff81..10b447640 100644 --- a/src/libguac/id.c +++ b/src/libguac/id.c @@ -24,6 +24,7 @@ #ifdef CYGWIN_BUILD +#include #include #elif defined(HAVE_LIBUUID) #include @@ -58,7 +59,7 @@ char* guac_generate_id(char prefix) { /* Convert the UUID to an all-caps, null-terminated tring */ RPC_CSTR uuid_string; - if (UuidToString(uuid, &uuid_string) == RPC_S_OUT_OF_MEMORY) { + if (UuidToString(&uuid, &uuid_string) == RPC_S_OUT_OF_MEMORY) { guac_error = GUAC_STATUS_NO_MEMORY; guac_error_message = "Could not allocate memory for unique ID"; return NULL; @@ -68,7 +69,7 @@ char* guac_generate_id(char prefix) { for (int i = 0; i < GUAC_UUID_LEN; i++) identifier[i] = tolower(uuid_string[i]); - RpcStringFree(uuid_string); + RpcStringFree(&uuid_string); #else diff --git a/src/libguac/tests/Makefile.am b/src/libguac/tests/Makefile.am index 68943da90..79180c6ec 100644 --- a/src/libguac/tests/Makefile.am +++ b/src/libguac/tests/Makefile.am @@ -56,7 +56,6 @@ test_libguac_SOURCES = \ test_libguac_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@ diff --git a/src/libguac/wait-fd.c b/src/libguac/wait-fd.c index d6079be38..0a41e8d14 100644 --- a/src/libguac/wait-fd.c +++ b/src/libguac/wait-fd.c @@ -19,8 +19,9 @@ #include "config.h" -#ifdef ENABLE_WINSOCK -# include +#ifdef CYGWIN_BUILD +#include +#include #else # ifdef HAVE_POLL # include diff --git a/src/libguac/wol.c b/src/libguac/wol.c index 9d69306c9..22c9fb72a 100644 --- a/src/libguac/wol.c +++ b/src/libguac/wol.c @@ -26,9 +26,15 @@ #include #include #include + +#ifdef CYGWIN_BUILD +#include +#include +#else #include #include #include +#endif /** * Generate the magic Wake-on-LAN (WoL) packet for the specified MAC address @@ -195,4 +201,4 @@ int guac_wol_wake(const char* mac_addr, const char* broadcast_addr, return 0; return -1; -} \ No newline at end of file +} diff --git a/src/protocols/kubernetes/tests/Makefile.am b/src/protocols/kubernetes/tests/Makefile.am index 1d1a8f443..b1936b612 100644 --- a/src/protocols/kubernetes/tests/Makefile.am +++ b/src/protocols/kubernetes/tests/Makefile.am @@ -38,7 +38,6 @@ test_kubernetes_SOURCES = \ url/escape.c test_kubernetes_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_CLIENT_KUBERNETES_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/protocols/rdp/tests/Makefile.am b/src/protocols/rdp/tests/Makefile.am index 41206a1e5..da6cbd75d 100644 --- a/src/protocols/rdp/tests/Makefile.am +++ b/src/protocols/rdp/tests/Makefile.am @@ -38,7 +38,6 @@ test_rdp_SOURCES = \ fs/normalize_path.c test_rdp_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_CLIENT_RDP_INCLUDE@ \ @LIBGUAC_INCLUDE@ diff --git a/src/protocols/vnc/Makefile.am b/src/protocols/vnc/Makefile.am index 517de2b5c..e7a3f4b70 100644 --- a/src/protocols/vnc/Makefile.am +++ b/src/protocols/vnc/Makefile.am @@ -55,7 +55,6 @@ noinst_HEADERS = \ vnc.h libguac_client_vnc_la_CFLAGS = \ - -Werror -Wall -pedantic -Iinclude \ @CYGWIN_CFLAGS@ \ @COMMON_INCLUDE@ \ @COMMON_SSH_INCLUDE@ \ diff --git a/src/pulse/Makefile.am b/src/pulse/Makefile.am index 0a9b066cd..4bef43474 100644 --- a/src/pulse/Makefile.am +++ b/src/pulse/Makefile.am @@ -35,7 +35,6 @@ libguac_pulse_la_SOURCES = \ pulse.c libguac_pulse_la_CFLAGS = \ - -Werror -Wall -pedantic \ @CYGWIN_CFLAGS@ \ @LIBGUAC_INCLUDE@