Skip to content

Commit

Permalink
buildsystem: adapt changes to use Fedora Buildchain
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Sep 4, 2020
1 parent 9b5ccff commit 1462bb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
43 changes: 21 additions & 22 deletions core/CMakeLists.txt
Expand Up @@ -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}")
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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} ")
Expand Down
2 changes: 1 addition & 1 deletion core/src/win32/compat/include/mingwconfig.h
Expand Up @@ -251,7 +251,7 @@
/* #undef HAVE_SYS_NDIR_H */

/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/*undef HAVE_SYS_SELECT_H */

/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
Expand Down

0 comments on commit 1462bb2

Please sign in to comment.