All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] chunkd: configure now detects location of cld program
@ 2009-07-29 21:26 Matthew Farrellee
  2009-07-30  1:35 ` Jeff Garzik
  2009-07-30  1:43 ` Jeff Garzik
  0 siblings, 2 replies; 7+ messages in thread
From: Matthew Farrellee @ 2009-07-29 21:26 UTC (permalink / raw)
  To: hail-devel

make check attempts to start cld, but cannot find it if it is not
already in PATH. This patch uses CLDC_PREFIX, possibly from
pkg-config, to detect the location of cld with configure.

Signed-off-by: Matthew Farrellee <matt@redhat.com>
---
 configure.ac              |   19 +++++++++++++++++++
 test/Makefile.am          |    1 +
 test/start-daemon         |   20 +-------------------
 test/start-daemon.real.in |   20 ++++++++++++++++++++
 4 files changed, 41 insertions(+), 19 deletions(-)
 create mode 100644 test/start-daemon.real.in

diff --git a/configure.ac b/configure.ac
index 7e51b84..942d446 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,6 +80,24 @@ AC_CHECK_LIB(argp, argp_parse, ARGP_LIBS=-largp)
 AC_CHECK_LIB(socket, bind, SOCKET_LIBS=-lsocket)
 PKG_CHECK_MODULES(CLDC, libcldc)
 
+dnl -----------------------------
+dnl Check for cld program, used
+dnl in the test process.
+dnl
+dnl Either use pkg-config or
+dnl define CLDC_PREFIX in
+dnl configure's environment.
+dnl -----------------------------
+_PKG_CONFIG([CLDC_PREFIX], [variable=prefix], [libcldc])
+AS_IF([test "x$pkg_failed" = xyes],
+ [AC_WARN([No CLDC_PREFIX defined, using /usr])
+  CLDC_PREFIX="/usr"],
+ [CLDC_PREFIX=$pkg_cv_CLDC_PREFIX])
+AC_PATH_PROG([CLDC_CMD], [cld], [no],
+             [$PATH$PATH_SEPARATOR$CLDC_PREFIX/bin$PATH_SEPARATOR$CLDC_PREFIX/sbin$PATH_SEPARATOR$CLDC_PREFIX/libexec])
+AS_IF([test "x$CLDC_CMD" = xno],
+  [AC_MSG_ERROR([Missing cld program])])
+
 dnl -------------------------------------
 dnl Checks for optional library functions
 dnl -------------------------------------
@@ -111,5 +129,6 @@ AC_CONFIG_FILES([doc/Makefile
 		 include/Makefile
 		 server/Makefile
 		 test/Makefile
+		 test/start-daemon.real
 		 Makefile])
 AC_OUTPUT
diff --git a/test/Makefile.am b/test/Makefile.am
index cc84187..4221b9f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -7,6 +7,7 @@ EXTRA_DIST =			\
 	server-test.cfg		\
 	prep-db			\
 	start-daemon		\
+	start-daemon.real	\
 	pid-exists		\
 	daemon-running		\
 	stop-daemon		\
diff --git a/test/start-daemon b/test/start-daemon
index 7d21e2f..74333d9 100755
--- a/test/start-daemon
+++ b/test/start-daemon
@@ -1,21 +1,3 @@
 #!/bin/sh
 
-if [ -f cld.pid ]
-then
-	echo "cld.pid file found.  daemon still running?"
-	exit 1
-fi
-if [ -f chunkd.pid ]
-then
-	echo "chunkd.pid file found.  daemon still running?"
-	exit 1
-fi
-
-# May be different on Solaris... like /usr/libexec or such.
-cld -d data/cld -P cld.pid -p 18081
-
-../server/chunkd -C $top_srcdir/test/server-test.cfg -E $*
-
-sleep 3
-
-exit 0
+exec sh ./start-daemon.real
diff --git a/test/start-daemon.real.in b/test/start-daemon.real.in
new file mode 100644
index 0000000..2e1df1d
--- /dev/null
+++ b/test/start-daemon.real.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+if [ -f cld.pid ]
+then
+	echo "cld.pid file found.  daemon still running?"
+	exit 1
+fi
+if [ -f chunkd.pid ]
+then
+	echo "chunkd.pid file found.  daemon still running?"
+	exit 1
+fi
+
+@CLDC_CMD@ -d data/cld -P cld.pid -p 18081
+
+../server/chunkd -C $top_srcdir/test/server-test.cfg -E $*
+
+sleep 3
+
+exit 0
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-30 21:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-29 21:26 [PATCH] chunkd: configure now detects location of cld program Matthew Farrellee
2009-07-30  1:35 ` Jeff Garzik
2009-07-30 14:27   ` Matthew Farrellee
2009-07-30  1:43 ` Jeff Garzik
2009-07-30 14:28   ` Matthew Farrellee
2009-07-30 20:46     ` Jeff Garzik
2009-07-30 21:34       ` Matthew Farrellee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.