[转载][心得] Alchemy环境配置详细说明

[url]http://bbs.9ria.com/viewthread.php?tid=71368&extra=page%3D1%26amp;orderby%3Ddateline%26amp;filter%3D86400[/url]

本帖最后由 rison 于 2010-12-29 21:43 编辑


官方教程地址:
http://labs.adobe.com/wiki/index.php/Alchemy:Documentation:Getting_Started#Steps_2

因为不熟悉Cygwin,配的过程简直是折磨.现在把各步的说明都写详细点,希望有帮助.

[color=orange]Step 1 Download and install Cygwin. Make sure to install the following packages:Perl,zip,gcc / g++[/color]
下载安装Cygwin,安装 Perl,zip,gcc/g++ package.
在这里下安装文件:http://www.cygwin.com/setup.exe
之后一路默认到选package的地方,注意几个地方:
一是位置,zip包在Archive下,gcc / g++ 在Devel下,Perl全要下.
二是Perl那个在文件外面点成install就可以了,不用展开来一个个选中了.如图:

三是选中的项目前面有个x,不要选反了,src那栏不用选中,如图:


[color=orange]Step 2 Download and install Java.
Step 3 Make sure to restart the Cygwin terminal after installing Java.
这个没什么好说的,一般都有Java环境吧.

Step 4 Download and install the Flex SDK, and add the $FLEX_HOME/bin directory to your Cygwin environment's path (within ~/.bashrc) (See below for an example).[/color]
下载Flex SDK,添加Flex到Cygwin环境变量,进入Cygwin安装目录\etc下,打开profile,修改PATH:
PATH=/cygdrive/d/as3/flex_sdk_3.4/bin:/usr/local/bin:/usr/bin:/bin:$PATH
复制代码
本人flex_sdk_3.4放在D盘as3目录下.

Step 5 Download the Alchemy Package for your system from the pre-release site. For this example, we will assume that Windows is being used.
下载Alchemy包,Adobe官网最神奇的是总能让你找不到想下载的东西,上面的Java,Cygwin有链接,这里的Alchemy居然没有.
http://labs.adobe.com/downloads/alchemy.html
window下开发,下最下面这个:Download the Alchemy Toolkit for Cygwin on Windows (ZIP, 37.6 MB)

[color=orange]Step 6 Unzip the package and copy the alchemy folder to you system. We will refer to this path as $ALCHEMY_HOME
Step 7 Open a Cygwin terminal and change to the $ALCHEMY_HOME/ directory.
Step 8 Run the $ALCHEMY_HOME/config script[/color]
将Alchemy解压到比如c:\alchemy下,打开Cygwin,执行
cd /cygdriver/c/alchemy/
复制代码
切换到alchemy目录下,执行
./config
复制代码
[color=orange]Step 9 Open alchemy_setup for editing and add the path to the ADL executable (included in the Flex SDK):
Make sure to uncomment this line, and that it contains the path to ADL.exe on your system.[/color]
打开alchemy目录下的alchemy_setup,取消adl设置这行前的#注释,变成这样:
export ADL=cygdrive/d/as3/flex_sdk_3.4/bin/adl.exe
复制代码
[color=orange]Step 10 Open your bash setup script to edit. This can usually be found in the ~/.bashrc file.
Step 11 Edit the the .bashrc script so that alchemy-setup is run when the script is run:
Step 12 Add $ALCHEMY_HOME/achacks to your path.
Step 13 Save the file, and restart your cygwin terminal.[/color]
打开Cygwin\etc下bash.bashrc文件,在最下面添加这三行,然后关闭Cygwin重新打开,本人alchemy放在D盘根目录下:
source /cygdrive/d/alchemy/alchemy-setup
PATH=$ALCHEMY_HOME/achacks:/cygdrive/d/as3/flex_sdk_3.4/bin:$PATH
export PATH
复制代码
[color=orange]Step 14 Change to the $ALCHEMY_HOME/bin directory, and run the following command:ln -s llvm-stub llvm-stub.exe[/color]
执行
cd /cygdriver/c/alchemy/bin
复制代码
切换到该目录,执行
ln -s llvm-stub llvm-stub.exe
复制代码
这个操作以后编译不用再执行.

[color=orange]Step 15 Change to the $ALCHEMY_HOME/samples/stringecho directory
Step 16 Type the following command in the terminal[/color]
用自带例子来试下,执行
cd $ALCHEMY_HOME/samples/stringecho/
复制代码
切换到例子目录,
执行
alc-on; which gcc
复制代码
可以看到被使用的gcc的程序位置

[color=orange]Step 17 Enter the following command to compile the c program into a SWC:[/color]
最后一步,将例子里的c程序转换成flash项目用的swc组件,执行
gcc stringecho.c -O3 -Wall -swc -o stringecho.swc
复制代码
看到这两行是正常的:
$ gcc stringecho.c -O3 -Wall -swc -o stringecho.swc
WARNING: While resolving call to function 'main' arguments were dropped!
复制代码
结果还有这个:
[Compiler] Error #1063: Unable to open file: /cygdrive/c/alchemy/flashlibs/global.abc.
[Compiler] Error #1063: Unable to open file: /cygdrive/c/alchemy/flashlibs/playerglobal.abc.
复制代码
生成的swc也明显不对才几k,查了下还要改个地方:
http://forums.adobe.com/thread/201580
打开\alchemy\achacks下hacks.pl
if(`uname` =~ /CYGWIN/)
复制代码
改成
if (`/bin/uname` =~ /CYGWIN/)
复制代码
再执行刚才的gcc那行,终于可以了.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值