Index: bsd.port.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v retrieving revision 1.483 diff -u -r1.483 bsd.port.mk --- bsd.port.mk 24 Jan 2004 01:26:30 -0000 1.483 +++ bsd.port.mk 25 Jan 2004 12:04:23 -0000 @@ -362,6 +362,7 @@ # Used only when USE_MOTIF is set. Implies # NO_OPENMOTIF. # USE_SDL - Says that the port uses the sdl libraries. +# See bsd.sdl.mk for more information. # USE_XPM - Says that the port uses the xpm graphics libraries. ## # USE_OPENSSL - Says that the port relies on the OpenSSL package. @@ -1214,6 +1215,7 @@ .endif .include "${PORTSDIR}/Mk/bsd.gnome.mk" +.include "${PORTSDIR}/Mk/bsd.sdl.mk" # defaults to 4.x for 5.0-CURRENT and 4.5-STABLE; and 3.3.6 for all other branches .if ${OSVERSION} > 500025 || ( ${OSVERSION} >= 450005 && ${OSVERSION} < 500000 ) @@ -1623,10 +1625,6 @@ RUN_DEPENDS+= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base .endif -.if defined(USE_SDL) -.include "${PORTSDIR}/Mk/bsd.sdl.mk" -.endif - .if defined(USE_MOTIF) USE_XPM= yes .if defined(WANT_LESSTIF) @@ -1757,6 +1755,7 @@ .endif .include "${PORTSDIR}/Mk/bsd.gnome.mk" +.include "${PORTSDIR}/Mk/bsd.sdl.mk" .if defined(USE_PYTHON) .include "${PORTSDIR}/Mk/bsd.python.mk" Index: bsd.sdl.mk =================================================================== RCS file: /home/pcvs/ports/Mk/bsd.sdl.mk,v retrieving revision 1.2 diff -u -r1.2 bsd.sdl.mk --- bsd.sdl.mk 21 Jan 2004 10:01:54 -0000 1.2 +++ bsd.sdl.mk 25 Jan 2004 12:04:23 -0000 @@ -16,14 +16,22 @@ # the standard SDL and SDL_sound, use "USE_SDL=sdl sound" and the # required libraries are included in your LIB_DEPENDS. # +# If you want to check for the availability for certain SDL ports, you +# can set WANT_SDL and run it through bsd.port.pre.mk: +# WANT_SDL= yes +# USE_SDL= sdl +# .include +# .if ${HAVE_SDL:Mgraphics} +# USE_SDL+= graphics +# .endif +# .include +# Run "make -v USE_SDL" to see which libs are asked for at the end. +# # # $FreeBSD: ports/Mk/bsd.sdl.mk,v 1.2 2004/01/21 10:01:54 krion Exp $ # -.if !defined(SDL_Include) - -SDL_Include= bsd.sdl.mk SDL_Include_MAINTAINER= edwin@FreeBSD.org # @@ -32,13 +40,6 @@ _USE_SDL_ALL= gfx gui image mixer ldbad mm net sdl sound ttf # -# Keep some backward compatibility -# -.if ${USE_SDL}=="yes" -USE_SDL=sdl -.endif - -# # Variables used to determine what is needed: # _VERSION_xxx version of the shared library (required) # _SUBDIR_xxx subdirectory below ${PORTSDIR} (required) @@ -107,6 +108,41 @@ .endfor # +# If WANT_SDL is defined, check for the available libraries +# +.if !defined(AFTERPORTMK) +.if !defined(SDL_Include_pre) + +SDL_Include_pre= bsd.sdl.mk + +.if defined(WANT_SDL) +.for component in ${_USE_SDL_ALL} +.if exists(${LOCALBASE}/lib/lib${_LIB_${component}}.so.${_VERSION_${component}}) +HAVE_SDL+= ${component} +.endif +.endfor +.endif + +.endif +.endif + +# +# If USE_SDL is defined, make dependencies for the libraries +# +.if !defined(BEFOREPORTMK) +.if !defined(SDL_Include_post) +.if defined(USE_SDL) + +SDL_Include_post= bsd.sdl.mk + +# +# Keep some backward compatibility +# +.if ${USE_SDL}=="yes" +USE_SDL= sdl +.endif + +# # Check if all the values given in USE_SDL are valid. # _USE_SDL= @@ -142,4 +178,6 @@ CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG} MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG} +.endif +.endif .endif