$NetBSD: patch-ai,v 1.1 2006/09/26 07:27:19 martti Exp $

--- configure.orig	2006-05-06 15:54:17.000000000 +0000
+++ configure
@@ -30035,13 +30035,13 @@ fi
 if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
 THREAD_LIB=error
 if test "${THREAD_LIB}" = "error"; then
-  echo "$as_me:$LINENO: checking for main in -lpthread" >&5
-echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for main in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" >&5
+echo $ECHO_N "checking for main in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}... $ECHO_C" >&6
 if test "${ac_cv_lib_pthread_main+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -30093,7 +30093,7 @@ fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
 if test $ac_cv_lib_pthread_main = yes; then
-  THREAD_LIB="-lpthread"
+  THREAD_LIB="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}"
 fi
 
 fi
@@ -36628,7 +36628,7 @@ fi;
 test "${enable_debug}" != "yes" && enable_debug="no"
 
 
-if test "x${enable_debug}" == "xno"; then
+if test "x${enable_debug}" = "xno"; then
   cat >>confdefs.h <<\_ACEOF
 #define NDEBUG 1
 _ACEOF
@@ -37311,7 +37311,7 @@ echo "${ECHO_T}yes" >&6
 
 
   for element in access_dv; do
-    eval "LDFLAGS_${element}="'"'"-L${with_dv_raw1394}/lib -lraw1394 -lpthread "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${with_dv_raw1394}/lib -lraw1394 ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -37563,7 +37563,7 @@ echo $ECHO_N "checking for avc1394 heade
 echo "${ECHO_T}yes" >&6
 
   for element in access_dv; do
-    eval "LDFLAGS_${element}="'"'"-L${with_dv_avc1394}/lib -lavc1394 -lrom1394 -lpthread "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${with_dv_avc1394}/lib -lavc1394 -lrom1394 ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -37727,7 +37727,7 @@ if test `eval echo '${'$as_ac_Header'}'`
 _ACEOF
 
   for element in access_dv; do
-    eval "LDFLAGS_${element}="'"'"-lavc1394 -lrom1394 -lpthread "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-lavc1394 -lrom1394 ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -37766,7 +37766,7 @@ echo "$as_me: error: cannot cd to ${real
 echo "${ECHO_T}${real_dv_avc1394_tree}/src/.libs/libavc1394.a" >&6
 
   for element in access_dv; do
-    eval "LDFLAGS_${element}="'"'"-L${real_dv_avc1394_tree}/src/.libs -lavc1394 -lrom1394 -lpthread "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${real_dv_avc1394_tree}/src/.libs -lavc1394 -lrom1394 ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -43126,14 +43126,14 @@ echo "${ECHO_T}no" >&6
 echo "$as_me: error: cannot cd to ${with_ffmpeg_tree}" >&2;}
    { (exit 1); exit 1; }; }
    fi
-   if ! test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
+   if ! test -f "${real_ffmpeg_tree}/libavcodec.a"; then
           echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-     { { echo "$as_me:$LINENO: error: cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}" >&5
-echo "$as_me: error: cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}" >&2;}
+     { { echo "$as_me:$LINENO: error: cannot find ${real_ffmpeg_tree}/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}" >&5
+echo "$as_me: error: cannot find ${real_ffmpeg_tree}/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}" >&2;}
    { (exit 1); exit 1; }; }
    fi
-   if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec/libavcodec.a"; then
+   if ! fgrep -s "pp_get_context" "${real_ffmpeg_tree}/libavcodec.a"; then
      if test -f "${real_ffmpeg_tree}/libavcodec/libpostproc/libpostproc.a"; then
 
   for element in ffmpeg; do
@@ -43144,13 +43144,13 @@ echo "$as_me: error: cannot find ${real_
      else
               echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6
-       { { echo "$as_me:$LINENO: error: ${real_ffmpeg_tree}/libavcodec/libavcodec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp" >&5
-echo "$as_me: error: ${real_ffmpeg_tree}/libavcodec/libavcodec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp" >&2;}
+       { { echo "$as_me:$LINENO: error: ${real_ffmpeg_tree}/libavcodec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp" >&5
+echo "$as_me: error: ${real_ffmpeg_tree}/libavcodec.a was not compiled with postprocessing support, make sure you configured ffmpeg with --enable-pp" >&2;}
    { (exit 1); exit 1; }; }
      fi
    fi
-      echo "$as_me:$LINENO: result: ${real_ffmpeg_tree}/libavcodec/libavcodec.a" >&5
-echo "${ECHO_T}${real_ffmpeg_tree}/libavcodec/libavcodec.a" >&6
+      echo "$as_me:$LINENO: result: ${real_ffmpeg_tree}/libavcodec.a" >&5
+echo "${ECHO_T}${real_ffmpeg_tree}/libavcodec.a" >&6
 
    if fgrep -s "CONFIG_ZLIB=yes" "${real_ffmpeg_tree}/config.mak"; then
      if test "${with_ffmpeg_zlib}" != "yes"; then
@@ -43318,7 +43318,7 @@ fi
 
 
   for element in ffmpeg; do
-    eval "LDFLAGS_${element}="'"'"-L${real_ffmpeg_tree}/libavcodec ${real_ffmpeg_tree}/libavcodec/libavcodec.a "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${real_ffmpeg_tree}/libavcodec ${real_ffmpeg_tree}/libavcodec.a "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -55864,7 +55864,7 @@ fi
 
 
   for element in directfb; do
-    eval "LDFLAGS_${element}="'"'"-ldirectfb -lfusion -ldirect -lpthread -ljpeg -lz -ldl "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-ldirectfb -lfusion -ldirect ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} -ljpeg -lz -ldl "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -56043,7 +56043,7 @@ if test "${with_directfb+set}" = set; th
 
 
   for element in directfb; do
-    eval "LDFLAGS_${element}="'"'"-L${with_directfb}/lib -ldirectfb -lfusion -ldirect -lpthread -ljpeg -lz -ldl "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"-L${with_directfb}/lib -ldirectfb -lfusion -ldirect ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} -ljpeg -lz -ldl "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -58056,7 +58056,7 @@ echo $ECHO_N "checking for XML parser to
       LIBS_save="$LIBS"
       LIBS_cclink="no"
       for l in "`xml2-config --libs`" -lexpat -lxerces-c; do
-        LIBS="$LIBS_save ${real_cyberlink_tree}/lib/unix/libclink.a -lpthread $l"
+        LIBS="$LIBS_save ${real_cyberlink_tree}/lib/unix/libclink.a ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $l"
         cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -58120,7 +58120,7 @@ rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
       done
       LIBS="${LIBS_save}"
-            if test "${LIBS_cclink}" == "no"; then
+            if test "${LIBS_cclink}" = "no"; then
   { { echo "$as_me:$LINENO: error: cannot find XML parser for CyberLink
 See \`config.log' for more details." >&5
 echo "$as_me: error: cannot find XML parser for CyberLink
@@ -58132,7 +58132,7 @@ fi
 echo "${ECHO_T}${LIBS_cclink}" >&6
 
   for element in upnp_cc; do
-    eval "LDFLAGS_${element}="'"'"${real_cyberlink_tree}/lib/unix/libclink.a -lpthread ${LIBS_cclink} "'$'"{LDFLAGS_${element}} "'"'
+    eval "LDFLAGS_${element}="'"'"${real_cyberlink_tree}/lib/unix/libclink.a ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} ${LIBS_cclink} "'$'"{LDFLAGS_${element}} "'"'
     am_modules_with_ldflags="${am_modules_with_ldflags} ${element}"
   done
 
@@ -58181,7 +58181,7 @@ if test "${ac_cv_lib_upnp_UpnpInit+set}"
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lupnp -lpthread $LIBS"
+LIBS="-lupnp ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -58244,7 +58244,7 @@ else
   has_upnp="no"
 fi
 
-  if test "x${enable_upnp}" != "x" && test "${has_upnp}" == "no"; then
+  if test "x${enable_upnp}" != "x" && test "${has_upnp}" = "no"; then
    
     { { echo "$as_me:$LINENO: error: cannot find Intel UPnP SDK (libupnp)" >&5
 echo "$as_me: error: cannot find Intel UPnP SDK (libupnp)" >&2;}
@@ -58252,7 +58252,7 @@ echo "$as_me: error: cannot find Intel U
 
 fi
 
-  if test "${has_upnp}" == "yes"; then
+  if test "${has_upnp}" = "yes"; then
 
 
   for element in upnp_intel; do
@@ -58271,7 +58271,7 @@ else
 fi
 
 
-if test "${has_upnp}" == "yes"; then
+if test "${has_upnp}" = "yes"; then
 
 
   PLUGINS="${PLUGINS} upnp_intel"
