Sfoglia il codice sorgente

fix compile on Darwin

Waldemar Brodkorb 13 anni fa
parent
commit
4c93c2e27f

+ 8 - 5
package/MesaLib/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		MesaLib
 PKG_VERSION:=		7.8.2
-PKG_RELEASE:=		2
+PKG_RELEASE:=		3
 PKG_MD5SUM:=		c89b63d253605ed40e8ac370d25a833c
 PKG_DESCR:=		MESA library
 PKG_SECTION:=		libs
@@ -21,7 +21,6 @@ PKGSC_GLXINFO:=		x11/apps
 PKGSD_GLXGEARS:=	Nice little OpenGL demo application
 PKGSC_GLXGEARS:=	x11/apps
 
-PKG_HOST_DEPENDS:=	!cygwin !darwin
 PKG_TARGET_DEPENDS:=	x86 x86_64 mips mipsel mips64 mips64el
 
 WRKDIST=		${WRKDIR}/Mesa-${PKG_VERSION}
@@ -43,9 +42,9 @@ CONFIGURE_ARGS+=	--disable-static \
 			--with-dri-drivers=${DRI_DRIVERS},swrast \
 			--with-demos=xdemos
 
-XAKE_FLAGS+=		HOST_CC=${HOSTCC}
+XAKE_FLAGS+=		HOST_CC=${HOSTCC} GLSL_CL=${STAGING_TOOLS}/bin/glslcompile
 
-pre-configure:
+post-extract:
 	(cd ${WRKBUILD}; rm -rf config.{cache,status}; \
 		./configure \
 		--disable-static \
@@ -56,9 +55,13 @@ pre-configure:
 	${MAKE} -C ${WRKBUILD}/src/glsl
 	${MAKE} -C ${WRKBUILD}/src/glsl/apps
 	${CP} ${WRKBUILD}/src/glsl/apps/compile \
-		${STAGING_TOOLS}/bin
+		${STAGING_TOOLS}/bin/glslcompile
 	${MAKE} -C ${WRKBUILD}/src/glsl clean
 
+pre-configure:
+	$(SED) "s#@@RANLIB@@#${TARGET_CROSS}ranlib#" ${WRKBUILD}/configs/default
+	$(SED) "s#@@AR@@#${TARGET_CROSS}ar#" ${WRKBUILD}/configs/default
+
 post-install:
 	$(INSTALL_DIR) $(IDIR_MESALIB)/usr/lib/dri
 	$(CP) $(WRKINST)/usr/lib/libGL*.so* \

+ 1 - 1
package/MesaLib/patches/000-mesalib-xdemos.patch

@@ -7807,7 +7807,7 @@ diff -Naurp Mesa-7.8.1/progs/xdemos/Makefile Mesa-7.8.1.patched/progs/xdemos/Mak
 +# Add X11 and pthread libs to satisfy GNU gold.
 +APP_LIB_DEPS += -lX11 -lpthread
 +
-+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(libdir) $(APP_LIB_DEPS)
++LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
 +
 +PROGS = \
 +	corender \

+ 36 - 1
package/MesaLib/patches/patch-bin_mklib

@@ -1,5 +1,40 @@
 --- Mesa-7.8.2.orig/bin/mklib	2010-06-15 19:43:41.000000000 +0200
-+++ Mesa-7.8.2/bin/mklib	2010-10-11 20:40:45.000000000 +0200
++++ Mesa-7.8.2/bin/mklib	2010-12-04 23:25:12.000000000 +0100
+@@ -49,8 +49,8 @@ expand_archives() {
+                     /*) ;;
+                     *)  FILE="$ORIG_DIR/$FILE" ;;
+                 esac
+-                MEMBERS=`ar t $FILE`
+-                ar x $FILE
++                MEMBERS=`${AR} t $FILE`
++                ${AR} x $FILE
+                 for MEMBER in $MEMBERS ; do
+                     NEWFILES="$NEWFILES $DIR/$MEMBER"
+                 done
+@@ -77,7 +77,7 @@ expand_archives() {
+ make_ar_static_lib() {
+     OPTS=$1
+     shift;
+-    RANLIB=$1
++    RAN=$1
+     shift;
+     LIBNAME=$1
+     shift;
+@@ -87,11 +87,11 @@ make_ar_static_lib() {
+     rm -f ${LIBNAME}
+ 
+     # make static lib
+-    ar ${OPTS} ${LIBNAME} ${OBJECTS}
++    ${AR} ${OPTS} ${LIBNAME} ${OBJECTS}
+ 
+     # run ranlib
+-    if [ ${RANLIB} = 1 ] ; then
+-        ranlib ${LIBNAME}
++    if [ ${RAN} = 1 ] ; then
++        ${RANLIB} ${LIBNAME}
+     fi
+ 
+     echo ${LIBNAME}
 @@ -251,7 +251,7 @@ OBJECTS=$@
  
  

+ 11 - 0
package/MesaLib/patches/patch-configs_default

@@ -0,0 +1,11 @@
+--- Mesa-7.8.2.orig/configs/default	2010-06-16 23:22:17.000000000 +0200
++++ Mesa-7.8.2/configs/default	2010-12-03 01:19:21.000000000 +0100
+@@ -32,7 +32,7 @@ APP_CXX = $(CXX)
+ 
+ # Misc tools and flags
+ SHELL = /bin/sh
+-MKLIB = $(SHELL) $(TOP)/bin/mklib
++MKLIB = env RANLIB=/Volumes/adk/openadk/cross_x86_glibc/host/bin/i686-openadk-linux-gnu-ranlib AR=/Volumes/adk/openadk/cross_x86_glibc/host/bin/i686-openadk-linux-gnu-ar $(SHELL) $(TOP)/bin/mklib
+ MKLIB_OPTIONS = 
+ MKDEP = makedepend
+ MKDEP_OPTIONS = -fdepend

+ 21 - 0
package/MesaLib/patches/patch-src_mesa_Makefile

@@ -0,0 +1,21 @@
+--- Mesa-7.8.2.orig/src/mesa/Makefile	2010-06-15 19:43:42.000000000 +0200
++++ Mesa-7.8.2/src/mesa/Makefile	2010-12-04 22:11:40.000000000 +0100
+@@ -30,15 +30,15 @@ default: depend asm_subdirs glsl_builtin
+ 
+ # Make archive of core mesa object files
+ libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS)
+-	@ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS)
++	$(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS)
+ 
+ # Make archive of subset of core mesa object files for gallium
+ libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
+-	@ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
++	$(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
+ 
+ # Make archive of gl* API dispatcher functions only
+ libglapi.a: $(GLAPI_OBJECTS)
+-	@ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
++	$(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
+ 
+ ######################################################################
+ # Device drivers

+ 3 - 3
package/MesaLib/patches/patch-src_mesa_main_imports_c

@@ -1,6 +1,6 @@
---- Mesa-7.8.1.orig/src/mesa/main/imports.c	2010-04-05 01:46:26.000000000 +0200
-+++ Mesa-7.8.1/src/mesa/main/imports.c	2010-04-19 21:22:52.000000000 +0200
-@@ -799,13 +799,7 @@ _mesa_strdup( const char *s )
+--- Mesa-7.8.2.orig/src/mesa/main/imports.c	2010-06-15 19:43:43.000000000 +0200
++++ Mesa-7.8.2/src/mesa/main/imports.c	2010-12-03 01:16:56.000000000 +0100
+@@ -800,13 +800,7 @@ _mesa_strdup( const char *s )
  float
  _mesa_strtof( const char *s, char **end )
  {

+ 11 - 0
package/MesaLib/patches/patch-src_mesa_shader_slang_library_Makefile

@@ -0,0 +1,11 @@
+--- Mesa-7.8.2.orig/src/mesa/shader/slang/library/Makefile	2010-04-27 23:41:21.000000000 +0200
++++ Mesa-7.8.2/src/mesa/shader/slang/library/Makefile	2010-12-04 21:18:11.000000000 +0100
+@@ -4,7 +4,7 @@ TOP = ../../../../..
+ 
+ include $(TOP)/configs/current
+ 
+-GLSL_CL = $(TOP)/src/glsl/apps/compile
++GLSL_CL ?= $(TOP)/src/glsl/apps/compile
+ 
+ #
+ # targets