Skip to content

Commit

Permalink
core: reduce config.h
Browse files Browse the repository at this point in the history
* merge host.h and friends into config.h
 remove unused defines from config.h
  • Loading branch information
arogge committed May 25, 2020
1 parent cf7b6bf commit b22b4e9
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 473 deletions.
7 changes: 1 addition & 6 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,6 @@ endif()

set(largefile_support "")

set(got_readline "${READLINE_FOUND}")
if("${READLINE_FOUND}")
set(HAVE_READLINE 1)
endif()

if("${PAM_FOUND}")
set(HAVE_PAM 1)
endif()
Expand Down Expand Up @@ -834,7 +829,7 @@ message(" File Daemon Group: ${fd_group} ")
message(" ")
message(" Large file support: ${largefile_support}")
message(
" readline support: ${got_readline} ROOT_DIR:${Readline_ROOT_DIR} INCLUDE_DIR:${Readline_INCLUDE_DIR} LIBRARY:${Readline_LIBRARY}
" readline support: ROOT_DIR:${Readline_ROOT_DIR} INCLUDE_DIR:${Readline_INCLUDE_DIR} LIBRARY:${Readline_LIBRARY}
"
)
message(
Expand Down
17 changes: 0 additions & 17 deletions core/cmake/BareosCheckFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ check_function_exists(strtoll HAVE_STRTOLL)
check_function_exists(backtrace HAVE_BACKTRACE)
check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS)
check_function_exists(bcopy HAVE_BCOPY)
check_function_exists(fchdir HAVE_FCHDIR)
check_function_exists(fchmod HAVE_FCHMOD)
check_function_exists(fchown HAVE_FCHOWN)

Expand All @@ -47,23 +46,18 @@ check_function_exists(futimens HAVE_FUTIMENS)
check_function_exists(futimes HAVE_FUTIMES)
check_function_exists(futimesat HAVE_FUTIMESAT)
check_function_exists(getaddrinfo HAVE_GETADDRINFO)
check_function_exists(getcwd HAVE_GETCWD)
check_function_exists(getea HAVE_GETEA)
check_function_exists(gethostbyname2 HAVE_GETHOSTBYNAME2)
check_function_exists(gethostid HAVE_GETHOSTID)
check_function_exists(gethostname HAVE_GETHOSTNAME)
check_function_exists(getmntent HAVE_GETMNTENT)
check_function_exists(getmntinfo HAVE_GETMNTINFO)
check_function_exists(getpagesize HAVE_GETPAGESIZE)
check_function_exists(getpid HAVE_GETPID)
check_function_exists(getproplist HAVE_GETPROPLIST)
check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
check_function_exists(getxattr HAVE_GETXATTR)
check_function_exists(get_proplist_entry HAVE_GET_PROPLIST_ENTRY)
check_function_exists(glfs_readdirplus HAVE_GLFS_READDIRPLUS)
check_function_exists(glob HAVE_GLOB)
check_function_exists(inet_ntop HAVE_INET_NTOP)
check_function_exists(inet_pton HAVE_INET_PTON)
check_function_exists(lchmod HAVE_LCHMOD)
check_function_exists(lchown HAVE_LCHOWN)
check_function_exists(lgetea HAVE_LGETEA)
Expand All @@ -86,22 +80,16 @@ check_function_exists(posix_fadvise HAVE_POSIX_FADVISE)
check_function_exists(prctl HAVE_PRCTL)
check_function_exists(putenv HAVE_PUTENV)
check_function_exists(readdir_r HAVE_READDIR_R)
check_function_exists(select HAVE_SELECT)
check_function_exists(setea HAVE_SETEA)
check_function_exists(setenv HAVE_SETENV)
check_function_exists(setlocale HAVE_SETLOCALE)
check_function_exists(setpgid HAVE_SETPGID)
check_function_exists(setpgrp HAVE_SETPGRP)
check_function_exists(setproplist HAVE_SETPROPLIST)
check_function_exists(setreuid HAVE_SETREUID)
check_function_exists(setsid HAVE_SETSID)
check_function_exists(setxattr HAVE_SETXATTR)
check_function_exists(hl_loa HAVE_HL_LOA)
check_function_exists(signal HAVE_SIGNAL)
check_function_exists(sizeof_proplist_entry HAVE_SIZEOF_PROPLIST_ENTRY)
check_function_exists(sqlite3_threadsafe HAVE_SQLITE3_THREADSAFE)
check_function_exists(stpcpy HAVE_STPCPY)
check_function_exists(strcasecmp HAVE_STRCASECMP)
check_function_exists(strerror HAVE_STRERROR)
check_function_exists(strerror_r HAVE_STRERROR_R)
check_function_exists(strftime HAVE_STRFTIME)
Expand All @@ -115,9 +103,4 @@ check_function_exists(snprintf HAVE_SNPRINTF)
check_function_exists(vsnprintf HAVE_VSNPRINTF)
check_function_exists(vprintf HAVE_VPRINTF)

check_function_exists(dcgettext HAVE_DCGETTEXT)
check_function_exists(fork HAVE_FORK)
check_function_exists(gai_strerror HAVE_GAI_STRERROR)
check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
check_function_exists(gettext HAVE_GETTEXT)
check_function_exists(glfs_readdirplus HAVE_GLFS_READDIRPLUS)
6 changes: 0 additions & 6 deletions core/cmake/BareosCheckIncludes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ check_include_files(afs/afsint.h HAVE_AFS_AFSINT_H)
check_include_files(afs/venus.h HAVE_AFS_VENUS_H)
check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
check_include_files(attr.h HAVE_ATTR_H)
check_include_files(curses.h HAVE_CURSES_H)
check_include_files(demangle.h HAVE_DEMANGLE_H)
check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(dl.h HAVE_DL_H)
Expand All @@ -37,11 +36,9 @@ check_include_files(grp.h HAVE_GRP_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(libutil.h HAVE_LIBUTIL_H)
check_include_files(limits.h HAVE_LIMITS_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(mtio.h HAVE_MTIO_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(regex.h HAVE_REGEX_H)
check_include_files(setjmp.h HAVE_SETJMP_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(string.h HAVE_STRING_H)
Expand Down Expand Up @@ -116,10 +113,7 @@ check_include_files(time.h HAVE_TIME_H)

check_include_files(sys/capability.h HAVE_SYS_CAPABILITY_H)
check_include_files(zlib.h HAVE_ZLIB_H)
check_include_files(lzo/lzoconf.h HAVE_LZO_LZOCONF_H)
check_include_files(lzo/lzo1x.h HAVE_LZO_LZO1X_H)

check_include_files(assert.h HAVE_ASSERT_H)
check_include_files(curses.h HAVE_CURSES_H)

check_include_files(scsi/scsi.h HAVE_SCSI_SCSI_H)
Expand Down
5 changes: 0 additions & 5 deletions core/cmake/BareosCheckSymbols.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ endif()
check_symbol_exists(poll poll.h HAVE_POLL)
check_symbol_exists(alloca alloca.h HAVE_ALLOCA)

cmake_push_check_state()
set(CMAKE_REQUIRED_LIBRARIES ${DL_LIBRARIES})
check_symbol_exists(dlerror dlfcn.h HAVE_DLERROR)
cmake_pop_check_state()

check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY)

cmake_push_check_state()
Expand Down
3 changes: 0 additions & 3 deletions core/cmake/BareosSetVariableDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,8 @@ set(lld "\"lld\"")
set(llu "\"llu\"")

set(HAVE_MYSQL_THREAD_SAFE 1)
set(HAVE_POSIX_SIGNALS 1)
set(HAVE_SHA2 1)
set(HAVE_PQISTHREADSAFE 1)
set(HAVE_PQ_COPY 1)

set(PROTOTYPES 1)
set(RETSIGTYPE void)
Expand All @@ -636,7 +634,6 @@ set(_FILE_OFFSET_BITS 64)
set(HAVE_COMPRESS_BOUND 1)
set(STDC_HEADERS 1)
set(HAVE_SQLITE3_THREADSAFE 1)
set(FSTYPE_MNTENT 1)

set(PACKAGE_BUGREPORT "\"\"")
set(PACKAGE_NAME "\"${CMAKE_PROJECT_NAME}\"")
Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/dir_plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#endif

#include <sys/types.h>
#include "include/hostconfig.h"
#include "include/config.h"
#include "include/bc_types.h"
#include "lib/plugins.h"

Expand Down
2 changes: 1 addition & 1 deletion core/src/dird/pthread_detach_if_not_detached.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "include/hostconfig.h"
#include "include/config.h"
#include <pthread.h>
#if defined(HAVE_PTHREAD_NP_H)
#include <pthread_np.h>
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/accurate.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
* also cost some bytes.
*/

#include "include/hostconfig.h"
#include "include/config.h"

#ifdef HAVE_HPUX_OS
#pragma pack(push, 4)
Expand Down
2 changes: 1 addition & 1 deletion core/src/filed/fd_plugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include <sys/types.h>

#include "include/hostconfig.h"
#include "include/config.h"

#include "lib/version.h"
#include "include/bc_types.h"
Expand Down
5 changes: 1 addition & 4 deletions core/src/include/bareos.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
#define _LANGUAGE_C_PLUS_PLUS 1
#endif

#include "hostconfig.h"
#include "config.h"

#if HAVE_AIX_OS
#define _LINUX_SOURCE_COMPAT 1
Expand Down Expand Up @@ -224,9 +224,6 @@ extern "C" {

#if defined(HAVE_WIN32)
#include "winapi.h"
#include "winhost.h"
#else
#include "host.h"
#endif

#ifndef HAVE_ZLIB_H
Expand Down

0 comments on commit b22b4e9

Please sign in to comment.