Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1047330
  • 博文数量: 254
  • 博客积分: 10185
  • 博客等级: 上将
  • 技术积分: 2722
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-25 15:04
文章存档

2011年(8)

2009年(1)

2008年(31)

2007年(214)

分类: LINUX

2007-07-25 16:50:28

Compilers are set for a project:

  • Project->Project Options->Configure Options (autotools based projects only, custom projects do not have such a tab)
  • add a new configure name, e.g. --debug

Tab "General":

  • set configure arguments (e. g. --host and --build options if cross compiling)
  • set the build directory, to avoid confusions use the same name as the configuration
  • set any flags if appropiate (LDFLAGS, ENV)

Tab "C":

  • set the name of your C-compiler binary, e.g. CC, gcc, icc, kcc, ... (cross-compilers also!)
  • set any flags as appropriate (CFLAGS)

Tab "C++":

  • set the name of your C++-compiler binary, e.g. cc, g++, ... (cross-compilers also!)
  • set any flags as appropriate (CXXFLAGS)

Tab "Fortran":

  • set the name of your Fortran-compiler binary, e.g. g77, g90, gfortran, ... (cross-compilers also!)
  • set any flags as appropriate (FFLAGS)

Close the options, select your configuration in Project->Build Configuration, then run Automake & Friends, configure and make.

For example, to set up sparc-sun-solaris2.9 target cross-compiler do:

  • Project -> Project Options -> Configure Options
  • Add a new config name, e.g. "sparc-debug""
  • Configure Arguments:
--host=i686-pc-linux-gnu -- build=sparc-sun-solaris2.9
  • Build Directory:
sparc-debug
  • change to Tab C, insert name of cross gcc, e.g. sun-solaris-sparc2.9-gcc
  • change to Tab C++, insert name of cross g++, e.g. sun-solaris-sparc2.9-g++
  • Automake & Friens
  • configure
  • make

For cross debugging see Remote debugging using KDevelop 3.0 in comp.os.linux.embedded newsgroup or Cross_debugging. The kdevelop.org forum also contains some info about it.

Make sure that the binaries and libraries of the (cross-)compiler are available in $PATH and $LD_LIBRARY_PATH!

It might be necessary to change some autoconf/automake macros in configure.in to fully support your compiler -- see the last message in this thread kdevelop.org forum what to do to get gfortran (GNU F90 compiler) working.

阅读(909) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~