Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69

The branch, jmb/monkey-cc has been created
        at  69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69 (commit)

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69
commit 69f358b85bd9d692c23ace2acb1d2ab9cdf7ba69
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    Monkey: hackery for aos3
    
    We need the Timer device, but there is no useful place to hook
    into monkey's initialisation stage (without changing monkey
    everywhere). Hack around the issue by doing it lazily and hoping
    that's enough.

diff --git a/frontends/monkey/aos3support.c b/frontends/monkey/aos3support.c
index fab3f04db..320a6f7e0 100644
--- a/frontends/monkey/aos3support.c
+++ b/frontends/monkey/aos3support.c
@@ -1,12 +1,37 @@
+#include <stdint.h>
+
 #include <sys/select.h>
 
 #include <proto/bsdsocket.h>
+#include <proto/dos.h>
+#include <proto/exec.h>
 #include <proto/timer.h>
 
 struct Device *TimerBase;
 
+struct TimeVal {
+       uint32_t Seconds;
+       uint32_t Microseconds;
+};
+
+struct TimeRequest {
+       struct IORequest Request;
+       struct TimeVal Time;
+};
+
 int select(int nfds, fd_set *read_fds, fd_set *write_fds,
                fd_set *except_fds, struct timeval *timeout)  {
+       if (TimerBase == NULL) {
+               /* Evil: in lieu of an initialiser, do it lazily */
+               static struct MsgPort *mp;
+               static struct TimeRequest *ioreq;
+               mp = CreateMsgPort();
+               ioreq = (struct TimeRequest *) CreateIORequest(
+                               mp, sizeof(struct TimeRequest));
+               OpenDevice("timer.device", UNIT_VBLANK,
+                               (struct IORequest *) ioreq, 0);
+               TimerBase = (struct Device *)ioreq->Request.io_Device;
+       }
        return WaitSelect(nfds, read_fds, write_fds, except_fds, timeout, NULL);
 }
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=0ddcb1636e110f3133630bcc454a2e1b40083422
commit 0ddcb1636e110f3133630bcc454a2e1b40083422
Author: John-Mark Bell <[email protected]>
Commit: John-Mark Bell <[email protected]>

    Monkey: bare minimum cross compilation support
    
    Builds, at least, for arm-*riscos*, and m68k-unknown-amigaos.

diff --git a/frontends/monkey/Makefile b/frontends/monkey/Makefile
index d2dae3e16..b4be6a3de 100644
--- a/frontends/monkey/Makefile
+++ b/frontends/monkey/Makefile
@@ -7,13 +7,61 @@
 # Monkey flag setup (using pkg-config)
 # ----------------------------------------------------------------------------
 
+ifeq ($(origin MONKEYCFLAGS),undefined)
+  __build=$(shell cc -dumpmachine 2>/dev/null)
+  __host=$(shell $(CC) -dumpmachine 2>/dev/null)
+  ifneq ($(__host),$(__build))
+    # Cross compiling
+    MONKEYCFLAGS := -static
+    ifeq ($(__host),arm-unknown-riscos)
+    endif
+    ifeq ($(__host),arm-riscos-gnueabi)
+    endif
+    ifeq ($(__host),m68k-unknown-amigaos)
+      MONKEYCFLAGS := $(MONKEYCFLAGS) -fomit-frame-pointer -Wno-error 
-Dnsamiga \
+                      -DPATH_MAX=1024 -D__m68k__ -m68020-60 -msoft-float \
+                      -DWITH_AMISSL -DWITH_OPENSSL -D__NO_NET_API 
-D__NO_NETINCLUDE_ERRNO -I$(GCCSDK_INSTALL_ENV)/netinclude \
+                     -U_POSIX_C_SOURCE \
+                      $(shell $(PKG_CONFIG) --cflags --static tre libcurl)
+      MONKEYEXTRASOURCES := aos3support.c
+    endif
+    ifeq ($(__host),ppc-amigaos)
+    endif
+  else
+    # Native
+    MONKEYCFLAGS :=
+  endif
+endif
+ifeq ($(origin MONKEYLDFLAGS),undefined)
+  __build=$(shell cc -dumpmachine 2>/dev/null)
+  __host=$(shell $(CC) -dumpmachine 2>/dev/null)
+  ifneq ($(__host),$(__build))
+    # Cross compiling
+    MONKEYLDFLAGS := -static
+    ifeq ($(__host),arm-unknown-riscos)
+    endif
+    ifeq ($(__host),arm-riscos-gnueabi)
+    endif
+    ifeq ($(__host),m68k-unknown-amigaos)
+      MONKEYLDFLAGS := $(MONKEYLDFLAGS) \
+                       $(shell $(PKG_CONFIG) --libs --static tre libcurl) \
+                      -L$(GCCSDKK_INSTALL_ENV)/lib \
+                       -lamisslauto -lpbl -liconv -lamiga -lc
+    endif
+
+  else
+    # Native
+    MONKEYLDFLAGS :=
+  endif
+endif
+
 CWARNFLAGS += -Werror
 
 CFLAGS += -std=c99 \
          -Dmonkey -Dnsmonkey -g \
          -DMONKEY_RESPATH=\"$(NETSURF_MONKEY_RESOURCES)\"
 
-LDFLAGS += -lm
+LDFLAGS += $(MONKEYLDFLAGS) -lm
 
 # ---------------------------------------------------------------------------
 # Target setup
@@ -45,13 +93,15 @@ ifeq ($(HOST),Windows_NT)
   CFLAGS += -U__STRICT_ANSI__
 endif
 
+CFLAGS += $(MONKEYCFLAGS)
+
 # ----------------------------------------------------------------------------
 # Source file setup
 # ----------------------------------------------------------------------------
 
 # S_MONKEY are sources purely for the MONKEY build
 S_FRONTEND := main.c output.c filetype.c schedule.c bitmap.c plot.c browser.c \
-       download.c 401login.c layout.c dispatch.c fetch.c
+       download.c 401login.c layout.c dispatch.c fetch.c $(MONKEYEXTRASOURCES)
 
 
 # This is the final source build list
diff --git a/frontends/monkey/aos3support.c b/frontends/monkey/aos3support.c
new file mode 100644
index 000000000..fab3f04db
--- /dev/null
+++ b/frontends/monkey/aos3support.c
@@ -0,0 +1,25 @@
+#include <sys/select.h>
+
+#include <proto/bsdsocket.h>
+#include <proto/timer.h>
+
+struct Device *TimerBase;
+
+int select(int nfds, fd_set *read_fds, fd_set *write_fds,
+               fd_set *except_fds, struct timeval *timeout)  {
+       return WaitSelect(nfds, read_fds, write_fds, except_fds, timeout, NULL);
+}
+
+int scandir(const char *dir, struct dirent ***namelist,
+  int (*filter)(const struct dirent *),
+  int (*compar)(const struct dirent **, const struct dirent **))
+{
+       /*\todo stub function, needs writing, preferably into clib2 */
+       return 0;
+}
+
+long long int strtoll(const char *nptr, char **endptr, int base)
+{
+       return (long long int)strtol(nptr, endptr, base);
+}
+


-----------------------------------------------------------------------


-- 
NetSurf Browser

Reply via email to