svn commit: samba r18073 - in
branches/SAMBA_4_0/source/lib/replace: .
tridge at samba.org
tridge at samba.org
Tue Sep 5 11:21:16 GMT 2006
Author: tridge
Date: 2006-09-05 11:21:16 +0000 (Tue, 05 Sep 2006)
New Revision: 18073
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18073
Log:
next step in grab libreplace plan - see IRC logs for very detailed
discussion wity metze and jelmer!
Modified:
branches/SAMBA_4_0/source/lib/replace/Makefile.in
branches/SAMBA_4_0/source/lib/replace/config.m4
branches/SAMBA_4_0/source/lib/replace/configure.ac
Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/Makefile.in
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/Makefile.in 2006-09-05 10:45:05 UTC (rev 18072)
+++ branches/SAMBA_4_0/source/lib/replace/Makefile.in 2006-09-05 11:21:16 UTC (rev 18073)
@@ -6,16 +6,16 @@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
-VPATH = @srcdir@
+VPATH = @libreplacedir@
srcdir = @srcdir@
builddir = @builddir@
INSTALL = @INSTALL@
.PHONY: test
-CFLAGS=-I. -I$(srcdir) @CFLAGS@
+CFLAGS=-I. -I at libreplacedir@ @CFLAGS@
-OBJS = dlfcn.o getpass.o replace.o snprintf.o timegm.o
+OBJS = @LIBREPLACEOBJ@
all: libreplace.a testsuite
Modified: branches/SAMBA_4_0/source/lib/replace/config.m4
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 10:45:05 UTC (rev 18072)
+++ branches/SAMBA_4_0/source/lib/replace/config.m4 2006-09-05 11:21:16 UTC (rev 18073)
@@ -1,3 +1,16 @@
+dnl find the libreplace sources. This is meant to work both for
+dnl libreplace standalone builds, and builds of packages using libreplace
+libreplacedir=""
+for d in "$srcdir" "$srcdir/lib/replace" "$srcdir/libreplace" "$srcdir/../libreplace"; do
+ if test -f "$d/replace.c"; then
+ libreplacedir="$d"
+ AC_SUBST(libreplacedir)
+ break;
+ fi
+done
+LIBREPLACEOBJ="dlfcn.o getpass.o replace.o snprintf.o timegm.o"
+AC_SUBST(LIBREPLACEOBJ)
+
AC_CHECK_HEADERS([stdint.h inttypes.h])
AC_CHECK_TYPE(uint_t, unsigned int)
AC_CHECK_TYPE(uint8_t, unsigned char)
@@ -56,9 +69,7 @@
AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename)
AC_CHECK_FUNCS(waitpid strlcpy strlcat innetgr initgroups memmove strdup)
AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp)
-AC_HAVE_DECL(setresuid, [#include <unistd.h>])
-AC_HAVE_DECL(setresgid, [#include <unistd.h>])
-AC_HAVE_DECL(errno, [#include <errno.h>])
+AC_CHECK_DECLS([setresuid, setresgid, errno])
AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
AC_TRY_RUN([#include <stdlib.h>
@@ -83,10 +94,7 @@
fi
dnl Provided by snprintf.c:
-AC_HAVE_DECL(asprintf, [#include <stdio.h>])
-AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
-AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
-AC_HAVE_DECL(snprintf, [#include <stdio.h>])
+AC_CHECK_DECLS([asprintf, vasprintf, snprintf])
AC_CHECK_FUNCS(snprintf vsnprintf asprintf vasprintf)
AC_CHECK_HEADERS(strings.h)
@@ -129,14 +137,10 @@
AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
fi
-dnl Provided by dlfcn.c:
-AC_SEARCH_LIBS_EXT(dlopen, [dl], DL_LIBS)
-SMB_EXT_LIB(DL,[${DL_LIBS}],[${DL_CFLAGS}],[${DL_CPPFLAGS}],[${DL_LDFLAGS}])
-SAVE_LIBS="$LIBS"
-LIBS="$LIBS $DL_LIBS"
+dnl dummies provided by dlfcn.c if not available
+AC_SEARCH_LIBS(dlopen, dl)
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose)
-LIBS="$SAVE_LIBS"
AC_CHECK_FUNCS([syslog memset setnetgrent getnetgrent endnetgrent memcpy],,
[AC_MSG_ERROR([Required function not found])])
Modified: branches/SAMBA_4_0/source/lib/replace/configure.ac
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/configure.ac 2006-09-05 10:45:05 UTC (rev 18072)
+++ branches/SAMBA_4_0/source/lib/replace/configure.ac 2006-09-05 11:21:16 UTC (rev 18073)
@@ -1,46 +1,6 @@
AC_DEFUN([SMB_EXT_LIB], [echo -n ""])
AC_DEFUN([SMB_ENABLE], [echo -n ""])
-dnl see if a declaration exists for a function or variable
-dnl defines HAVE_function_DECL if it exists
-dnl AC_HAVE_DECL(var, includes)
-AC_DEFUN(AC_HAVE_DECL,
-[
- AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
- AC_TRY_COMPILE([$2],[int i = (int)$1],
- ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
- if test x"$ac_cv_have_$1_decl" = x"yes"; then
- AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
- fi
-])
-
-dnl AC_SEARCH_LIBS_EXT(FUNCTION, SEARCH-LIBS, EXT_LIBS,
-dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
-dnl [OTHER-LIBRARIES])
-dnl --------------------------------------------------------
-dnl Search for a library defining FUNC, if it's not already available.
-AC_DEFUN([AC_SEARCH_LIBS_EXT],
-[AC_CACHE_CHECK([for library containing $1], [ac_cv_search_ext_$1],
-[
-ac_func_search_ext_save_LIBS=$LIBS
-ac_cv_search_ext_$1=no
-AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
- [ac_cv_search_ext_$1="none required"])
-if test "$ac_cv_search_ext_$1" = no; then
- for ac_lib in $2; do
- LIBS="-l$ac_lib $$3 $6 $ac_func_search_save_ext_LIBS"
- AC_LINK_IFELSE([AC_LANG_CALL([], [$1])],
- [ac_cv_search_ext_$1="-l$ac_lib"
-break])
- done
-fi
-LIBS=$ac_func_search_ext_save_LIBS])
-AS_IF([test "$ac_cv_search_ext_$1" != no],
- [test "$ac_cv_search_ext_$1" = "none required" || $3="$ac_cv_search_ext_$1 $$3"
- $4],
- [$5])dnl
-])
-
AC_PREREQ(2.50)
AC_INIT(dlfcn.c)
AC_CONFIG_SRCDIR([dlfcn.c])
More information about the samba-cvs
mailing list