Commit f586a85b authored by tomas@mc05.(none)'s avatar tomas@mc05.(none)

portability/autoconf fixes

parent 6fb4bea1
......@@ -7,8 +7,10 @@ C++ := gcc$(GCC_VERSION)
CC := gcc$(GCC_VERSION)
AR_RCS := $(PURE) ar rcs
SO := gcc$(GCC_VERSION) -shared -lpthread -o
#SO := gcc$(GCC_VERSION) -shared -o
MAKEDEPEND := gcc$(GCC_VERSION) -M
#MAKEDEPEND := gcc$(GCC_VERSION) -M -nostdinc -nostdinc++
PIC := -fPIC
RPCGENFLAGS := -M -C -N
......@@ -27,7 +29,8 @@ else
CCFLAGS_WARNINGS = -Wno-long-long -Wall
endif
# Add these for more warnings -Weffc++ -W
CCFLAGS_TOP = -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
CCFLAGS_TOP =
#CCFLAGS_TOP = -DSAFE_MUTEX
CCFLAGS_TOP += -fno-rtti -fno-exceptions
ifeq (RELEASE, $(NDB_VERSION))
......@@ -53,4 +56,5 @@ LINK.cc = $(PURE) $(CC) $(CCFLAGS) $(LDFLAGS)
LINK.c = $(PURE) $(CC) $(CFLAGS) $(LDFLAGS)
LDFLAGS_LAST = -lpthread -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp
LDFLAGS_LAST = -lrt -lpthread $(NDB_TOP)/src/common/portlib/gcc.cpp
#LDFLAGS_LAST = -lrt $(NDB_TOP)/src/common/portlib/gcc.cpp $(NDB_TOP)/../mysys/libmysys.a $(NDB_TOP)/../dbug/libdbug.a $(NDB_TOP)/../regex/libregex.a $(NDB_TOP)/../strings/libmystrings.a -lpthread
......@@ -22,7 +22,6 @@
#ifdef NDB_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#endif
#ifdef __cplusplus
......
......@@ -21,6 +21,5 @@
#define CRLF "\r\n"
#include <sys/types.h>
#include <sys/stat.h>
#include <ndb_global.h>
#include <dirent.h>
......@@ -4,38 +4,16 @@ DIRS :=
ifeq ($(NDB_OS), SOFTOSE)
DIRS += ose
endif
else
ifeq ($(NDB_OS), OSE)
DIRS += ose
endif
ifeq ($(NDB_OS), SIMCELLO)
DIRS += ose
endif
ifeq ($(NDB_OS), LINUX)
DIRS += unix
endif
ifeq ($(NDB_OS), MACOSX)
DIRS += unix
endif
ifeq ($(NDB_OS), SOLARIS)
else
ifeq ($(NDB_OS), WIN32)
DIRS += win32
else
DIRS += unix
endif
ifeq ($(NDB_OS), SOLARIS6)
DIRS += unix
endif
ifeq ($(NDB_OS), HPUX)
DIRS += unix
endif
ifeq ($(NDB_OS), WIN32)
DIRS += win32
endif
......
......@@ -17,8 +17,7 @@
#include <ndb_global.h>
#include <sys/time.h>
#include <sys/mman.h>
long long getMilli();
long long getMicro();
void malloctest(int loopcount, int memsize, int touch);
......
......@@ -15,20 +15,26 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbMutex.h>
#include "NdbTCP.h"
#ifdef NDB_WIN32
static NdbMutex & LOCK_gethostbyname = * NdbMutex_Create();
#else
static NdbMutex LOCK_gethostbyname = NDB_MUTEX_INITIALIZER;
#endif
#ifdef NDB_SOLARIS
int
Ndb_getInAddr(struct in_addr * dst, const char *address) {
struct hostent host, * hostPtr;
char buf[1024];
int h_errno;
hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno);
struct hostent * hostPtr;
NdbMutex_Lock(&LOCK_gethostbyname);
hostPtr = gethostbyname(address);
if (hostPtr != NULL) {
dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
NdbMutex_Unlock(&LOCK_gethostbyname);
return 0;
}
NdbMutex_Unlock(&LOCK_gethostbyname);
/* Try it as aaa.bbb.ccc.ddd. */
dst->s_addr = inet_addr(address);
......@@ -37,13 +43,14 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
}
return -1;
}
#endif
#if defined NDB_LINUX || defined NDB_HPUX || defined NDB_MACOSX
#if 0
int
Ndb_getInAddr(struct in_addr * dst, const char *address) {
struct hostent * hostPtr;
hostPtr = gethostbyname(address);
struct hostent host, * hostPtr;
char buf[1024];
int h_errno;
hostPtr = gethostbyname_r(address, &host, &buf[0], 1024, &h_errno);
if (hostPtr != NULL) {
dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
return 0;
......@@ -57,4 +64,3 @@ Ndb_getInAddr(struct in_addr * dst, const char *address) {
return -1;
}
#endif
......@@ -17,7 +17,7 @@
#include <ndb_global.h>
#include <NdbThread.h>
#include <my_pthread.h>
#include <pthread.h>
#define MAX_THREAD_NAME 16
......
......@@ -10,7 +10,6 @@ DIRS := basictest perftest
SOURCES = \
Transporter.cpp \
SendBuffer.cpp \
SHM_Transporter.cpp \
TCP_Transporter.cpp \
TransporterRegistry.cpp \
Packer.cpp
......@@ -22,6 +21,7 @@ CCFLAGS_LOC += -I$(call fixpath,$(NDB_TOP)/include/kernel) \
ifeq ($(NDB_SHM), Y)
SOURCES += SHM_Transporter.cpp
ifeq ($(NDB_OS), WIN32)
SOURCES += SHM_Transporter.win32.cpp
else
......
......@@ -23,9 +23,7 @@
#include <NdbSleep.h>
#include <NdbOut.hpp>
#ifdef NDB_WIN32
#include <windows.h>
#else
#ifndef NDB_WIN32
#include <sys/ipc.h>
#include <sys/shm.h>
#endif
......
......@@ -78,10 +78,6 @@ NDB_MAIN(ndb_kernel){
char homePath[255];
NdbConfig_HomePath(homePath, 255);
#if defined (NDB_LINUX) || defined (NDB_SOLARIS)
/**
* This has only been tested with linux & solaris
*/
if (theConfig->getDaemonMode()) {
// Become a daemon
char lockfile[255], logfile[255];
......@@ -134,7 +130,6 @@ NDB_MAIN(ndb_kernel){
}
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
#endif
systemInfo(* theConfig,
theConfig->clusterConfigurationData().SizeAltData.logLevel);
......
......@@ -6,8 +6,6 @@ BIN_TARGET := mgmtsrvr
BIN_TARGET_LIBS :=
BIN_TARGET_ARCHIVES := mgmapi NDB_API mgmsrvcommon
LDFLAGS_LOC = -lpthread
ifneq ($(USE_EDITLINE), N)
BIN_TARGET_ARCHIVES += editline
DIRS := mkconfig
......
......@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <ndb_global.h>
#include <my_pthread.h>
#include <pthread.h>
#include "MgmtSrvr.hpp"
#include "MgmtErrorReporter.hpp"
......
......@@ -22,6 +22,7 @@ Name: Ndb.cpp
******************************************************************************/
#include <ndb_global.h>
#include <pthread.h>
#include "NdbApiSignal.hpp"
#include "NdbImpl.hpp"
......@@ -1244,7 +1245,7 @@ Ndb::printState(const char* fmt, ...)
NdbMutex_Lock(&print_state_mutex);
bool dups = false;
ndbout << buf << " ndb=" << hex << this << dec;
#ifdef NDB_LINUX
#ifndef NDB_WIN32
ndbout << " thread=" << (int)pthread_self();
#endif
ndbout << endl;
......
......@@ -12,8 +12,6 @@ BIN_TARGET := ndb_rep
BIN_TARGET_LIBS :=
BIN_TARGET_ARCHIVES += editline repstorage repadapters reprequestor reptransfer mgmapi NDB_API mgmsrvcommon
LDFLAGS_LOC = -lpthread
SOURCES = \
RepMain.cpp \
Requestor.cpp \
......
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