pkgsrc/graphics/Mesa/Makefile.lib
bjs 03aa255c8f Update to Mesa-7.0.4 (the head of the 7.0 branch in GIT). Basically,
lots of bug fixes; the intent of my update was mostly to fix
problems with i915 and r300 dri drivers and to provide the best environment
possible for the xorg server update to the 1.4 branch.

Morever, many of our patches from pkgsrc, i.e. those removed in this commit,
are now included upstream.

Additionally, MesaDemos now builds.

NOTES:

 - MesaLib now requires xf86driproto 2.0.4, as earlier versions install
   dri_interface.h, which is not correct.

 - glu now exports its symbols via libtool's -export-symfile.
   The symfile is generated pre-build--see glu/Makefile.

 - glxinfo/glxgears do not seem to need to be linked to libpthread, and this
   seems to cause problems on NetBSD with the new drm code.  If I am wrong
   about this, please let me know.  The only program that seems to need
   libpthread is glthreads in MesaDemos.
2008-07-27 00:03:42 +00:00

101 lines
2.6 KiB
Makefile

# $NetBSD: Makefile.lib,v 1.13 2008/07/27 00:03:42 bjs Exp $
#
# This Makefile fragment is included by all packages that build libraries
# from the Mesa sources.
#
.include "../../graphics/Mesa/Makefile.common"
DISTFILES+= MesaLib-${MESA_VERSION}${EXTRACT_SUFX}
DISTFILES+= MesaGLUT-${MESA_VERSION}${EXTRACT_SUFX}
DISTFILES+= MesaDemos-${MESA_VERSION}${EXTRACT_SUFX}
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_LANGUAGES= c c++
USE_LIBTOOL= yes
LIBTOOL= ${PKG_SHLIBTOOL}
USE_TOOLS+= gmake pkg-config
PATCHDIR= ${.CURDIR}/../MesaLib/patches
DISTINFO_FILE= ${.CURDIR}/../MesaLib/distinfo
COPTS?= # empty
COPTS+= -prefer-pic # Make sure to build PIC libraries.
MAKE_ENV+= MAKE=${GMAKE:Q}
MAKE_ENV+= COPTS=${COPTS:M*:Q}
MAKE_ENV+= MKDEP=${TRUE:Q}
#.if ${X11_TYPE} == "modular"
#. if defined(PKG_BUILD_OPTIONS.libX11) && \
# !empty(PKG_BUILD_OPTIONS.libX11:Mxcb)
#MAKE_ENV+= USE_XCB=yes
#. endif
#.endif
#.if empty(MAKE_ENV:MUSE_XCB=*)
MAKE_ENV+= USE_XCB=no
#.endif
.include "../../mk/compiler.mk"
.if !empty(PKGSRC_COMPILER:Mccc)
CFLAGS+= -D__FUNCTION__=__FILE__
.endif
MESA_HZ?= 100
MAKE_ENV+= MESA_HZ=${MESA_HZ:Q}
.if ${OPSYS} == "NetBSD" && exists(/sbin/sysctl)
tmphz=\
${/sbin/sysctl kern.clockrate || ${TRUE}\
:L:sh:ts,:S/,//gW:C/([^[0-9]]*)(=|[^ hz])*([^[0-9])//g:M[0-9]*}
. if !empty(tmphz) && (${tmphz} > 50) && (${tmphz} < 2001)
MESA_HZ= ${tmphz}
. endif
.endif
###
### XXX do we still want this?
###
.if ${OPSYS} == "Interix"
BUILD_TARGET= interix3
.else
BUILD_TARGET?= pkgsrc
.endif
RM_PATCH_BACKUP_DIRS= docs src/mesa src/glut/glx \
progs/demos progs/xdemos progs/glsl
pre-patch:
for fn in ${RM_PATCH_BACKUP_DIRS}; do \
${RM} -f ${WRKSRC}/$${fn}/*.orig; \
done
post-patch:
${CP} ${.CURDIR}/../MesaLib/files/configs/[d-z]* ${WRKSRC}/configs
post-install: install-headers
###
### XXX MesaLib installs headers into GL/internal, and this directory is
### created there by the pre-install target. TODO: unify these targets.
###
.PHONY: install-headers
.if empty(PKGNAME:M*MesaDemos*)
install-headers:
${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/include/GL
.for hdr in ${MESA_HEADERS}
if [ -f ${WRKSRC}/include/GL/${hdr:Q} ]; then \
${INSTALL_DATA} ${WRKSRC}/include/GL/${hdr:Q} \
${DESTDIR}${PREFIX}/include/GL/${hdr:Q}; \
fi;
.endfor
.else
install-headers:
@${DO_NADA}
.endif
SUBST_CLASSES+= fix-paths
SUBST_STAGE.fix-paths= pre-configure
SUBST_MESSAGE.fix-paths= Fixing absolute paths.
SUBST_FILES.fix-paths= src/*.c
SUBST_FILES.fix-paths+= scripts/*.sh
SUBST_SED.fix-paths= -e 's,"/usr/local,"${PREFIX},g'