From 9d7c5ccdc0c04d04f7265abcc840ede9f7850988 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 30 Aug 2007 07:58:28 +0000 Subject: [PATCH] Apply patch from Martin Simmons that adds a test for va_copy to ./configure git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5415 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/autoconf/config.h.in | 18 ++++++++ bacula/autoconf/configure.in | 27 +++++++---- bacula/configure | 89 ++++++++++++++++++++++++++++++++---- bacula/src/baconfig.h | 5 -- bacula/src/version.h | 4 +- bacula/technotes-2.3 | 3 ++ 6 files changed, 123 insertions(+), 23 deletions(-) diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 8434cc7565..994901cb3f 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -396,6 +396,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H +/* Set if you have GTK 4.2 or greater loaded */ +#undef HAVE_GTK_2_4 + /* Define if you have the iconv() function. */ #undef HAVE_ICONV @@ -448,6 +451,9 @@ /* Define to 1 if you have the `util' library (-lutil). */ #undef HAVE_LIBUTIL +/* Set to enable libwraper support */ +#undef HAVE_LIBWRAP + /* Define to 1 if you have the `xnet' library (-lxnet). */ #undef HAVE_LIBXNET @@ -520,6 +526,9 @@ /* Define to 1 if you have the `readdir_r' function. */ #undef HAVE_READDIR_R +/* Set to enable readline support */ +#undef HAVE_READLINE + /* Define to 1 if you have the header file. */ #undef HAVE_REGEX_H @@ -720,9 +729,15 @@ /* Define if you have the 'unsigned long long' type. */ #undef HAVE_UNSIGNED_LONG_LONG +/* Set if utime.h exists */ +#undef HAVE_UTIME_H + /* Define to 1 if you have the header file. */ #undef HAVE_VARARGS_H +/* Set if va_copy exists */ +#undef HAVE_VA_COPY + /* Define to 1 if you have the `vfprintf' function. */ #undef HAVE_VFPRINTF @@ -819,6 +834,9 @@ it. */ #undef SIZE_MAX +/* Set if you want Smartalloc enabled */ +#undef SMARTALLOC + /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 7044b0257b..ca1aa87c49 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -379,7 +379,7 @@ if test x$support_tray_monitor = xyes; then abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0` pkg=$? if test $pkg = 0; then - AC_DEFINE(HAVE_GTK_2_4) + AC_DEFINE(HAVE_GTK_2_4, 1, [Set if you have GTK 4.2 or greater loaded]) fi fi fi @@ -395,7 +395,7 @@ AC_ARG_ENABLE(smartalloc, fi]) if test x$support_smartalloc = xyes; then - AC_DEFINE(SMARTALLOC) + AC_DEFINE(SMARTALLOC, 1, [Set if you want Smartalloc enabled]) fi # ------------------------------------------- @@ -641,7 +641,7 @@ if test x$support_readline = xyes; then with_readline="/usr/include/readline" fi AC_CHECK_HEADER(${with_readline}/readline.h, - [ AC_DEFINE(HAVE_READLINE) + [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) CONS_LIBS="-lreadline -lhistory -ltermcap" got_readline="yes" ], @@ -655,14 +655,14 @@ if test x$support_readline = xyes; then ],[ # check for standard readline library AC_CHECK_HEADER(/usr/include/readline/readline.h, - [ AC_DEFINE(HAVE_READLINE) + [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) got_readline="yes" CONS_INC="-I/usr/include/readline" CONS_LIBS="-lreadline -ltermcap" ], [ # Did not find standard library, so try Bacula's default AC_CHECK_HEADER(${TOP_DIR}/depkgs/readline/readline.h, - [ AC_DEFINE(HAVE_READLINE) + [ AC_DEFINE(HAVE_READLINE, 1, [Set to enable readline support]) got_readline="yes" CONS_INC="-I${TOP_DIR}/depkgs/readline" CONS_LIBS="-lreadline -lhistory -ltermcap" @@ -816,7 +816,7 @@ AC_ARG_WITH(tcp-wrappers, [ hosts_access(req); ], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LIBWRAP) + AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support]) TCPW_MSG="yes" LIBS="$saved_LIBS" WRAPLIBS="-lwrap" @@ -832,7 +832,7 @@ AC_ARG_WITH(tcp-wrappers, [ hosts_access(req); ], [ AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LIBWRAP) + AC_DEFINE(HAVE_LIBWRAP, 1, [Set to enable libwraper support]) TCPW_MSG="yes" LIBS="$saved_LIBS" WRAPLIBS="-lwrap" @@ -1417,7 +1417,7 @@ AC_CACHE_CHECK(for utime.h, ba_cv_header_utime_h, #include #include ], [struct utimbuf foo], ba_cv_header_utime_h=yes, ba_cv_header_utime_h=no)]) -test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H) +test $ba_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H, 1, [Set if utime.h exists]) dnl# -------------------------------------------------------------------------- dnl# Check for socklen_t @@ -1720,6 +1720,17 @@ AC_CHECK_FUNCS(chflags) AC_CHECK_FUNCS(snprintf vsnprintf gethostid fseeko) +AC_CACHE_CHECK(for va_copy, ba_cv_va_copy, + [AC_TRY_LINK([ +#include +void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);} +void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);} +], + [call_use_va_copy(1,2,3)], + ba_cv_va_copy=yes, ba_cv_va_copy=no)]) +test $ba_cv_va_copy = yes && AC_DEFINE(HAVE_VA_COPY, 1, [Set if va_copy exists]) + + dnl# -------------------------------------------------------------------------- dnl# CHECKING FOR THREAD SAFE FUNCTIONS dnl# -------------------------------------------------------------------------- diff --git a/bacula/configure b/bacula/configure index f61dd1ee6c..12c7e1b050 100755 --- a/bacula/configure +++ b/bacula/configure @@ -12932,7 +12932,8 @@ if test x$support_tray_monitor = xyes; then abc=`$PKGCONFIG --atleast-version=2.4 gtk+-2.0` pkg=$? if test $pkg = 0; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GTK_2_4 1 _ACEOF @@ -12953,7 +12954,8 @@ if test "${enable_smartalloc+set}" = set; then fi; if test x$support_smartalloc = xyes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define SMARTALLOC 1 _ACEOF @@ -13961,7 +13963,8 @@ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE 1 _ACEOF @@ -14121,7 +14124,8 @@ echo "${ECHO_T}$ac_cv_header__usr_include_readline_readline_h" >&6 fi if test $ac_cv_header__usr_include_readline_readline_h = yes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE 1 _ACEOF @@ -14271,7 +14275,8 @@ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_READLINE 1 _ACEOF @@ -15870,7 +15875,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBWRAP 1 _ACEOF @@ -15929,7 +15935,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 - cat >>confdefs.h <<\_ACEOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LIBWRAP 1 _ACEOF @@ -21015,7 +21022,8 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ba_cv_header_utime_h" >&5 echo "${ECHO_T}$ba_cv_header_utime_h" >&6 -test $ba_cv_header_utime_h = yes && cat >>confdefs.h <<\_ACEOF +test $ba_cv_header_utime_h = yes && +cat >>confdefs.h <<\_ACEOF #define HAVE_UTIME_H 1 _ACEOF @@ -27080,6 +27088,71 @@ fi done +echo "$as_me:$LINENO: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 +if test "${ba_cv_va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +void use_va_copy(va_list args){va_list args2; va_copy(args2,args); va_end(args2);} +void call_use_va_copy(int junk,...){va_list args; va_start(args,junk); use_va_copy(args); va_end(args);} + +int +main () +{ +call_use_va_copy(1,2,3) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ba_cv_va_copy=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ba_cv_va_copy=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ba_cv_va_copy" >&5 +echo "${ECHO_T}$ba_cv_va_copy" >&6 +test $ba_cv_va_copy = yes && +cat >>confdefs.h <<\_ACEOF +#define HAVE_VA_COPY 1 +_ACEOF + + + diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index df14b3ce97..f5b0282da7 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -38,8 +38,6 @@ /* Bacula common configuration defines */ -#define HAVE_VA_COPY - #undef TRUE #undef FALSE #define TRUE 1 @@ -629,7 +627,6 @@ extern int thr_setconcurrency(int); #endif #if defined(HAVE_DARWIN_OS) || defined(HAVE_OSF1_OS) -#undef HAVE_VA_COPY /* Apparently someone forgot to wrap getdomainname as a C function */ extern "C" int getdomainname(char *name, int len); #endif @@ -661,7 +658,6 @@ inline const char *first_path_separator(const char *path) { return strchr(path, #ifdef HAVE_HPUX_OS # undef h_errno -#undef HAVE_VA_COPY extern int h_errno; /* the {get,set}domainname() functions exist in HPUX's libc. * the configure script detects that correctly. @@ -674,7 +670,6 @@ extern "C" int setdomainname(char *name, int namelen); #ifdef HAVE_OSF1_OS -#undef HAVE_VA_COPY extern "C" int fchdir(int filedes); extern "C" long gethostid(void); extern "C" int mknod ( const char *path, int mode, dev_t device ); diff --git a/bacula/src/version.h b/bacula/src/version.h index 57e5b5d6a3..da63a2fd99 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.3.1" -#define BDATE "29 August 2007" -#define LSMDATE "29Aug07" +#define BDATE "30 August 2007" +#define LSMDATE "30Aug07" #define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n" #define BYEAR "2007" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.3 b/bacula/technotes-2.3 index 47da483488..4935d24502 100644 --- a/bacula/technotes-2.3 +++ b/bacula/technotes-2.3 @@ -1,6 +1,9 @@ Technical notes on version 2.3 General: +30Aug07 +kes Apply patch from Martin Simmons that adds a test for va_copy to + ./configure 29Aug07 kes Fix bug 921 by increasing the number of tries to create a new volume from 11 to 100. -- 2.39.2