To a different target platform

The OSS ASN.1 tools have the capability to cross-compile. Cross-compiling enables a developer to produce files that can be used on an operating system other than the operating system the compiler runs on.

Cross compiling is accomplished by passing a configuration file, asn1dflt. < compilerAbbreviation [. compilerOption ]>, as the first input file on the command-line.

For example, by default the OSS ASN.1 compiler for Windows NT/9x generates files with an 8-byte alignment ( /Zp8 ) for use with the Microsoft Visual C++ compiler. However, it is possible to use this same OSS ASN.1 compiler to create files that are usable on another platform (e.g., Solaris SPARC) by passing the appropriate asn1dflt file as the first command-line option. After cross-compiling, you simply copy the generated output files to the machine on which you develop your application for the target platform. You then proceed as normal, integrating the generated files into your application.

The table below shows configuration files used on the Windows NT/9x platform, along with the intended compiler and data-alignment .

The following table shows configuration files used on the Windows NT/9x platform, along with the intended compiler and data-alignment:

Default Configuration File    Target Platform    Compiler    Data Alignment
asn1dflt.bor.a1 Windows Borland 1-byte (/a1)
asn1dflt.bor.a2 Windows Borland 2-byte (/a2)
asn1dflt.bor.a4 Windows Borland 4-byte (/a4)
asn1dflt.bor.a8 Windows Borland 8-byte (/a8)
asn1dflt.ms.zp1 Windows Microsoft 1-byte (/Zp1)
asn1dflt.ms.zp2 Windows Microsoft 2-byte (/Zp2)
asn1dflt.ms.zp4 Windows Microsoft 4-byte (/Zp4)
asn1dflt.ms.zp8 Windows Microsoft 8-byte (/Zp8)

Examples:

The following examples further demonstrate the use of the asn1dflt file in cross-compiling:

  1. To have the ASN.1 compiler compile the file abc.asn for use on Windows NT/9x with MS Visual C++ with a default 8-byte alignment ( /Zp8 ), we could issue the following command:

    asn1 asn1dflt.ms.zp8 abc.asn

    The asn1dflt.ms.zp8 file contains configuration information that instructs the ASN.1 compiler that the target platform is Windows NT/9x, the language compiler in use is Microsoft Visual C++, and the structure packing option in use is /Zp8 . Note that this is the default for this shipment of the OSS ASN.1 Tools.

  2. Similarly, to compile the file abc.asn using the Borland C++ compiler with 1-byte alignment ( /a1 ) on the Windows NT/9x platform, we would issue the following command:

    asn1 asn1dflt.bor.a1 abc.asn

    The asn1dflt.bor.a1 file contains configuration information that instructs the ASN.1 compiler that the target platform is Windows NT/9x, the language compiler in use is Borland (Inprise) C++, and the structure packing option in use is /a1 .

  3. To compile the file abc.asn for use on the SCO UNIX operating system, we would issue the command:

    asn1 asn1dflt.sco abc.asn

    The file asn1dflt.sco contains configuration information that instructs the ASN.1 compiler that the target platform is SCO UNIX, and that the language compiler in use is the native C compiler on SCO UNIX.

 

Copyright © 2008 OSS Nokalva, Inc.   All Rights Reserved.

OSS ASN.1 Tools for C

Platform Information

E-XER

FAQs

Purchase

Free Trial Download