Merge pull request #355 from 0-wiz-0/master

Fix build on NetBSD.
This commit is contained in:
Vas Crabb 2015-10-02 19:06:05 +10:00
commit 92ba3e7d1c
4 changed files with 10 additions and 9753 deletions

View File

@ -1,105 +0,0 @@
# Make file for Scintilla on Linux or compatible OS
# Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
# The License.txt file describes the conditions under which this software may be distributed.
# This makefile assumes GCC 4.3 is used and changes will be needed to use other compilers.
# GNU make does not like \r\n line endings so should be saved to CVS in binary form.
# Builds for GTK+ 2 and no longer supports GTK+ 1.
# Also works with ming32-make on Windows.
.SUFFIXES: .cxx .c .o .h .a
ifdef CLANG
CC = clang++
CCOMP = clang
# Can choose aspect to sanitize: address and undefined can simply change SANITIZE but for
# thread also need to create Position Independent Executable -> search online documentation
SANITIZE = address
#SANITIZE = undefined
else
CC = g++ -mrecip
CCOMP = gcc -mrecip
endif
AR = ar
RANLIB = touch
ifdef GTK3
GTKVERSION=gtk+-3.0
else
GTKVERSION=gtk+-2.0
endif
# Environment variable windir always defined on Win32
ifndef windir
ifeq ($(shell uname),Darwin)
RANLIB = ranlib
endif
endif
ifdef windir
DEL = del /q
COMPLIB=..\bin\scintilla.a
else
DEL = rm -f
COMPLIB=../bin/scintilla.a
endif
vpath %.h ../src ../include ../lexlib
vpath %.cxx ../src ../lexlib ../lexers
INCLUDEDIRS=-I ../include -I ../src -I ../lexlib
ifdef CHECK_DEPRECATED
DEPRECATED=-DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DDISABLE_GDK_FONT
endif
CXXBASEFLAGS=-Wall -pedantic -DGTK -DSCI_LEXER $(INCLUDEDIRS) $(DEPRECATED)
ifdef NOTHREADS
THREADFLAGS=-DG_THREADS_IMPL_NONE
else
THREADFLAGS=
endif
ifdef DEBUG
ifdef CLANG
CTFLAGS=-DDEBUG -g -fsanitize=$(SANITIZE) $(CXXBASEFLAGS) $(THREADFLAGS)
else
CTFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS)
endif
else
CTFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
endif
CFLAGS:=$(CTFLAGS)
CXXTFLAGS:=--std=c++0x $(CTFLAGS)
CONFIGFLAGS:=$(shell pkg-config --cflags $(GTKVERSION))
MARSHALLER=scintilla-marshal.o
.cxx.o:
$(CC) $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) -c $<
.c.o:
$(CCOMP) $(CONFIGFLAGS) $(CFLAGS) -w -c $<
LEXOBJS:=$(addsuffix .o,$(basename $(notdir $(wildcard ../lexers/Lex*.cxx))))
all: $(COMPLIB)
clean:
$(DEL) *.o $(COMPLIB) *.plist
analyze:
clang --analyze $(CONFIGFLAGS) $(CXXTFLAGS) $(CXXFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx
deps:
$(CC) -MM $(CONFIGFLAGS) $(CXXTFLAGS) *.cxx ../src/*.cxx ../lexlib/*.cxx ../lexers/*.cxx | sed -e 's/\/usr.* //' | grep [a-zA-Z] >deps.mak
$(COMPLIB): Accessor.o CharacterSet.o LexerBase.o LexerModule.o LexerSimple.o StyleContext.o WordList.o \
CharClassify.o Decoration.o Document.o PerLine.o Catalogue.o CallTip.o CaseConvert.o CaseFolder.o \
ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSetSimple.o PlatGTK.o \
KeyMap.o LineMarker.o PositionCache.o ScintillaGTK.o CellBuffer.o CharacterCategory.o ViewStyle.o \
RESearch.o RunStyles.o Selection.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
$(MARSHALLER) $(LEXOBJS)
$(AR) rc $@ $^
$(RANLIB) $@
# Automatically generate header dependencies with "make deps"
include deps.mak

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,7 @@
#elif BX_PLATFORM_ANDROID \
|| BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_FREEBSD \
|| BX_PLATFORM_NETBSD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
@ -24,6 +25,7 @@
# include <sched.h> // sched_yield
# if BX_PLATFORM_FREEBSD \
|| BX_PLATFORM_NETBSD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_NACL \
|| BX_PLATFORM_OSX \
@ -103,7 +105,7 @@ namespace bx
return (pid_t)::syscall(SYS_gettid);
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD
// Casting __nc_basic_thread_data*... need better way to do this.
return *(uint32_t*)::pthread_self();
#else

View File

@ -15,6 +15,7 @@
#define BX_PLATFORM_ANDROID 0
#define BX_PLATFORM_EMSCRIPTEN 0
#define BX_PLATFORM_FREEBSD 0
#define BX_PLATFORM_NETBSD 0
#define BX_PLATFORM_IOS 0
#define BX_PLATFORM_LINUX 0
#define BX_PLATFORM_NACL 0
@ -187,6 +188,9 @@
#elif defined(__FreeBSD__)
# undef BX_PLATFORM_FREEBSD
# define BX_PLATFORM_FREEBSD 1
#elif defined(__NetBSD__)
# undef BX_PLATFORM_NETBSD
# define BX_PLATFORM_NETBSD 1
#else
# error "BX_PLATFORM_* is not defined!"
#endif //
@ -195,6 +199,7 @@
|| BX_PLATFORM_ANDROID \
|| BX_PLATFORM_EMSCRIPTEN \
|| BX_PLATFORM_FREEBSD \
|| BX_PLATFORM_NETBSD \
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_LINUX \
|| BX_PLATFORM_NACL \
@ -244,6 +249,8 @@
BX_STRINGIZE(__EMSCRIPTEN_tiny__)
#elif BX_PLATFORM_FREEBSD
# define BX_PLATFORM_NAME "FreeBSD"
#elif BX_PLATFORM_NETBSD
# define BX_PLATFORM_NAME "NetBSD"
#elif BX_PLATFORM_IOS
# define BX_PLATFORM_NAME "iOS"
#elif BX_PLATFORM_LINUX