diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b8c5246423c..4f86375e4fb 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -20,13 +20,13 @@ cmake_minimum_required(VERSION 3.0) project(bareos C CXX) -if (POLICY CMP0054) +if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) -endif (POLICY CMP0054) +endif(POLICY CMP0054) -if (POLICY CMP0057) +if(POLICY CMP0057) cmake_policy(SET CMP0057 NEW) -endif (POLICY CMP0057) +endif(POLICY CMP0057) # disable in-source builds if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}") @@ -62,13 +62,14 @@ if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS") if(${compiler_format_security}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wformat") endif() - check_cxx_compiler_flag(-Werror=format-security compiler_error_format_security) + check_cxx_compiler_flag( + -Werror=format-security compiler_error_format_security + ) if(${compiler_error_format_security}) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=format-security") endif() endif() - option(DEBUG_PREFIX_MAP "remap absolute debug paths to relative if compiler supports it" ON ) @@ -243,15 +244,14 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "SunOS") set(PSCMD "ps -e -o pid,comm") link_libraries(nsl socket curses sec) - - if (${CMAKE_C_COMPILER_ID} MATCHES SunPro) + if(${CMAKE_C_COMPILER_ID} MATCHES SunPro) include_directories(/usr/local/include) link_directories(/usr/local/lib) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64") endif() - if (${CMAKE_CXX_COMPILER_ID} MATCHES SunPro) + if(${CMAKE_CXX_COMPILER_ID} MATCHES SunPro) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64") endif() endif() @@ -304,21 +304,22 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(HAVE_WIN32 1) set(WINDOWS_LIBRARIES ws2_32) + if(${WINDOWS_BITS} MATCHES "32") + set(cross-prefix i686-w64-mingw32) + else() + set(cross-prefix x86_64-w64-mingw32) + endif() - set(PYTHON_LIBRARIES - ${PROJECT_SOURCE_DIR}/src/win32/plugins/python/lib/${WINDOWS_BITS}/python27.dll - ) - set(PYTHON_INCLUDE_DIRS - ${PROJECT_SOURCE_DIR}/src/win32/plugins/python/include - ) + set(PYTHON_LIBRARIES /usr/${cross-prefix}/lib/python27.dll) + set(PYTHON_INCLUDE_DIRS /usr/${cross-prefix}/include/python2/) set(HAVE_PYTHON 1) - set(PostgreSQL_LIBRARY - ${PROJECT_SOURCE_DIR}/src/win32/cats/pgsql/lib/${WINDOWS_BITS}/libpq.dll + set(PostgreSQL_LIBRARY /usr/${cross-prefix}/sys-root/mingw/bin/libpq.dll) + set(PostgreSQL_INCLUDE_DIR + /usr/${cross-prefix}/sys-root/mingw/include/postgresql/server/ ) - set(PostgreSQL_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src/win32/cats/pgsql/include) set(PostgreSQL_TYPE_INCLUDE_DIR - ${PROJECT_SOURCE_DIR}/src/win32/plugins/python/include + /usr/${cross-prefix}/sys-root/mingw/include/postgresql/internal/ ) set(dynamic-storage-backends OFF) @@ -776,9 +777,7 @@ message(" Host: ${host} -- ${DISTNAME} ${DISTVER} ") message( " Bareos version: ${BAREOS} ${BAREOS_FULL_VERSION} (${DATE}) " ) -message( - " Distribution: ${DISTNAME}" -) +message(" Distribution: ${DISTNAME}") message(" Source code location: ${srcdir} ") message(" Modify Debian Control file: ${GENERATE_DEBIAN_CONTROL} ") message(" Install binaries: ${bindir} ") diff --git a/core/src/win32/compat/include/mingwconfig.h b/core/src/win32/compat/include/mingwconfig.h index ca00ae463a4..bb2186ed9c5 100644 --- a/core/src/win32/compat/include/mingwconfig.h +++ b/core/src/win32/compat/include/mingwconfig.h @@ -251,7 +251,7 @@ /* #undef HAVE_SYS_NDIR_H */ /* Define to 1 if you have the header file. */ -#define HAVE_SYS_SELECT_H 1 +/*undef HAVE_SYS_SELECT_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_SOCKET_H 1