Skip to content

Commit

Permalink
Hardcode couchjs binary name
Browse files Browse the repository at this point in the history
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
davisp committed Oct 23, 2011
1 parent 47598c8 commit 0f8c86d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Expand Up @@ -219,7 +219,12 @@ AC_CHECK_LIB([$JS_LIB_BASE], [JS_GetStringCharsAndLength],
# Else, hope that 1.7.0 works # Else, hope that 1.7.0 works
LIBS="$OLD_LIBS" LIBS="$OLD_LIBS"


AC_DEFINE([COUCHJS_NAME], ["couchjs"], ["CouchJS executable name."])

if test x${IS_WINDOWS} = xTRUE; then 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 if test -f "$JS_LIB_DIR/$JS_LIB_BASE.dll"; then
# seamonkey 1.7- build layout on Windows # seamonkey 1.7- build layout on Windows
JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll" JS_LIB_BINARY="$JS_LIB_DIR/$JS_LIB_BASE.dll"
Expand Down
4 changes: 1 addition & 3 deletions src/couchdb/priv/couch_js/help.h
Expand Up @@ -13,8 +13,6 @@
#ifndef COUCHJS_HELP_H #ifndef COUCHJS_HELP_H
#define COUCHJS_HELP_H #define COUCHJS_HELP_H


#include <libgen.h>

#include "config.h" #include "config.h"


static const char VERSION_TEMPLATE[] = static const char VERSION_TEMPLATE[] =
Expand Down Expand Up @@ -55,7 +53,7 @@ static const char USAGE_TEMPLATE[] =
"\n" "\n"
"Report bugs at <%s>.\n"; "Report bugs at <%s>.\n";


#define BASENAME basename((char*)argv[0]) #define BASENAME COUCHJS_NAME


#define couch_version(basename) \ #define couch_version(basename) \
fprintf( \ fprintf( \
Expand Down

0 comments on commit 0f8c86d

Please sign in to comment.