Commit 0c84b972 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

freebsd port. addresses #1789

git-svn-id: file:///svn/toku/tokudb@12444 c7de825b-a66e-492c-adef-691d508d4ae1
parent 08360e01
#ifndef _TOKU_HTONL_H
#define _TOKU_HTONL_H
#if !__linux__
#if !__linux__ && !__FreeBSD__
#error
#endif
......
......@@ -5,12 +5,6 @@
#ident "Copyright (c) 2007, 2008, 2009 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 500
#endif
#define _FILE_OFFSET_BITS 64
// Portability first!
#include "stdint.h"
#include <toku_portability.h>
......
......@@ -64,6 +64,8 @@ endif
OPT_OPTFLAGS = -O3 -finline-functions
DBG_OPTFLAGS = -O0
SYSTEM = $(shell uname -s | tr [A-Z] [a-z])
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
......@@ -76,13 +78,21 @@ else ifeq ($(VERBOSE),1)
endif
CPPFLAGS = $(INCLUDEDIRS) -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include
ifeq ($(SYSTEM),freebsd)
CPPFLAGS += -DTOKU_ALLOW_DEPRECATED
endif
# TODO: 1398 Get rid of this hack.
CPPFLAGS+=-DBRT_LEVEL_STRADDLE_CALLBACK_LOGIC_NOT_READY=1
#CFLAG default options
# Add -Wconversion #DISABLED for now.
ifeq ($(SYSTEM),freebsd)
WERROR =
else
WERROR = -Werror
endif
WALL = -Wall -Wextra -Wcast-align -Wbad-function-cast -Wno-missing-noreturn
FORMAT = -Wmissing-format-attribute
......@@ -96,7 +106,7 @@ COMBINE_C = -combine -c
LIBPORTABILITY = $(TOKUROOT)lib/libtokuportability.$(AEXT)
LIBPORTABILITY_BUNDLE = $(TOKUROOT)lib/libtokuportability.bundle
PORTABILITY_HEADERS= $(TOKUROOT)linux
PORTABILITY_HEADERS= $(TOKUROOT)$(SYSTEM)
ALWAYS_LINK= $(LIBPORTABILITY) -lz -lpthread
ifeq ($(CC),icc)
ifeq ($(CYGWIN),)
......@@ -145,14 +155,14 @@ DEPEND_LINK += \
ifeq ($(CYGWIN),)
OS_CHOICE=linux
OS_CHOICE=$(SYSTEM)
OS_NOTCHOICE=windows
else ifneq ($(CC),icc)
OS_CHOICE=linux
OS_CHOICE=$(SYSTEM)
OS_NOTCHOICE=windows
else
OS_CHOICE=windows
OS_NOTCHOICE=linux
OS_NOTCHOICE=$(SYSTEM)
endif
DEPEND_COMPILE += $(wildcard $(TOKUROOT)$(OS_CHOICE)/*.h)
......@@ -289,7 +299,9 @@ LDFLAGS += -$(CRUNTIME)
CFLAGS += -$(CRUNTIME)
endif
# Need XOPEN_SOURCE=600 to get strtoll()
ifeq ($(SYSTEM),linux)
CPPFLAGS+=-D_SVID_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=600
endif
#TODO: Fix this up if we want to keep using CIL.
#ifeq ($(CIL),1)
......@@ -345,11 +357,11 @@ clean-default:
ifeq ($(SKIP_LIBPORTABILITYRULE),)
ifeq ($(CYGWIN),)
$(LIBPORTABILITY): $(TOKUROOT)linux/*.[ch]
pwd && cd $(TOKUROOT)linux && $(MAKE) install
$(LIBPORTABILITY): $(TOKUROOT)$(SYSTEM)/*.[ch]
pwd && cd $(TOKUROOT)$(SYSTEM) && $(MAKE) install
else ifneq ($(CC),icc)
$(LIBPORTABILITY): $(TOKUROOT)linux/*.[ch]
cd $(TOKUROOT)linux && $(MAKE) install
$(LIBPORTABILITY): $(TOKUROOT)$(SYSTEM)/*.[ch]
cd $(TOKUROOT)$(SYSTEM) && $(MAKE) install
else
$(LIBPORTABILITY): $(TOKUROOT)windows/*.[ch]
cd $(TOKUROOT)windows && $(MAKE) install
......
......@@ -64,6 +64,7 @@ typedef int64_t toku_off_t;
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#else
......
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