summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-09-06 01:36:02 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:17:35 -0500
commita59706f721c70e9a4f78eb2296bb746b912ce9d0 (patch)
tree6a0744113bec965cfec156f6c68cb905ee1ebe5c
parenta83286d91cd3ff61b276955b1e0998f9e8ebc527 (diff)
downloadsamba-a59706f721c70e9a4f78eb2296bb746b912ce9d0.tar.gz
samba-a59706f721c70e9a4f78eb2296bb746b912ce9d0.tar.bz2
samba-a59706f721c70e9a4f78eb2296bb746b912ce9d0.zip
r18121: Simplify m4 code, hopefully fix Samba4 build problems.
(This used to be commit 1adf65b4d7c5d2d4f65d4b28575bdf2368a42139)
-rw-r--r--source4/client/config.mk4
-rw-r--r--source4/configure.ac3
-rw-r--r--source4/include/includes.h2
-rw-r--r--source4/lib/cmdline/config.mk4
-rw-r--r--source4/lib/ldb/config.mk2
-rw-r--r--source4/lib/popt/samba.m428
-rw-r--r--source4/lib/registry/config.mk8
-rw-r--r--source4/lib/replace/config.mk2
-rw-r--r--source4/lib/replace/libreplace.m45
-rw-r--r--source4/lib/replace/samba.m427
-rw-r--r--source4/scripting/ejs/config.mk2
-rw-r--r--source4/smbd/config.mk2
-rw-r--r--source4/torture/config.mk6
-rw-r--r--source4/utils/config.mk8
-rw-r--r--source4/utils/net/config.mk2
15 files changed, 30 insertions, 75 deletions
diff --git a/source4/client/config.mk b/source4/client/config.mk
index 546d14d12b..ebac2a4bb0 100644
--- a/source4/client/config.mk
+++ b/source4/client/config.mk
@@ -13,7 +13,7 @@ PRIVATE_DEPENDENCIES = \
LIBCLI_SMB \
RPC_NDR_SRVSVC \
LIBCLI_LSA \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS
# End BINARY smbclient
@@ -29,7 +29,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBCLI_SMB \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS
# End BINARY sdd
diff --git a/source4/configure.ac b/source4/configure.ac
index 6043a28d63..795e6e0451 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -11,7 +11,8 @@ AC_CONFIG_HEADER(include/config_tmp.h)
# Configuration rules.
m4_include(build/m4/env.m4)
-m4_include(lib/replace/samba.m4)
+m4_include(lib/replace/libreplace.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)
diff --git a/source4/include/includes.h b/source4/include/includes.h
index 007d130379..5eb49b7f75 100644
--- a/source4/include/includes.h
+++ b/source4/include/includes.h
@@ -22,7 +22,7 @@
*/
#ifndef NO_CONFIG_H /* for some tests */
-#include "replace.h"
+#include "lib/replace/replace.h"
#endif
#include "local.h"
diff --git a/source4/lib/cmdline/config.mk b/source4/lib/cmdline/config.mk
index 33607636a9..5c47be66e6 100644
--- a/source4/lib/cmdline/config.mk
+++ b/source4/lib/cmdline/config.mk
@@ -1,12 +1,12 @@
[SUBSYSTEM::LIBCMDLINE_CREDENTIALS]
PRIVATE_PROTO_HEADER = credentials.h
OBJ_FILES = credentials.o
-PUBLIC_DEPENDENCIES = CREDENTIALS POPT_EXT
+PUBLIC_DEPENDENCIES = CREDENTIALS LIBPOPT
[SUBSYSTEM::POPT_SAMBA]
PUBLIC_HEADERS = popt_common.h
OBJ_FILES = popt_common.o
-PUBLIC_DEPENDENCIES = POPT_EXT
+PUBLIC_DEPENDENCIES = LIBPOPT
[SUBSYSTEM::POPT_CREDENTIALS]
PRIVATE_PROTO_HEADER = popt_credentials.h
diff --git a/source4/lib/ldb/config.mk b/source4/lib/ldb/config.mk
index 0ebd51192c..8dff4df2dc 100644
--- a/source4/lib/ldb/config.mk
+++ b/source4/lib/ldb/config.mk
@@ -200,7 +200,7 @@ OBJ_FILES = \
[SUBSYSTEM::LIBLDB_CMDLINE]
OBJ_FILES= \
tools/cmdline.o
-PUBLIC_DEPENDENCIES = ldb LIBSAMBA-UTIL POPT_EXT POPT_SAMBA POPT_CREDENTIALS
+PUBLIC_DEPENDENCIES = ldb LIBSAMBA-UTIL LIBPOPT POPT_SAMBA POPT_CREDENTIALS
PRIVATE_DEPENDENCIES = gensec
# End SUBSYSTEM LIBLDB_CMDLINE
################################################
diff --git a/source4/lib/popt/samba.m4 b/source4/lib/popt/samba.m4
index cd0de5e826..d940075f86 100644
--- a/source4/lib/popt/samba.m4
+++ b/source4/lib/popt/samba.m4
@@ -1,27 +1,3 @@
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_CPPFLAGS="$CPPFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-
-LIBS=""
-CFLAGS=""
-CPPFLAGS=""
-LDFLAGS=""
-
m4_include(lib/popt/libpopt.m4)
-
-POPT_EXT_LIBS="$LIBS $POPTOBJ"
-POPT_EXT_CFLAGS="$CFLAGS"
-POPT_EXT_CPPFLAGS="$CPPFLAGS"
-POPT_EXT_LDFLAGS="$LDFLAGS"
-
-LIBS="$SAVE_LIBS"
-CFLAGS="$SAVE_CFLAGS"
-CPPFLAGS="$SAVE_CPPFLAGS"
-LDFLAGS="$SAVE_LDFLAGS"
-
-SMB_EXT_LIB(POPT_EXT,
- [${POPT_EXT_LIBS}],
- [${POPT_EXT_CFLAGS}],
- [${POPT_EXT_CPPFLAGS}],
- [${POPT_EXT_LDFLAGS}])
+SMB_SUBSYSTEM(LIBPOPT,
+ [lib/popt/findme.o lib/popt/popt.o lib/popt/poptconfig.o lib/popt/popthelp.o lib/popt/poptparse.o], [], [-I$srcdir/lib/popt])
diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk
index d979f9fb99..89a77c231e 100644
--- a/source4/lib/registry/config.mk
+++ b/source4/lib/registry/config.mk
@@ -110,7 +110,7 @@ PUBLIC_HEADERS = registry.h
INSTALLDIR = BINDIR
OBJ_FILES = tools/regdiff.o
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG registry POPT_EXT POPT_SAMBA POPT_CREDENTIALS
+ LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
MANPAGE = man/regdiff.1
# End BINARY regdiff
################################################
@@ -121,7 +121,7 @@ MANPAGE = man/regdiff.1
INSTALLDIR = BINDIR
OBJ_FILES = tools/regpatch.o
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG registry POPT_EXT POPT_SAMBA POPT_CREDENTIALS
+ LIBSAMBA-CONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS
MANPAGE = man/regpatch.1
# End BINARY regpatch
################################################
@@ -132,7 +132,7 @@ MANPAGE = man/regpatch.1
INSTALLDIR = BINDIR
OBJ_FILES = tools/regshell.o
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG POPT_EXT registry POPT_SAMBA POPT_CREDENTIALS \
+ LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS \
SMBREADLINE
MANPAGE = man/regshell.1
# End BINARY regshell
@@ -144,7 +144,7 @@ MANPAGE = man/regshell.1
INSTALLDIR = BINDIR
OBJ_FILES = tools/regtree.o
PRIVATE_DEPENDENCIES = \
- LIBSAMBA-CONFIG POPT_EXT registry POPT_SAMBA POPT_CREDENTIALS
+ LIBSAMBA-CONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS
MANPAGE = man/regtree.1
# End BINARY regtree
################################################
diff --git a/source4/lib/replace/config.mk b/source4/lib/replace/config.mk
index a05db5abad..2482c69636 100644
--- a/source4/lib/replace/config.mk
+++ b/source4/lib/replace/config.mk
@@ -14,6 +14,6 @@ OBJ_FILES = replace.o \
snprintf.o \
dlfcn.o \
getpass.o
-PUBLIC_DEPENDENCIES = REPLACE_READDIR REPLACE_EXT
+PUBLIC_DEPENDENCIES = REPLACE_READDIR
# End SUBSYSTEM LIBREPLACE
##############################
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index abbd63db7a..7136a18029 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -139,7 +139,12 @@ if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
fi
dnl dummies provided by dlfcn.c if not available
+save_LIBS="$LIBS"
+LIBS=""
AC_SEARCH_LIBS(dlopen, dl)
+LIBDL="$LIBS"
+AC_SUBST(LIBDL)
+LIBS="$save_LIBS"
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose)
diff --git a/source4/lib/replace/samba.m4 b/source4/lib/replace/samba.m4
deleted file mode 100644
index 6183b7e28f..0000000000
--- a/source4/lib/replace/samba.m4
+++ /dev/null
@@ -1,27 +0,0 @@
-SAVE_LIBS="$LIBS"
-SAVE_CFLAGS="$CFLAGS"
-SAVE_CPPFLAGS="$CPPFLAGS"
-SAVE_LDFLAGS="$LDFLAGS"
-
-LIBS=""
-CFLAGS=""
-CPPFLAGS=""
-LDFLAGS=""
-
-m4_include(libreplace.m4)
-
-REPLACE_EXT_LIBS="$LIBS"
-REPLACE_EXT_CFLAGS="$CFLAGS"
-REPLACE_EXT_CPPFLAGS="$CPPFLAGS"
-REPLACE_EXT_LDFLAGS="$LDFLAGS"
-
-LIBS="$SAVE_LIBS"
-CFLAGS="$SAVE_CFLAGS"
-CPPFLAGS="$SAVE_CPPFLAGS"
-LDFLAGS="$SAVE_LDFLAGS"
-
-SMB_EXT_LIB(REPLACE_EXT,
- [${REPLACE_EXT_LIBS}],
- [${REPLACE_EXT_CFLAGS}],
- [${REPLACE_EXT_CPPFLAGS}],
- [${REPLACE_EXT_LDFLAGS}])
diff --git a/source4/scripting/ejs/config.mk b/source4/scripting/ejs/config.mk
index 8c7e9cd53d..ca73ce279a 100644
--- a/source4/scripting/ejs/config.mk
+++ b/source4/scripting/ejs/config.mk
@@ -76,7 +76,7 @@ OBJ_FILES = \
PUBLIC_DEPENDENCIES = \
EJS LIBSAMBA-UTIL \
EJSRPC MESSAGING \
- LIBSAMBA-NET LIBCLI_SMB POPT_EXT \
+ LIBSAMBA-NET LIBCLI_SMB LIBPOPT \
POPT_CREDENTIALS POPT_SAMBA \
dcerpc \
NDR_TABLE
diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk
index 42479f5105..569a1f0d38 100644
--- a/source4/smbd/config.mk
+++ b/source4/smbd/config.mk
@@ -37,7 +37,7 @@ PRIVATE_DEPENDENCIES = \
LIBSAMBA-UTIL \
PIDFILE \
POPT_SAMBA \
- POPT_EXT \
+ LIBPOPT \
gensec \
registry \
ntptr \
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index 2da8caccdc..be2d6a1bde 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -270,7 +270,7 @@ OBJ_FILES = \
smbtorture.o
PRIVATE_DEPENDENCIES = \
torture \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS \
TORTURE_UI \
@@ -289,7 +289,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS \
LIBCLI_SMB \
@@ -307,7 +307,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS \
LIBCLI_SMB
diff --git a/source4/utils/config.mk b/source4/utils/config.mk
index 442a7466e4..69d5a3b77f 100644
--- a/source4/utils/config.mk
+++ b/source4/utils/config.mk
@@ -9,7 +9,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
NDR_TABLE
MANPAGE = man/ndrdump.1
@@ -26,7 +26,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS \
gensec \
@@ -83,7 +83,7 @@ PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
LIBCLI_NBT \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
LIBNETIF \
LIBCLI_RESOLVE
@@ -99,7 +99,7 @@ OBJ_FILES = \
PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
- POPT_EXT \
+ LIBPOPT \
samba-socket \
POPT_SAMBA \
LIBCLI_RESOLVE \
diff --git a/source4/utils/net/config.mk b/source4/utils/net/config.mk
index 6985f1475c..c07d6a67cb 100644
--- a/source4/utils/net/config.mk
+++ b/source4/utils/net/config.mk
@@ -16,7 +16,7 @@ PRIVATE_DEPENDENCIES = \
LIBSAMBA-CONFIG \
LIBSAMBA-UTIL \
LIBSAMBA-NET \
- POPT_EXT \
+ LIBPOPT \
POPT_SAMBA \
POPT_CREDENTIALS
# End BINARY net