Chromium on FreeBSD

"Jeremy W. Sheaffer" <[email protected]> Tue, 2 Nov 2004 21:21:42 -0500 (EST)
Newsgroups gmane.comp.graphics.chromium.devel
Message-ID <[email protected]>
I just built Chromium under amd64 FreeBSD 5.3 with gcc 3.4.2.  The
attached patch has all of the changes I had to make.  I think this should
work for any FreeBSD system, but I don't have any others to test on.

-- 
Jeremy W. Sheaffer
[email protected]
http://cs.virginia.edu/~jws9c/



             /*********************************************
             * The Moving Finger writes; and having writ, *
             *    Moves on: nor all thy piety nor wit     *
             *  Shall lure it back to cancel half a line  *
             *  Nor all thy tears wash out a word of it.  *
             *                                            *
             *                       -Omar Khayyam        *
             *********************************************/
cr-1.7.FreeBSD.patch (text/plain, 3.6 KB)
diff -Naur cr-1.7/app_faker/app_faker.c cr-1.7.FreeBSD/app_faker/app_faker.c
--- cr-1.7/app_faker/app_faker.c	Thu Apr 15 19:00:11 2004
+++ cr-1.7.FreeBSD/app_faker/app_faker.c	Tue Nov  2 15:20:05 2004
@@ -32,6 +32,10 @@
 #include <dirent.h>
 #endif
 
+#ifdef FreeBSD
+#include <signal.h>
+#endif
+
 #include "cr_mothership.h"
 #include "cr_mem.h"
 #include "cr_environment.h"
diff -Naur cr-1.7/config/FreeBSD.mk cr-1.7.FreeBSD/config/FreeBSD.mk
--- cr-1.7/config/FreeBSD.mk	Thu Apr 15 19:00:11 2004
+++ cr-1.7.FreeBSD/config/FreeBSD.mk	Tue Nov  2 15:10:30 2004
@@ -7,11 +7,13 @@
 CXX = g++
 CC = gcc
 
-CXXFLAGS          += -DFREEBSD -Wall -Werror
+CXXFLAGS          += -DFREEBSD -Wall -Werror -I/usr/X11R6/include \
+                     -fno-strict-aliasing -fPIC
 CXX_RELEASE_FLAGS += -O3 -DNDEBUG
 CXX_DEBUG_FLAGS   += -g
 
-CFLAGS            += -DFREEBSD -Wall -Werror
+CFLAGS            += -DFREEBSD -Wall -Werror -I/usr/X11R6/include \
+                     -fno-strict-aliasing -fPIC
 C_RELEASE_FLAGS   += -O3 -DNDEBUG
 C_DEBUG_FLAGS     += -g
 
diff -Naur cr-1.7/include/chromium.h cr-1.7.FreeBSD/include/chromium.h
--- cr-1.7/include/chromium.h	Thu Apr 15 19:00:11 2004
+++ cr-1.7.FreeBSD/include/chromium.h	Tue Nov  2 15:05:40 2004
@@ -53,7 +53,7 @@
 
 #ifdef DARWIN
 #include <stddef.h>
-#else
+#elif !defined(FreeBSD)
 #include <malloc.h>  /* to get ptrdiff_t used below */
 #endif
 
diff -Naur cr-1.7/opengl_stub/FreeBSD_exports.py cr-1.7.FreeBSD/opengl_stub/FreeBSD_exports.py
--- cr-1.7/opengl_stub/FreeBSD_exports.py	Thu Apr 15 19:00:11 2004
+++ cr-1.7.FreeBSD/opengl_stub/FreeBSD_exports.py	Tue Nov  2 15:33:50 2004
@@ -5,7 +5,7 @@
 
 import entrypoints
 
-hacks = ["TexImage3D", "EdgeFlagPointer" ]
+hacks = []
 
 entrypoints.GenerateEntrypoints(hacks)
 
diff -Naur cr-1.7/progs/dlistperf1/dlistperf1.c cr-1.7.FreeBSD/progs/dlistperf1/dlistperf1.c
--- cr-1.7/progs/dlistperf1/dlistperf1.c	Thu Apr 15 19:00:11 2004
+++ cr-1.7.FreeBSD/progs/dlistperf1/dlistperf1.c	Tue Nov  2 15:49:44 2004
@@ -1,6 +1,8 @@
 #include "OGLwin.h"
 #include <math.h>
+#if !defined(FreeBSD)
 #include <malloc.h>
+#endif
 #include "Timer.h"
 
 #include <stdio.h>
diff -Naur cr-1.7/spu/zpix/zpixspu.c cr-1.7.FreeBSD/spu/zpix/zpixspu.c
--- cr-1.7/spu/zpix/zpixspu.c	Thu Apr 15 19:00:12 2004
+++ cr-1.7.FreeBSD/spu/zpix/zpixspu.c	Tue Nov  2 15:17:26 2004
@@ -149,7 +149,7 @@
         int       pixsize;
         GLuint      alen, plen;
         int       r, rc;
-        ulong     zliblen;
+        unsigned long     zliblen;
         int       zlen;
         ZTYPE     ztype;
         FBTYPE    FBtype;
@@ -311,7 +311,7 @@
 
         case ZLIB:  /* use gnu zlib compression */
 
-             zliblen = (ulong) zlen;
+             zliblen = (unsigned long) zlen;
              rc = compress2(zpix_spu.zBuf[FBtype], &zliblen,
                             zpix_spu.b.dBuf[FBtype],
                             plen, zpix_spu.ztype_parm);
@@ -537,7 +537,7 @@
                                 GLint   zlen, 
                                 const GLvoid  *zpixels )
 {
-        ulong   zldlen, zliblen;
+        unsigned long   zldlen, zliblen;
         GLuint    alen, plen;
         GLuint    *p_fb;
         GLuint    *p_dif;
@@ -685,8 +685,8 @@
        case ZLIB:
            /* Decompress and then DrawPixels */
 
-            zliblen = (ulong) zlen;
-            zldlen  = (ulong) dlen;
+            zliblen = (unsigned long) zlen;
+            zldlen  = (unsigned long) dlen;
 
             rc = uncompress(zpix_spu.b.dBuf[FBtype], &zldlen, zpixels, zliblen);