compile static perl on fedora

the build of static perl method on  loongson fedora13-o32

the main reference comes frome this site:

     http://ucla.jamesyxu.com/?p=303
the detail steps as follow:

1. build the openssl library is needed,just only configure,make,make install is ok

2. download the App-staticperl tar, use the App-staticperl directory with the replaced staticperl.sh script

run command: ./staticperl.sh install
this will take a long time and for the most case, it will not be success,because some already compiled file in the directory ".staticperl/cpan/build/" not been copied to the ".staticperl/perl/lib/" directory, so we should manually copy the missing directory and file into this directory
like the

 common-sense-3.74-Paa2df/blib/arch/common to the .staticperl/perl/lib/
Module-Build-Tiny-0.039-0Y19u5/lib/Module/Build/Tiny.pm to the .staticperl/perl/lib/Module/Build/
ExtUtils-Config-0.008-tzplFT/lib/ExtUtils/Config.pm to the .staticperl/perl/lib/ExtUtils/
ExtUtils-Helpers-0.022-_CJAC_/lib/ExtUtils/* to the .staticperl/perl/lib/ExtUtils/
ExtUtils-InstallPaths-0.011-d2cyqq/lib/ExtUtils/InstallPaths.pm to the .staticperl/perl/lib/ExtUtils/
ExtUtils-MakeMaker-7.10-oU70GN/lib/ExtUtils/MakeMaker* to the .staticperl/perl/lib/ExtUtils/
also some other directory and files

4.Copy ./mkbundle to ~/.staticperl/bin/SP-mkbundle. This step is required to work around a script error in staticperl.sh that prevents it from generating the mkbundle script

5.Run ./staticperl.sh mkperl, if there are any missing module errors then install the corresponding module from CPAN using ~/.staticperl/bin/perl

6.download  Crypt-CBC, Build and install CBC::Crypt:

Untar Crypt-CBC
    cd into the new directory and issue:
    ~/.staticperl/bin/perl Makefile.PL
    make
    make install

7.Build and install Crypt::OpenSSL::AES. This require modification to Makefile.PL to statically link in the OpenSSL library built during step 1

Untar Crypt::OpenSSL::AES
    cd into the new directory and modify the Makefile.PL
    Comment out LIBS
    Add path to the build openssl's include dir to INC
    Add MYEXTLIB => 'POINT TO libcrypto.a FILE' # this gets directly added to the linker
the above modify already done in the Makefile.PL of Crypt-OpenSSL-AES
AS FOLLOW:
#    LIBS              => ['-lcrypto'], # e.g., '-lm'
    MYEXTLIB              => '/usr/local/ssl/lib/libcrypto.a', # e.g., '-lm'
    DEFINE            => '', # e.g., '-DHAVE_SOMETHING'
    INC               => '-I. -I/usr/local/ssl/include', # e.g., '-I. -I/usr/include/other'
    # Un-comment this if you add C files to link with later:
    # OBJECT            => '$(O_FILES)', # link all the C files too
);


 Issue commands:
    ~/.staticperl/bin/perl Makefile.PL
    make
    make install

8. Build staticperl, CD into App-Staticperl and issue

./staticperl.sh mkperl --incglob '*' --static

9. solve the error during build(this did not show up in the ubuntu system, so if use x86 ubuntu,maybe ignore this step)

when building the static perl the link of libcrypt.a has some problem, this lib is compiled out from glibc,can find out with the "rpm -qf /usr/lib/libcrypt.a" command, the error is undefined reference to `NSSLOW_Init' and some else

this is because the glibc compiled with nss-crypt support, so recompiled the glibc with the following configure

CC=gcc -march=mips3 -mabi=32 -mplt -fPIC -fexceptions CXX=g++ -march=mips3 -mabi=32 -mplt -fPIC -fexceptions CFLAGS=-Wp,-D_FORTIFY_SOURCE=0 -fasynchronous-unwind-tables -DNDEBUG -g -march=mips3 -mabi=32 -O3  --prefix=/opt/glibc-static --enable-add-ons=nptl,ports,c_stubs,libidn --without-cvs --enable-kernel=2.6.18 --with-headers=/usr/include --enable-bind-now --enable-static --disable-nss-crypt --with-tls --with-__thread --build mipsel-redhat-linux --host mipsel-redhat-linux --disable-profile --enable-experimental-malloc build_alias=mipsel-redhat-linux host_alias=mipsel-redhat-linux --no-create --no-recursion

the main modify is --enable-static --disable-nss-crypt ,then recompile glibc,replace the /usr/lib/libcrypt.a with the newly build one

reference:
https://bitbucket.org/abensonca/galacticus/issues/3/libcrypta-results-in-errors-when-compile
http://serverfault.com/questions/571104/libcrypt-a-undefined-reference-to-nsslow

rerun the command in step 8 to build out the static perl

10. run ./perl test1.pl to test the perl

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用bld在DB2服务器主机上编译Debezium管理UDFs。 首先,确保在DB2服务器主机上安装了bld(Build Launcher for DB2)。bld是一个用于编译和构建DB2相关组件的工具。 首先,将Debezium管理UDFs的源代码复制到DB2服务器主机上的一个目录中。这些源代码可以在Debezium的官方代码库或者其他可靠的来源中获取到。 然后,打开命令行终端,并进入到这个源代码目录中。 接下来,运行bld命令来编译UDFs。下面是一个示例命令: bld compile -z -o=udfs.out 在这个命令中,-z参数表示进行编译操作,-o参数指定输出文件的名称。 bld命令会根据源代码中的构建文件(例如Makefile或者build.xml)进行编译操作。确保构建文件中指定了正确的编译选项和依赖项,以便成功地编译UDFs。 编译过程可能需要一些时间,具体取决于代码的大小和复杂性。 一旦编译完成,您可以查看输出文件udfs.out,以确保编译过程顺利完成。如果有任何错误或警告信息,请根据提示进行调试和修复。 最后,将生成的UDFs文件udfs.out(或者指定的输出文件名称)复制到DB2服务器上的适当位置。这个位置可能与您使用UDFs的代码或配置文件中的路径设置有关。确保将UDFs文件放置在系统能够找到的地方。 现在,您已经成功地在DB2服务器主机上编译了Debezium管理UDFs,可以根据需要在相关应用程序或数据库配置中使用它们了。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值