LSB Eclipse Plugin Getting Started

From ISP_RAS
Jump to: navigation, search

This document describes the general steps to get started with the LSB Eclipse Plugin.

System requirements

  1. Eclipse version 3.3 or higher (3.4 is preferable) for Linux platform: http://www.eclipse.org/downloads/
  2. C Development Tools (CDT) version 4.0 or higher (5.0 is preferable): http://www.eclipse.org/cdt/downloads.php (alternatively you can use the integrated Eclipse IDE for C/C++ Developers)
  3. GCC Toolchain (included as optional tool in CDT)
  4. Java Runtime Environment (JRE) version 1.5.0 or higher (1.6.0 is preferable) for Linux platform: http://java.sun.com/javase/downloads/index.jsp
  5. LSB SDK: http://ldn.linuxfoundation.org/support/downloads
  6. Linux Application Checker version 1.2.3 or higher: Linux App Checker Releases

Installation and uninstallation

To install or uninstall plug-in please use LSB Eclipse Plugin Update Site

Usage

  1. Creating new LSB projects
    Creating a new LSB C/C++ project is similar to creating a usual C/C++ Eclipse project:
    • select "File -> New -> Project", select "C Project" (or "C++ Project"),
    • enter project name,
    • select project type ("Executable", "Shared Library" or "Static Library") or template,
    • make sure that "LSB Toolchain" is selected in the "Toolchain" list-box,
    • press "Finish".
      Eclipse SDK Create.png
      The new project will be compiled using the lsbcc/lsbc++ compilers from LSB SDK with the "LSB Version" option set to default. If you want to change this option to another one, see the next item.
  2. Changing the LSB target version
    To build application that satisfies the previous LSB standards, set the appropriate value for the "LSB Version" option in the project's settings:
    • select your project,
    • select "LSB -> Properties for <project>" from the main menu,
    • in the "Tool Settings" page within the resulting dialog select the "LSB Settings" category,
    • in the "LSB Version" combo-box select the target LSB version,
    • finally, apply changes, close the dialog and rebuild the project.
      Eclipse SDK Change.png
  3. Converting existing projects
    If you have already a standard project with "Linux GCC" toolchain, you can change it to "LSB Toolchain". To do so:
    • select your project,
    • select "Project -> Properties" from the main menu,
    • expand the "C/C++ Build" outline tree node within the resulting dialog, select "Tool Chain Editor",
    • in the "Current toolchain" combo-box select "LSB Toolchain" item,
    • finally, apply changes, close the dialog and rebuild the project.
      Eclipse SDK Toolchain.png
  4. Checking your application
    Linux Application Checker allows you to check your applications for cross-distro compatibility, as well as for LSB compliance. To check the application:
    • select your project,
    • select "LSB -> Check selected projects with Linux AppChecker" main menu item.
    • Also this command can be called from the project popup menu or via toolbar button.
      Please note, that the AppChecker Server should be running. If it is not started, please run the following command:
      $ <path_to_app_checker>/bin/app-checker-start.pl
      Note: this function is available only in "C/C++" perspective and not applicable for static libraries.
      Eclipse AppCheck Toolbar.png
      The result of this check will be opened in the internal browser on a new tab of Source Editor:
      Eclipse AppCheck Result.png
  5. Changing the LSB version to check against
    By default, AppChecker checks your program against the LSB version, specified in the project's settings (see p.2), but you can change this behaviour:
    • select "LSB -> Preferences..." from the main menu,
    • in the section "LSB version to check against:" within the resulting dialog make one of three choices: "From project's settings", "Maximum available" or "Chosen:",
    • if you selected the third variant, then choose one on the available LSB versions in the activated combo-box,
    • finally, apply changes, close the dialog and see p.4.
      Eclipse Preferences.png
  6. Integration with the LSB Database Navigator
    LSB Navigator provides information for the given interfaces, types or constants about LSB status, presence in distributions and usage by applications.
    To retrieve such information:
    • set the caret position to the syntax symbol (not keyword) that interests you,
    • press Ctrl+4.
    • Also this command can be called from the main menu or via toolbar button.
      Note: make sure, that your internet connection is active.
      Note: this function is available only in "C/C++" perspective.
      Eclipse Navigator Toolbar.png
      The result of this check will be opened in the internal browser on a new tab of Source Editor:
      Eclipse Navigator Result.png
Personal tools