Parcourir la source

[master] Merged trac5210 (distcheck vs --enable-shell & co)

Francis Dupont il y a 7 ans
Parent
commit
26434357ca
5 fichiers modifiés avec 25 ajouts et 33 suppressions
  1. 8 0
      Makefile.am
  2. 7 0
      configure.ac
  3. 5 1
      src/bin/Makefile.am
  4. 1 13
      src/bin/shell/Makefile.am
  5. 4 19
      src/bin/shell/tests/Makefile.am

+ 8 - 0
Makefile.am

@@ -10,6 +10,8 @@ GENHTML=@GENHTML@
 DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@
 DISTCHECK_CRYPTO_CONFIGURE_FLAG=@DISTCHECK_CRYPTO_CONFIGURE_FLAG@
 DISTCHECK_BOOST_CONFIGURE_FLAG=@DISTCHECK_BOOST_CONFIGURE_FLAG@
+DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=@DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
+DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
 
 DISTCLEANFILES = config.report
 
@@ -25,6 +27,12 @@ DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CRYPTO_CONFIGURE_FLAG)
 # Keep the Boost configuration which becomes sensible
 DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_BOOST_CONFIGURE_FLAG)
 
+# Keep the log4cplus path too
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG)
+
+# Keep kea-shell if enabled
+DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_KEA_SHELL_CONFIGURE_FLAG)
+
 dist_doc_DATA = AUTHORS COPYING ChangeLog README
 
 .PHONY: check-valgrind check-valgrind-suppress

+ 7 - 0
configure.ac

@@ -407,6 +407,7 @@ AC_ARG_ENABLE(shell, [AC_HELP_STRING([--enable-shell],
   [enable kea-shell, a text management client for Control Agent [default=no]])],
   enable_shell=$enableval, enable_shell=no)
 
+DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=
 PKGPYTHONDIR=
 m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
  [python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 dnl
@@ -427,12 +428,14 @@ if test "x$enable_shell" != xno ; then
     eval PKGPYTHONDIR="\"$OLD\""
   done
   prefix="$saved_prefix"
+  DISTCHECK_KEA_SHELL_CONFIGURE_FLAG="--enable-shell"
 else
   PYTHON=no
 fi
 
 # Export to makefiles the info whether we have shell enabled or not
 AM_CONDITIONAL(KEA_SHELL, test x$enable_shell != xno)
+AC_SUBST(DISTCHECK_KEA_SHELL_CONFIGURE_FLAG)
 AC_SUBST(PKGPYTHONDIR)
 
 # produce PIC unless we disable shared libraries. need this for python bindings.
@@ -757,6 +760,7 @@ fi
 AM_CONDITIONAL(HAVE_CQL, test "$CQL_CONFIG" != "")
 
 # Check for log4cplus
+DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=
 log4cplus_path="yes"
 AC_ARG_WITH([log4cplus],
   AC_HELP_STRING([--with-log4cplus=PATH],
@@ -765,6 +769,7 @@ AC_ARG_WITH([log4cplus],
 if test "${log4cplus_path}" = "no" ; then
     AC_MSG_ERROR([Need log4cplus])
 elif test "${log4cplus_path}" != "yes" ; then
+  DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG="-with-log4cplus=${log4cplus_path}"
   LOG4CPLUS_INCLUDES="-I${log4cplus_path}/include"
   LOG4CPLUS_LIBS="-L${log4cplus_path}/lib"
 else
@@ -778,10 +783,12 @@ else
                         break
                 fi
         done
+	DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG="-with-log4cplus"
 fi
 
 LOG4CPLUS_LIBS="$LOG4CPLUS_LIBS -llog4cplus"
 
+AC_SUBST(DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG)
 AC_SUBST(LOG4CPLUS_LIBS)
 AC_SUBST(LOG4CPLUS_INCLUDES)
 

+ 5 - 1
src/bin/Makefile.am

@@ -1,4 +1,8 @@
 # The following build order must be maintained.
-SUBDIRS = dhcp4 dhcp6 d2 agent perfdhcp admin lfc keactrl shell
+SUBDIRS = dhcp4 dhcp6 d2 agent perfdhcp admin lfc keactrl
+
+if KEA_SHELL
+SUBDIRS += shell
+endif
 
 check-recursive: all-recursive

+ 1 - 13
src/bin/shell/Makefile.am

@@ -1,26 +1,14 @@
 SUBDIRS = . tests
 
-EXTRA_DIST =
-
-if KEA_SHELL
-
-# Kea-shell is enabled, here are proper rules for it.
 pkgpython_PYTHON = kea_conn.py kea_connector2.py kea_connector3.py
 
 sbin_SCRIPTS = kea-shell
 
-else
-
-# Kea-shell is disabled, simply keep the files for make dist
-EXTRA_DIST += kea-shell kea_conn.py kea_connector2.py kea_connector3.py
-
-endif
-
 CLEANFILES = *.pyc
 
 man_MANS = kea-shell.8
 DISTCLEANFILES = $(man_MANS)
-EXTRA_DIST += $(man_MANS) kea-shell.xml
+EXTRA_DIST = $(man_MANS) kea-shell.xml
 
 if GENERATE_DOCS
 kea-shell.8: kea-shell.xml

+ 4 - 19
src/bin/shell/tests/Makefile.am

@@ -1,12 +1,5 @@
-PYTESTS =
-SHTESTS =
-EXTRA_DIST =
-
-if KEA_SHELL
-
-# Ok, shell is enabled. Let's run those tests.
-PYTESTS += shell_unittest.py
-SHTESTS += shell_process_tests.sh
+PYTESTS = shell_unittest.py
+SHTESTS = shell_process_tests.sh
 noinst_SCRIPTS = $(PYTESTS) $(SHTESTS)
 
 # test using command-line arguments, so use check-local target instead of TESTS
@@ -16,7 +9,7 @@ check-python:
 	@for pytest in $(PYTESTS) ; do \
 	echo Running python test: $$pytest ; \
 	chmod +x $(abs_builddir)/$$pytest ; \
-	PYTHONPATH=$(PYTHONPATH):$(abs_top_builddir)/src/bin/shell python $(abs_builddir)/$$pytest || exit ; \
+	PYTHONPATH=$(PYTHONPATH):$(abs_top_srcdir)/src/bin/shell python $(abs_builddir)/$$pytest || exit ; \
 	done
 
 check-shell:
@@ -24,18 +17,10 @@ check-shell:
 	echo Running shell test: $$shtest ; \
 	export KEA_LOCKFILE_DIR=$(abs_top_builddir); \
 	export KEA_PIDFILE_DIR=$(abs_top_builddir); \
+	export PYTHONPATH=$(PYTHONPATH):$(abs_top_srcdir)/src/bin/shell; \
 	${SHELL} $(abs_builddir)/$$shtest || exit ; \
 	done
 
-else
-
-# Nope, shell is disabled. Let's keep the files in EXTRA_DIST, so they get
-# included in make dist, but don't do anything special about them.
-EXTRA_DIST += shell_unittest.py shell_process_tests.sh
-
-endif
-
-
 CLEANDIRS = __pycache__
 
 clean-local: