Make GTK build compile on FreeBSD.

svn path=/trunk/netsurf/; revision=3154
This commit is contained in:
James Bursa 2007-01-29 22:27:15 +00:00
parent b76283f3d5
commit a0b6661eb6
18 changed files with 58 additions and 15 deletions

View File

@ -18,6 +18,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include "netsurf/utils/config.h"
#include "netsurf/content/content.h"

View File

@ -24,14 +24,15 @@
#include <string.h>
#include <strings.h>
#include <time.h>
#include <sys/select.h>
#include <sys/stat.h>
#ifdef riscos
#include <unixlib/local.h>
#endif
#include "curl/curl.h"
#include <curl/curl.h>
#include "netsurf/utils/config.h"
#ifdef WITH_SSL
#include "openssl/ssl.h"
#include <openssl/ssl.h>
#endif
#include "netsurf/content/fetch.h"
#include "netsurf/content/urldb.h"

View File

@ -13,7 +13,8 @@
#define _NETSURF_DESKTOP_FETCH_H_
#include <stdbool.h>
#include "curl/curl.h"
#include <sys/select.h>
#include <curl/curl.h>
#include "netsurf/utils/config.h"
typedef enum {

View File

@ -16,6 +16,7 @@
#define _GNU_SOURCE /* for strndup */
#include <assert.h>
#include <string.h>
#include <strings.h>
#include <sys/types.h>
#include <regex.h>
#include <time.h>

View File

@ -76,8 +76,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <time.h>
#include <sys/select.h>
#include <curl/curl.h>
#include "netsurf/image/bitmap.h"

View File

@ -11,7 +11,7 @@ $out = shift or die "usage: makeenum leafname";
open H, ">$out.h" or die "open 'enum.h' failed";
open C, ">$out.c" or die "open 'enum.c' failed";
print C "#include <string.h>\n";
print C "#include <strings.h>\n";
print C "#include \"$out.h\"\n\n";
while (<>) {

View File

@ -398,7 +398,7 @@ any(A) ::= ASTERISK(B).
%extra_argument { struct css_parser_params *param }
%include {
#include <string.h>
#include <strings.h>
#define CSS_INTERNALS
#include "netsurf/css/css.h"
#include "netsurf/utils/utils.h" }

View File

@ -23,6 +23,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#define CSS_INTERNALS
#define NDEBUG
#include "netsurf/css/css.h"

View File

@ -20,6 +20,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <sys/select.h>
#include "curl/curl.h"
#include "netsurf/utils/config.h"
#include "netsurf/content/fetch.h"

View File

@ -13,6 +13,7 @@
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <sys/select.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <curl/curl.h>

View File

@ -94,7 +94,7 @@ OBJS_DEBUG=$(OBJECTS_DEBUG:%.o=$(OBJDIR_DEBUG)/%.o)
OBJS_DEBUGRO=$(OBJECTS_DEBUGRO:%.o=$(OBJDIR_RISCOS)/%.o)
OBJDIR_GTK = $(shell $(SYSTEM_CC) -dumpmachine)-gtk
OBJDIR_GTK = objects-gtk
SOURCES_GTK=$(OBJECTS_GTK:.o=.c)
OBJS_GTK=$(OBJECTS_GTK:%.o=$(OBJDIR_GTK)/%.o)
@ -129,7 +129,7 @@ CFLAGS_RISCOS_SMALL = $(CFLAGS_RISCOS) -Dsmall
CFLAGS_NCOS = $(CFLAGS_RISCOS) -Dncos
CFLAGS_DEBUG = -std=c9x -D_BSD_SOURCE -DDEBUG_BUILD $(WARNFLAGS) -I.. \
$(PLATFORM_CFLAGS_DEBUG) -g
CFLAGS_GTK = -Dnsgtk -std=c9x -D_BSD_SOURCE -D_POSIX_C_SOURCE -Dgtk \
CFLAGS_GTK = -Dnsgtk -std=c9x -D_BSD_SOURCE -Dgtk \
$(WARNFLAGS) -I.. -g -O0 -Wformat=2 -DNDEBUG \
`pkg-config --cflags libglade-2.0 gtk+-2.0` `xml2-config --cflags`

View File

@ -10,14 +10,14 @@ PLATFORM_CFLAGS_RISCOS = -I$(GCCSDK_INSTALL_ENV)/include \
-I$(GCCSDK_INSTALL_ENV)/include/libmng \
#-finstrument-functions
PLATFORM_CFLAGS_DEBUG = -I/usr/include/libxml2 -I/riscos/src/OSLib \
-I/riscos/include/libjpeg -D_POSIX_C_SOURCE
-I/riscos/include/libjpeg -D_POSIX_C_SOURCE=200112
PLATFORM_AFLAGS_RISCOS = -I$(GCCSDK_INSTALL_ENV)/include
LDFLAGS_RISCOS = -L$(GCCSDK_INSTALL_ENV)/lib -lxml2 -lz -lcurl -lssl -lcrypto \
-lcares -lmng -lOSLib32 -ljpeg -lrufl -lpencil #-lprof
LDFLAGS_SMALL = -L$(GCCSDK_INSTALL_ENV)/lib -lxml2 -lz -lucurl \
-lcares -lmng -lOSLib32 -ljpeg -lrufl -lpencil
LDFLAGS_DEBUG = -L/usr/lib -lxml2 -lz -lm -lcurl -lssl -lcrypto -ldl -lmng \
LDFLAGS_DEBUG = -L/usr/lib -lxml2 -lz -lm -lcurl -lssl -lcrypto -lmng \
-ljpeg -llcms
# Hackery for Cygwin - it has no libdl, so remove it from LDFLAGS

View File

@ -19,6 +19,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "libxml/HTMLparser.h"
#include "libxml/parserInternals.h"
#include "netsurf/utils/config.h"

View File

@ -101,8 +101,8 @@ bool directory_convert(struct content *c, int width, int height) {
return false;
}
while ((entry = readdir(parent)) != NULL) {
if ((entry->d_ino == 0) || (!strcmp(entry->d_name, ".")) ||
(!strcmp(entry->d_name, "..")))
if (!strcmp(entry->d_name, ".") ||
!strcmp(entry->d_name, ".."))
continue;
snprintf(buffer, sizeof(buffer), "<a href=\"%s/%s\">%s</a>\n",

View File

@ -216,8 +216,8 @@ bool filename_flush_directory(const char *folder, int depth) {
parent = opendir(folder);
while ((entry = readdir(parent))) {
if ((entry->d_ino == 0) || (!strcmp(entry->d_name, ".")) ||
(!strcmp(entry->d_name, "..")))
if (!strcmp(entry->d_name, ".") ||
!strcmp(entry->d_name, ".."))
continue;
/* first 3 depths are directories only, then files only */

View File

@ -21,6 +21,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <unistd.h>
/* this is only needed for compatibility with the old talloc */
typedef void TALLOC_CTX;

View File

@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf-browser.org/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004-2007 James Bursa <bursa@users.sourceforge.net>
* Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
* Copyright 2003 John M Bell <jmb202@ecs.soton.ac.uk>
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
@ -235,3 +235,30 @@ char *strcasestr(const char *haystack, const char *needle)
return NULL;
}
#ifdef __FreeBSD__
/**
* Duplicate up to n characters of a string.
*/
char *strndup(const char *s, size_t n)
{
size_t len;
char *s2;
for (len = 0; len != n && s[len]; len++)
continue;
s2 = malloc(len + 1);
if (!s2)
return 0;
memcpy(s2, s, len);
s2[len] = 0;
return s2;
}
#endif

View File

@ -2,7 +2,7 @@
* This file is part of NetSurf, http://netsurf-browser.org/
* Licensed under the GNU General Public License,
* http://www.opensource.org/licenses/gpl-license
* Copyright 2004 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004-2007 James Bursa <bursa@users.sourceforge.net>
* Copyright 2004 John Tytgat <John.Tytgat@aaug.net>
*/
@ -56,6 +56,10 @@ void unicode_transliterate(unsigned int c, char **r);
char *human_friendly_bytesize(unsigned long bytesize);
const char *rfc1123_date(time_t t);
char *strcasestr(const char *haystack, const char *needle);
#ifdef __FreeBSD__
/* FreeBSD lacks strndup */
char *strndup(const char *s, size_t n);
#endif
/* Platform specific functions */
void die(const char * const error);