mirror of
https://github.com/samba-team/samba.git
synced 2025-12-02 00:23:50 +03:00
r15000: Move some more autoconf tests out of build/m4/rewrite.m4
Guarantee availability of __FUNCTION__ in libreplace
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
a5c87360a7
commit
76b1576541
@@ -9,3 +9,9 @@ fi
|
|||||||
SMB_EXT_LIB(PAM, $PAM_LIBS)
|
SMB_EXT_LIB(PAM, $PAM_LIBS)
|
||||||
# end SMB_EXT_LIB_PAM
|
# end SMB_EXT_LIB_PAM
|
||||||
###############################
|
###############################
|
||||||
|
|
||||||
|
################################################
|
||||||
|
# test for where we get crypt() from
|
||||||
|
AC_CHECK_LIB_EXT(crypt, CRYPT_LIBS, crypt)
|
||||||
|
SMB_EXT_LIB_ENABLE(CRYPT,YES)
|
||||||
|
SMB_EXT_LIB(CRYPT, $CRYPT_LIBS)
|
||||||
|
|||||||
@@ -172,10 +172,6 @@ case "$host_os" in
|
|||||||
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
|
AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
|
||||||
;;
|
;;
|
||||||
*irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
|
*irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
|
||||||
case "$host_os" in
|
|
||||||
*irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
ATTEMPT_WRAP32_BUILD=yes
|
ATTEMPT_WRAP32_BUILD=yes
|
||||||
BLDSHARED="true"
|
BLDSHARED="true"
|
||||||
LDSHFLAGS="-set_version sgi1.0 -shared"
|
LDSHFLAGS="-set_version sgi1.0 -shared"
|
||||||
@@ -303,13 +299,6 @@ if test $ac_cv_shlib_works = no; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
|
|
||||||
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
|
|
||||||
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
|
|
||||||
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
|
|
||||||
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
|
AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@@ -392,24 +381,6 @@ if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
|
|||||||
AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
|
AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
|
|
||||||
AC_TRY_RUN([#include <sys/types.h>
|
|
||||||
#include <sys/capability.h>
|
|
||||||
main() {
|
|
||||||
cap_t cap;
|
|
||||||
if ((cap = cap_get_proc()) == NULL)
|
|
||||||
exit(1);
|
|
||||||
cap->cap_effective |= CAP_NETWORK_MGT;
|
|
||||||
cap->cap_inheritable |= CAP_NETWORK_MGT;
|
|
||||||
cap_set_proc(cap);
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
],
|
|
||||||
samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
|
|
||||||
if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
|
|
||||||
AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
|
AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
|
||||||
AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncate.c"],
|
AC_TRY_RUN([#include "${srcdir-.}/build/tests/ftruncate.c"],
|
||||||
@@ -418,13 +389,6 @@ if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
|
|||||||
AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
|
AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
|
|
||||||
AC_TRY_RUN([#include "${srcdir-.}/build/tests/getgroups.c"],
|
|
||||||
samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
|
|
||||||
if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
|
|
||||||
AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
|
AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
|
||||||
AC_TRY_RUN([#include <unistd.h>
|
AC_TRY_RUN([#include <unistd.h>
|
||||||
main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
|
main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
|
||||||
@@ -489,9 +453,3 @@ samba_cv_HAVE_OPEN_O_DIRECT=yes,samba_cv_HAVE_OPEN_O_DIRECT=no)])
|
|||||||
if test x"$samba_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
|
if test x"$samba_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then
|
||||||
AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
|
AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###############################################
|
|
||||||
# test for where we get crypt() from
|
|
||||||
AC_CHECK_LIB_EXT(crypt, CRYPT_LIBS, crypt)
|
|
||||||
SMB_EXT_LIB_ENABLE(CRYPT,YES)
|
|
||||||
SMB_EXT_LIB(CRYPT, $CRYPT_LIBS)
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/* test whether ftruncte() can extend a file */
|
/* test whether ftruncate() can extend a file */
|
||||||
|
|
||||||
#if defined(HAVE_UNISTD_H)
|
#if defined(HAVE_UNISTD_H)
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ sinclude(lib/replace/win32/config.m4)
|
|||||||
sinclude(lib/replace/repdir/config.m4)
|
sinclude(lib/replace/repdir/config.m4)
|
||||||
sinclude(heimdal_build/config.m4)
|
sinclude(heimdal_build/config.m4)
|
||||||
sinclude(lib/util/fsusage.m4)
|
sinclude(lib/util/fsusage.m4)
|
||||||
|
sinclude(lib/util/capability.m4)
|
||||||
sinclude(lib/popt/config.m4)
|
sinclude(lib/popt/config.m4)
|
||||||
sinclude(lib/charset/config.m4)
|
sinclude(lib/charset/config.m4)
|
||||||
sinclude(lib/socket/config.m4)
|
sinclude(lib/socket/config.m4)
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ UINT16_MAX
|
|||||||
UINT32_MAX
|
UINT32_MAX
|
||||||
UINT64_MAX
|
UINT64_MAX
|
||||||
|
|
||||||
|
Macros:
|
||||||
|
va_copy
|
||||||
|
__FUNCTION__
|
||||||
|
|
||||||
Prerequisites:
|
Prerequisites:
|
||||||
memset (for bzero)
|
memset (for bzero)
|
||||||
syslog (for vsyslog)
|
syslog (for vsyslog)
|
||||||
|
|||||||
@@ -152,4 +152,10 @@ if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl __FUNCTION__ macro
|
||||||
|
AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
|
||||||
|
AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
|
||||||
|
samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
|
||||||
|
if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
|
||||||
|
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
|
||||||
|
fi
|
||||||
|
|||||||
@@ -209,4 +209,8 @@ typedef bool int;
|
|||||||
#define true (1)
|
#define true (1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_FUNCTION_MACRO
|
||||||
|
#define __FUNCTION__ ("")
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -114,4 +114,3 @@ _PUBLIC_ void oplock_set_capability(BOOL this_process, BOOL inherit)
|
|||||||
set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY,inherit);
|
set_inherited_process_capability(KERNEL_OPLOCK_CAPABILITY,inherit);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
17
source/lib/util/capability.m4
Normal file
17
source/lib/util/capability.m4
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
|
||||||
|
AC_TRY_RUN([#include <sys/types.h>
|
||||||
|
#include <sys/capability.h>
|
||||||
|
main() {
|
||||||
|
cap_t cap;
|
||||||
|
if ((cap = cap_get_proc()) == NULL)
|
||||||
|
exit(1);
|
||||||
|
cap->cap_effective |= CAP_NETWORK_MGT;
|
||||||
|
cap->cap_inheritable |= CAP_NETWORK_MGT;
|
||||||
|
cap_set_proc(cap);
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
],
|
||||||
|
samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
|
||||||
|
if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
|
||||||
|
AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
|
||||||
|
fi
|
||||||
@@ -23,14 +23,6 @@
|
|||||||
* @brief Debugging macros
|
* @brief Debugging macros
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* If we have these macros, we can add additional info to the header. */
|
|
||||||
|
|
||||||
#ifdef HAVE_FUNCTION_MACRO
|
|
||||||
#define FUNCTION_MACRO (__FUNCTION__)
|
|
||||||
#else
|
|
||||||
#define FUNCTION_MACRO ("")
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* the debug operations structure - contains function pointers to
|
/* the debug operations structure - contains function pointers to
|
||||||
various debug implementations of each operation */
|
various debug implementations of each operation */
|
||||||
struct debug_ops {
|
struct debug_ops {
|
||||||
@@ -54,7 +46,7 @@ extern int DEBUGLEVEL;
|
|||||||
#define _DEBUG(level, body, header) do { \
|
#define _DEBUG(level, body, header) do { \
|
||||||
if (DEBUGLVL(level)) { \
|
if (DEBUGLVL(level)) { \
|
||||||
if (header) { \
|
if (header) { \
|
||||||
do_debug_header(level, __location__, FUNCTION_MACRO); \
|
do_debug_header(level, __location__, __FUNCTION__); \
|
||||||
} \
|
} \
|
||||||
do_debug body; \
|
do_debug body; \
|
||||||
} \
|
} \
|
||||||
|
|||||||
Reference in New Issue
Block a user