Skip to content

Commit c56f28b

Browse files
committed
Added Linux Makefiles for creating static libraries
for client_handler, v8function_handler, cpp_utils.
1 parent 30c46e0 commit c56f28b

File tree

11 files changed

+122
-23
lines changed

11 files changed

+122
-23
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.a
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CC = g++
2+
CCFLAGS = -g
3+
4+
SRC = client_handler.cpp
5+
OBJ = $(SRC:.cpp=.o)
6+
OUT = client_handler.a
7+
8+
INC = -I./../ -I/usr/include/python2.7 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0
9+
10+
.cpp.o:
11+
$(CC) $(INC) $(CCFLAGS) -c $< -o $@
12+
13+
$(OUT): $(OBJ)
14+
ar rcs $(OUT) $(OBJ)

cefpython/cef1/client_handler/client_handler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
#include "windows/setup/cefpython.h"
2727
#endif
2828

29+
#if defined(OS_LINUX)
30+
#include "linux/setup/cefpython.h"
31+
#endif
32+
2933
class ClientHandler : public CefClient,
3034
public CefLoadHandler,
3135
public CefKeyboardHandler,
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#ifndef __PYX_HAVE__cefpython_py27
2+
#define __PYX_HAVE__cefpython_py27
3+
4+
5+
#ifndef __PYX_HAVE_API__cefpython_py27
6+
7+
#ifndef __PYX_EXTERN_C
8+
#ifdef __cplusplus
9+
#define __PYX_EXTERN_C extern "C"
10+
#else
11+
#define __PYX_EXTERN_C extern
12+
#endif
13+
#endif
14+
15+
__PYX_EXTERN_C DL_IMPORT(void) LoadHandler_OnLoadEnd(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, int);
16+
__PYX_EXTERN_C DL_IMPORT(void) LoadHandler_OnLoadStart(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>);
17+
__PYX_EXTERN_C DL_IMPORT(bool) LoadHandler_OnLoadError(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, enum cef_handler_errorcode_t, CefString &, CefString &);
18+
__PYX_EXTERN_C DL_IMPORT(bool) KeyboardHandler_OnKeyEvent(CefRefPtr<CefBrowser>, enum cef_handler_keyevent_type_t, int, int, bool, bool);
19+
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_OnBeforeBrowse(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefRequest>, enum cef_handler_navtype_t, bool);
20+
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_OnBeforeResourceLoad(CefRefPtr<CefBrowser>, CefRefPtr<CefRequest>, CefString &, CefRefPtr<CefStreamReader> &, CefRefPtr<CefResponse>, int);
21+
__PYX_EXTERN_C DL_IMPORT(void) RequestHandler_OnResourceRedirect(CefRefPtr<CefBrowser>, CefString &, CefString &);
22+
__PYX_EXTERN_C DL_IMPORT(void) RequestHandler_OnResourceResponse(CefRefPtr<CefBrowser>, CefString &, CefRefPtr<CefResponse>, CefRefPtr<CefContentFilter> &);
23+
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_OnProtocolExecution(CefRefPtr<CefBrowser>, CefString &, bool &);
24+
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_GetDownloadHandler(CefRefPtr<CefBrowser>, CefString &, CefString &, int64, CefRefPtr<CefDownloadHandler> &);
25+
__PYX_EXTERN_C DL_IMPORT(bool) RequestHandler_GetAuthCredentials(CefRefPtr<CefBrowser>, bool, CefString &, int, CefString &, CefString &, CefString &, CefString &);
26+
__PYX_EXTERN_C DL_IMPORT(CefRefPtr<CefCookieManager>) RequestHandler_GetCookieManager(CefRefPtr<CefBrowser>, CefString &);
27+
__PYX_EXTERN_C DL_IMPORT(void) DisplayHandler_OnAddressChange(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefString &);
28+
__PYX_EXTERN_C DL_IMPORT(bool) DisplayHandler_OnConsoleMessage(CefRefPtr<CefBrowser>, CefString &, CefString &, int);
29+
__PYX_EXTERN_C DL_IMPORT(void) DisplayHandler_OnContentsSizeChange(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, int, int);
30+
__PYX_EXTERN_C DL_IMPORT(void) DisplayHandler_OnNavStateChange(CefRefPtr<CefBrowser>, bool, bool);
31+
__PYX_EXTERN_C DL_IMPORT(void) DisplayHandler_OnStatusMessage(CefRefPtr<CefBrowser>, CefString &, enum cef_handler_statustype_t);
32+
__PYX_EXTERN_C DL_IMPORT(void) DisplayHandler_OnTitleChange(CefRefPtr<CefBrowser>, CefString &);
33+
__PYX_EXTERN_C DL_IMPORT(bool) DisplayHandler_OnTooltip(CefRefPtr<CefBrowser>, CefString &);
34+
__PYX_EXTERN_C DL_IMPORT(bool) LifespanHandler_DoClose(CefRefPtr<CefBrowser>);
35+
__PYX_EXTERN_C DL_IMPORT(void) LifespanHandler_OnAfterCreated(CefRefPtr<CefBrowser>);
36+
__PYX_EXTERN_C DL_IMPORT(void) LifespanHandler_OnBeforeClose(CefRefPtr<CefBrowser>);
37+
__PYX_EXTERN_C DL_IMPORT(bool) LifespanHandler_RunModal(CefRefPtr<CefBrowser>);
38+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetViewRect(CefRefPtr<CefBrowser>, CefRect &);
39+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetScreenRect(CefRefPtr<CefBrowser>, CefRect &);
40+
__PYX_EXTERN_C DL_IMPORT(bool) RenderHandler_GetScreenPoint(CefRefPtr<CefBrowser>, int, int, int &, int &);
41+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPopupShow(CefRefPtr<CefBrowser>, bool);
42+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPopupSize(CefRefPtr<CefBrowser>, CefRect &);
43+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnPaint(CefRefPtr<CefBrowser>, cef_paint_element_type_t, std::vector<CefRect> &, void *);
44+
__PYX_EXTERN_C DL_IMPORT(void) RenderHandler_OnCursorChange(CefRefPtr<CefBrowser>, CefCursorHandle);
45+
__PYX_EXTERN_C DL_IMPORT(void) V8ContextHandler_OnContextCreated(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefV8Context>);
46+
__PYX_EXTERN_C DL_IMPORT(void) V8ContextHandler_OnContextReleased(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefV8Context>);
47+
__PYX_EXTERN_C DL_IMPORT(void) V8ContextHandler_OnUncaughtException(CefRefPtr<CefBrowser>, CefRefPtr<CefFrame>, CefRefPtr<CefV8Context>, CefRefPtr<CefV8Exception>, CefRefPtr<CefV8StackTrace>);
48+
__PYX_EXTERN_C DL_IMPORT(bool) V8FunctionHandler_Execute(CefRefPtr<CefV8Context>, int, CefString &, CefRefPtr<CefV8Value>, CefV8ValueList &, CefRefPtr<CefV8Value> &, CefString &);
49+
50+
#endif /* !__PYX_HAVE_API__cefpython_py27 */
51+
52+
#if PY_MAJOR_VERSION < 3
53+
PyMODINIT_FUNC initcefpython_py27(void);
54+
#else
55+
PyMODINIT_FUNC PyInit_cefpython_py27(void);
56+
#endif
57+
58+
#endif /* !__PYX_HAVE__cefpython_py27 */

cefpython/cef1/linux/setup/setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@ def CompileTimeConstants():
3636
# http_authentication not implemented on Linux.
3737
library_dirs=[
3838
r'./',
39-
r'./../../v8function_handler/Release_py%s/' % PYTHON_VERSION,
40-
r'./../../client_handler/Release_py%s/' % PYTHON_VERSION,
41-
r'./../../../cpp_utils/Release/',
39+
r'./../../v8function_handler/',
40+
r'./../../client_handler/',
41+
r'./../../../cpp_utils/',
4242
],
4343

4444
libraries=[
4545
'libcef_dll_wrapper',
46-
'v8function_handler_py%s' % PYTHON_VERSION, # Build with /MD.
47-
'client_handler_py%s' % PYTHON_VERSION, # Build with /MD.
46+
'v8function_handler',
47+
'client_handler',
4848
'cpp_utils'
4949
],
5050

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.a
Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
11
CC = g++
2+
CCFLAGS = -g
23

3-
INC = -I$PYTHONPATH/include
4-
INC = -I./../
4+
SRC = v8function_handler.cpp
5+
OBJ = $(SRC:.cpp=.o)
6+
OUT = v8function_handler.a
57

6-
CFLAGS = -Wall -g $(INC)
7-
utilObjs = v8function_handler.o
8+
INC = -I./../ -I/usr/include/python2.7 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0
89

9-
v8function_handler.a: $(utilObjs)
10-
ar rc $@ $(utilObjs)
11-
ranlib $@
10+
.cpp.o:
11+
$(CC) $(INC) $(CCFLAGS) -c $< -o $@
1212

13-
v8function_handler: v8function_handler.o v8function_handler.a
14-
$(CC) $(CFLAGS) v8function_handler.o -L ./ -lutil -o $@
15-
16-
v8function_handler.o: v8function_handler.cpp v8function_handler.h
17-
$(CC) $(CFLAGS) -c $<
18-
19-
clean:
20-
rm -rf *.o v8function_handler.a v8function_handler
21-
22-
all: v8function_handler
23-
.PHONY: all clean
13+
$(OUT): $(OBJ)
14+
ar rcs $(OUT) $(OBJ)

cefpython/cef1/v8function_handler/v8function_handler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#include "windows/setup/cefpython.h"
3333
#endif
3434

35+
#if defined(OS_LINUX)
36+
#include "linux/setup/cefpython.h"
37+
#endif
38+
3539
typedef void (*RemovePythonCallback_type)(
3640
int callbackID
3741
);

cefpython/cpp_utils/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
*.a

cefpython/cpp_utils/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
CC = g++
2+
CCFLAGS = -g
3+
4+
SRC = PaintBuffer.cpp
5+
OBJ = $(SRC:.cpp=.o)
6+
OUT = cpp_utils.a
7+
8+
INC = -I./../ -I/usr/include/python2.7 -I/usr/include/gtk-2.0 -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0
9+
10+
.cpp.o:
11+
$(CC) $(INC) $(CCFLAGS) -c $< -o $@
12+
13+
$(OUT): $(OBJ)
14+
ar rcs $(OUT) $(OBJ)

0 commit comments

Comments
 (0)