您的位置:首页 > 其它

port systemc to mac os x

2010-12-25 23:19 337 查看
很遗憾,systemc官方提供的SDK并不能直接在 mac os x 下用 gcc编译链接。

需要做如下 修改 :

1、为configure添加编译环境支持,简单的说,就是修改config/config.sub,加入i686-apple-darwin10编译环境。不同操作系统版本下,这个字串从/usr/bin/*-*-*-gcc-*中可以看出;关键语句如下:

maybe_os=`echo $1 | sed 's/^/(.*/)-/([^-]*-[^-]*/)$//2/'` #e.g., apple-darwin10
case $maybe_os in
linux-gnu*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^/(.*/)-/([^-]*-[^-]*/)$//1/'`
;;
apple-*)
vendor=apple
basic_machine=`echo $1 | sed 's/^/(.*/)-/([^-]*-[^-]*/)$//1/'`  # i686
os=`echo $1 | sed 's/.*-/-/'`  # -darwin10
;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
;;
esac


-darwin*)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration /`$1/'system /`$os/' not recognized 1>&2
exit 1
;;
esac


3、在configure、configure.in脚本中添加i686-apple-darwin10的编译器配置:

case "$target" in
i[3456789]86-apple-darwin*)
case "$CXX_COMP" in
CC)
EXTRA_CXXFLAGS=""
DEBUG_CXXFLAGS="-g"
OPT_CXXFLAGS="-O3"
TARGET_ARCH="darwin10"
AR_TOOL="$CXX -xar -o"
CC="$CXX"
CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS"
;;
c++ | g++)
EXTRA_CXXFLAGS="-Wall"
DEBUG_CXXFLAGS="-g"
OPT_CXXFLAGS="-O3"
TARGET_ARCH="darwin10"
AR_TOOL="$ar -ruv"
CC="$CXX"
CFLAGS="$EXTRA_CXXFLAGS $OPT_CXXFLAGS"
;;
*)
{ { echo "$as_me:2730: error: /"sorry...compiler not supported/"" >&5
echo "$as_me: error: /"sorry...compiler not supported/"" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
AS=as
QT_ARCH="i686-apple-darwin10"
;;


并修改一个“硬编码”问题:am__api_version="1.6",将1.6修改为aclocal的实际版本号。

2、add #include <sys/typedef.h> in file rc//sysc/kernel/sc_cor_qt.cpp
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: