Skip to content

Commit

Permalink
removed weak attribute
Browse files Browse the repository at this point in the history
and added dummy functions for commandline tools to satisfy
the link requirements of libbareos
  • Loading branch information
pstorz authored and franku committed Sep 20, 2018
1 parent 9f9a6e3 commit db64a50
Show file tree
Hide file tree
Showing 15 changed files with 80 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/src/lib/CMakeLists.txt
Expand Up @@ -37,8 +37,8 @@ set(INCLUDE_FILES ../include/baconfig.h ../include/bareos.h
crypto.h crypto_cache.h devlock.h dlist.h fnmatch.h
guid_to_name.h htable.h ini.h lex.h lib.h lockmgr.h
md5.h mem_pool.h message.h mntent_cache.h ordered_cbuf.h parse_conf.h
plugins.h qualified_resource_name_type_converter.h queue.h rblist.h
runscript.h rwlock.h scsi_crypto.h scsi_lli.h scsi_tapealert.h sellist.h
plugins.h qualified_resource_name_type_converter.h queue.h rblist.h
runscript.h rwlock.h scsi_crypto.h scsi_lli.h scsi_tapealert.h sellist.h
serial.h sha1.h smartall.h status.h tls.h tls_conf.h tree.h var.h
watchdog.h workq.h)

Expand All @@ -51,7 +51,7 @@ set (BAREOS_SRCS address_conf.cc alist.cc attr.cc attribs.cc base64.cc
devlock.cc dlist.cc edit.cc fnmatch.cc guid_to_name.cc hmac.cc htable.cc
jcr.cc json.cc lockmgr.cc md5.cc mem_pool.cc message.cc mntent_cache.cc
output_formatter.cc ordered_cbuf.cc passphrase.cc path_list.cc plugins.cc
bpoll.cc priv.cc qualified_resource_name_type_converter.cc
bpoll.cc priv.cc
queue.cc rblist.cc runscript.cc rwlock.cc scan.cc scsi_crypto.cc scsi_lli.cc
sellist.cc serial.cc sha1.cc signal.cc smartall.cc tls.cc
tls_gnutls.cc tls_conf_base.cc tls_conf_psk.cc tls_conf_cert.cc tls_openssl.cc tls_openssl_crl.cc
Expand Down Expand Up @@ -81,7 +81,7 @@ set (BAREOSCFG_SRCS ini.cc lex.cc parse_bsr.cc )



set (BAREOS_STATIC_SRCS parse_conf.cc res.cc)
set (BAREOS_STATIC_SRCS parse_conf.cc res.cc qualified_resource_name_type_converter.cc)

IF(HAVE_WIN32)
add_library(bareosstatic STATIC ${BAREOS_STATIC_SRCS})
Expand Down
4 changes: 2 additions & 2 deletions core/src/lib/parse_conf.h
Expand Up @@ -549,7 +549,7 @@ class DLL_IMP_EXP ConfigurationParser {
const char *name,
bool error_if_exits = false,
bool create_directories = false);
CommonResourceHeader *GetNextRes(int rcode, CommonResourceHeader *res) __attribute__((weak));
CommonResourceHeader *GetNextRes(int rcode, CommonResourceHeader *res);
CommonResourceHeader *GetResWithName(int rcode, const char *name, bool lock = true);
void b_LockRes(const char *file, int line);
void b_UnlockRes(const char *file, int line);
Expand All @@ -561,7 +561,7 @@ class DLL_IMP_EXP ConfigurationParser {
}
static bool GetTlsPskByFullyQualifiedResourceName(ConfigurationParser *config,
const char *fully_qualified_name,
std::string &psk) __attribute__((weak));
std::string &psk);

private:
ConfigurationParser(const ConfigurationParser &) = delete;
Expand Down
3 changes: 3 additions & 0 deletions core/src/tests/bbatch.cc
Expand Up @@ -41,6 +41,9 @@
done > dat1
*/

/* pull in dummy functions that libbareos depends ons */
#include "tools/dummy_config_parser.cc"

#include "include/bareos.h"
#include "stored/stored.h"
#include "findlib/find.h"
Expand Down
3 changes: 3 additions & 0 deletions core/src/tests/bregtest.cc
Expand Up @@ -33,6 +33,9 @@
*/
//#define BAREOS_REGEX

/* pull in dummy functions that libbareos depends ons */
#include "tools/dummy_config_parser.cc"

#include "include/bareos.h"
#include <stdio.h>
#include "lib/breg.h"
Expand Down
3 changes: 3 additions & 0 deletions core/src/tests/grow.cc
Expand Up @@ -31,6 +31,9 @@
#endif
#endif

/* pull in dummy functions that libbareos depends ons */
#include "tools/dummy_config_parser.cc"

#include "include/bareos.h"
#include "lib/edit.h"

Expand Down
3 changes: 3 additions & 0 deletions core/src/tests/testls.cc
Expand Up @@ -26,6 +26,9 @@
* Kern Sibbald, MM
*/

/* pull in dummy functions that libbareos depends ons */
#include "tools/dummy_config_parser.cc"

#include "include/bareos.h"
#include "include/jcr.h"
#include "findlib/find.h"
Expand Down
5 changes: 4 additions & 1 deletion core/src/tools/CMakeLists.txt
Expand Up @@ -17,19 +17,22 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.


SET(BSMTPSRCS bsmtp.cc)

IF(HAVE_WIN32)
LIST(APPEND BSMTPSRCS ../win32/tools/bsmtpres.rc)
ENDIF()
add_executable(bsmtp ${BSMTPSRCS})
target_link_libraries(bsmtp bareos ${JANSSON_LIBRARIES})
target_link_libraries(bsmtp bareos ${JANSSON_LIBRARIES})

add_executable(drivetype drivetype.cc)
target_link_libraries(drivetype bareos bareosfind ${JANSSON_LIBRARIES})

add_executable(fstype fstype.cc)
target_link_libraries(fstype bareos bareosfind ${JANSSON_LIBRARIES})


SET(BREGEXSRCS bregex.cc)
IF(HAVE_WIN32)
LIST(APPEND BREGEXSRCS ../win32/tools/bregexres.rc)
Expand Down
2 changes: 2 additions & 0 deletions core/src/tools/bpluginfo.cc
Expand Up @@ -34,6 +34,8 @@
* - API version
* - Enabled functions, etc.
*/
/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "filed/fd_plugins.h"
Expand Down
3 changes: 3 additions & 0 deletions core/src/tools/bregex.cc
Expand Up @@ -27,6 +27,9 @@
* Test program for testing regular expressions.
*/

/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"

/**
Expand Down
3 changes: 3 additions & 0 deletions core/src/tools/bscrypto.cc
Expand Up @@ -29,6 +29,9 @@
* using a lowlevel SCSI interface.
*/

/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "lib/crypto_cache.h"
#include "lib/crypto_wrap.h"
Expand Down
3 changes: 3 additions & 0 deletions core/src/tools/bsmtp.cc
Expand Up @@ -56,6 +56,8 @@
copyright. See:
http://archives.neohapsis.com/archives/postfix/2000-05/1520.html
*/
/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "include/jcr.h"
Expand All @@ -69,6 +71,7 @@
#define MAXSTRING 254
#endif


enum resolv_type {
RESOLV_PROTO_ANY,
RESOLV_PROTO_IPV4,
Expand Down
3 changes: 3 additions & 0 deletions core/src/tools/bwild.cc
Expand Up @@ -27,6 +27,9 @@
* Test program for testing wild card expressions
*/

/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "lib/fnmatch.h"

Expand Down
3 changes: 3 additions & 0 deletions core/src/tools/drivetype.cc
Expand Up @@ -27,6 +27,9 @@
* Program for determining drive type
*/

/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "findlib/find.h"
#include "findlib/drivetype.h"
Expand Down
38 changes: 38 additions & 0 deletions core/src/tools/dummy_config_parser.cc
@@ -0,0 +1,38 @@
/*
BAREOS® - Backup Archiving REcovery Open Sourced
Copyright (C) 2018-2018 Bareos GmbH & Co. KG
This program is Free Software; you can redistribute it and/or
modify it under the terms of version three of the GNU Affero General Public
License as published by the Free Software Foundation and included
in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/

/*
* Dummy library with empty functions to satisfy the link
* requirements of libbareos for commandline tools that
* do not need those functions anyway.
*/

#include <include/bareos.h>
#include <string>

CommonResourceHeader *ConfigurationParser::GetNextRes(int rcode, CommonResourceHeader *res) { return nullptr; }

bool ConfigurationParser::GetTlsPskByFullyQualifiedResourceName(ConfigurationParser *config,
const char *fq_name_in,
std::string &psk)
{
return false;
}
3 changes: 3 additions & 0 deletions core/src/tools/fstype.cc
Expand Up @@ -27,6 +27,9 @@
* Program for determining file system type
*/

/* pull in dummy functions that libbareos depends ons */
#include "dummy_config_parser.cc"

#include "include/bareos.h"
#include "findlib/find.h"
#include "lib/mntent_cache.h"
Expand Down

0 comments on commit db64a50

Please sign in to comment.