Added boost coroutine, more windows build script, autobuild manifest for license.

Wed, 12 Jan 2011 16:44:39 -0800

author
Mark Palange (Mani) <palange@lindenlab.com>
date
Wed, 12 Jan 2011 16:44:39 -0800
changeset 1
5d2fab2fd055
parent 0
e72314f66307
child 2
9d5907e78bde

Added boost coroutine, more windows build script, autobuild manifest for license.

autobuild.xml file | annotate | diff | revisions
boost-coroutine-2009-12-01.patch file | annotate | diff | revisions
boost-coroutine-2009-12-01.tar.gz file | annotate | diff | revisions
boost-coroutine-linden.patch file | annotate | diff | revisions
build-cmd.sh file | annotate | diff | revisions
     1.1 --- a/autobuild.xml	Tue Jan 11 16:28:42 2011 -0800
     1.2 +++ b/autobuild.xml	Wed Jan 12 16:44:39 2011 -0800
     1.3 @@ -3,18 +3,20 @@
     1.4  <map>
     1.5      <key>package_description</key>
     1.6      <map>
     1.7 +      <key>description</key>
     1.8 +      <string>Boost C++ Libraries</string>
     1.9        <key>license</key>
    1.10 -      <string>zlib</string>
    1.11 +      <string>boost 1.0</string>
    1.12        <key>license_file</key>
    1.13 -      <string>LICENSES/zlib.txt</string>
    1.14 +      <string>LICENSES/boost.txt</string>
    1.15        <key>name</key>
    1.16 -      <string>zlib</string>
    1.17 +      <string>boost</string>
    1.18        <key>platforms</key>
    1.19        <map>
    1.20          <key>common</key>
    1.21          <map>
    1.22            <key>build_directory</key>
    1.23 -          <string>zlib-1.2.5/stage</string>
    1.24 +          <string>boost_1_45_0/stage</string>
    1.25            <key>configurations</key>
    1.26            <map>
    1.27              <key>Release</key>
    1.28 @@ -34,8 +36,7 @@
    1.29            </map>
    1.30            <key>manifest</key>
    1.31            <array>
    1.32 -            <string>include/zlib/*.h</string>
    1.33 -            <string>LICENSES/zlib.txt</string>
    1.34 +            <string>LICENSES/boost.txt</string>
    1.35            </array>
    1.36            <key>name</key>
    1.37            <string>common</string>
    1.38 @@ -109,9 +110,9 @@
    1.39          </map>
    1.40        </map>
    1.41        <key>source_directory</key>
    1.42 -      <string>zlib-1.2.5</string>
    1.43 +      <string>boost_1_45_0</string>
    1.44        <key>version</key>
    1.45 -      <string>1.2.5</string>
    1.46 +      <string>1.45.0</string>
    1.47      </map>
    1.48      <key>type</key>
    1.49      <string>autobuild</string>
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/boost-coroutine-2009-12-01.patch	Wed Jan 12 16:44:39 2011 -0800
     2.3 @@ -0,0 +1,162 @@
     2.4 +diff -rc boost-coroutine/boost/coroutine/coroutine.hpp /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/coroutine.hpp
     2.5 +*** boost-coroutine/boost/coroutine/coroutine.hpp	Wed Apr 29 14:41:05 2009
     2.6 +--- /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/coroutine.hpp	Tue Dec  1 15:25:52 2009
     2.7 +***************
     2.8 +*** 258,265 ****
     2.9 +      result_type call_impl(arg_slot_type args) {
    2.10 +        BOOST_ASSERT(m_pimpl);
    2.11 +        m_pimpl->bind_args(&args);
    2.12 +!       result_slot_type * ptr;
    2.13 +!       m_pimpl->bind_result_pointer(&ptr);
    2.14 +        m_pimpl->invoke();
    2.15 +  
    2.16 +        return detail::fix_result<result_slot_traits>(*m_pimpl->result());
    2.17 +--- 261,267 ----
    2.18 +      result_type call_impl(arg_slot_type args) {
    2.19 +        BOOST_ASSERT(m_pimpl);
    2.20 +        m_pimpl->bind_args(&args);
    2.21 +!       BOOST_DEDUCED_TYPENAME impl_type::local_result_slot_ptr ptr(m_pimpl);
    2.22 +        m_pimpl->invoke();
    2.23 +  
    2.24 +        return detail::fix_result<result_slot_traits>(*m_pimpl->result());
    2.25 +***************
    2.26 +*** 270,277 ****
    2.27 +      call_impl_nothrow(arg_slot_type args) {
    2.28 +        BOOST_ASSERT(m_pimpl);
    2.29 +        m_pimpl->bind_args(&args);
    2.30 +!       result_slot_type * ptr;
    2.31 +!       m_pimpl->bind_result_pointer(&ptr);
    2.32 +        if(!m_pimpl->wake_up())
    2.33 +  	return detail::optional_result<result_type>();
    2.34 +  
    2.35 +--- 272,278 ----
    2.36 +      call_impl_nothrow(arg_slot_type args) {
    2.37 +        BOOST_ASSERT(m_pimpl);
    2.38 +        m_pimpl->bind_args(&args);
    2.39 +!       BOOST_DEDUCED_TYPENAME impl_type::local_result_slot_ptr ptr(m_pimpl);
    2.40 +        if(!m_pimpl->wake_up())
    2.41 +  	return detail::optional_result<result_type>();
    2.42 +  
    2.43 +diff -rc boost-coroutine/boost/coroutine/detail/coroutine_impl.hpp /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/detail/coroutine_impl.hpp
    2.44 +*** boost-coroutine/boost/coroutine/detail/coroutine_impl.hpp	Sun Aug 20 13:11:09 2006
    2.45 +--- /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/detail/coroutine_impl.hpp	Tue Dec  1 16:04:48 2009
    2.46 +***************
    2.47 +*** 89,95 ****
    2.48 +      }
    2.49 +      
    2.50 +      void bind_result(result_slot_type* res) {
    2.51 +!       *m_result = res;
    2.52 +      }
    2.53 +  
    2.54 +      // Another level of indirecition is needed to handle
    2.55 +--- 89,98 ----
    2.56 +      }
    2.57 +      
    2.58 +      void bind_result(result_slot_type* res) {
    2.59 +!       // This used to be unconditional. But m_result isn't always valid.
    2.60 +!       if (m_result) {
    2.61 +!         *m_result = res;
    2.62 +!       }
    2.63 +      }
    2.64 +  
    2.65 +      // Another level of indirecition is needed to handle
    2.66 +***************
    2.67 +*** 102,120 ****
    2.68 +        return m_result;
    2.69 +      }
    2.70 +  
    2.71 +      // This function must be called only for void
    2.72 +      // coroutines. It wakes up the coroutine.
    2.73 +      // Entering the wait state does not cause this
    2.74 +      // method to throw.
    2.75 +      void run() {
    2.76 +        arg_slot_type void_args;
    2.77 +-       result_slot_type * ptr = 0;
    2.78 +        
    2.79 +        // This dummy binding is required because
    2.80 +        // do_call expect args() and result()
    2.81 +        // to return a non NULL result.
    2.82 +        bind_args(&void_args);
    2.83 +!       bind_result_pointer(&ptr);
    2.84 +        this->wake_up();
    2.85 +      }
    2.86 +    protected:
    2.87 +--- 105,157 ----
    2.88 +        return m_result;
    2.89 +      }
    2.90 +  
    2.91 ++     /// This helper class packages data/logic originally found inline in
    2.92 ++     /// coroutine::call_impl() and call_impl_nothrow(), also
    2.93 ++     /// coroutine_impl::run().
    2.94 ++     class local_result_slot_ptr
    2.95 ++     {
    2.96 ++     public:
    2.97 ++         local_result_slot_ptr(pointer pimpl):
    2.98 ++             m_pimpl(pimpl),
    2.99 ++             m_ptr(NULL)
   2.100 ++         {
   2.101 ++             m_pimpl->bind_result_pointer(&m_ptr);
   2.102 ++         }
   2.103 ++         ~local_result_slot_ptr()
   2.104 ++         {
   2.105 ++             // In the original use case, a coroutine could only be resumed by
   2.106 ++             // calling coroutine::operator() again, which would rebind the
   2.107 ++             // result pointer to a new valid value. But with the introduction
   2.108 ++             // of futures, it's possible to suspend a coroutine by waiting on
   2.109 ++             // a future object -- thus destroying the local result_slot_type*
   2.110 ++             // -- then resume that coroutine by calling the future's callback,
   2.111 ++             // bypassing coroutine::operator(). This used to leave an old,
   2.112 ++             // invalid result pointer in effect. Subsequent coroutine exit
   2.113 ++             // wrote through that pointer, munging a word of stack. Now we
   2.114 ++             // make a point of setting the bound result pointer NULL when the
   2.115 ++             // result_slot_type* to which it pointed vanishes, so that any
   2.116 ++             // attempt to dereference it will at least self-identify --
   2.117 ++             // instead of producing arbitrary undefined behavior.
   2.118 ++             m_pimpl->bind_result_pointer(NULL);
   2.119 ++         }
   2.120 ++ 
   2.121 ++     private:
   2.122 ++         pointer m_pimpl;
   2.123 ++         result_slot_type* m_ptr;
   2.124 ++     };
   2.125 ++ 
   2.126 +      // This function must be called only for void
   2.127 +      // coroutines. It wakes up the coroutine.
   2.128 +      // Entering the wait state does not cause this
   2.129 +      // method to throw.
   2.130 +      void run() {
   2.131 +        arg_slot_type void_args;
   2.132 +        
   2.133 +        // This dummy binding is required because
   2.134 +        // do_call expect args() and result()
   2.135 +        // to return a non NULL result.
   2.136 +        bind_args(&void_args);
   2.137 +!       local_result_slot_pointer(this);
   2.138 +        this->wake_up();
   2.139 +      }
   2.140 +    protected:
   2.141 +diff -rc boost-coroutine/boost/coroutine/detail/self.hpp /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/detail/self.hpp
   2.142 +*** boost-coroutine/boost/coroutine/detail/self.hpp	Sun Aug 20 13:11:09 2006
   2.143 +--- /Users/nat/linden/viewer-20-topush/libraries/include/boost/coroutine/detail/self.hpp	Wed Aug  5 16:50:17 2009
   2.144 +***************
   2.145 +*** 217,222 ****
   2.146 +--- 217,235 ----
   2.147 +        BOOST_ASSERT(m_pimpl);
   2.148 +        return m_pimpl->pending();
   2.149 +      }
   2.150 ++ 
   2.151 ++     /// @c true only if this @c self object was created by the passed @a coroutine
   2.152 ++     template <typename SomeCoroutine>
   2.153 ++     bool is_from(const SomeCoroutine& coroutine) const
   2.154 ++     {
   2.155 ++       // get_impl() only accepts non-const ref... a mistake, IMO.
   2.156 ++       return static_cast<void*>(coroutine_accessor::get_impl(const_cast<SomeCoroutine&>(coroutine)).get()) ==
   2.157 ++              static_cast<void*>(m_pimpl);
   2.158 ++     }
   2.159 ++ 
   2.160 ++     /// opaque token used to correlate this 'self' with its corresponding coroutine
   2.161 ++     void* get_id() const { return m_pimpl; }
   2.162 ++ 
   2.163 +    private:
   2.164 +      coroutine_self(impl_type * pimpl, detail::init_from_impl_tag) :
   2.165 +        m_pimpl(pimpl) {}
     3.1 Binary file boost-coroutine-2009-12-01.tar.gz has changed
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/boost-coroutine-linden.patch	Wed Jan 12 16:44:39 2011 -0800
     4.3 @@ -0,0 +1,55 @@
     4.4 +diff -rc ../boost-coroutine/boost/coroutine/coroutine.hpp boost-coroutine/boost/coroutine/coroutine.hpp
     4.5 +*** ../boost-coroutine/boost/coroutine/coroutine.hpp	Wed Apr 29 14:41:05 2009
     4.6 +--- boost-coroutine/boost/coroutine/coroutine.hpp	Wed Apr 22 09:35:22 2009
     4.7 +***************
     4.8 +*** 28,33 ****
     4.9 +--- 28,36 ----
    4.10 +  
    4.11 +  #ifndef BOOST_COROUTINE_COROUTINE_HPP_20060512
    4.12 +  #define BOOST_COROUTINE_COROUTINE_HPP_20060512
    4.13 ++ // On Linux systems, use native swapcontext() et al. rather than
    4.14 ++ // Boost.Coroutine homebrew assembler
    4.15 ++ #define BOOST_COROUTINE_NO_ASM
    4.16 +  // default_context_impl.hpp must be first for weird Apple bug
    4.17 +  #include <boost/coroutine/detail/default_context_impl.hpp>
    4.18 +  #include <cstddef>
    4.19 +diff -rc ../boost-coroutine/boost/coroutine/detail/self.hpp boost-coroutine/boost/coroutine/detail/self.hpp
    4.20 +*** ../boost-coroutine/boost/coroutine/detail/self.hpp	Sun Aug 20 13:11:09 2006
    4.21 +--- boost-coroutine/boost/coroutine/detail/self.hpp	Wed Jun  3 16:40:05 2009
    4.22 +***************
    4.23 +*** 217,222 ****
    4.24 +--- 217,235 ----
    4.25 +        BOOST_ASSERT(m_pimpl);
    4.26 +        return m_pimpl->pending();
    4.27 +      }
    4.28 ++ 
    4.29 ++     /// @c true only if this @c self object was created by the passed @a coroutine
    4.30 ++     template <typename SomeCoroutine>
    4.31 ++     bool is_from(const SomeCoroutine& coroutine) const
    4.32 ++     {
    4.33 ++       // get_impl() only accepts non-const ref... a mistake, IMO.
    4.34 ++       return static_cast<void*>(coroutine_accessor::get_impl(const_cast<SomeCoroutine&>(coroutine)).get()) ==
    4.35 ++              static_cast<void*>(m_pimpl);
    4.36 ++     }
    4.37 ++ 
    4.38 ++     /// opaque token used to correlate this 'self' with its corresponding coroutine
    4.39 ++     void* get_id() const { return m_pimpl; }
    4.40 ++ 
    4.41 +    private:
    4.42 +      coroutine_self(impl_type * pimpl, detail::init_from_impl_tag) :
    4.43 +        m_pimpl(pimpl) {}
    4.44 +diff -rc ../boost-coroutine/boost/coroutine/future.hpp boost-coroutine/boost/coroutine/future.hpp
    4.45 +*** ../boost-coroutine/boost/coroutine/future.hpp	Wed Apr 29 14:41:05 2009
    4.46 +--- boost-coroutine/boost/coroutine/future.hpp	Wed Apr 22 09:35:26 2009
    4.47 +***************
    4.48 +*** 33,38 ****
    4.49 +--- 33,41 ----
    4.50 +  #ifndef BOOST_COROUTINE_WAIT_MAX
    4.51 +  #define BOOST_COROUTINE_WAIT_MAX 10
    4.52 +  #endif
    4.53 ++ // On Linux systems, use native swapcontext() et al. rather than
    4.54 ++ // Boost.Coroutine homebrew assembler
    4.55 ++ #define BOOST_COROUTINE_NO_ASM
    4.56 +  // default_context_impl.hpp must be first for weird Apple bug
    4.57 +  #include <boost/coroutine/detail/default_context_impl.hpp>
    4.58 +  #include <boost/none.hpp>
     5.1 --- a/build-cmd.sh	Tue Jan 11 16:28:42 2011 -0800
     5.2 +++ b/build-cmd.sh	Wed Jan 12 16:44:39 2011 -0800
     5.3 @@ -29,49 +29,44 @@
     5.4  fetch_archive "$BOOST_URL" "$BOOST_ARCHIVE" "$BOOST_MD5"
     5.5  extract "$BOOST_ARCHIVE"
     5.6  
     5.7 +# Add boost coroutine to the linden lab boost build
     5.8 +COROUTINE_TAR=boost-coroutine-2009-12-01.tar.gz
     5.9 +tar xzf "$COROUTINE_TAR"
    5.10 +cd boost-coroutine
    5.11 +patch -p1 < "boost-coroutine-2009-12-01.patch"
    5.12 +patch -p1 < "boost-coroutine-linden.patch"
    5.13 +cp -rv boost/coroutine "$BOOST_SOURCE_DIR/boost/coroutine"
    5.14 +
    5.15  top="$(pwd)"
    5.16  cd "$BOOST_SOURCE_DIR"
    5.17 -	stage="$(pwd)/stage"
    5.18 -    case "$AUTOBUILD_PLATFORM" in
    5.19 -        "windows")
    5.20 -	    #install bjam, the boost build tool, to the extracted boost folder.
    5.21 -	    BJAM_URL_WINDOWS="http://sourceforge.net/projects/boost/files/boost-jam/3.1.18/boost-jam-3.1.18-1-ntx86.zip/download"
    5.22 -	    BJAM_ARCHIVE_WINDOWS="boost-jam-3.1.18-1-ntx86.zip"
    5.23 -	    BJAM_MD5_WINDOWS="15ec7ae2c8354e4d070a67660f022c5b" # for bjam 3.1.18-1-ntx86
    5.24 -	    
    5.25 -	    fetch_archive "$BJAM_URL_WINDOWS" "$BJAM_ARCHIVE_WINDOWS" "$BJAM_MD5_WINDOWS"
    5.26 -	    extract "$BJAM_ARCHIVE_WINDOWS'
    5.27 +stage="$(pwd)/stage"
    5.28  
    5.29 -	    
    5.30 -	    (cd contrib/masmx86 ; cmd.exe /C "bld_ml32.bat")
    5.31 -            build_sln "contrib/vstudio/vc10/zlibvc.sln" "Debug|Win32" "zlibstat"
    5.32 -            build_sln "contrib/vstudio/vc10/zlibvc.sln" "Release|Win32" "zlibstat"
    5.33 -            mkdir -p "$stage/lib/debug"
    5.34 -            mkdir -p "$stage/lib/release"
    5.35 -            cp "contrib/vstudio/vc10/x86/ZlibStatDebug/zlibstat.lib" \
    5.36 -                "$stage/lib/debug/zlibd.lib"
    5.37 -            cp "contrib/vstudio/vc10/x86/ZlibStatRelease/zlibstat.lib" \
    5.38 -                "$stage/lib/release/zlib.lib"
    5.39 -            mkdir -p "stage/include/zlib"
    5.40 -            cp {zlib.h,zconf.h} "$stage/include/zlib"
    5.41 +case "$AUTOBUILD_PLATFORM" in
    5.42 +    "windows")
    5.43 +	cmd.exe /C bootstrap.bat
    5.44 +	./bjam --toolset=msvc-10.0 --with-program_options --with-regex --with-python --with-signals stage 
    5.45          ;;
    5.46 -        "darwin")
    5.47 -            ./configure --prefix="$stage"
    5.48 -            make
    5.49 -            make install
    5.50 -			mkdir -p "$stage/include/zlib"
    5.51 -			mv "$stage/include/"*.h "$stage/include/zlib/"
    5.52 +    "darwin")
    5.53 +        ./configure --prefix="$stage"
    5.54 +        make
    5.55 +        make install
    5.56 +	mkdir -p "$stage/include/zlib"
    5.57 +	mv "$stage/include/"*.h "$stage/include/zlib/"
    5.58          ;;
    5.59 -        "linux")
    5.60 -            CFLAGS="-m32" CXXFLAGS="-m32" ./configure --prefix="$stage"
    5.61 -            make
    5.62 -            make install
    5.63 -			mkdir -p "$stage/include/zlib"
    5.64 -			mv "$stage/include/"*.h "$stage/include/zlib/"
    5.65 +    "linux")
    5.66 +        CFLAGS="-m32" CXXFLAGS="-m32" ./configure --prefix="$stage"
    5.67 +        make
    5.68 +        make install
    5.69 +	mkdir -p "$stage/include/zlib"
    5.70 +	mv "$stage/include/"*.h "$stage/include/zlib/"
    5.71          ;;
    5.72 -    esac
    5.73 -    mkdir -p stage/LICENSES
    5.74 -    tail -n 31 README > stage/LICENSES/zlib.txt
    5.75 +esac
    5.76 +    
    5.77 +mkdir -p "$stage/include"
    5.78 +cp -R boost "$stage/include"
    5.79 +mkdir -p "$stage/LICENSES"
    5.80 +cp LICENSE_1_0.txt "$stage/LICENSES/"boost.txt
    5.81 +
    5.82  cd "$top"
    5.83  
    5.84  pass

mercurial