Skip to content

Commit

Permalink
libs: removed libbareoscfg and libbareostatic
Browse files Browse the repository at this point in the history
- moved all symbols into libbareos
- inhibit DLL_IMP_EXP, CATS_IMP_EXP, SD_IMP_EXP
- removed libbareoscfg from packaging
  • Loading branch information
franku committed Sep 20, 2018
1 parent d4eeee6 commit 05ea59e
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 153 deletions.
1 change: 0 additions & 1 deletion core/debian/bareos-common.install.in
@@ -1,5 +1,4 @@
@libdir@/libbareos.so*
@libdir@/libbareoscfg.so*
@libdir@/libbareosfind.so*
@libdir@/libbareoslmdb.so*
@libdir@/libbareosndmp.so*
Expand Down
1 change: 0 additions & 1 deletion core/platforms/packaging/bareos.spec
Expand Up @@ -1166,7 +1166,6 @@ echo "This is a meta package to install a full bareos system" > %{buildroot}%{_d
%endif
%dir %{backend_dir}
%{library_dir}/libbareos.so*
%{library_dir}/libbareoscfg.so*
%{library_dir}/libbareosfind.so*
%{library_dir}/libbareoslmdb.so*
%if !0%{?client_only}
Expand Down
2 changes: 0 additions & 2 deletions core/platforms/win32/winbareos.nsi
Expand Up @@ -578,7 +578,6 @@ SectionIn 1 2 3 4
File "libbareosfind.dll"
File "libbareoslmdb.dll"
File "libbareossql.dll"
File "libbareoscfg.dll"
File "libcrypto-*.dll"
File "libgcc_s_*-1.dll"
File "libssl-*.dll"
Expand Down Expand Up @@ -2134,7 +2133,6 @@ ConfDeleteSkip:
Delete "$INSTDIR\libbareossd.dll"
Delete "$INSTDIR\libbareosfind.dll"
Delete "$INSTDIR\libbareoslmdb.dll"
Delete "$INSTDIR\libbareoscfg.dll"
Delete "$INSTDIR\libbareossql.dll"
Delete "$INSTDIR\libbareoscats.dll"
Delete "$INSTDIR\libbareoscats-postgresql.dll"
Expand Down
4 changes: 2 additions & 2 deletions core/src/console/CMakeLists.txt
Expand Up @@ -27,10 +27,10 @@ add_executable(bconsole console.cc)

add_library(console_objects STATIC ${BCONSSRCS})

set(CONSOLE_LINK_LIBRARIES console_objects bareos bareoscfg ${Readline_LIBRARY})
set(CONSOLE_LINK_LIBRARIES console_objects bareos ${Readline_LIBRARY})

IF(HAVE_WIN32)
LIST(APPEND CONSOLE_LINK_LIBRARIES bareosstatic)
LIST(APPEND CONSOLE_LINK_LIBRARIES)
ENDIF()

target_link_libraries(bconsole ${CONSOLE_LINK_LIBRARIES})
Expand Down
8 changes: 3 additions & 5 deletions core/src/dird/CMakeLists.txt
Expand Up @@ -67,7 +67,6 @@ set(BAREOS_DIR_LIBRARIES
dird_objects
bareos
bareoscats
bareoscfg
bareossql
bareosfind
${LMDB_LIBS}
Expand All @@ -76,7 +75,6 @@ set(BAREOS_DIR_LIBRARIES

IF(HAVE_WIN32)
LIST(APPEND BAREOS_DIR_LIBRARIES
bareosstatic
comctl32
)
ENDIF()
Expand All @@ -85,10 +83,10 @@ target_link_libraries(bareos-dir ${BAREOS_DIR_LIBRARIES})


add_executable(bareos-dbcheck ${DBCHKSRCS})
SET(DBCHECK_LIBRARIES bareossql bareos bareosfind bareoscfg bareoscats)
SET(DBCHECK_LIBRARIES bareossql bareos bareosfind bareoscats)

IF(HAVE_WIN32)
LIST(APPEND DBCHECK_LIBRARIES bareosstatic)
LIST(APPEND DBCHECK_LIBRARIES)
ENDIF()

target_link_libraries(bareos-dbcheck
Expand All @@ -99,7 +97,7 @@ target_link_libraries(bareos-dbcheck
# is not built by default

#add_executable(testfind ${TSTFNDSRCS})
#target_link_libraries(testfind bareos bareosfind bareoscfg
#target_link_libraries(testfind bareos bareosfind
# jansson ${OPENSSL_LIBS} acl cap lzo2
#)

Expand Down
4 changes: 2 additions & 2 deletions core/src/filed/CMakeLists.txt
Expand Up @@ -50,13 +50,13 @@ ENDIF()
add_executable(bareos-fd ${FDSRCS})

SET(BAREOS_FD_LIBRARIES
bareosfind bareoscfg bareos
bareosfind bareos
pthread
${LMDB_LIBS}
)
IF(HAVE_WIN32)
LIST(APPEND BAREOS_FD_LIBRARIES
comctl32 bareosstatic
comctl32
)

SET (FD_COMPILE_DEFINITIONS -DWIN32_VSS)
Expand Down
22 changes: 0 additions & 22 deletions core/src/include/baconfig.h
Expand Up @@ -105,31 +105,9 @@ void InitWinAPIWrapper();

#define ClearThreadId(x) memset(&(x), 0, sizeof(x))

#if defined(BUILDING_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllimport)
#elif defined(BUILDING_BAREOS_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllimport)
#elif defined(BUILDING_BAREOSCFG_DLL)
#define DLL_IMP_EXP _declspec(dllexport)
#define CATS_IMP_EXP _declspec(dllexport)
#define SD_IMP_EXP _declspec(dllexport)
#define BAREOSCFG_DLL_IMP_EXP _declspec(dllexport)
#elif defined(USING_DLL)
#define DLL_IMP_EXP _declspec(dllimport)
#define CATS_IMP_EXP _declspec(dllimport)
#define SD_IMP_EXP _declspec(dllimport)
#else
#define BAREOSCFG_DLL_IMP_EXP
#define DLL_IMP_EXP
#define CATS_IMP_EXP
#define SD_IMP_EXP
#endif

#else /* HAVE_WIN32 */

Expand Down
1 change: 0 additions & 1 deletion core/src/lib/CMakeLists.txt
Expand Up @@ -33,7 +33,6 @@ set(INCLUDE_FILES ../include/baconfig.h ../include/bareos.h

INSTALL(FILES ${INCLUDE_FILES} DESTINATION ${includedir})

add_subdirectory(bareoscfg)
add_subdirectory(bareos)

IF(NOT HAVE_WIN32 AND GTEST_FOUND)
Expand Down
21 changes: 4 additions & 17 deletions core/src/lib/bareos/CMakeLists.txt
Expand Up @@ -52,12 +52,14 @@ IF(HAVE_WIN32)
../../win32/compat/print.cc
../../win32/compat/winapi.cc
)
set(BAREOSCFG_IMPORT_LIB bareoscfg_import_a)
ELSE()
LIST(APPEND BAREOS_SRCS
scsi_tapealert.cc)
ENDIF()

set (BAREOSCFG_SRCS ini.cc lex.cc parse_bsr.cc res.cc parse_conf.cc res.cc qualified_resource_name_type_converter.cc)
LIST(APPEND BAREOS_SRCS ${BAREOSCFG_SRCS})

#link_directories(${PROJECT_BINARY_DIR}/src/lib/bareos)
add_library(bareos SHARED ${BAREOS_SRCS})

Expand All @@ -71,22 +73,7 @@ INSTALL(TARGETS bareos DESTINATION ${libdir})
set_target_properties(bareos PROPERTIES VERSION "${VERSION}"
SOVERSION "${SOVERSION}")


IF(HAVE_WIN32)
IF ("${WINDOWS_BITS}" STREQUAL "64")
set(DLLTOOL x86_64-w64-mingw32-dlltool)
ELSE()
set(DLLTOOL i686-w64-mingw32-dlltool)
ENDIF()

ADD_CUSTOM_COMMAND(
PRE_LINK
TARGET bareos
DEPENDS libbareoscfg_${WINDOWS_BITS}.def
COMMAND ${DLLTOOL} -d ${CMAKE_CURRENT_SOURCE_DIR}/libbareoscfg_${WINDOWS_BITS}.def -l libbareoscfg_import_a
COMMAND echo ${CMAKE_CURRENT_BINARY_DIR}
COMMAND cp libbareoscfg_import_a ${WINDOWS_IMPORT_LIB_DIRECTORY}/libbareoscfg_import_a.a)

set_target_properties(bareos PROPERTIES DEFINE_SYMBOL "BUILDING_BAREOS_DLL")
set_target_properties(bareos PROPERTIES DEFINE_SYMBOL "BUILDING_DLL")
ENDIF()

File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions core/src/lib/bareos/libbareoscfg_32.def

This file was deleted.

4 changes: 0 additions & 4 deletions core/src/lib/bareos/libbareoscfg_64.def

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
43 changes: 0 additions & 43 deletions core/src/lib/bareoscfg/CMakeLists.txt

This file was deleted.

8 changes: 4 additions & 4 deletions core/src/lib/parse_conf.h
Expand Up @@ -382,7 +382,7 @@ struct DatatypeName {
/*
* Base Class for all Resource Classes
*/
class BareosResource {
class DLL_IMP_EXP BareosResource {
public:
CommonResourceHeader hdr;

Expand All @@ -396,7 +396,7 @@ class BareosResource {
// virtual inline bool validate() { return true; };
};

class TlsResource : public BareosResource {
class DLL_IMP_EXP TlsResource : public BareosResource {
public:
s_password password; /* UA server password */
TlsConfigCert tls_cert; /* TLS structure */
Expand All @@ -406,7 +406,7 @@ class TlsResource : public BareosResource {
/*
* Message Resource
*/
class MessagesResource : public BareosResource {
class DLL_IMP_EXP MessagesResource : public BareosResource {
/*
* Members
*/
Expand Down Expand Up @@ -469,7 +469,7 @@ class QualifiedResourceNameTypeConverter;
/*
* New C++ configuration routines
*/
class BAREOSCFG_DLL_IMP_EXP ConfigurationParser {
class DLL_IMP_EXP ConfigurationParser {
public:
std::string cf_; /* Config file parameter */
LEX_ERROR_HANDLER *scan_error_; /* Error handler if non-null */
Expand Down
2 changes: 1 addition & 1 deletion core/src/lib/qualified_resource_name_type_converter.h
Expand Up @@ -24,7 +24,7 @@

#include "include/bareos.h"

class QualifiedResourceNameTypeConverter {
class DLL_IMP_EXP QualifiedResourceNameTypeConverter {
public:
QualifiedResourceNameTypeConverter(const std::map<int, std::string> &map);
bool ResourceToString(const std::string &name_of_resource, const int &r_type, std::string &out) const;
Expand Down
2 changes: 0 additions & 2 deletions core/src/lib/unittests/CMakeLists.txt
Expand Up @@ -41,7 +41,6 @@ target_link_libraries(test_lib
stored_objects
bareossd
bareos
bareoscfg
${JANSSON_LIBRARIES}
${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES}
Expand Down Expand Up @@ -73,7 +72,6 @@ target_link_libraries(test_bsock
bareossd
bareos
bareoscats
bareoscfg
bareossql
bareosfind
${LMDB_LIBS}
Expand Down
8 changes: 1 addition & 7 deletions core/src/qt-tray-monitor/CMakeLists.txt
Expand Up @@ -50,13 +50,7 @@ IF(HAVE_WIN32)
LIST(APPEND SOURCES ../win32/qt-tray-monitor/traymon.rc)
ENDIF()

set(TRAYMON_LIBRARIES bareos-tray-monitor Qt4::QtGui bareos bareoscfg)

IF(HAVE_WIN32)
LIST(APPEND TRAYMON_LIBRARIES
bareosstatic
)
ENDIF()
set(TRAYMON_LIBRARIES bareos-tray-monitor Qt4::QtGui bareos)

IF(HAVE_WIN32)
add_executable(bareos-tray-monitor WIN32 ${SOURCES} main.qrc)
Expand Down
2 changes: 1 addition & 1 deletion core/src/qt-tray-monitor/tray-monitor.pro.in
Expand Up @@ -17,7 +17,7 @@ CONFIG( debug, debug|release ) {

QMAKE_LIBDIR += ../lib
QMAKE_CXXFLAGS += @JANSSON_INC@
LIBS += -lbareoscfg -lbareos
LIBS += -lbareos

bins.path = /$(DESTDIR)@bindir@
bins.files = bareos-tray-monitor
Expand Down
2 changes: 2 additions & 0 deletions core/src/qt-tray-monitor/tray_conf.cc
Expand Up @@ -44,6 +44,8 @@
#include "include/bareos.h"
#include "tray_conf.h"

#include "lib/parse_conf.h"

static const std::string default_config_filename("tray-monitor.conf");

/*
Expand Down
19 changes: 6 additions & 13 deletions core/src/stored/CMakeLists.txt
Expand Up @@ -166,13 +166,6 @@ ENDIF()

add_library(bareossd SHARED ${LIBBAREOSSD_SRCS})


IF(HAVE_WIN32)
LIST(APPEND LIBBAREOSSD_LIBRARIES
bareosstatic
)
ENDIF()

if(NOT ${HAVE_DYNAMIC_SD_BACKENDS})
target_link_libraries(bareossd ${LIBBAREOSSD_LIBRARIES})
endif()
Expand All @@ -182,7 +175,7 @@ add_library(stored_objects STATIC ${SDSRCS})
add_executable(bareos-sd stored.cc)

SET(BAREOS_SD_LIBRARIES
bareos bareossd bareosfind bareoscfg
bareos bareossd bareosfind
${NDMP_LIBS}
)

Expand All @@ -199,29 +192,29 @@ target_link_libraries(bareos-sd

add_executable(bls ${BLSSRCS})
target_link_libraries(bls
bareos bareossd bareosfind bareoscfg
bareos bareossd bareosfind
)

add_executable(bextract ${BEXTRACTSRS})
target_link_libraries(bextract
bareossd bareosfind bareos bareoscfg
bareossd bareosfind bareos
)

add_executable(bscan ${BSCANSRCS})
target_link_libraries(bscan
bareos bareossd bareosfind bareoscfg bareossql bareoscats
bareos bareossd bareosfind bareossql bareoscats
)

add_executable(btape ${BTAPESRCS})
target_link_libraries(btape
bareossd bareos bareoscfg
bareossd bareos
)

add_executable(bcopy ${BCOPYSRCS})


target_link_libraries(bcopy
bareossd bareos bareoscfg
bareossd bareos
)

INSTALL(TARGETS bareossd DESTINATION ${libdir})
Expand Down

0 comments on commit 05ea59e

Please sign in to comment.