From ff2c1ae9669e5b164a36bd372729948537110928 Mon Sep 17 00:00:00 2001 From: Vlad Mironov Date: Mon, 26 May 2014 07:14:46 +0000 Subject: another gcc compilation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@9311 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/m_skin_eng.h | 4 +- plugins/TrafficCounter/.cproject | 31 ++++++++------ plugins/TrafficCounter/makefile_gcc | 78 ++++++++++++++++++++++++++++++++++ plugins/TrafficCounter/res/resource.rc | 4 ++ 4 files changed, 103 insertions(+), 14 deletions(-) create mode 100644 plugins/TrafficCounter/makefile_gcc diff --git a/plugins/ExternalAPI/m_skin_eng.h b/plugins/ExternalAPI/m_skin_eng.h index b00178d623..a25724a485 100644 --- a/plugins/ExternalAPI/m_skin_eng.h +++ b/plugins/ExternalAPI/m_skin_eng.h @@ -188,8 +188,6 @@ int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * obje } -//Paint ObjectID -int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID); //Register object with predefined style int __inline CreateGlyphedObjectDefStyle(char * ObjID,BYTE defStyle); @@ -252,6 +250,8 @@ static BOOL __inline ScreenToClientRect(HWND hWnd, LPRECT lpRect) // prm.szObjectID=ObjID; // return CallService(MS_SKIN_REGISTERDEFOBJECT,(WPARAM)&prm,0); //} + +//Paint ObjectID static int __inline SkinDrawGlyph(HDC hdc, RECT * rcSize, RECT * rcClip, char * objectID) { SKINDRAWREQUEST rq; diff --git a/plugins/TrafficCounter/.cproject b/plugins/TrafficCounter/.cproject index d1ce15cca3..5604f09f6b 100644 --- a/plugins/TrafficCounter/.cproject +++ b/plugins/TrafficCounter/.cproject @@ -34,7 +34,7 @@ - + @@ -87,27 +87,27 @@ - + - + - + - - + + - + - + - + - + + + + + + + + diff --git a/plugins/TrafficCounter/makefile_gcc b/plugins/TrafficCounter/makefile_gcc new file mode 100644 index 0000000000..5baf60ce0e --- /dev/null +++ b/plugins/TrafficCounter/makefile_gcc @@ -0,0 +1,78 @@ +ifndef CFG + $(error Specify configuration: CFG=Release|Debug) +endif + +COMPILER_OPTS = -c -Wall -fmessage-length=0 -fpermissive -fno-exceptions \ + -DUNICODE -D_UNICODE +INCLUDE_PATH = -I../../Include -I../../Include/msapi -I../ExternalAPI +LINKER_OPTS = -nostartfiles -nodefaultlibs -nostdlib -shared -Wl,-Map,$(OUTDIR)/$(PROJECT_NAME).map -Wl,-e,_DllMain@12 +LIBRARIES = -lgcc -lmsvcrt -lkernel32 -lshell32 -luser32 -lcomctl32 -lgdi32 -lmsimg32 -loleaut32 $(FINDIR)/lib/mir_core.lib + +ifeq ($(CFG), Release) + COMPILER_OPTS += -O2 -Os -DNDEBUG + LINKER_OPTS += -s +else + ifeq ($(CFG), Debug) + COMPILER_OPTS += -O0 -g3 -D_DEBUG + else + $(error Invalid configuration specfied: $(CFG)) + endif +endif + +PROJECT_NAME = TrafficCounter +SRCDIR = src +OUTDIR = $(CFG) +FINDIR = ../../bin +OUTNAME = $(FINDIR)/$(CFG)/Plugins/$(PROJECT_NAME).dll + +COMPILER = gcc +LINKER = gcc +RSC = windres + +SRCS = $(SRCDIR)/TrafficCounter.cpp \ + $(SRCDIR)/misc.cpp \ + $(SRCDIR)/options.cpp \ + $(SRCDIR)/opttree.cpp \ + $(SRCDIR)/statistics.cpp \ + $(SRCDIR)/vars.cpp + +OBJECTS = $(OUTDIR)/TrafficCounter.obj \ + $(OUTDIR)/misc.obj \ + $(OUTDIR)/options.obj \ + $(OUTDIR)/opttree.obj \ + $(OUTDIR)/statistics.obj \ + $(OUTDIR)/vars.obj \ + $(OUTDIR)/resource.res + +DEPFILE = $(OUTDIR)/$(PROJECT_NAME).dep + +ALL: $(OUTDIR) depfile + @$(MAKE) USE_DEPFILE=1 -f makefile_gcc build + @echo Done. + +$(OUTDIR): + @mkdir -pv $(OUTDIR) + +.PHONY: depfile +depfile: + @echo Rebuilding dependencies... + $(COMPILER) -MM $(INCLUDE_PATH) $(SRCS) > $(DEPFILE) + +.PHONY: build +build: $(OUTNAME) + +$(OUTNAME): $(OBJECTS) + @echo Building $(OUTNAME)... + @$(LINKER) $(LINKER_OPTS) $(LIBRARIES_PATH) -o $(OUTNAME) $(OBJECTS) $(LIBRARIES) + +ifdef USE_DEPFILE + include $(DEPFILE) +endif + +$(OUTDIR)/%.obj : $(SRCDIR)/%.cpp + @echo Compliling $< + @$(COMPILER) $(INCLUDE_PATH) -o $@ $(COMPILER_OPTS) $< + +$(OUTDIR)/%.res : res/%.rc + @echo Compiling resources... + @$(RSC) $(INCLUDE_PATH) -i $< -o $@ -J RC -O COFF -c 0x4E3 diff --git a/plugins/TrafficCounter/res/resource.rc b/plugins/TrafficCounter/res/resource.rc index c14b8a8aaa..7dff79bb8a 100644 --- a/plugins/TrafficCounter/res/resource.rc +++ b/plugins/TrafficCounter/res/resource.rc @@ -20,6 +20,10 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #pragma code_page(1251) +#ifdef __GNUC__ +#include "version.rc" +#endif + ///////////////////////////////////////////////////////////////////////////// // // Icon -- cgit v1.2.3