diff --git a/.gitignore b/.gitignore index 98ca450a2..6853f6825 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ LICENSE.txt *Config.cmake *ConfigVersion.cmake include/freerdp/version.h +include/freerdp/build-config.h *.a.objlist.cmake *.a.objlist diff --git a/channels/client/addin.c b/channels/client/addin.c index 8f4d54bc3..a2d688006 100644 --- a/channels/client/addin.c +++ b/channels/client/addin.c @@ -31,6 +31,7 @@ #include #include +#include #include #include "tables.h" @@ -181,22 +182,22 @@ FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPSTR pszName, LPSTR pszSub if (pszName && pszSubsystem && pszType) { - sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client-%s-%s.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-%s-%s.%s", pszName, pszSubsystem, pszType, pszExtension); } else if (pszName && pszType) { - sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client-?-%s.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-?-%s.%s", pszName, pszType, pszExtension); } else if (pszName) { - sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client*.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client*.%s", pszName, pszExtension); } else { - sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"?-client*.%s", + sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"?-client*.%s", pszExtension); } diff --git a/config.h.in b/config.h.in index e25162dd1..0f39545f2 100644 --- a/config.h.in +++ b/config.h.in @@ -1,22 +1,6 @@ #ifndef __CONFIG_H #define __CONFIG_H -#define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}" -#define FREERDP_KEYMAP_PATH "${FREERDP_KEYMAP_PATH}" -#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}" - -#define FREERDP_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" - -#define FREERDP_LIBRARY_PATH "${FREERDP_LIBRARY_PATH}" - -#define FREERDP_ADDIN_PATH "${FREERDP_ADDIN_PATH}" - -#define CMAKE_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}" -#define CMAKE_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}" - -#define FREERDP_VENDOR_STRING "${VENDOR}" -#define FREERDP_PRODUCT_STRING "${PRODUCT}" - /* Include files */ #cmakedefine HAVE_FCNTL_H #cmakedefine HAVE_UNISTD_H diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 06e2b77bd..8995688e3 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -18,10 +18,12 @@ # limitations under the License. configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h) file(GLOB FREERDP_HEADERS "freerdp/*.h") install(FILES ${FREERDP_HEADERS} DESTINATION include/freerdp COMPONENT headers) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h DESTINATION include/freerdp COMPONENT headers) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h DESTINATION include/freerdp COMPONENT headers) install(DIRECTORY freerdp/cache DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h") install(DIRECTORY freerdp/codec DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h") diff --git a/include/freerdp/build-config.h.in b/include/freerdp/build-config.h.in new file mode 100644 index 000000000..788e27f2f --- /dev/null +++ b/include/freerdp/build-config.h.in @@ -0,0 +1,20 @@ +#ifndef FREERDP_BUILD_CONFIG_H +#define FREERDP_BUILD_CONFIG_H + +#define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}" +#define FREERDP_KEYMAP_PATH "${FREERDP_KEYMAP_PATH}" +#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}" + +#define FREERDP_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" + +#define FREERDP_LIBRARY_PATH "${FREERDP_LIBRARY_PATH}" + +#define FREERDP_ADDIN_PATH "${FREERDP_ADDIN_PATH}" + +#define FREERDP_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}" +#define FREERDP_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}" + +#define FREERDP_VENDOR_STRING "${VENDOR}" +#define FREERDP_PRODUCT_STRING "${PRODUCT}" + +#endif /* FREERDP_BUILD_CONFIG_H */ diff --git a/libfreerdp/codec/rfx.c b/libfreerdp/codec/rfx.c index 7886daea4..cc8a61c38 100644 --- a/libfreerdp/codec/rfx.c +++ b/libfreerdp/codec/rfx.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "rfx_constants.h" #include "rfx_types.h" diff --git a/libfreerdp/common/addin.c b/libfreerdp/common/addin.c index 52197b418..ce7cf7b9e 100644 --- a/libfreerdp/common/addin.c +++ b/libfreerdp/common/addin.c @@ -30,6 +30,7 @@ #include #include +#include LPSTR freerdp_get_library_install_path() @@ -143,7 +144,7 @@ void* freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, LPCSTR pszE } else { - cchAddinFile = cchFileName + cchExt + 2 + sizeof(CMAKE_SHARED_LIBRARY_PREFIX); + cchAddinFile = cchFileName + cchExt + 2 + sizeof(FREERDP_SHARED_LIBRARY_PREFIX); pszAddinFile = (LPSTR) malloc(cchAddinFile + 1); if (!pszAddinFile) { @@ -151,7 +152,7 @@ void* freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, LPCSTR pszE free(pszFilePath); return NULL; } - sprintf_s(pszAddinFile, cchAddinFile, CMAKE_SHARED_LIBRARY_PREFIX"%s%s", pszFileName, pszExt); + sprintf_s(pszAddinFile, cchAddinFile, FREERDP_SHARED_LIBRARY_PREFIX"%s%s", pszFileName, pszExt); cchAddinFile = strlen(pszAddinFile); } @@ -182,9 +183,9 @@ void* freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, LPSTR pszSubsyste { void* entry; LPSTR pszFileName; - size_t cchFileName = sizeof(CMAKE_SHARED_LIBRARY_PREFIX) + 32; + size_t cchFileName = sizeof(FREERDP_SHARED_LIBRARY_PREFIX) + 32; LPCSTR pszExtension; - LPCSTR pszPrefix = CMAKE_SHARED_LIBRARY_PREFIX; + LPCSTR pszPrefix = FREERDP_SHARED_LIBRARY_PREFIX; pszExtension = PathGetSharedLibraryExtensionA(0); diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 0fcbaa56f..22c013834 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index a89198ce4..2fb632fac 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -37,6 +37,7 @@ #include #include +#include #include diff --git a/server/Windows/wf_info.c b/server/Windows/wf_info.c index 460154bb7..a582bc835 100644 --- a/server/Windows/wf_info.c +++ b/server/Windows/wf_info.c @@ -23,6 +23,8 @@ #include +#include + #include #include diff --git a/server/Windows/wf_interface.c b/server/Windows/wf_interface.c index 216d3cae5..0dc8defd0 100644 --- a/server/Windows/wf_interface.c +++ b/server/Windows/wf_interface.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "wf_peer.h" #include "wf_settings.h" diff --git a/server/Windows/wf_peer.c b/server/Windows/wf_peer.c index 4a4c493c9..ecb3a21bf 100644 --- a/server/Windows/wf_peer.c +++ b/server/Windows/wf_peer.c @@ -28,6 +28,7 @@ #include #include +#include #include "wf_info.h" #include "wf_input.h" diff --git a/winpr/libwinpr/sspi/NTLM/ntlm.c b/winpr/libwinpr/sspi/NTLM/ntlm.c index a210e45cc..9b732a8e2 100644 --- a/winpr/libwinpr/sspi/NTLM/ntlm.c +++ b/winpr/libwinpr/sspi/NTLM/ntlm.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "ntlm.h" #include "../sspi.h"