Permalink
Browse files

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.
  • Loading branch information...
1 parent 47598c8 commit 0f8c86d9387ced39743a0d22c6e54aa39a38508e @davisp davisp committed Oct 23, 2011
Showing with 6 additions and 3 deletions.
  1. +5 −0 configure.ac
  2. +1 −3 src/couchdb/priv/couch_js/help.h
View
@@ -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"
@@ -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( \

0 comments on commit 0f8c86d

Please sign in to comment.