Commit 3bb1ede0 authored by Yoni Fogel's avatar Yoni Fogel

[t:2517] utils and db-benchmark-test now compile statically only for windows

git-svn-id: file:///svn/toku/tokudb@19292 c7de825b-a66e-492c-adef-691d508d4ae1
parent 0ea12bb4
......@@ -144,16 +144,14 @@ $(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
$(SCANRACE_TDB): scanrace.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(OFILES) $(LINK_MUST_BE_LAST)
else
ifeq ($(OS_CHOICE),windows)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): $(WIN_YDB) $(PTHREAD_LOCAL)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): LINK_FILES+=$(WIN_YDB)
else
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): DLINK_FILES=$(TDB_DLINK_FILES)
ifeq ($(SOEXT),dll) #Windows does not support rpath.
$(TOKUDB): $(TOKUROOT)lib/$(TOKUDB)
cp $< $@
$(TOKUROOT)lib/$(TOKUDB):
cd $(@D) && $(MAKE) $(@F).install
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): $(TOKUDB) $(PTHREAD_LOCAL)
endif
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): RPATH_DIRS=$(dir $(TDB_DLINK_FILES))
endif
$(TARGET_TDB): db-benchmark-test.c $(PTHREAD_LOCAL)
$(CC) $< $(BIN_FROM_C_FLAGS) $(LINK_MUST_BE_LAST)
$(SCANSCAN_TDB): scanscan.c $(PTHREAD_LOCAL)
......
......@@ -3,8 +3,8 @@
/* Insert a bunch of stuff */
#include <toku_portability.h>
#include "tokudb_common_funcs.h"
#include <toku_time.h>
#include <db.h>
#include <toku_assert.h>
#include <errno.h>
#include <string.h>
......@@ -544,7 +544,7 @@ test1514(void) {
}
#endif
int main (int argc, const char *const argv[]) {
static int test_main (int argc, char *const argv[]) {
struct timeval t1,t2,t3;
long long total_n_items = default_n_items;
char *endptr;
......
/* Scan the bench.tokudb/bench.db over and over. */
#include <toku_portability.h>
#include "tokudb_common_funcs.h"
#include <toku_assert.h>
#include <db.h>
#include <errno.h>
......@@ -132,7 +133,7 @@ static void scanrace_lwc (void) {
printf("LWC Scan %lld bytes (%d rows) in %9.6fs at %9fMB/s\n", e.totalbytes, e.rowcounter, tdiff, 1e-6*e.totalbytes/tdiff);
}
int main (int argc, const char *const argv[]) {
static int test_main (int argc, char *const argv[]) {
parse_args(argc,argv);
......
......@@ -2,6 +2,7 @@
#define DONT_DEPRECATE_MALLOC
#include <toku_portability.h>
#include "tokudb_common_funcs.h"
#include <toku_assert.h>
#include <db.h>
#include <errno.h>
......@@ -540,7 +541,7 @@ static void scanscan_verify (void) {
#endif
int main (int argc, const char *const argv[]) {
static int test_main (int argc, char *const argv[]) {
parse_args(argc,argv);
......
#if !defined(TOKUDB_COMMON_FUNCS_H)
#define TOKUDB_COMMON_FUNCS_H
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
#include <db.h>
#include <memory.h>
#if defined(TOKUDB) && TOKU_WINDOWS
#include <ydb.h>
#endif
static int test_main (int argc, char *const argv[]);
int
main(int argc, char *const argv[]) {
int r;
#if defined(TOKUDB) && TOKU_WINDOWS
toku_ydb_init();
#endif
#if !defined(TOKUDB) && DB_VERSION_MINOR==4 && DB_VERSION_MINOR == 7
r = db_env_set_func_malloc(toku_malloc); assert(r==0);
r = db_env_set_func_free(toku_free); assert(r==0);
r = db_env_set_func_realloc(toku_realloc); assert(r==0);
#endif
r = test_main(argc, argv);
#if defined(TOKUDB) && TOKU_WINDOWS
toku_ydb_destroy();
#endif
return r;
}
#endif /* #if !defined(TOKUDB_COMMON_H) */
......@@ -38,10 +38,16 @@ UTILS= \
BDB_UTILS=$(patsubst %$(BINSUF),%.bdb$(BINSUF),$(UTILS))
STATIC_UTILS=$(patsubst %$(BINSUF),%_static$(BINSUF),$(UTILS))
ifeq ($(OS_CHOICE),windows)
$(UTILS): LINK_FILES+=$(WIN_YDB)
$(UTILS): $(WIN_YDB)
else
$(UTILS): DLINK_FILES=$(TOKUROOT)lib/libtokudb.$(SOEXT)
$(STATIC_UTILS): LINK_FILES+=$(TOKUROOT)lib/libtokudb.$(AEXT)
$(UTILS) $(STATIC_UTILS): RPATH_DIRS+=$(TOKUROOT)lib
endif
#empty
ifeq ($(OS_CHOICE),windows)
......
......@@ -239,14 +239,14 @@ resend_signals(void) {
}
#include <memory.h>
#if IS_TDB && !TOKU_WINDOWS && TDB_IS_STATIC
#if IS_TDB && (TOKU_WINDOWS || TDB_IS_STATIC)
#include <ydb.h>
#endif
static int test_main (int argc, char *const argv[]);
int
main(int argc, char *const argv[]) {
int r;
#if IS_TDB && !TOKU_WINDOWS && TDB_IS_STATIC
#if IS_TDB && (TOKU_WINDOWS || TDB_IS_STATIC)
toku_ydb_init();
#endif
#if !IS_TDB && DB_VERSION_MINOR==4 && DB_VERSION_MINOR == 7
......@@ -255,7 +255,7 @@ main(int argc, char *const argv[]) {
r = db_env_set_func_realloc(toku_realloc); assert(r==0);
#endif
r = test_main(argc, argv);
#if IS_TDB && !TOKU_WINDOWS && TDB_IS_STATIC
#if IS_TDB && (TOKU_WINDOWS || TDB_IS_STATIC)
toku_ydb_destroy();
#endif
return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment