openbsd-ports/editors/scintilla/patches/patch-gtk_makefile
steven 134affccfd upgrade to 1.72
based on diffs from new maintainer Jeremy Evans <jeremyevans0 at gmail.com>
2007-01-18 10:56:27 +00:00

115 lines
3.4 KiB
Plaintext

$OpenBSD: patch-gtk_makefile,v 1.5 2007/01/18 10:56:27 steven Exp $
--- gtk/makefile.orig Wed Dec 13 01:19:17 2006
+++ gtk/makefile Thu Jan 18 08:46:52 2007
@@ -7,7 +7,7 @@
# To force GTK+ 2 build, define GTK2 on the make command line.
# To force GTK+ 1 build, define GTK1 on the make command line.
-.SUFFIXES: .cxx .c .o .h .a
+.SUFFIXES: .cxx .c .o .h .a .so
CC = g++
CCOMP = gcc
AR = ar
@@ -17,14 +17,18 @@ ifeq ($(shell uname),Darwin)
RANLIB = ranlib
endif
-COMPLIB=../bin/scintilla.a
+COMPLIB=../bin/libscintilla.a
+LEXERLIB=../bin/libscintilla_lexers.a
+SHAREDLIB=../bin/libscintilla.so.${LIBscintilla_VERSION}
+SHAREDLEXER=../bin/libscintilla_lexers.so.${LIBscintilla_lexers_VERSION}
vpath %.h ../src ../include
vpath %.cxx ../src
-INCLUDEDIRS=-I ../include -I ../src
-CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -pedantic -Os -DGTK -DSCI_LEXER $(INCLUDEDIRS)
+INCLUDEDIRS=-I ../include -I ../src -I /usr/local/include
+CXXBASEFLAGS=-Wall -Wno-missing-braces -Wno-char-subscripts -pedantic -DGTK -DSCI_LEXER -Dunix $(INCLUDEDIRS)
+
ifdef NOTHREADS
THREADFLAGS=-DG_THREADS_IMPL_NONE
else
@@ -34,7 +38,7 @@ endif
ifdef DEBUG
CXXFLAGS=-DDEBUG -g $(CXXBASEFLAGS) $(THREADFLAGS)
else
-CXXFLAGS=-DNDEBUG -Os $(CXXBASEFLAGS) $(THREADFLAGS)
+CXXFLAGS+=-DNDEBUG $(CXXBASEFLAGS) $(THREADFLAGS)
endif
# If explicit setting of GTK1 or GTK2 then use that else look for
@@ -56,9 +60,13 @@ endif
endif
.cxx.o:
- $(CC) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $<
+ $(CXX) `$(CONFIGFLAGS)` $(CXXFLAGS) -c $<
+.cxx.so:
+ $(CXX) -fPIC `$(CONFIGFLAGS)` $(CXXFLAGS) -o $@ -c $<
.c.o:
$(CCOMP) `$(CONFIGFLAGS)` $(CXXFLAGS) -w -c $<
+.c.so:
+ $(CCOMP) -fPIC `$(CONFIGFLAGS)` $(CXXFLAGS) -w -o $@ -c $<
#++Autogenerated -- run src/LexGen.py to regenerate
#**LEXOBJS=\\\n\(\*.o \)
@@ -74,22 +82,52 @@ LexSpecman.o LexSpice.o LexSQL.o LexTADS
LexVerilog.o LexVHDL.o LexYAML.o
#--Autogenerated -- end of automatically generated section
-all: $(COMPLIB)
+ifeq (${NO_SHARED_LIBS},"yes")
+all: static
+else
+all: static shared
+endif
+static: $(COMPLIB) $(LEXERLIB)
+shared: $(SHAREDLIB) $(SHAREDLEXER)
+
+install: install-shared
+ mkdir -p ${PREFIX}/include/scintilla
+ install -m 444 ../include/*.h ${PREFIX}/include/scintilla
+ install -m 444 ${COMPLIB} ${LEXERLIB} ${PREFIX}/lib
+
+ifeq (${NO_SHARED_LIBS},"yes")
+install-shared:
+else
+install-shared:
+ install -m 444 ${SHAREDLIB} ${SHAREDLEXER} ${PREFIX}/lib
+endif
+
clean:
rm -f *.o $(COMPLIB)
deps:
- $(CC) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
+ $(CXX) -MM `$(CONFIGFLAGS)` $(CXXFLAGS) *.cxx ../src/*.cxx >deps.mak
-$(COMPLIB): DocumentAccessor.o WindowAccessor.o KeyWords.o StyleContext.o \
+LIBOBJS = DocumentAccessor.o WindowAccessor.o KeyWords.o StyleContext.o \
CharClassify.o Document.o CallTip.o \
ScintillaBase.o ContractionState.o Editor.o ExternalLexer.o PropSet.o PlatGTK.o \
KeyMap.o LineMarker.o ScintillaGTK.o CellBuffer.o ViewStyle.o \
RESearch.o Style.o Indicator.o AutoComplete.o UniConversion.o XPM.o \
$(MARSHALLER) $(LEXOBJS)
+
+$(COMPLIB): $(LIBOBJS)
$(AR) rc $@ $^
$(RANLIB) $@
+
+$(LEXERLIB): $(LEXOBJS)
+ $(AR) rc $@ $^
+ $(RANLIB) $@
+
+$(SHAREDLIB): $(addsuffix .so,$(basename $(LIBOBJS)))
+ $(CXX) -shared -fPIC -o $@ -Wl,-soname,$(notdir $(SHAREDLIB)) $^
+$(SHAREDLEXER): $(addsuffix .so,$(basename $(LEXOBJS)))
+ $(CXX) -shared -fPIC -o $@ -Wl,-soname,$(notdir $(SHAREDLEXER)) $^
# Automatically generate header dependencies with "make deps"
include deps.mak