Index: Makefile =================================================================== --- Makefile (revision 517956) +++ Makefile (working copy) @@ -27,12 +27,6 @@ CMAKE_ON= ALSOFT_BACKEND_WAVE \ ALSOFT_UTILS -# use gold linker due to some problems with ld.bfd on 12-STABLE, -# cf. PR 235603 -# do not link with librt and libdl. -LDFLAGS+= -fuse-ld=gold \ - -Wl,--as-needed - OPTIONS_DEFINE= EXAMPLES CONFIG JACK OSS PORTAUDIO PULSEAUDIO SDL SNDIO OPTIONS_DEFAULT= OSS OPTIONS_SUB= yes @@ -62,6 +56,16 @@ SNDIO_CMAKE_BOOL= ALSOFT_REQUIRE_SNDIO ALSOFT_BACKEND_SNDIO SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio +.include + +# use gold linker due to some problems with ld.bfd on 12-STABLE, +# cf. PR 235603 +# do not link with librt and libdl. +.if exists(${PREFIX}/bin/ld.gold) +LDFLAGS+= -fuse-ld=gold \ + -Wl,--as-needed +.endif + post-patch: @${REINPLACE_CMD} 's|/etc/openal|${ETCDIR}|' \ ${WRKSRC}/Alc/alconfig.c @@ -70,4 +74,4 @@ (cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . \ ${STAGEDIR}${EXAMPLESDIR}) -.include +.include