$NetBSD$

--- res/Makefile.in.orig	2009-05-19 13:41:26.000000000 +0400
+++ res/Makefile.in
@@ -502,7 +502,7 @@
 @WANT_RES_CONFIG_CURL_TRUE@res_config_curl_la_LIBADD = ${top_builddir}/corelib/libcallweaver.la
 @WANT_RES_SNMP_TRUE@res_snmp_la_SOURCES = res_snmp.c snmp/agent.c
 @WANT_RES_SNMP_TRUE@res_snmp_la_LDFLAGS = -module -avoid-version -no-undefined
-@WANT_RES_SNMP_TRUE@res_snmp_la_CFLAGS = $(AM_CFLAGS) 
+@WANT_RES_SNMP_TRUE@res_snmp_la_CFLAGS = $(AM_CFLAGS) `perl -MExtUtils::Embed -e ldopts`
 @WANT_RES_SNMP_TRUE@res_snmp_la_LIBADD = -lnetsnmp -lnetsnmpagent -lnetsnmphelpers -lnetsnmpmibs ${top_builddir}/corelib/libcallweaver.la
 
 #if WANT_RES_ODBC
