# $NetBSD: Makefile.common,v 1.45 2007/02/22 19:26:48 wiz Exp $
#
# XBUILD_DIRS is the group of directories under ${WRKSRC} that will
# be built in.
# XINCLUDE_DIRS is the group of directories under ${WRKSRC} that need
# to be Makefilesed or included in besides XBUILD_DIRS
# XINSTALL_DIRS is the group of directories which will have
# their install targets run.
# XINSTALL_MAN_DIRS is the group of directories which will have
# their install.man targets run.
.if !defined(XORG_MAKEFILE_COMMON)
XORG_MAKEFILE_COMMON= # defined
.include "../../mk/bsd.prefs.mk"
#
# Manual page handling.
#
.if ${OPSYS} == "DragonFly"
XTHRSTUB_MINOR= '@comment '
LIBXTHRSTUB=
XF86RUSH= '@comment '
IMAKE_MANTOOLS=
LIBDRI=
MANSOURCEPATH= man/man
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 1
LIBMAN_SUFFIX= 3
KERNMAN_SUFFIX= 4
FILEMAN_SUFFIX= 5
MISCMAN_SUFFIX= 7
.elif ${OPSYS} == "FreeBSD"
. if ${LOWER_OPSYS_VERSUFFIX} == "4"
XTHRSTUB_MINOR= '@comment '
LIBXTHRSTUB=
. else
XTHRSTUB_MINOR=
LIBXTHRSTUB= '@comment '
. endif
XF86RUSH= '@comment '
IMAKE_MANTOOLS=
LIBDRI=
MANSOURCEPATH= man/man
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 1
LIBMAN_SUFFIX= 3
KERNMAN_SUFFIX= 4
FILEMAN_SUFFIX= 5
MISCMAN_SUFFIX= 7
.elif ${OPSYS} == "Darwin"
# Use Quartz and Apple OpenGL on MacOSX; IOKit driver on pure Darwin
.if exists(/System/Library/Frameworks/OpenGL.framework)
DARWIN_USE_QUARTZ= YES
DARWIN_QUARTZ=
.else
DARWIN_USE_QUARTZ= NO
DARWIN_QUARTZ= '@comment '
.endif
XF86RUSH= '@comment '
IMAKE_MANTOOLS=
LIBDRI= '@comment '
MANSOURCEPATH= man/man
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 1
LIBMAN_SUFFIX= 3
KERNMAN_SUFFIX= 4
FILEMAN_SUFFIX= 5
MISCMAN_SUFFIX= 7
.elif ${OPSYS} == "Linux"
XF86RUSH=
USE_TOOLS+= gmake
IMAKE_MANTOOLS=
LIBDRI=
MANSOURCEPATH= man/man
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 1x
LIBMAN_SUFFIX= 3x
KERNMAN_SUFFIX= 4
FILEMAN_SUFFIX= 5
MISCMAN_SUFFIX= 7
.elif ${OPSYS} == "NetBSD" || ${OPSYS} == "OpenBSD"
XF86RUSH= '@comment '
IMAKE_MANTOOLS= '@comment '
LIBDRI= '@comment '
MANSOURCEPATH= man/cat
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 0
LIBMAN_SUFFIX= ${MAN_SUFFIX}
KERNMAN_SUFFIX= ${MAN_SUFFIX}
FILEMAN_SUFFIX= ${MAN_SUFFIX}
MISCMAN_SUFFIX= ${MAN_SUFFIX}
.elif ${OPSYS} == "SunOS"
XF86RUSH= '@comment '
IMAKE_MANTOOLS=
LIBDRI=
MANSOURCEPATH= man/man
MAN_DIR= ${MANSOURCEPATH}1
LIBMAN_DIR= ${MANSOURCEPATH}3
KERNMAN_DIR= ${MANSOURCEPATH}4
FILEMAN_DIR= ${MANSOURCEPATH}5
MISCMAN_DIR= ${MANSOURCEPATH}7
MAN_SUFFIX= 1x
LIBMAN_SUFFIX= 3x
KERNMAN_SUFFIX= 4
FILEMAN_SUFFIX= 5
MISCMAN_SUFFIX= 7
.endif # SunOS
.if !defined(XORG_ONLY_DIRS) || empty(XORG_ONLY_DIRS:M[Yy][Ee][Ss])
PLIST_SUBST+= DARWIN_QUARTZ=${DARWIN_QUARTZ}
PLIST_SUBST+= XTHRSTUB_MINOR=${XTHRSTUB_MINOR}
PLIST_SUBST+= LIBXTHRSTUB=${LIBXTHRSTUB}
PLIST_SUBST+= XF86RUSH=${XF86RUSH}
PLIST_SUBST+= IMAKE_MANTOOLS=${IMAKE_MANTOOLS}
PLIST_SUBST+= LIBDRI=${LIBDRI}
PLIST_SUBST+= MAN_DIR=${MAN_DIR}
PLIST_SUBST+= LIBMAN_DIR=${LIBMAN_DIR}
PLIST_SUBST+= MAN_SUFFIX=${MAN_SUFFIX}
PLIST_SUBST+= LIBMAN_SUFFIX=${LIBMAN_SUFFIX}
PLIST_SUBST+= KERNMAN_DIR=${KERNMAN_DIR}
PLIST_SUBST+= KERNMAN_SUFFIX=${KERNMAN_SUFFIX}
PLIST_SUBST+= FILEMAN_DIR=${FILEMAN_DIR}
PLIST_SUBST+= FILEMAN_SUFFIX=${FILEMAN_SUFFIX}
PLIST_SUBST+= MISCMAN_DIR=${MISCMAN_DIR}
PLIST_SUBST+= MISCMAN_SUFFIX=${MISCMAN_SUFFIX}
CHECK_X11_TYPE?= yes
.if defined(CHECK_X11_TYPE) && !empty(CHECK_X11_TYPE:M[Yy][Ee][Ss])
. if !defined(X11_TYPE) || empty(X11_TYPE:Mxorg)
PKG_SKIP_REASON+= "X11_TYPE=xorg is mandatory."
. endif
.endif
NO_MTREE= yes
WRKSRC?= ${WRKDIR}/xc
X11ROOT?= ${LOCALBASE}/${X11ROOT_PREFIX}
PREPEND_PATH+= ${X11ROOT}/bin # Make sure we have this in PATH :)
EGDIR?= ${LOCALBASE}/share/examples/xorg
PLIST_SUBST+= X11ROOT_PREFIX=${X11ROOT_PREFIX}
MESSAGE_SUBST+= X11ROOT=${X11ROOT}
.if ${OPSYS} != "Darwin"
. if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64" || \
${MACHINE_ARCH} == "sparc64"
PLIST_SUBST+= DGA=
. else
PLIST_SUBST+= DGA='@comment '
. endif
.endif
.if defined(XORG_PLIST_ENTRY) && !empty(XORG_PLIST_ENTRY)
. for _e in ${XORG_PLIST_ENTRY}
XORG_PLIST_SED+= -e '/^@comment begin ${_e}$$/,/^@comment end ${_e}$$/p'
. endfor
XORG_PLIST_SED+= -e '/^@comment begin .*$$/,/^@comment end .*$$/d'
.endif
#
# Any volunteer to test any platform not listed here? :)
#
ONLY_FOR_PLATFORM= Darwin-*-* FreeBSD-*-* Linux-*-* NetBSD-*-* \
OpenBSD-*-* SunOS-*-* DragonFly-*-*
MASTER_SITE_XORG+= \
http://xorg.freedesktop.org/releases/X11R${XORG_VER}/src/ \
ftp://ftp.opengroup.org/pub/x.org/pub/X11R${XORG_VER}/src/ \
ftp://x.mirrors.skynet.be/pub/ftp.x.org/pub/X11R${XORG_VER}/src/ \
http://x.mirrors.skynet.be/pub/ftp.x.org/pub/X11R${XORG_VER}/src/ \
ftp://mirror.cict.fr/x.org/pub/X11R${XORG_VER}/src/ \
http://mirror.cict.fr/x.org/pub/X11R${XORG_VER}/src/ \
ftp://ftp.gwdg.de/pub/x11/x.org/pub/X11R${XORG_VER}/src/ \
http://ftp.gwdg.de/pub/x11/x.org/pub/X11R${XORG_VER}/src/ \
http://www.mirror.ac.uk/mirror/ftp.x.org/pub/X11R${XORG_VER}/src/
# When updating the version be sure to regenerate checksums
# for each xorg package with distinfo files.
XORG_VER= 6.9.0
IMAKE= ${X11ROOT}/bin/imake
XINSTALL_DIRS?= ${XBUILD_DIRS}
_XINCLUDE_DIRS= include ${XBUILD_DIRS} ${XINCLUDE_DIRS}
#
# Operating Systems to pass our compiler options (CC, CXX, CPP, CFLAGS).
#
SYSTEMS= FreeBSD NetBSD OpenBSD darwin linux DragonFly
.if !defined(NO_XORG_TARGETS)
.if !empty(MACHINE_PLATFORM:MNetBSD-1.6[M-Z]*) || \
!empty(MACHINE_PLATFORM:MNetBSD-[2-9]*)
SUBST_CLASSES+= thr
SUBST_STAGE.thr= post-patch
SUBST_MESSAGE.thr= Fixes for threadlib.h.
SUBST_FILES.thr= config/cf/NetBSD.cf.in
. if exists(/usr/include/threadlib.h)
SUBST_SED.thr= -e 's|@@NETBSD_THREADLIB@@|-DUSE_NBSD_THREADLIB|'
. else
SUBST_SED.thr= -e 's|@@NETBSD_THREADLIB@@||'
. endif
.endif
SUBST_CLASSES+= zlib
SUBST_STAGE.zlib= pre-configure
SUBST_FILES.zlib= config/cf/Imake.tmpl
SUBST_SED.zlib= -e 's|@ZLIBDIR@|${BUILDLINK_PREFIX.zlib}/lib|g' \
-e 's|@COMPILER_RPATH_FLAG@|${COMPILER_RPATH_FLAG}|g'
SUBST_MESSAGE.zlib= Adding the zlib library path.
USE_LANGUAGES= c c++
. if !target(post-extract)
GLOBAL_LDFLAGS= -L${LOCALBASE}/lib -L${X11ROOT}/lib \
${COMPILER_RPATH_FLAG}${LOCALBASE}/lib \
${COMPILER_RPATH_FLAG}${X11BASE}/lib
post-extract:
@${SED} \
-e "s|@BLNK@|${BUILDLINK_DIR}|g" \
-e "s|@MAKE@|${MAKE_PROGRAM}|g" \
-e "s|@MAKE_PROGRAM@|${MAKE_PROGRAM}|g" \
-e "s|@IMAKE@|${IMAKE}|g" \
-e "s|@RMAN@|${X11ROOT}/bin/rman|g" \
-e "s|@MKHTMLINDEX@|${X11ROOT}/bin/mkhtmlindex|g" \
-e "s|@GCCMAKEDEP@|${X11ROOT}/bin/gccmakedep|g" \
-e "s|@MAKEDEPEND@|${X11ROOT}/bin/makedepend|g" \
-e "s|@REVPATH@|${X11ROOT}/bin/revpath|g" \
-e "s|@PREFIX@|${X11ROOT}|g" \
-e "s|@LOCALBASE@|${LOCALBASE}|g" \
-e "s|@LDFLAGS@|${GLOBAL_LDFLAGS}|g" \
-e "s|@WRKSRC@|${WRKSRC}|g" \
-e "s|@COMPILER_RPATH_FLAG@|${COMPILER_RPATH_FLAG}|g" \
-e "s|@PKG_SYSCONFDIR@|${PKG_SYSCONFDIR}|g" \
-e "s|@EGDIR@|${EGDIR}|g" \
-e "s|@KERNMAN_SUFFIX@|${KERNMAN_SUFFIX}|g" \
-e "s|@MISCMAN_SUFFIX@|${MISCMAN_SUFFIX}|g" \
-e "s|@FILEMAN_SUFFIX@|${FILEMAN_SUFFIX}|g" \
-e "s|@KERNMAN_DIR@|${KERNMAN_DIR}|g" \
-e "s|@MISCMAN_DIR@|${MISCMAN_DIR}|g" \
-e "s|@FILEMAN_DIR@|${FILEMAN_DIR}|g" \
-e "s|@CARDDRIVERS@|${CARDDRIVERS}|g" \
${FILESDIR}/host.def > ${WRKSRC}/config/cf/host.def
@${LN} -sf ${X11ROOT}/bin/gccmakedep ${WRKSRC}/config/util
@${LN} -sf ${X11ROOT}/bin/revpath ${WRKSRC}/config/util
@${LN} -sf ${X11ROOT}/bin/pswrap ${WRKSRC}/config/pswrap
@${LN} -sf ${X11ROOT}/lib/X11/config/version.def ${WRKSRC}/config/cf
@${LN} -sf ${X11ROOT}/lib/X11/config/date.def ${WRKSRC}/config/cf
. for F in ${SYSTEMS}
@${MV} ${WRKSRC}/config/cf/${F}.cf ${WRKSRC}/config/cf/${F}.cf.in
. endfor
. undef F
. endif
. if !target(pre-configure)
pre-configure:
. for F in ${SYSTEMS}
@${SED} -e "s|@@PKGSRC_CC@@|${CC}|g" \
-e "s|@@PKGSRC_CXX@@|${CXX}|g" \
-e "s|@@PKGSRC_CPP@@|${CPP}|g" \
-e "s|@@PKGSRC_CFLAGS@@|${CFLAGS:C/-I.*//}|g" \
-e "s|@@DARWIN_USE_QUARTZ@@|${DARWIN_USE_QUARTZ}|g" \
-e "s|-I${LOCALBASE}/include||" \
-e "s|-I${X11BASE}/include||" \
${WRKSRC}/config/cf/${F}.cf.in > \
${WRKSRC}/config/cf/${F}.cf
. endfor
. undef F
. endif
. if !target(do-configure)
do-configure:
@for dir in ${_XINCLUDE_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${IMAKE} \
-DTOPDIR=${WRKSRC} -DCURDIR=$${dir} \
-I${WRKSRC}/config/cf; \
done
@for dir in ${_XINCLUDE_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} Makefiles; \
done
@for dir in ${_XINCLUDE_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} includes; \
done
@for dir in include ${XBUILD_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} depend; \
done
. endif
#
# This can use for a single distfile.
#
USE_TOOLS+= tar
. if defined(XEXTRACTS) && !empty(XEXTRACTS)
_EXTRACTS= xc/config xc/include xc/extras/Mesa/include/GL
. for _dir in ${XEXTRACTS}
_EXTRACTS+= xc/${_dir}
. endfor
. if !target(do-extract)
do-extract: ${WRKDIR}
cd ${WRKDIR} && \
${GZCAT} ${DISTDIR}/${DISTFILES} | ${TAR} xf - ${_EXTRACTS}
. endif
. endif
. if !target(do-build)
do-build:
@for dir in ${XBUILD_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} all; \
done
. endif
. if !target(do-install)
do-install:
@for dir in ${XINSTALL_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE_PROGRAM} install; \
done
@for dir in ${XINSTALL_MAN_DIRS}; do \
cd ${WRKSRC}/$${dir} && ${SETENV} ${INSTALL_ENV} ${MAKE_ENV} ${MAKE_PROGRAM} install.man; \
done
. endif
.endif # !defined(XORG_TARGETS)
.endif # !defined(XORG_ONLY_DIRS) || empty(XORG_ONLY_DIRS:M[Yy][Ee][Ss])
.endif # !defined(XORG_MAKEFILE_COMMON)
CVSweb <webmaster@jp.NetBSD.org>