File pion-net-boost-linking.patch of Package pion-net

Reorder libraries detection, link boost-system to boost-thread.

Author: Jan Vcelak <jvcelak@redhat.com>

--- a/common/build/pion-boost.inc
+++ b/common/build/pion-boost.inc
@@ -52,41 +52,41 @@
 AC_SUBST(BOOST_DATE_TIME_LIB)
 
 
-# Check for Boost Thread library
-BOOST_TRY_LIB=thread
+# Check for Boost System library
+BOOST_TRY_LIB=system
 BOOST_TRY_LINK="boost_${BOOST_TRY_LIB}${BOOST_LIB_EXTENSION}"
 LIBS_SAVED="$LIBS"
-LIBS="$LIBS_SAVED -l${BOOST_TRY_LINK} ${BOOST_DATE_TIME_LIB}"
+LIBS="$LIBS_SAVED -l${BOOST_TRY_LINK}"
 AC_MSG_CHECKING([for boost::${BOOST_TRY_LIB} library])
-AC_TRY_LINK([#include <boost/thread/thread.hpp>
-	#include <boost/thread/condition.hpp>],
-	[ boost::thread current_thread; return 0; ],
+AC_TRY_LINK([#include <boost/system/error_code.hpp>],
+	[ boost::system::error_code error_code; std::string message(error_code.message()); return 0; ],
 	[ AC_MSG_RESULT(ok)
-	  BOOST_THREAD_LIB="-l${BOOST_TRY_LINK}"
+	  BOOST_SYSTEM_LIB="-l${BOOST_TRY_LINK}"
 	],
 	[ AC_MSG_RESULT(not found)
 	  AC_MSG_ERROR(Unable to link with the boost::${BOOST_TRY_LIB} library)
 	])
 LIBS="$LIBS_SAVED"
-AC_SUBST(BOOST_THREAD_LIB)
+AC_SUBST(BOOST_SYSTEM_LIB)
 
 
-# Check for Boost System library
-BOOST_TRY_LIB=system
+# Check for Boost Thread library
+BOOST_TRY_LIB=thread
 BOOST_TRY_LINK="boost_${BOOST_TRY_LIB}${BOOST_LIB_EXTENSION}"
 LIBS_SAVED="$LIBS"
-LIBS="$LIBS_SAVED -l${BOOST_TRY_LINK}"
+LIBS="$LIBS_SAVED -l${BOOST_TRY_LINK} ${BOOST_DATE_TIME_LIB} ${BOOST_SYSTEM_LIB}"
 AC_MSG_CHECKING([for boost::${BOOST_TRY_LIB} library])
-AC_TRY_LINK([#include <boost/system/error_code.hpp>],
-	[ boost::system::error_code error_code; std::string message(error_code.message()); return 0; ],
+AC_TRY_LINK([#include <boost/thread/thread.hpp>
+	#include <boost/thread/condition.hpp>],
+	[ boost::thread current_thread; return 0; ],
 	[ AC_MSG_RESULT(ok)
-	  BOOST_SYSTEM_LIB="-l${BOOST_TRY_LINK}"
+	  BOOST_THREAD_LIB="-l${BOOST_TRY_LINK}"
 	],
 	[ AC_MSG_RESULT(not found)
 	  AC_MSG_ERROR(Unable to link with the boost::${BOOST_TRY_LIB} library)
 	])
 LIBS="$LIBS_SAVED"
-AC_SUBST(BOOST_SYSTEM_LIB)
+AC_SUBST(BOOST_THREAD_LIB)
 
 
 # Check for Boost Filesystem library