CFLAGS+=-fPIC
+OSARCH=$(shell uname -s)
+ifeq (${OSARCH},FreeBSD)
+SOLINK+=-L/usr/local/lib
+endif
+
#
# unixODBC stuff...
#
ifneq (${OSARCH},Darwin)
CHANNEL_LIBS+=chan_oss.so
endif
+ifeq (${OSARCH},FreeBSD)
+SOLINK+=-L/usr/local/lib
+CHANNEL_LIBS+=chan_oss.so
+endif
CHANNEL_LIBS+=$(shell [ -f /usr/include/linux/ixjuser.h ] && echo chan_phone.so)
CHANNEL_LIBS+=$(shell [ -f h323/libchanh323.a ] && echo chan_h323.so)
#if defined(res_ninit)
#define HAS_RES_NINIT
#else
+static ast_mutex_t res_lock = AST_MUTEX_INITIALIZER;
+#if 0
#warning "Warning, res_ninit is missing... Could have reentrancy issues"
#endif
+#endif
int ast_search_dns(void *context,
const char *dname, int class, int type,
res_ninit(&dnsstate);
res = res_nsearch(&dnsstate, dname, class, type, answer, sizeof(answer));
#else
+ ast_mutex_lock(&res_lock);
res_init();
res = res_search(dname, class, type, answer, sizeof(answer));
#endif
#ifndef __APPLE__
res_close();
#endif
+ ast_mutex_unlock(&res_lock);
#endif
return ret;
}