summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2008-08-11 16:44:12 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2008-08-11 16:44:12 +0000
commit25018c455b1297b72bb793a8eba7bc9426e28326 (patch)
tree438e57f78edd43f3b0e20142f5e25a94368544c4
parent1124712760b2dbcd73c67a8e7249b85d860668fc (diff)
downloadnetsurf-25018c455b1297b72bb793a8eba7bc9426e28326.tar.gz
netsurf-25018c455b1297b72bb793a8eba7bc9426e28326.tar.bz2
Make nsgtk compile on Mac OS X.
svn path=/trunk/netsurf/; revision=5031
-rw-r--r--Makefile24
-rw-r--r--Makefile.config7
-rw-r--r--desktop/browser.c1
-rw-r--r--desktop/options.c1
-rw-r--r--image/mng.c7
-rw-r--r--render/imagemap.c1
-rw-r--r--render/list.c1
-rw-r--r--render/textplain.c1
-rw-r--r--utils/config.h3
-rw-r--r--utils/utf8.c2
-rw-r--r--utils/utils.c1
-rw-r--r--utils/utils.h3
12 files changed, 37 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index a207877bf..262891aa0 100644
--- a/Makefile
+++ b/Makefile
@@ -60,12 +60,6 @@ else
# Haiku implements the BeOS API
HOST := beos
endif
- ifeq ($(HOST),AmigaOS)
- HOST := amiga
- ifeq ($(TARGET),)
- TARGET := amiga
- endif
- endif
ifeq ($(HOST),beos)
# Build happening on BeOS platform, default target is BeOS backend
ifeq ($(TARGET),)
@@ -74,9 +68,21 @@ else
# BeOS still uses gcc2
GCCVER := 2
else
- # Build happening on non-RO platform, default target is GTK backend
- ifeq ($(TARGET),)
- TARGET := gtk
+ ifeq ($(HOST),AmigaOS)
+ HOST := amiga
+ ifeq ($(TARGET),)
+ TARGET := amiga
+ endif
+ GCCVER := 2
+ else
+ ifeq ($(HOST),Darwin)
+ HOST := macosx
+ endif
+
+ # Default target is GTK backend
+ ifeq ($(TARGET),)
+ TARGET := gtk
+ endif
endif
endif
endif
diff --git a/Makefile.config b/Makefile.config
index 362db38f9..96e7646c7 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -26,7 +26,7 @@ NETSURF_USE_JPEG := YES
NETSURF_USE_MNG := YES
# Use libharu to enable PDF export and GTK printing support. There is no
-# auto-detection available for this, as it does not have a pkg-config file
+# auto-detection available for this, as it does not have a pkg-config file.
# Valid options: YES, NO
NETSURF_USE_HARU_PDF := YES
@@ -103,6 +103,11 @@ ifeq ($(TARGET),gtk)
# Valid options: YES, NO, AUTO
NETSURF_USE_ROSPRITE := AUTO
+ # Configuration overrides for Mac OS X
+ ifeq ($(HOST),macosx)
+ NETSURF_USE_LIBICONV_PLUG := NO
+ NETSURF_USE_HARU_PDF := NO
+ endif
endif
# ----------------------------------------------------------------------------
diff --git a/desktop/browser.c b/desktop/browser.c
index 0b9c2a638..899457b74 100644
--- a/desktop/browser.c
+++ b/desktop/browser.c
@@ -31,6 +31,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <math.h>
#include <sys/select.h>
#include "curl/curl.h"
diff --git a/desktop/options.c b/desktop/options.c
index 8668afa74..c289cb0b6 100644
--- a/desktop/options.c
+++ b/desktop/options.c
@@ -30,6 +30,7 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
#include <libxml/HTMLparser.h>
#include <libxml/HTMLtree.h>
#include "content/urldb.h"
diff --git a/image/mng.c b/image/mng.c
index e4e375922..d6902f4e9 100644
--- a/image/mng.c
+++ b/image/mng.c
@@ -383,9 +383,10 @@ mng_uint32 nsmng_gettickcount(mng_handle mng) {
static bool start = true;
static time_t t0;
struct timeval tv;
-#if defined(__SVR4) && defined(__sun) || defined(__NetBSD__)
- /* Solaris and NetBSD don't have this structure, and ignores the second
- * parameter to gettimeofday()
+#if defined(__SVR4) && defined(__sun) || defined(__NetBSD__) || \
+ defined(__APPLE__)
+ /* Solaris, NetBSD, and OS X don't have this structure, and ignore the
+ * second parameter to gettimeofday()
*/
int tz;
#else
diff --git a/render/imagemap.c b/render/imagemap.c
index af442484f..9f1c3bf95 100644
--- a/render/imagemap.c
+++ b/render/imagemap.c
@@ -23,6 +23,7 @@
#include <assert.h>
#include <stdbool.h>
#include <string.h>
+#include <strings.h>
#include "content/content.h"
#include "render/box.h"
#include "render/imagemap.h"
diff --git a/render/list.c b/render/list.c
index 5bcf36ffc..8b5ef698e 100644
--- a/render/list.c
+++ b/render/list.c
@@ -23,6 +23,7 @@
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include "css/css.h"
#include "render/list.h"
#include "utils/log.h"
diff --git a/render/textplain.c b/render/textplain.c
index f85906a10..9503b3dad 100644
--- a/render/textplain.c
+++ b/render/textplain.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <stddef.h>
#include <string.h>
+#include <strings.h>
#include <math.h>
#include <iconv.h>
#include "content/content.h"
diff --git a/utils/config.h b/utils/config.h
index 2e586974c..deee87150 100644
--- a/utils/config.h
+++ b/utils/config.h
@@ -24,7 +24,8 @@
/* Try to detect which features the target OS supports */
#define HAVE_STRNDUP
-#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun))
+#if defined(__FreeBSD__) || (defined(__SRV4) && defined(__sun)) || \
+ defined(__APPLE__)
/* FreeBSD and Solaris do not have this function, so
* we implement it ourselves in util.c
*/
diff --git a/utils/utf8.c b/utils/utf8.c
index 2ebac31b6..4c3c612f5 100644
--- a/utils/utf8.c
+++ b/utils/utf8.c
@@ -25,8 +25,10 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+#include <strings.h>
#include <iconv.h>
+#include "utils/config.h"
#include "utils/log.h"
#include "utils/utf8.h"
diff --git a/utils/utils.c b/utils/utils.c
index cf5b5276e..9f72be0ee 100644
--- a/utils/utils.c
+++ b/utils/utils.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <strings.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/time.h>
diff --git a/utils/utils.h b/utils/utils.h
index 49b67528c..cf66aedca 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -75,7 +75,8 @@ void regcomp_wrapper(regex_t *preg, const char *regex, int cflags);
void unicode_transliterate(unsigned int c, char **r);
char *human_friendly_bytesize(unsigned long bytesize);
const char *rfc1123_date(time_t t);
-#if !(defined(_GNU_SOURCE) || defined(__NetBSD__)) || defined(riscos)
+#if !(defined(_GNU_SOURCE) || defined(__NetBSD__)) || defined(riscos) || \
+ defined(__APPLE__)
char *strcasestr(const char *haystack, const char *needle);
#endif
unsigned int wallclock(void);