$NetBSD: patch-aa,v 1.13 2013/01/20 08:33:13 ryoon Exp $

--- mozilla/configure.in.orig	2013-01-06 06:26:09.000000000 +0000
+++ mozilla/configure.in
@@ -2137,6 +2137,9 @@ ia64*-hpux*)
     if test -z "$MC"; then
         MC=mc.exe
     fi
+    if test "$LIBRUNPATH"; then
+	DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
+    fi
     ;;
 *-mingw*)
     DSO_CFLAGS=
@@ -3075,6 +3078,9 @@ dnl ====================================
 case $target in
 *-hpux11.*)
 	;;
+*-dragonfly*)
+	AC_CHECK_LIB(c, gethostbyname_r)
+	;;
 *)
 	AC_CHECK_LIB(c_r, gethostbyname_r)
 	;;
@@ -3376,6 +3382,9 @@ AC_CACHE_CHECK(
         #ifdef linux
         #define _BSD_SOURCE 1
         #endif
+	#ifdef __NetBSD__
+	#error use of global _res variable in threaded programs is not portable
+	#endif
         #include <resolv.h>
         ],
         [int foo = res_ninit(&_res);],
@@ -4042,6 +4051,14 @@ if test -n "$YASM"; then
   _YASM_BUILD=`        echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
 fi
 
+if test -n "${LIBXUL_SDK_DIR}"; then
+    AC_MSG_WARN([pkgsrc: LIBXUL_SDK_DIR is set; assuming we want nss and nspr from xulrunner.])
+    NSPR_CFLAGS="-I${prefix}/include/xulrunner/unstable `pkg-config --cflags mozilla-nspr`"
+    NSPR_LIBS="`pkg-config --libs mozilla-nspr`"
+    NSS_CFLAGS="`pkg-config --cflags mozilla-nss`"
+    NSS_LIBS="`pkg-config --libs mozilla-nss`"
+fi
+
 if test -z "$SKIP_LIBRARY_CHECKS"; then
 dnl system JPEG support
 dnl ========================================================
@@ -5283,8 +5300,8 @@ AC_SUBST(MOZ_WEBRTC_IN_LIBXUL)
 AC_SUBST(MOZ_SCTP)
 AC_SUBST(MOZ_SRTP)
 
-case "$target_cpu" in
-arm*)
+case "$target" in
+arm-*-linux*|*-dragonfly*|*-freebsd*|*-netbsd*|*-openbsd*)
     MOZ_SAMPLE_TYPE_S16=1
     AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
     AC_SUBST(MOZ_SAMPLE_TYPE_S16)
@@ -8690,6 +8707,7 @@ AC_SUBST(MOZ_VP8_ERROR_CONCEALMENT)
 AC_SUBST(MOZ_VP8_ENCODER)
 AC_SUBST(MOZ_VP8)
 AC_SUBST(MOZ_OGG)
+AC_SUBST(MOZ_ALSA)
 AC_SUBST(MOZ_ALSA_LIBS)
 AC_SUBST(MOZ_ALSA_CFLAGS)
 AC_SUBST(VPX_AS)
