From: Matthew Farrellee <matt@redhat.com>
To: hail-devel@vger.kernel.org
Subject: [PATCH] chunkd: configure now detects location of cld program
Date: Wed, 29 Jul 2009 16:26:03 -0500 [thread overview]
Message-ID: <4A70BE6B.7070906@redhat.com> (raw)
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
next reply other threads:[~2009-07-29 21:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 21:26 Matthew Farrellee [this message]
2009-07-30 1:35 ` [PATCH] chunkd: configure now detects location of cld program 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A70BE6B.7070906@redhat.com \
--to=matt@redhat.com \
--cc=hail-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.