在Unix下安装MICO
(by huihoo.com connect_freeman 翻译 )
Installing MICO under Unix
The MICO source release is shipped as a tar'ed and gzip'ed archive called
mico-2.3.6.tar.gz
Unpack the archive using the following command:
gzip -dc mico-2.3.6.tar.gz | tar xf -
You are left with a new directory mico containing the MICO sources. To save you the hassle of manually editing Makefile's and such, MICO comes with a configuration script that checks your system for required programs and other configuration issues. The script, called configure, supports several important command line options:
-help
Gives an overview of all supported command line options.
-prefix=
With this options you tell configure where the MICO programs and libraries should be installed after compilation. This defaults to /usr/local.
-enable-corba2-1
This option makes MICO compliant to the version 2.1 of the CORBA standard due to some backward incompatibilities with later releases of the standard.
-disable-optimize
Do not use the -O option when compiling C/C++ files. It is now safe to use this option because only files that do not use exceptions are compiled using -O, which is why optimization is now turned on by default.
-enable-debug
Use the -g option when compiling C/C++ files.
-enable-repo
Use the -frepo flag when compiling C++ files. This works only with a patched g++ 2.7.2 and will greatly reduce the size of the binaries, at the cost of much slower compilation (this option instructs g++ to do some sort of template repository). You must use this option on HP-UX, otherwise you will get lots of error during linking.
-disable-shared
Build the MICO library as a static library instead as a shared one. Shared libraries currently only work on ELF based systems (e.g., Linux, Solaris, Digital Unix, AIX, and HP-UX). If you do not use the -disable-shared option you have to make sure the directory where the MICO library resides is either by default searched for shared libraries by the dynamic linker (/usr/lib and /lib on most systems) or you have to include the directory in the environment variable that tells the dynamic linker where to search for additional shared libraries. This variable is called LIBPATH on AIX, SHLIB_PATH on HP-UX and LD_LIBRARY_PATH on all the other systems. To run the generated binaries before doing a make install you have to set this environment variable like this:
# AIX
export LIBPATH=/mico/orb:$LIBPATH
# HP-UX
export SHLIB_PATH=/mico/orb:$SHLIB_PATH
# others
export LD_LIBRARY_PATH=/mico/orb:$LD_LIBRARY_PATH
%$
where is the absolute path of the directory the MICO sources were unpacked in.
-disable-dynamic
This option disables dynamic loading of CORBA objects into a running executable. For dynamic loading to work your system must either support dlopen() and friends or shl_load() and friends. See section 4.3.4 for details.
-enable-final
Build a size optimized version of the MICO library. This will need lots of memory during compilation but will reduce the size of the resulting library a lot. Works with and without -enable-shared. Does not work on HP-UX.
-disable-mini-stl
As mentioned before, MICO makes use of the Standard Template Library (STL). For environments that do not provide an STL implementation, MICO comes with its own slim STL (called MiniSTL), which is simply a subset of the standard STL sufficient to compile MICO. By default MICO will use MiniSTL. If you want to use the system supplied STL for some reason you have to use the option -disable-mini-stl. MiniSTL works well with g++ and greatly reduces compilation time and size of the binaries. Using MiniSTL one could try to compile MICO using a C++ compiler other than g++. But this still has not been tested and may therefore lead to problems.
-disable-except
Disable exception handling. On some platforms (e.g., DEC alpha) g++ has very buggy exception handling support that inhibit the compilation of MICO with exception handling enabled. If this happens try turning off exception handling using this option.
-with-qt=
Enable support for QT. is the directory where QT has been installed in.
-with-gtk=
Enable support for GTK. is the directory where GTK has been installed in.
-with-tcl=
Enable support for TCL. is the directory where TCL has been installed in.
-with-ssl=
Enable support for SSL. is the directory where SSLeay has been installed in.
Now you should run configure with the proper command line options you need, e.g.:
cd mico
./configure --with-qt=/usr/local/qt
Use gmake to start compilation and install the programs and libraries, possibly becoming root before installation:
gmake
gmake install
On some systems you have to take special actions after installing a shared library in order to tell the dynamic linker about the new library. For instance on Linux you have to run ldconfig as root:
/sbin/ldconfig -v
在Unix下安装MICO
MICO源码发布是打包成tar和gzip存档格式.
mico-2.3.6.tar.gz
用如下的命令对存档进行解压:
gzip -dc mico-2.3.6.tar.gz | tar xf -
离开时有一个新的目录mico包含有MICO源代码.保存完你手动修正后的诸如Makefile's文件后,MICO随之带来的配置脚本将检查你的系统,查看所要用到的程序和其它配置结果。那个叫configure的脚本,支持几个重要的命令行选项:
-help
给出所有支持的命令行选项的概览.
-prefix=<安装目录>
用这个选项来告诉configure在编辑过后,MICO程序和库应该安装到哪里。缺省目录是 /usr/local.
-enable-corba2-1
该选项使MICO适应CORBA2.1标准,这是由于由于最近发布的标准的向后兼容性造成的。
-disable-optimize
编译C/C++文件里不要用 -O 选项. 仅仅文件中用-O 编译时没有用到异常才是安全的,这也是为什么缺省选项是打开成优化的.
-enable-debug
编译C/C++文件时使用 -g 选项.
-enable-repo
编译C++文件时使用 -frepo 标志. 它只能和补丁过的g++ 2.7.2一起工作,还能最大程序的减少二进制码的大小,代价就是编译时变得更慢了(这个选项指明 g++要做一些模板库的排序).在HP-UX下你必须使用这个选项,否则在链接时你将捕捉到大量的出错信息。
-disable-shared
用静态库构建MICO库而不是用共享库.共享库目前只能工作在基于ELF系统中(诸如, Linux, Solaris, Digital Unix, AIX, 和 HP-UX). 如果你不用 -disable-shared选项那得MICO库存在的目录必须是下列两种情形之一,动态链接器所用到的共享库的缺省路径(大多数系统是/usr/lib 和/lib)或者目录包含在环境变量中以使动态链接器可以查找到附加共享库.这个变量在AIX上叫LIBPATH,HP-UX叫SHLIB_PATH,其它系统叫LD_LIBRARY_PATH.在做 make install运行生成二进制码前你得象这样设定环境变量:
# AIX
export LIBPATH=/mico/orb:$LIBPATH
# HP-UX
export SHLIB_PATH=/mico/orb:$SHLIB_PATH
# others
export LD_LIBRARY_PATH=/mico/orb:$LD_LIBRARY_PATH
%$
其中 MICO 源码解压所在目录的绝对路径.
-disable-dynamic
这个选项使在CORBA 对象在正在实际运行中的动态装入去能 . 为了使动态装入能在你系统中工作必须要么支持dlopen()和辅助功能要么支持dlopen()和辅助功能。看章节4.3.4获取更多细节.
-enable-final
构建MICO库的字节容量优化版本。编译时那将需要大量的内存可大多数库容量都能得到缩减.工作时必须没有-enable-shared.HP-UX下不能工作。
-disable-mini-stl
以前提过, MICO 用了标准模板库(STL). 如果环境没有提供模板库的实现的话,MICO可以用自己的轻型STL(叫做MiniSTL),只是对编译MICO来说足够的标准STL的简化子集。如果因为某些原因要用到系统支持的STL那就得使用选项 -disable-mini-stl.MiniSTL 可以和g++工作得很好,并减少了大量的编译时间和二进制码的容量。在C++编译器下试图用MiniSTL编译MICO不同于g++.但那没有测试过所以有可能会产生问题。
-disable-except
去能异常处理. 在某些平台(诸如, DEC alpha) g++ 会产生有巨量异常处理过程支持抑制了使能了异常处理过程的MICO编译.在这种情况下应该试着关掉异常处理。
-with-qt=
使能QT支持. 是QT安装的路径.
-with-gtk=
使能GTK支持. 是GTK安装的路径.
-with-tcl=
使能TCL支持. 是TCL安装的路径.
-with-ssl=
使能SSL支持. 是SSLeay安装的路径.
现在你运行configure 带有你所要的正确的命令行选项, 诸如:
cd mico
./configure --with-qt=/usr/local/qt
使用gmake开始编译和安装程序和库, 可能安装前要成为root用户:
gmake
gmake install
在某些系统上你为了告诉动态链接器有新的库得在安装完共享库后做专门的动作。在linux上作为root运行ldconfig的实例:
/sbin/ldconfig -v