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
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.