From af7a6ae52890c6c158615068f2a48d40c52ec538 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Sun, 23 Oct 2011 12:27:35 -0500 Subject: 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. --- configure.ac | 5 +++++ src/couchdb/priv/couch_js/help.h | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 182e0eb5..6a5d8653 100644 --- a/configure.ac +++ b/configure.ac @@ -127,7 +127,12 @@ Is the Mozilla SpiderMonkey library installed?])])])])])])]) AC_SUBST(JS_LIB_BASE) +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 c42c9f59..41025942 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 - #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( \ -- cgit v1.2.3