Showing posts with label tip. Show all posts
Showing posts with label tip. Show all posts

Sunday, 12 July 2009

HOWTO: install Adobe Air on Feodra 11

Just guest Redhat developers want to improve the boot speed, they make the fedora 11 without some 'useful' packages by default. This makes some program can not installed properly, such as Adobe Air.

The fix:
================

yum -y install xterm gtk2-devel gnome-keyring libxml2-devel libxslt rpm-devel nss
From: yum -y install xterm gtk2-devel gnome-keyring libxml2-devel libxslt rpm-devel nss

放弃在Mac 10.5.7 上安装GNUstep 0.23

经过大半个星期的下班时间调试,尝试在Mac osx 10.5.7 (darwin 9.7)上安装GNUstep 0.23,最终没有成功,还把Mac弄残一次,我猜可能是由于compiling的时候出现的segmentation fault致使Kernel Panic。


总结失败教训如下:
  1. make的时候,常常是需要 $LDFLAG 比用到 $DYLD_LIBRARY_PATH 的时候多。后者貌似更像是运行程序的时候使用,而不是configure和make时候用。
  2. Mac作为操作系统,其界面无可争议,但是底层系统方面,我个人觉得还不如Linux。在最近的console下编译程序的时候,出现两次致使Mac不断重启的情况,而解决方法都是不得不重装系统后,第二次更离谱,连cmd+s的single user mode都无法进入。Mac啊,现在给我的感觉是典型的外强中干。
  3. GNUstep需要有gnu的objc runtime,如果用默认的设置,必然使得其调用mac自带的gcc和objc的库,这样肯定会带来些兼容性的问题。 我猜我弄出的两次mac无法开机不断重启,与此两种不兼容并冲突的objc有关系。因为GNUstep在ubuntu 9.04和fedora 11下编译运行的很好。如果想在Mac上安装,我觉得还得是要等macports提供,macports跟进的还算不错,对gnustep,和官方新版本放出的时间也就差2个星期左右。可是,macports下的objc目前还不能安装,等到这个出现后,可以再试编译gnustep源文件。

以下是我用到的env设置:
#export LDFLAGS='-L/usr/local/lib -L/usr/lib -L/opt/local/lib -L/sw/lib'
export LDFLAGS='-L/opt/local/lib -L/sw/lib -L/usr/GNUstep/Local/Library/Libraries'
#export DYLD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/local/lib:/sw/lib

export CPPFLAGS='-I/opt/local/include -I/sw/include'
#export CFLAGS='-I/usr/local/include -I/usr/include -I/opt/local/include -I/sw/include'

export PATH=/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sb:/usr/bin:/bin:/usr/sbin:/sbin

#. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh

注:个人认为,在编译gnu的程序时,最好避免用到mac自带的一些命令。而且,最好在编译之前,把/usr/bin/gcc改成是 /opt/local/bin/gcc-mp-4.2这样的,以防止避免gnu和mac的程序冲突。

Tuesday, 7 July 2009

HOWTO: compile source code on MAC OS X

Conditions:

======================
Macport (recommended, can be found on apple.com, updated and organized well) and Fink are installed in default locations, /opt/local and /sw.

Note: Fink is buggy, normally reinstallation on the previous version will not work, issues like path setup maybe occur, either bin files or libraries are not accessible.

To compile:
======================
  1. For library invoking:
    export LDFLAGS='-L/usr/local/lib -L/usr/lib -L/opt/local/lib -L/sw/lib'
    - '-L/dir' is the convention to setup gcc switch, while -L for make is --check-symlink-times, useless for me :)
    - Official way for invoking library is to setup $DYLD_LIBRARY_PATH (export DYLD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/local/lib:/sw/lib), which in Linux is $LD_LIBRARY_PATH by default.
    - Normally lib path don't need specified, because the bin files (in /usr/bin or /opt/local/bin' will know where to get appropriate libraries, no matter bin files from Macports or Fink.

  2. For header files invoking:
    export CPPFLAGS='-I/usr/local/include -I/usr/include -I/opt/local/include -I/sw/include'
    - This is the way to setup both 'make' and 'gcc' switch, which is 'make -I/usr/local/include'.

Example:
=====================
The following are what I typed in terminal with user root to compile GNUstep-0.22.

export CPPFLAGS='-I/usr/local/include -I/opt/local/include'
export LDFLAGS='-L/usr/local/lib -L/usr/lib -L/opt/local/lib -L/sw/lib'
export DYLD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/local/lib:/sw/lib:/usr/GNUstep/Local/Library/Libraries
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter