2009-03-20 20:23:50 +01:00
|
|
|
# $NetBSD: dlopen.buildlink3.mk,v 1.17 2009/03/20 19:25:01 joerg Exp $
|
2004-11-25 22:33:36 +01:00
|
|
|
#
|
|
|
|
# This Makefile fragment is included by package Makefiles and
|
|
|
|
# buildlink3.mk files for the packages that use dlopen().
|
|
|
|
#
|
2007-06-04 10:10:32 +02:00
|
|
|
# It defines the variables DL_CFLAGS, DL_LDFLAGS and DL_LIBS, which
|
|
|
|
# are also exported into the CONFIGURE_ENV and MAKE_ENV environments.
|
|
|
|
#
|
|
|
|
# Package-settable variables:
|
|
|
|
#
|
|
|
|
# DL_AUTO_VARS
|
|
|
|
# When set to "yes", the necessary flags are added automatically
|
|
|
|
# to CFLAGS and friends.
|
|
|
|
#
|
|
|
|
# Default: no
|
|
|
|
#
|
|
|
|
# Keywords: dl dlopen
|
|
|
|
#
|
|
|
|
|
2004-11-26 02:56:17 +01:00
|
|
|
DLOPEN_BUILDLINK3_MK:= ${DLOPEN_BUILDLINK3_MK}+
|
2004-11-25 22:33:36 +01:00
|
|
|
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "bsd.fast.prefs.mk"
|
2004-11-25 22:33:36 +01:00
|
|
|
|
2004-11-26 08:05:19 +01:00
|
|
|
.if !empty(DLOPEN_BUILDLINK3_MK:M+)
|
|
|
|
CHECK_BUILTIN.dl:= yes
|
2007-10-17 12:43:36 +02:00
|
|
|
.include "dlopen.builtin.mk"
|
2004-11-26 08:05:19 +01:00
|
|
|
CHECK_BUILTIN.dl:= no
|
|
|
|
.endif # DLOPEN_BUILDLINK3_MK
|
2004-11-25 22:33:36 +01:00
|
|
|
|
2004-11-26 08:05:19 +01:00
|
|
|
DL_AUTO_VARS?= no
|
2004-11-25 22:33:36 +01:00
|
|
|
|
2004-11-26 10:32:06 +01:00
|
|
|
.if !empty(USE_BUILTIN.dl:M[yY][eE][sS])
|
2009-03-20 20:23:50 +01:00
|
|
|
BUILDLINK_TREE+= dl -dl
|
2004-11-26 08:05:19 +01:00
|
|
|
BUILDLINK_BUILTIN_MK.dl= ../../mk/dlopen.builtin.mk
|
|
|
|
BUILDLINK_AUTO_VARS.dl= ${DL_AUTO_VARS}
|
2005-06-26 15:11:22 +02:00
|
|
|
.elif !empty(MACHINE_PLATFORM:MDarwin-[56].*)
|
2004-11-26 08:05:19 +01:00
|
|
|
. include "../../devel/dlcompat/buildlink3.mk"
|
|
|
|
BUILDLINK_AUTO_VARS.dlcompat= ${DL_AUTO_VARS}
|
2007-04-27 17:02:37 +02:00
|
|
|
BUILDLINK_LDFLAGS.dl:= ${BUILDLINK_LDFLAGS.dlcompat}
|
2004-11-25 22:33:36 +01:00
|
|
|
.else
|
2007-02-10 09:59:07 +01:00
|
|
|
PKG_FAIL_REASON= "${PKGNAME} requires a working dlopen()."
|
2004-11-25 22:33:36 +01:00
|
|
|
.endif
|
2004-11-26 02:56:17 +01:00
|
|
|
|
|
|
|
.if !empty(DLOPEN_BUILDLINK3_MK:M+)
|
|
|
|
#
|
|
|
|
# Define user-visible DL_{CFLAGS,LDFLAGS,LIBS} as compiler options used
|
|
|
|
# to compile/link code that uses dl*() functions.
|
|
|
|
#
|
2004-11-26 08:05:19 +01:00
|
|
|
DL_CFLAGS= ${BUILDLINK_CFLAGS.dl}
|
|
|
|
DL_LDFLAGS= ${BUILDLINK_LDFLAGS.dl}
|
|
|
|
DL_LIBS= ${BUILDLINK_LIBS.dl}
|
2005-12-05 23:07:07 +01:00
|
|
|
CONFIGURE_ENV+= DL_CFLAGS=${DL_CFLAGS:Q}
|
|
|
|
CONFIGURE_ENV+= DL_LDFLAGS=${DL_LDFLAGS:Q}
|
|
|
|
CONFIGURE_ENV+= DL_LIBS=${DL_LIBS:Q}
|
|
|
|
MAKE_ENV+= DL_CFLAGS=${DL_CFLAGS:Q}
|
|
|
|
MAKE_ENV+= DL_LDFLAGS=${DL_LDFLAGS:Q}
|
|
|
|
MAKE_ENV+= DL_LIBS=${DL_LIBS:Q}
|
2004-11-26 02:56:17 +01:00
|
|
|
.endif # DLOPEN_BUILDLINK3_MK
|