freebsd-ports/games/quake2forge/Makefile
Rong-En Fan 741aa71483 Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.
Specifically, newer autoconf (> 2.13) has different semantic of the
configure target. In short, one should use --build=CONFIGURE_TARGET
instead of CONFIGURE_TARGET directly. Otherwise, you will get a warning
and the old semantic may be removed in later autoconf releases.

To workaround this issue, many ports hack the CONFIGURE_TARGET variable
so that it contains the ``--build='' prefix.

To solve this issue, under the fact that some ports still have
configure script generated by the old autoconf, we use runtime detection
in the do-configure target so that the proper argument can be used.

Changes to Mk/*:
 - Add runtime detection magic in bsd.port.mk
 - Remove CONFIGURE_TARGET hack in various bsd.*.mk
 - USE_GNOME=gnometarget is now an no-op

Changes to individual ports, other than removing the CONFIGURE_TARGET hack:

= pkg-plist changed (due to the ugly CONFIGURE_TARGET prefix in * executables)
  - comms/gnuradio
  - science/abinit
  - science/elmer-fem
  - science/elmer-matc
  - science/elmer-meshgen2d
  - science/elmerfront
  - science/elmerpost

= use x86_64 as ARCH
  - devel/g-wrap

= other changes
  - print/magicfilter
    GNU_CONFIGURE -> HAS_CONFIGURE since it's not generated by autoconf

Total # of ports modified:  1,027
Total # of ports affected: ~7,000 (set GNU_CONFIGURE to yes)

PR:		126524 (obsoletes 52917)
Submitted by:	rafan
Tested on:	two pointyhat 7-amd64 exp runs (by pav)
Approved by:	portmgr (pav)
2008-08-21 06:18:49 +00:00

129 lines
2.9 KiB
Makefile

# New ports collection makefile for: quake2
# Date created: 20.01.2003
# Whom: Ulrich Spoerlein <q@uni.de>
#
# $FreeBSD$
#
PORTNAME= quake2forge
PORTVERSION= 0.3
PORTREVISION= 6
CATEGORIES= games
MASTER_SITES= http://www.galgenberg.net/distfiles/
DISTNAME= quake2-${PORTVERSION}
MAINTAINER= alepulver@FreeBSD.org
COMMENT= First Person Shooter with many addons available
USE_AUTOTOOLS= autoconf:262 libtool:15
USE_BZIP2= yes
CONFIGURE_ARGS= --program-transform-name='s/^quake2$$/${PORTNAME}/' \
--disable-warn
OPTIONS= AO "Build libao sound module" off \
CTF "Build the CTF (Capture The Flag) modification" off \
GAME "Build a main game .so file" off \
GL "Build OpenGL renderer" on \
SDL "Build SDL renderers" off \
SVGA "Build SVGA renderer" off \
X11 "Build X11 renderer" on
LIBDIR= ${PREFIX}/lib/${PORTNAME}
.include "${.CURDIR}/../quake2-data/Makefile.include"
.include <bsd.port.pre.mk>
.if defined(WITH_GL) || defined(WITH_X11)
USE_XORG= xxf86dga
.endif
.if defined(WITH_AO)
LIB_DEPENDS+= ao.3:${PORTSDIR}/audio/libao
CONFIGURE_ARGS+=--with-ao=${LOCALBASE}
PLIST_SUB+= AO=""
.else
CONFIGURE_ARGS+=--without-ao
PLIST_SUB+= AO="@comment "
.endif
.if defined(WITH_CTF)
PLIST_SUB+= CTF=""
.else
Q2F_BADMODS+= ctf
PLIST_SUB+= CTF="@comment "
.endif
.if defined(WITH_GAME)
PLIST_SUB+= GAME=""
.else
Q2F_BADMODS+= baseq2
PLIST_SUB+= GAME="@comment "
.endif
.if defined(WITH_GL)
USE_GL= yes
CONFIGURE_ARGS+=--with-opengl=${LOCALBASE}
PLIST_SUB+= GL=""
.else
CONFIGURE_ARGS+=--with-opengl=no
PLIST_SUB+= GL="@comment "
.endif
.if defined(WITH_SDL)
USE_SDL= yes
CONFIGURE_ARGS+=--with-sdl=${LOCALBASE}
PLIST_SUB+= SDL=""
.else
CONFIGURE_ARGS+=--disable-sdl --disable-sdltest
PLIST_SUB+= SDL="@comment "
.endif
.if defined(WITH_GL) && defined(WITH_SDL)
PLIST_SUB+= SDLGL=""
.else
PLIST_SUB+= SDLGL="@comment "
.endif
.if defined(WITH_SVGA)
LIB_DEPENDS+= vga.1:${PORTSDIR}/graphics/svgalib
CONFIGURE_ARGS+=--with-svgalib=${LOCALBASE}
PLIST_SUB+= SVGA=""
.else
CONFIGURE_ARGS+=--with-svgalib=no
PLIST_SUB+= SVGA="@comment "
.endif
.if defined(WITH_X11)
CONFIGURE_ARGS+=--with-x
PLIST_SUB+= X11=""
.else
CONFIGURE_ARGS+=--without-x
PLIST_SUB+= X11="@comment "
.endif
post-patch:
@${FIND} ${WRKSRC} -type f -name Makefile.in -print0 | \
${XARGS} -0 ${REINPLACE_CMD} -e \
's|\($$(libdir)/\)@PACKAGE@|\1${PORTNAME}|'
@${REINPLACE_CMD} -e 's|\($$libdir/\)$$PACKAGE|\1${PORTNAME}|' \
${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}.in
.for f in ${Q2F_BADMODS}
@${REINPLACE_CMD} -i "" -e 's/${f}//' ${WRKSRC}/src/Makefile.in
.endfor
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/docs/README.* ${WRKSRC}/docs/*.txt ${DOCSDIR}
.if defined(WITH_CTF)
${MKDIR} ${DOCSDIR}/ctf
.for f in *.html *.gif *.jpg
${INSTALL_DATA} ${WRKSRC}/docs/ctf/${f} ${DOCSDIR}/ctf
.endfor
.endif
.endif
@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}
.include <bsd.port.post.mk>