mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
r18450: - autogenerate the OBJ_FILES for LIBREPLACE
- remove samba specific stuff from libreplace
- and include the readdir replacement stuff in the standalone builds
metze
(This used to be commit 3cac61152e
)
This commit is contained in:
parent
c447b8a199
commit
0584c108db
@ -11,11 +11,8 @@ AC_CONFIG_HEADER(include/config_tmp.h)
|
||||
AC_DEFINE(CONFIG_H_IS_FROM_SAMBA,1,[Marker for samba's config.h])
|
||||
|
||||
# Configuration rules.
|
||||
m4_include(lib/replace/libreplace.m4)
|
||||
m4_include(lib/replace/samba.m4)
|
||||
m4_include(build/m4/env.m4)
|
||||
SMB_EXT_LIB(DL, $LIBDL)
|
||||
m4_include(lib/replace/win32/config.m4)
|
||||
m4_include(lib/replace/repdir/config.m4)
|
||||
m4_include(lib/smbreadline/readline.m4)
|
||||
m4_include(heimdal_build/config.m4)
|
||||
m4_include(lib/util/fault.m4)
|
||||
|
@ -12,7 +12,6 @@ include events/config.mk
|
||||
include cmdline/config.mk
|
||||
include socket_wrapper/config.mk
|
||||
include appweb/config.mk
|
||||
include replace/config.mk
|
||||
include stream/config.mk
|
||||
include util/config.mk
|
||||
include tdr/config.mk
|
||||
|
@ -1,29 +0,0 @@
|
||||
##############################
|
||||
# Start SUBSYSTEM REPLACE_READDIR
|
||||
[SUBSYSTEM::REPLACE_READDIR]
|
||||
OBJ_FILES = \
|
||||
repdir/repdir.o
|
||||
# End SUBSYSTEM REPLACE_READDIR
|
||||
##############################
|
||||
|
||||
##############################
|
||||
# Start SUBSYSTEM LIBREPLACE
|
||||
[SUBSYSTEM::LIBREPLACE]
|
||||
CFLAGS = -Ilib/replace
|
||||
OBJ_FILES = replace.o \
|
||||
snprintf.o \
|
||||
dlfcn.o \
|
||||
getpass.o \
|
||||
timegm.o
|
||||
PUBLIC_DEPENDENCIES = REPLACE_READDIR DL
|
||||
# End SUBSYSTEM LIBREPLACE
|
||||
##############################
|
||||
|
||||
[SUBSYSTEM::LIBREPLACE_HOSTCC]
|
||||
CFLAGS = -Ilib/replace
|
||||
OBJ_FILES = replace.ho \
|
||||
snprintf.ho \
|
||||
dlfcn.ho \
|
||||
getpass.ho \
|
||||
timegm.ho
|
||||
|
@ -1,16 +1,12 @@
|
||||
AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
|
||||
AC_DEFUN([SMB_ENABLE], [echo -n ""])
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(dlfcn.c)
|
||||
AC_CONFIG_SRCDIR([dlfcn.c])
|
||||
AC_INIT(replace.c)
|
||||
AC_CONFIG_SRCDIR([replace.c])
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
m4_include(libreplace.m4)
|
||||
|
||||
if test "$ac_cv_prog_gcc" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings"
|
||||
fi
|
||||
|
||||
m4_include(libreplace.m4)
|
||||
m4_include(win32/config.m4)
|
||||
m4_include(repdir/config.m4)
|
||||
AC_OUTPUT(Makefile)
|
||||
|
@ -236,13 +236,6 @@ if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
|
||||
fi
|
||||
|
||||
|
||||
AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
|
||||
[AC_MSG_ERROR([Required function not found])])
|
||||
|
||||
m4_include(dlfcn.m4)
|
||||
m4_include(getpass.m4)
|
||||
m4_include(system/config.m4)
|
||||
|
||||
LIBREPLACE_C99_STRUCT_INIT(c99_struct_initialization=yes,
|
||||
c99_struct_initialization=no)
|
||||
|
||||
@ -344,3 +337,12 @@ AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
|
||||
if test x"$samba_cv_volatile" = x"yes"; then
|
||||
AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
|
||||
fi
|
||||
|
||||
m4_include(dlfcn.m4)
|
||||
m4_include(getpass.m4)
|
||||
m4_include(system/config.m4)
|
||||
m4_include(win32/config.m4)
|
||||
m4_include(repdir/config.m4)
|
||||
|
||||
AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
|
||||
[AC_MSG_ERROR([Required function not found])])
|
||||
|
@ -1,25 +1,30 @@
|
||||
AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
|
||||
AC_CACHE_CHECK([for broken readdir],libreplace_READDIR_NEEDED,[
|
||||
AC_TRY_RUN([
|
||||
#define test_readdir_os2_delete main
|
||||
#error
|
||||
#include "$libreplacedir/test/os2_delete.c"],
|
||||
[samba_cv_HAVE_BROKEN_READDIR=no],
|
||||
[samba_cv_HAVE_BROKEN_READDIR=yes],
|
||||
[samba_cv_HAVE_BROKEN_READDIR="assuming not"])
|
||||
[libreplace_READDIR_NEEDED=no],
|
||||
[libreplace_READDIR_NEEDED=yes],
|
||||
[libreplace_READDIR_NEEDED="assuming not"])
|
||||
])
|
||||
|
||||
if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
|
||||
AC_CACHE_CHECK([for replacing readdir],samba_cv_REPLACE_READDIR,[
|
||||
#
|
||||
# try to replace with getdents() if needed
|
||||
#
|
||||
if test x"$libreplace_READDIR_NEEDED" = x"yes"; then
|
||||
AC_CACHE_CHECK([for replacing readdir using getdents()],libreplace_READDIR_GETDENTS,[
|
||||
AC_TRY_RUN([
|
||||
#include "confdefs.h"
|
||||
#include "$libreplacedir/repdir/repdir.c"
|
||||
#define test_readdir_os2_delete main
|
||||
#include "$libreplacedir/test/os2_delete.c"],
|
||||
[samba_cv_REPLACE_READDIR=yes],
|
||||
[samba_cv_REPLACE_READDIR=no])
|
||||
[libreplace_READDIR_GETDENTS=yes],
|
||||
[libreplace_READDIR_GETDENTS=no])
|
||||
])
|
||||
fi
|
||||
|
||||
SMB_ENABLE(REPLACE_READDIR, NO)
|
||||
if test x"$samba_cv_REPLACE_READDIR" = x"yes"; then
|
||||
if test x"$libreplace_READDIR_GETDENTS" = x"yes"; then
|
||||
AC_DEFINE(REPLACE_READDIR,1,[replace readdir])
|
||||
SMB_ENABLE(REPLACE_READDIR, YES)
|
||||
AC_DEFINE(REPLACE_READDIR_GETDENTS,1,[replace readdir using getdents()])
|
||||
LIBREPLACEOBJ="${LIBREPLACEOBJ} repdir/repdir.o"
|
||||
libreplace_READDIR_NEEDED=no
|
||||
fi
|
||||
|
23
source4/lib/replace/samba.m4
Normal file
23
source4/lib/replace/samba.m4
Normal file
@ -0,0 +1,23 @@
|
||||
m4_include(lib/replace/libreplace.m4)
|
||||
|
||||
SMB_EXT_LIB(LIBREPLACE_EXT, [${LIBDL}])
|
||||
SMB_ENABLE(LIBREPLACE_EXT)
|
||||
|
||||
LIBREPLACE_DIR=`echo ${libreplacedir} |sed -e 's/^\.\///g'`
|
||||
|
||||
LIBREPLACE_OBJS=""
|
||||
for obj in ${LIBREPLACEOBJ}; do
|
||||
LIBREPLACE_OBJS="${LIBREPLACE_OBJS} ${LIBREPLACE_DIR}/${obj}"
|
||||
done
|
||||
|
||||
SMB_SUBSYSTEM(LIBREPLACE,
|
||||
[${LIBREPLACE_OBJS}],
|
||||
[LIBREPLACE_EXT],
|
||||
[-Ilib/replace])
|
||||
|
||||
LIBREPLACE_HOSTCC_OBJS=`echo ${LIBREPLACE_OBJS} |sed -e 's/\.o/\.ho/g'`
|
||||
|
||||
SMB_SUBSYSTEM(LIBREPLACE_HOSTCC,
|
||||
[${LIBREPLACE_HOSTCC_OBJS}],
|
||||
[],
|
||||
[-Ilib/replace])
|
Loading…
Reference in New Issue
Block a user