First commit for surf webext - surf - surf browser, a WebKit2GTK based browser
Log
Files
Refs
README
LICENSE
---
commit 315af78589c1eb00b45dd0ece32087dba5eb93e3
parent 723ff26c3618cf4db1ae34688509cbcdfed1412f
Author: Quentin Rameau 
Date:   Mon, 23 Nov 2015 22:12:00 +0100

First commit for surf webext

Diffstat:
  Makefile                            |      49 ++++++++++++++++++++++++++-----
  config.mk                           |       8 +++++++-
  libsurf-webext.c                    |       7 +++++++

3 files changed, 55 insertions(+), 9 deletions(-)
---
diff --git a/Makefile b/Makefile
@@ -6,30 +6,51 @@ include config.mk
 
 SRC = surf.c
 OBJ = $(SRC:.c=.o)
+LIBSRC = libsurf-webext.c
+LIBOBJ = $(LIBSRC:.c=.lo)
 
-all: options surf
+all: options libsurf-webext.la surf
 
 options:
         @echo surf build options:
-        @echo "CFLAGS   = $(SURF_CFLAGS)"
-        @echo "LDFLAGS  = $(SURF_LDFLAGS)"
-        @echo "CC       = $(CC)"
+        @echo "CFLAGS    = $(SURF_CFLAGS)"
+        @echo "LDFLAGS   = $(SURF_LDFLAGS)"
+        @echo "CC        = $(CC)"
+        @echo "LIBCFLAGS  = $(LIBCFLAGS)"
+        @echo "LIBLDFLAGS = $(LIBLDFLAGS)"
+        @echo "LIBTOOL    = $(LIBTOOL)"
+
+.SUFFIXES: .la .lo .o .c
 
 .c.o:
         @echo CC -c $<
         @$(CC) $(SURF_CFLAGS) -c $<
 
+.c.lo:
+        @echo libtool compile $<
+        @$(LIBTOOL) --mode compile --tag CC $(CC) $(LIBCFLAGS) -c $<
+
 $(OBJ): config.h config.mk
+$(LIBOBJ): config.mk
 
 config.h:
         @echo creating $@ from config.def.h
         @cp config.def.h $@
 
+libsurf-webext.la: $(LIBOBJ)
+        @echo libtool link $@
+        @$(LIBTOOL) --mode link --tag CC $(CC) $(LIBLDFLAGS) -o $@ \
+            libsurf-webext.lo -rpath $(DESTDIR)$(LIBPREFIX)
+
 surf: $(OBJ)
         @echo CC -o $@
         @$(CC) $(SURF_CFLAGS) -o $@ $(OBJ) $(SURF_LDFLAGS)
 
-clean:
+clean-lib:
+        @echo cleaning library
+        @rm -rf libsurf-webext.la .libs $(LIBOBJ) $(LIBOBJ:.lo=.o)
+
+clean: clean-lib
         @echo cleaning
         @rm -f surf $(OBJ)
 
@@ -47,7 +68,13 @@ dist: distclean
         @gzip surf-$(VERSION).tar
         @rm -rf surf-$(VERSION)
 
-install: all
+install-lib: libsurf-webext.la
+        @echo installing library file to $(DESTDIR)$(LIBPREFIX)
+        @mkdir -p $(DESTDIR)$(LIBPREFIX)
+        @$(LIBTOOL) --mode install install -c libsurf-webext.la \
+                $(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
+
+install: all install-lib
         @echo installing executable file to $(DESTDIR)$(PREFIX)/bin
         @mkdir -p $(DESTDIR)$(PREFIX)/bin
         @cp -f surf $(DESTDIR)$(PREFIX)/bin
@@ -57,10 +84,16 @@ install: all
         @sed "s/VERSION/$(VERSION)/g" < surf.1 > $(DESTDIR)$(MANPREFIX)/man1/surf.1
         @chmod 644 $(DESTDIR)$(MANPREFIX)/man1/surf.1
 
-uninstall:
+uninstall-lib:
+        @echo removing library file from $(DESTDIR)$(LIBPREFIX)
+        @$(LIBTOOL) --mode uninstall rm -f \
+            $(DESTDIR)$(LIBPREFIX)/libsurf-webext.la
+        @rm -df $(DESTDIR)$(LIBPREFIX) || true
+
+uninstall: uninstall-lib
         @echo removing executable file from $(DESTDIR)$(PREFIX)/bin
         @rm -f $(DESTDIR)$(PREFIX)/bin/surf
         @echo removing manual page from $(DESTDIR)$(MANPREFIX)/man1
         @rm -f $(DESTDIR)$(MANPREFIX)/man1/surf.1
 
-.PHONY: all options clean dist install uninstall
+.PHONY: all options clean-dist clean dist install-lib install uninstall-lib uninstall
diff --git a/config.mk b/config.mk
@@ -13,16 +13,21 @@ X11LIB = /usr/X11R6/lib
 
 GTKINC = `pkg-config --cflags gtk+-3.0 gcr-3 webkit2gtk-4.0`
 GTKLIB = `pkg-config --libs gtk+-3.0 gcr-3 webkit2gtk-4.0`
+WEBEXTINC = `pkg-config --cflags webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
+WEBEXTLIB = `pkg-config --libs webkit2gtk-4.0 webkit2gtk-web-extension-4.0`
 
 # includes and libs
 INCS = -I$(X11INC) $(GTKINC)
 LIBS = -L$(X11LIB) -lX11 $(GTKLIB) -lgthread-2.0
 
 # flags
-CPPFLAGS = -DVERSION=\"${VERSION}\" -DWEBEXTDIR=\"${LIBPREFIX}\" \
+CPPFLAGS = -DVERSION=\"$(VERSION)\" -DWEBEXTDIR=\"$(LIBPREFIX)\" \
            -D_DEFAULT_SOURCE -DGCR_API_SUBJECT_TO_CHANGE
 SURF_CFLAGS = $(INCS) $(CPPFLAGS) $(CFLAGS)
 SURF_LDFLAGS = $(LIBS) $(LDFLAGS)
+LIBCPPFLAGS = -DWEBEXTDIR=\"$(LIBPREFIX)\"
+LIBCFLAGS = $(WEBEXTINC) $(LIBCPPFLAGS) $(CFLAGS)
+LIBLDFLAGS = $(WEBEXTLIB) $(LDFLAGS)
 
 # Solaris
 #CFLAGS = -fast $(INCS) -DVERSION=\"$(VERSION)\"
@@ -30,3 +35,4 @@ SURF_LDFLAGS = $(LIBS) $(LDFLAGS)
 
 # compiler and linker
 #CC = c99
+LIBTOOL = libtool --quiet
diff --git a/libsurf-webext.c b/libsurf-webext.c
@@ -0,0 +1,7 @@
+#include 
+
+G_MODULE_EXPORT void
+webkit_web_extension_initialize(WebKitWebExtension *e)
+{
+        return;
+}