From 4aec882196558e08a52fb6007936807c0b1854cf Mon Sep 17 00:00:00 2001 From: danfe Date: Sat, 30 Jun 2007 20:38:21 +0000 Subject: - Fix the build with recent GCC [1] - Pet portlint(1) - Clean up Makefile Reported by: pointyhat (logs) [1] --- x11-servers/driglide/Makefile | 28 ++++++--- .../driglide/files/patch-h5_glide3_src_glfb.c | 73 ++++++++++++++++++++++ .../driglide/files/patch-swlibs_fxmisc_fxos.c | 44 +++++++++++++ 3 files changed, 135 insertions(+), 10 deletions(-) create mode 100644 x11-servers/driglide/files/patch-h5_glide3_src_glfb.c create mode 100644 x11-servers/driglide/files/patch-swlibs_fxmisc_fxos.c (limited to 'x11-servers') diff --git a/x11-servers/driglide/Makefile b/x11-servers/driglide/Makefile index a56537c835a9..c01d8dc398fa 100644 --- a/x11-servers/driglide/Makefile +++ b/x11-servers/driglide/Makefile @@ -15,26 +15,34 @@ MASTER_SITE_SUBDIR= anholt/driglide/ MAINTAINER= ports@FreeBSD.org COMMENT= Libraries to support 3dfx Voodoo3/4/5/Banshee with the DRI -USE_BZIP2= yes -USE_X_PREFIX= yes +USE_BZIP2= yes USE_LDCONFIG= yes USE_AUTOTOOLS= automake:14 autoconf:253 libtool:15 -AUTOMAKE_ARGS= -a -USE_GMAKE= yes -MAKE_ARGS= PREPROCESSOR=/usr/bin/cpp +AUTOMAKE_ARGS= -a +USE_GMAKE= yes +MAKE_ARGS= PREPROCESSOR=/usr/bin/cpp # Not yet ported to Alpha. -ONLY_FOR_ARCHS= i386 +ONLY_FOR_ARCHS= i386 # Glide DOES NOT work with CFLAGS greater than -O2 CFLAGS+= -O post-patch: - @${REINPLACE_CMD} -e 's|/usr/X11R6|${X11BASE}|g' ${WRKSRC}/configure.in - @${REINPLACE_CMD} -e 's|/usr/X11R6|${X11BASE}|g' ${WRKSRC}/h3/glide3/src/Makefile.am - @${REINPLACE_CMD} -e 's|/usr/X11R6|${X11BASE}|g' ${WRKSRC}/h5/glide3/src/Makefile.am + @${REINPLACE_CMD} -e 's|/usr/X11R6|${X11BASE}|g' \ + ${WRKSRC}/configure.in \ + ${WRKSRC}/h3/glide3/src/Makefile.am \ + ${WRKSRC}/h5/glide3/src/Makefile.am + @${REINPLACE_CMD} -e \ + 's|(float \*)pointers +=|pointers += sizeof(float *) *|' \ + ${WRKSRC}/h3/glide3/src/gaa.c \ + ${WRKSRC}/h3/glide3/src/gdraw.c \ + ${WRKSRC}/h3/glide3/src/distrip.c \ + ${WRKSRC}/h5/glide3/src/gaa.c \ + ${WRKSRC}/h5/glide3/src/gdraw.c \ + ${WRKSRC}/h5/glide3/src/distrip.c pre-configure: - @cd $(WRKSRC) && ${ACLOCAL} -I ${LOCALBASE}/share/aclocal + @cd ${WRKSRC} && ${ACLOCAL} -I ${LOCALBASE}/share/aclocal @${REINPLACE_CMD} -e '/^_LT_AC_SHELL_INIT/d' ${WRKSRC}/aclocal.m4 .include diff --git a/x11-servers/driglide/files/patch-h5_glide3_src_glfb.c b/x11-servers/driglide/files/patch-h5_glide3_src_glfb.c new file mode 100644 index 000000000000..e8cb294eba57 --- /dev/null +++ b/x11-servers/driglide/files/patch-h5_glide3_src_glfb.c @@ -0,0 +1,73 @@ +--- h5/glide3/src/glfb.c.orig Thu Jan 16 01:23:50 2003 ++++ h5/glide3/src/glfb.c Sun Jul 1 03:06:16 2007 +@@ -1014,17 +1014,28 @@ + FXFALSE, + &info)) + { +- FxU32 *src,*dst; ++ union { ++ FxU32 *src; ++ FxU16 *src16; ++ FxU8 *src8; ++ } s; ++ ++ union { ++ FxU32 *dst; ++ FxU16 *dst16; ++ FxU8 *dst8; ++ } d; ++ + FxI32 length,scanline; + FxU32 src_adjust,dst_adjust,tmp; + +- src=(FxU32 *) (((char*)info.lfbPtr)+ ++ s.src=(FxU32 *) (((char*)info.lfbPtr)+ + (src_y*info.strideInBytes) + (src_x * bpp)); +- dst=dst_data; ++ d.dst=dst_data; + scanline=src_height; + + /* set length - alignment fix*/ +- tmp=(((AnyPtr)src)&2); ++ tmp=(((AnyPtr)s.src)&2); + length=src_width * bpp - tmp; + src_adjust=info.strideInBytes - tmp; + dst_adjust=dst_stride - tmp; +@@ -1035,8 +1046,8 @@ + while(src_height--) + { + /* adjust starting alignment */ +- if (((AnyPtr)src)&3) +- *((FxU16 *)dst)++=*((FxU16 *)src)++; ++ if (((AnyPtr)s.src)&3) ++ *d.dst16++ = *s.src16++; + + /* read in dwords of pixels */ + if(length) +@@ -1047,16 +1058,21 @@ + /* copies aligned dwords */ + do + { +- *((FxU32 *)(((AnyPtr)dst) + byte_index))=*((FxU32 *)(((AnyPtr)src) + byte_index)); ++ FxU32 *dst = (FxU32 *)(((AnyPtr)dst) + byte_index); ++ FxU32 *src = (FxU32 *)(((AnyPtr)src) + byte_index); ++ *dst = *src; + }while((byte_index+=4) + +-/* return current time in seconds (floating point) */ +-float fxTime(void) +-{ + #if defined ( __sparc__ ) || defined ( __DJGPP__ ) + /* times returns 0 in BSD Unix, so we use ftime instead */ + # include + # include ++#elif defined(__FreeBSD__) ++# include ++#else ++# include ++# include ++# include ++#endif ++ ++/* return current time in seconds (floating point) */ ++float fxTime(void) ++{ ++#if defined ( __sparc__ ) || defined ( __DJGPP__ ) + struct timeb tb; + static time_t once; // saves first time value + +@@ -43,15 +52,11 @@ + return (tb.time - once) + tb.millitm * .001; + + #elif defined(__FreeBSD__) +-#include + struct timeval t; + struct timezone tz; + gettimeofday(&t, &tz); + return ((float)t.tv_sec + ((float)t.tv_usec)/1000000.0); + #else +-# include +-# include +-# include + struct tms foo; + return times(&foo)/(float)HZ; + #endif -- cgit