How to compile ASL (boost based Adobe C++ gui library) on linux?

Intro

So we spent some days with all our team that consists of 2 individuals including me (meaning that our efforts were not as professional as yours could be) at CloudObserver triing to make it out with ASL.

We have found out how to compile ASL on windows and Mac OS.

We have created some visual/graphical GUI simple tutorials on ASL that worked perfectly with Mac OS X and Windows, so we have seen that Adobe Source Libraries work for creation of at least simple UI's and dialogs.

Than we started trying to make it work on linux.

Meat

We have started with compiling ASL on linux by first fixing out of date asl_1.0.43_net_setup.sh. It was quite eazy here is our code:

#!/bin/bash

ASL_DISTRO_NAME=asl_1.0.43.tgz
ASL_NAME=source_release
APL_DISTRO_NAME=apl_1.0.43.tgz
APL_VERSION=1.0.43
APL_NAME=platform_release
ASL_DISTRO_SITE=surfnet.dl.sourceforge.net
BOOST_NAME=boost_1_44_0
BOOST_VERSION=1.44.0
BOOST_DISTRO_NAME="$BOOST_NAME".tar.gz
#-L protects against redirects
CURL_CMD=curl -L 
INTEL_TBB_NAME=tbb30_018oss
INTEL_TBB_DISTRO_NAME="$INTEL_TBB_NAME"_src.tgz

# Run a command, and echo before doing so. Also checks the exit
# status and quits if there was an error.
#
# WARNING : Does *not* work when the command uses the redirection operator (>)
#
echo_run ()
{
    echo "$@"
    "$@"
    r=$?
    if test $r -ne 0 ; then
        exit $r
    fi
}

test_path()
{
    hash $1 1>/dev/null 2>/dev/null
}

WD=`pwd`
MACHINE=`uname`
HERE=`dirname $0`

cd $HERE

if [ "$1" != "" ]; then
    ASL_DISTRO_SITE="$1"
fi
#http://surfnet.dl.sourceforge.net/project/adobe-source/adobe-source/1.0.43/asl_1.0.43.tgz
if [ ! -e $ASL_DISTRO_NAME ]; then
   echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/adobe-source/adobe-source/$APL_VERSION/$ASL_DISTRO_NAME -o $ASL_DISTRO_NAME
fi

if [ ! -e $APL_DISTRO_NAME ]; then
   echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/adobe-source/adobe-source/$APL_VERSION/$APL_DISTRO_NAME -o $APL_DISTRO_NAME
fi

if [ ! -e $BOOST_DISTRO_NAME ]; then
    echo_run ${CURL_CMD} http://$ASL_DISTRO_SITE/project/boost/boost/$BOOST_VERSION/$BOOST_DISTRO_NAME -o $BOOST_DISTRO_NAME
fi

if [ ! -e $INTEL_TBB_DISTRO_NAME ]; then
    echo_run ${CURL_CMD} http://www.threadingbuildingblocks.org/uploads/78/154/3.0/$INTEL_TBB_DISTRO_NAME -o $INTEL_TBB_DISTRO_NAME
fi

if [ ! -d adobe_root ]; then
    echo_run mkdir adobe_root
fi

if [ ! -d adobe_root/adobe_source_libraries ]; then
   echo_run tar -xzf $ASL_DISTRO_NAME
   echo_run mv $ASL_NAME adobe_root/adobe_source_libraries
fi

if [ ! -d adobe_root/adobe_platform_libraries ]; then
   echo_run tar -xzf $APL_DISTRO_NAME
   echo_run mv $APL_NAME adobe_root/adobe_platform_libraries
fi

if [ ! -e adobe_root/boost_libraries/INSTALL ]; then
    # move the boost distro into place
    echo_run tar -xzf $BOOST_DISTRO_NAME
    echo_run rm -rf adobe_root/boost_libraries
    echo_run mv $BOOST_NAME adobe_root/boost_libraries
fi

if [ ! -e adobe_root/intel_tbb_libraries/README ]; then
    # move the intel_tbb distro into place
    echo_run tar -xzf $INTEL_TBB_DISTRO_NAME
    echo_run rm -rf adobe_root/intel_tbb_libraries
    echo_run mv $INTEL_TBB_NAME adobe_root/intel_tbb_libraries
fi

cd $HERE
echo_run adobe_root/adobe_source_libraries/tools/patch_boost.sh

if [[ $MACHINE == "Darwin" ]]
then
    cd adobe_root/adobe_platform_libraries
else
    cd adobe_root/adobe_source_libraries
fi

echo_run ../adobe_source_libraries/tools/build.sh

echo Done!

exit 0

So we hade libasl_dev.a compiled. Sadly only it. Which is quite useless for us because we want to have a GUI, not just Adam reader.

So we needed some analog to libasl_widgets.dll on Windows - libasl_widgets_dev.a. I quote ASL/platform_release/jamroot.jam

APL doesn't support gcc cygwin, though ASL does. Only supported toolsets for APL are msvc and darwin

So adobe talls us that It does support Linux. That is just Sad! Way 2 Sad! So we found missioncode project.

It was dated to year 2006 and boost 1.33.1 so it was sad. Also it was sad in here

External libraries which are used by mission are kept in here.

This keeps them in our build, and means we don't have to have any magical build scripts/rules to get the prereqs installed.

Meaning that thay do not have any separate build files for libraries - libraries are merjed into project. But all project is compiled via bjam and inside the project Boost, ASL and other libraries are subdivided into projects. That means each of that subprojects compiles in order and intoan exequtable or into lib.

But all we really needed from ASL was simple GUI for simple needs of not GUI centric small crossplatform opensource project. All we needed was a button, a scale (aka slider, aka trackbar) and a text input feild. And some scale options for future development. So we thought - lets compele ASL from missioncode project any way we can.

We first tried some modern Ubuntu 11 and 11 and OpenSuse (Mono for VMware release from here) we use every day. But it constantly failed with tons of errors. So we thought - lets compile it on earlier, more appropriate for project age OS. We started with Ubuntu 4 and were going up version by version. It compiled on 6.10 with some minor fixes like

diff -crB original/external/adobe/adobe/basic_sheet.hpp modified/external/adobe/adobe/basic_sheet.hpp
*** original/external/adobe/adobe/basic_sheet.hpp   2011-06-25 08:21:48.000000000 +0400
--- modified/external/adobe/adobe/basic_sheet.hpp   2011-06-25 08:24:33.000000000 +0400
***************
*** 13,18 ****
--- 13,19 ----

  #include <deque>
  #include <map>
+ #include <vector>

  #include <adobe/name.hpp>
  #include <adobe/any_regular.hpp>
diff -crB original/external/adobe/source/xstring.cpp modified/external/adobe/source/xstring.cpp
*** original/external/adobe/source/xstring.cpp  2011-06-25 08:21:46.000000000 +0400
--- modified/external/adobe/source/xstring.cpp  2011-06-25 08:24:10.000000000 +0400
***************
*** 331,337 ****
  {
      typedef std::iterator_traits<store_iterator>::difference_type   difference_type;

!     difference_type range_size(boost::size(range));

      if (!range_size) return glossary_m.end();

--- 331,337 ----
  {
      typedef std::iterator_traits<store_iterator>::difference_type   difference_type;

!     difference_type range_size(boost::distance(range));

      if (!range_size) return glossary_m.end();

we had Missioncode compiling ASL with Widgets. Widgets were entirely created by mission code augthor so there were no any waranty if thay worked.. but we had full missioncode trunk compiled (also an application called missionPhoto) and app worked just fine.

We tried to compile our code with that full ASL but it appeared that ASL api's we had on window do not work on ASL we had on windows... like more or less at all.=(

Not an End

But still there is hope that any one of you dear SO users with lots of experience would look at ASL that thay have in MissionCode and on current ASL and would provide all of us with working ASL 1.0.43 for linux.



It seems that current version of apl doesn't support building for linux. It stated in docs: http://stlab.adobe.com/asl_readme.html#Building_for_Mac.2C_.2ANIX. Also you can see it in apl directories structure. There are $APL_ROOT/windows and $APL_ROOT/macintosh directories, but no any linux related directory (something like gtk, qt etc.)
About "mission code" project: they use some older version of adobe libraries (it has no separation for asl and apl etc.). It possible that previous versions of adobe libs supported building for linux (or maybe mission code programmers added spport for gtk by themselves).
In theory It's possible to add support for new platform by implementing similar functionality as implemented for win and macos (in current version this code is about 6...8k lines for each of them), but I don't think that this work would be too easy.
Anyway, goodluck ! :)

链接地址: http://www.djcxy.com/p/53342.html

上一篇: Apache 2.2重定向到SSL *然后* auth(解决方案<但它是废话?)

下一篇: 如何在Linux上编译ASL(基于boost的Adobe C ++ gui库)?