summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2011-10-23 12:27:35 -0500
committerPaul Joseph Davis <davisp@apache.org>2011-10-23 12:27:35 -0500
commit0f8c86d9387ced39743a0d22c6e54aa39a38508e (patch)
tree014cbb53eca16bf4e3d8ced67538cbf1ec388739
parent47598c85ad0727299c89d28b5697b749b3096a54 (diff)
downloadcouchdb-0f8c86d9387ced39743a0d22c6e54aa39a38508e.tar.gz
Hardcode couchjs binary name
Windows doesn't have the libgen.h header or an easily identified basename function. Instead of playing games we just configure the name with autoconf and run with that.
-rw-r--r--configure.ac5
-rw-r--r--src/couchdb/priv/couch_js/help.h4
2 files changed, 6 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index f7cf955ce..202b76110 100644
--- a/configure.ac
+++ b/configure.ac
@@ -219,7 +219,12 @@ AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
# Else, hope that 1.7.0 works
LIBS="$OLD_LIBS"
+AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."])
+
if test x${IS_WINDOWS} = xTRUE; then
+
+ AC_DEFINE([COUCHJS_NAME], ["couchjs.exe"], ["CouchJS executable name."])
+
if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then
# seamonkey 1.7- build layout on Windows
JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll"
diff --git a/src/couchdb/priv/couch_js/help.h b/src/couchdb/priv/couch_js/help.h
index c42c9f592..410259422 100644
--- a/src/couchdb/priv/couch_js/help.h
+++ b/src/couchdb/priv/couch_js/help.h
@@ -13,8 +13,6 @@
#ifndef COUCHJS_HELP_H
#define COUCHJS_HELP_H
-#include <libgen.h>
-
#include "config.h"
static const char VERSION_TEMPLATE[] =
@@ -55,7 +53,7 @@ static const char USAGE_TEMPLATE[] =
"\n"
"Report bugs at <%s>.\n";
-#define BASENAME basename((char*)argv[0])
+#define BASENAME COUCHJS_NAME
#define couch_version(basename) \
fprintf( \