summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-02-12 08:07:46 +0000
committerStefan Metzmacher <metze@samba.org>2004-02-12 08:07:46 +0000
commite46d297083c6e656774d94bb8153334836a27937 (patch)
tree1b0231ae6eb3d7be7e85e841b62740ea175909a9 /source4
parent45e446248d36087dd53c341051424beb058bd99d (diff)
downloadsamba-e46d297083c6e656774d94bb8153334836a27937.tar.gz
samba-e46d297083c6e656774d94bb8153334836a27937.tar.bz2
samba-e46d297083c6e656774d94bb8153334836a27937.zip
move the -lpopt replacement to a LIBPOPT subsystem
metze (This used to be commit 9eb593a7c065326dafbba896ed723d0ea5cb00ed)
Diffstat (limited to 'source4')
-rw-r--r--source4/Makefile.in19
-rw-r--r--source4/lib/popt/config.m439
-rw-r--r--source4/popt/config.m439
3 files changed, 57 insertions, 40 deletions
diff --git a/source4/Makefile.in b/source4/Makefile.in
index 7eddeb9aae..8d67e2a44f 100644
--- a/source4/Makefile.in
+++ b/source4/Makefile.in
@@ -12,7 +12,7 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
-LIBS=@LIBS@ @LDAP_LIBS@ @KRB5_LIBS@
+LIBS=@LIBS@ @LDAP_LIBS@ @KRB5_LIBS@ @LIBPOPT_LIBS@
CC=@CC@
SHLD=@SHLD@
CFLAGS=@CFLAGS@
@@ -57,7 +57,7 @@ LOCKDIR = @lockdir@
# the directory where pid files go
PIDDIR = @piddir@
-FLAGS = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I. $(CPPFLAGS) -I$(srcdir)
+FLAGS = $(CFLAGS) -Iinclude -I$(srcdir)/include $(CPPFLAGS) -I. -I$(srcdir)
FLAGS32 =
PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATEDIR)\"
@@ -111,6 +111,8 @@ LIBRPC_OBJS = @LIBRPC_OBJS@
LIBSMB_OBJS = @LIBSMB_OBJS@
+LIBPOPT_OBJS = @LIBPOPT_OBJS@
+
PROCESS_MODEL_OBJS = @PROCESS_MODEL_OBJS@
PROCESS_MODEL_LIBS = @PROCESS_MODEL_LIBS@
@@ -158,14 +160,14 @@ SMBD_OBJ_BASE = $(PROCESS_MODEL_OBJS) $(SMBD_OBJ_SRV) \
$(PARAM_OBJ) $(SECRETS_OBJ) \
$(LIBBASIC_OBJS) $(POPT_LIB_OBJ) $(LIBSMB_OBJS)
-SMBD_OBJS = $(SMBD_OBJ_MAIN) $(SMBD_OBJ_BASE) @BUILD_POPT@
-SMBD_LIBS = $(LIBS) $(SMB_LIBS) $(PROCESS_MODEL_LIBS) $(DCERPC_LIBS) $(AUTH_LIBS) $(PASSDB_LIBS) $(NTVFS_LIBS)
+SMBD_OBJS = $(SMBD_OBJ_MAIN) $(SMBD_OBJ_BASE) $(LIBPOPT_OBJS)
+SMBD_LIBS = $(LIBS) $(SMB_LIBS) $(PROCESS_MODEL_LIBS) $(DCERPC_LIBS) $(AUTH_LIBS) $(PASSDB_LIBS) $(NTVFS_LIBS) $(LIBPOPT_LIBS)
CLIENT_OBJ1 = client/client.o client/clitar.o libcli/raw/clirewrite.o
CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJS) $(SECRETS_OBJ) \
$(LIBBASIC_OBJS) \
- $(READLINE_OBJ) $(POPT_LIB_OBJ)
+ $(READLINE_OBJ) $(POPT_LIB_OBJ) $(LIBPOPT_OBJS)
SMBTORTURE_OBJS = $(TORTURE_OBJS) $(SECRETS_OBJ) $(LIBSMB_OBJS) $(PARAM_OBJ) $(LIBBASIC_OBJS)
SMBTORTURE_LIBS = $(LIBS)
@@ -190,9 +192,6 @@ PROTO_OBJ = $(SMBD_OBJ_SRV) \
$(READLINE_OBJ) $(CLIENT_OBJ1) \
$(LIBBASIC_OBJS) $(POPT_LIB_OBJ)
-POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
- popt/popthelp.o popt/poptparse.o
-
######################################################################
# now the rules...
######################################################################
@@ -310,9 +309,9 @@ bin/smbd@EXEEXT@: $(SMBD_OBJS) bin/.dummy
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(SMBD_OBJS) $(LDFLAGS) $(DYNEXP) $(SMBD_LIBS)
-bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
+bin/smbclient@EXEEXT@: $(CLIENT_OBJ) bin/.dummy
@echo Linking $@
- @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @BUILD_POPT@
+ @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS)
bin/smbtorture@EXEEXT@: $(SMBTORTURE_OBJS) bin/.dummy
@echo Linking $@
diff --git a/source4/lib/popt/config.m4 b/source4/lib/popt/config.m4
index 7532c5826e..0be7d308c7 100644
--- a/source4/lib/popt/config.m4
+++ b/source4/lib/popt/config.m4
@@ -1,31 +1,40 @@
#################################################
-# Check to see if we should use the included popt
+# Check to see if we should use the included popt
+INCLUDED_POPT=auto
AC_ARG_WITH(included-popt,
[ --with-included-popt use bundled popt library, not from system],
[
- case "$withval" in
+case "$withval" in
yes)
INCLUDED_POPT=yes
;;
no)
- INCLUDED_POPT=no
- ;;
- esac ],
+ INCLUDED_POPT=no
+ ;;
+esac ],
)
if test x"$INCLUDED_POPT" != x"yes"; then
- AC_CHECK_LIB(popt, poptGetContext,
- INCLUDED_POPT=no, INCLUDED_POPT=yes)
+ AC_CHECK_HEADERS(popt.h)
+ AC_CHECK_LIB_EXT(popt, TMP_LIBPOPT_LIBS, poptGetContext, [], [], INCLUDED_POPT=no)
+ if test x"$ac_cv_header_popt_h" = x"no"; then
+ INCLUDED_POPT=yes
+ TMP_LIBPOPT_LIBS=""
+ fi
fi
AC_MSG_CHECKING(whether to use included popt)
-if test x"$INCLUDED_POPT" = x"yes"; then
- AC_MSG_RESULT(yes)
- BUILD_POPT='$(POPT_OBJS)'
- FLAGS1="-I$srcdir/popt"
+if test x"$INCLUDED_POPT" != x"no"; then
+ TMP_LIBPOPT_OBJS="popt/findme.o popt/popt.o popt/poptconfig.o \
+ popt/popthelp.o popt/poptparse.o"
+ CPPFLAGS="$CPPFLAGS -I$srcdir/popt"
+ AC_MSG_RESULT(yes)
else
- AC_MSG_RESULT(no)
- LIBS="$LIBS -lpopt"
+ AC_MSG_RESULT(no)
fi
-AC_SUBST(BUILD_POPT)
-AC_SUBST(FLAGS1)
+
+SMB_SUBSYSTEM(LIBPOPT,[],
+ [${TMP_LIBPOPT_OBJS}],
+ [],
+ [],
+ [${TMP_LIBPOPT_LIBS}])
diff --git a/source4/popt/config.m4 b/source4/popt/config.m4
index 7532c5826e..0be7d308c7 100644
--- a/source4/popt/config.m4
+++ b/source4/popt/config.m4
@@ -1,31 +1,40 @@
#################################################
-# Check to see if we should use the included popt
+# Check to see if we should use the included popt
+INCLUDED_POPT=auto
AC_ARG_WITH(included-popt,
[ --with-included-popt use bundled popt library, not from system],
[
- case "$withval" in
+case "$withval" in
yes)
INCLUDED_POPT=yes
;;
no)
- INCLUDED_POPT=no
- ;;
- esac ],
+ INCLUDED_POPT=no
+ ;;
+esac ],
)
if test x"$INCLUDED_POPT" != x"yes"; then
- AC_CHECK_LIB(popt, poptGetContext,
- INCLUDED_POPT=no, INCLUDED_POPT=yes)
+ AC_CHECK_HEADERS(popt.h)
+ AC_CHECK_LIB_EXT(popt, TMP_LIBPOPT_LIBS, poptGetContext, [], [], INCLUDED_POPT=no)
+ if test x"$ac_cv_header_popt_h" = x"no"; then
+ INCLUDED_POPT=yes
+ TMP_LIBPOPT_LIBS=""
+ fi
fi
AC_MSG_CHECKING(whether to use included popt)
-if test x"$INCLUDED_POPT" = x"yes"; then
- AC_MSG_RESULT(yes)
- BUILD_POPT='$(POPT_OBJS)'
- FLAGS1="-I$srcdir/popt"
+if test x"$INCLUDED_POPT" != x"no"; then
+ TMP_LIBPOPT_OBJS="popt/findme.o popt/popt.o popt/poptconfig.o \
+ popt/popthelp.o popt/poptparse.o"
+ CPPFLAGS="$CPPFLAGS -I$srcdir/popt"
+ AC_MSG_RESULT(yes)
else
- AC_MSG_RESULT(no)
- LIBS="$LIBS -lpopt"
+ AC_MSG_RESULT(no)
fi
-AC_SUBST(BUILD_POPT)
-AC_SUBST(FLAGS1)
+
+SMB_SUBSYSTEM(LIBPOPT,[],
+ [${TMP_LIBPOPT_OBJS}],
+ [],
+ [],
+ [${TMP_LIBPOPT_LIBS}])