IDE Setup

From TUDOS-Wiki
Jump to navigationJump to search

Eclipse

If you want to use Eclipse to work on the ComplexLab, you need to tell Eclipse where the include files are located and provide them in the correct order.

To simplify that task, you can import this project-settings using File -> Import -> C/C++ Project Settings. Afterwards you need to rebuild the index at <Your project> -> Index -> Rebuild. Note that this settings are specific for the ComplexLab and the x86 architecture.

This is a work in progress, so don't expect it to be perfect :-)

KDevelop

KDevelop requires you to set up an index file using absolute paths. This file is called .kdev_include_paths and should reside in the root directory of your L4Re checkout. Mine looks like this:

/home/doebel/src/tudos/src/build/include/x86
/home/doebel/src/tudos/src/build/include/x86/l4f
/home/doebel/src/tudos/src/build/include
/home/doebel/src/tudos/src/build/include/l4f
/home/doebel/src/tudos/src/build/include/uclibc
/home/doebel/src/tudos/src/build/include/contrib/acpica
/home/doebel/src/tudos/src/build/include/contrib/ankh_lwip
/home/doebel/src/tudos/src/build/include/contrib/boost-1_39-lite
/home/doebel/src/tudos/src/build/include/contrib/libiniparser
/home/doebel/src/tudos/src/build/include/contrib/libio-direct
/home/doebel/src/tudos/src/build/include/contrib/libio-io
/home/doebel/src/tudos/src/build/include/contrib/libpng
/home/doebel/src/tudos/src/build/include/contrib/libstdc++-v3
/home/doebel/src/tudos/src/build/include/contrib/libudis86
/home/doebel/src/tudos/src/build/include/contrib/lua
/home/doebel/src/tudos/src/build/include/contrib/lwip
/home/doebel/src/tudos/src/build/include/contrib/zlib

VIM / YouCompleteMe

VIM's excellent YouCompleteMe plugin provides C/C++ completion and works for L4Re with some tweaks. You will need to define your own customization for YCM by putting a .ycm_extra_conf.py file in your l4/pkg directory. Start with a copy of the original file that ships with YCM (.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py).

Set the flags array to contain a list of the L4Re compile flags that should be passed to Clang for compilation. You can get those flags by doing a

 $> make VERBOSE=1

for any of your L4Re packages and copying the flags from there.

The important part of .ycm_extra_conf.py looks like this for me:

# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-m32',
'-Wall',
'-fexceptions',
# THIS IS IMPORTANT! Without a "-std=<something>" flag, clang won't know which
# language to use when compiling headers. So it will guess. Badly. So C++
# headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>". 
# For a C project, you would set this to something like 'c99' instead of
# 'c++11'.
'-std=c++11',
# ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly
# relevant for c++ headers.
# For a C project, you would set this to 'c' instead of 'c++'.
'-x',
'c++',
'-DSYSTEM_x86_586_l4f',
'-DARCH_x86',
'-DCPUTYPE_586',
'-DL4API_l4f',
'-D_GNU_SOURCE',
'-D__L4',
'-I/home/doebel/src/tudos/l4/build/include/contrib/libstdc++-v3',
'-I/home/doebel/src/tudos/l4/build/include/contrib/libudis86',
'-I/home/doebel/src/tudos/l4/build/include/contrib/libiniparser',
'-I/home/doebel/src/tudos/l4/build/include/contrib/zlib',
'-I/home/doebel/src/tudos/l4/build/include/contrib/',
'-I/home/doebel/src/tudos/l4/build/include/x86/l4f',
'-I/home/doebel/src/tudos/l4/build/include/l4f',
'-I/home/doebel/src/tudos/l4/build/include/x86',
'-I/home/doebel/src/tudos/l4/build/include',
'-nostdinc',
'-I/home/doebel/src/tudos/l4/build/include/uclibc',
'-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/include',
'-isystem /usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed'
]