IDA BUILDLIB command

The IDA BUILDLIB CLPPlus command builds a C++ shared library, that is, it produces the executable code that can be used by one or more UDXs that are written in C++. This command carries out the same steps as the IDA DEPLOYUDX command, except that it does not register a UDX to use the generated library file.

This command:
  • Creates a project directory on the database server under user home and uploads the compressed file containing the UDX source files to the project directory.
  • Compiles all source files to create object files.
  • Links the object files to create a library file.
  • Promotes the library file and other files that are used by the library to the release directory.

As with the IDA DEPLOYUDX command, you can specify the parameters that control these steps in the command string, in an IDA parameter file, or in both (see IDA parameter file). If the specified IDA parameter file contains parameters that do not apply to the build process (for example, a UDX signature or return type), those parameters are ignored.

Invocation

You must run this command from the CLPPlus interface.

Authorization

None

Required connection

CLPPlus must be connected to the database.

Command syntax

IDA BUILDLIB

Read syntax diagramSkip visual syntax diagramIDA BUILDLIBPARAMFILEparameter_fileSOURCEcompressed_filePROJECTname_of_compressed_file PROJECTprojectPROMOTEfile_namePROMOTE",file_name"REPLACEPROMPTREPLACEYESREPLACENOLIBRARYlib name_of_projectLIBRARYlibraryLIBRARY library(,file)USELIBRARY project_nameUSELIBRARYproject_name:library.soINCLUDEDIRECTORIESdirectoryINCLUDEDIRECTORIES",directory"BINDIRbinBINDIRdir

Command parameters

PARAMFILE
The name of an IDA parameter file that determines the default values of any parameters that are not explicitly specified for this command (see IDA parameter file).

Any mandatory main parameters that are not specified explicitly in the command string must be specified by means of a parameter file. The only mandatory main parameter for this command is SOURCE (which can be abbreviated to SRC).

SOURCE | SRC
The fully-qualified name of a compressed file that contains all of the source files that are needed by the UDX for which a library is to be built.
PROJECT | PROJ
The name of the project directory that is to be created for the specified set of source files. The name can contain only alphanumeric characters (A-Z, a-z, 0-9) and underscore characters (_). The default is the name, without the extension, of the file specified for the SOURCE parameter.
PROMOTE
A comma-separated list of files that, in addition to the generated library (and for UDXs written in C++, in addition to the files specified for the library parameter) are to be promoted to the release directory.
ENVIRONMENT | ENV
A string containing a comma-separated list of the environment variables that are to be used during UDX registration. For example:
ENV "'USD_TO_INR'='60','EUR_TO_INR'='80'"
REPLACE
If a project with the specified name already exists, whether to:
YES
Delete the existing project and replace it with the new one.
NO
Cancel the command and take no action.
PROMPT
Prompt the user to specify whether to:
  • Continue with the command and delete and replace the existing project.
  • Cancel the command and take no action.
LIBRARY | LIB
The name that is to be assigned to the generated library file, including the extension. The default is a name of the form lib<project>.so. For example, if the project name is udx77, the default name of the generated library will be libudx77.so.

If additional object files (.o files), static libraries (.a files), or shared libraries (.so files) are to be included in the link step and promoted to the release directory, these can be specified in a comma-separated list following the specified library name. The DEPLOYUDX operation will search for the files in the directories specified by the LIBRARYDIRECTORIES parameter, so the names are not to contain path information. The file names must include the file extension. For example: mylib.so(obj1.o,obj2.o,lib25.so,lib50.a).

USELIBRARY | USELIB
A comma-separated list of <project>[:<library>] entries which are UDSLs that the build library depends on. Passed to IDA REST API call. Available only for C++. The library part defaults to lib<project>.so. Any library referenced in the list results in a symbolic link to it in the release/DEPS folder.
INCLUDEDIRECTORIES | INCLUDEDIRS
A comma-separated list of subdirectories relative to the project directory that contain files to be included during compilation. For example:
INCLUDEDIRS "inc/sub2,myincludes"
BINARYDIRECTORY | BINDIR
The name of the subdirectory of the project directory in which the object files created during compilation are to be stored.

Examples

The following command specifies all of its parameters by means of a parameter file with the name pf1b.txt:
SQL> IDA BUILDLIB PARAMFILE pf1b.txt
The following command overwrites some of the parameters specified in pf1b.txt.
SQL> IDA BUILDLIB PARAMFILE pf1b.txt SRC udxin4.tar PROJ udx77
The following command does not specify a parameter file; all parameters are specified in the command string. Defaults are used for all unspecified parameters.
SQL> IDA BUILDLIB SRC C:\udxdev\udx1\*.zip PROJ udx77 REPLACE YES