svn commit: samba r18450 - in branches/SAMBA_4_0/source: . lib lib/replace lib/replace/repdir

metze at samba.org metze at samba.org
Wed Sep 13 09:47:41 GMT 2006


Author: metze
Date: 2006-09-13 09:47:41 +0000 (Wed, 13 Sep 2006)
New Revision: 18450

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18450

Log:
- autogenerate the OBJ_FILES for LIBREPLACE
- remove samba specific stuff from libreplace
- and include the readdir replacement stuff in the standalone builds

metze
Added:
   branches/SAMBA_4_0/source/lib/replace/samba.m4
Removed:
   branches/SAMBA_4_0/source/lib/replace/config.mk
Modified:
   branches/SAMBA_4_0/source/configure.ac
   branches/SAMBA_4_0/source/lib/basic.mk
   branches/SAMBA_4_0/source/lib/replace/configure.ac
   branches/SAMBA_4_0/source/lib/replace/libreplace.m4
   branches/SAMBA_4_0/source/lib/replace/repdir/config.m4


Changeset:
Modified: branches/SAMBA_4_0/source/configure.ac
===================================================================
--- branches/SAMBA_4_0/source/configure.ac	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/configure.ac	2006-09-13 09:47:41 UTC (rev 18450)
@@ -11,11 +11,8 @@
 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)

Modified: branches/SAMBA_4_0/source/lib/basic.mk
===================================================================
--- branches/SAMBA_4_0/source/lib/basic.mk	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/basic.mk	2006-09-13 09:47:41 UTC (rev 18450)
@@ -12,7 +12,6 @@
 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

Deleted: branches/SAMBA_4_0/source/lib/replace/config.mk
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/config.mk	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/replace/config.mk	2006-09-13 09:47:41 UTC (rev 18450)
@@ -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
-

Modified: branches/SAMBA_4_0/source/lib/replace/configure.ac
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/configure.ac	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/replace/configure.ac	2006-09-13 09:47:41 UTC (rev 18450)
@@ -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)

Modified: branches/SAMBA_4_0/source/lib/replace/libreplace.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/libreplace.m4	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/replace/libreplace.m4	2006-09-13 09:47:41 UTC (rev 18450)
@@ -236,13 +236,6 @@
 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 @@
 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])])

Modified: branches/SAMBA_4_0/source/lib/replace/repdir/config.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/repdir/config.m4	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/replace/repdir/config.m4	2006-09-13 09:47:41 UTC (rev 18450)
@@ -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

Added: branches/SAMBA_4_0/source/lib/replace/samba.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/samba.m4	2006-09-13 09:32:24 UTC (rev 18449)
+++ branches/SAMBA_4_0/source/lib/replace/samba.m4	2006-09-13 09:47:41 UTC (rev 18450)
@@ -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])



More information about the samba-cvs mailing list