如何为 FreeBSD 8.1 构建 WSO2 WSF/PHP 2.1.0?

发布于 2024-11-15 20:40:18 字数 3698 浏览 2 评论 0 原文

我在 FreeBSD 8.1 上构建 WSO2 WSF/PHP 时遇到问题。似乎源头中有些东西被破坏了。

我检查所有先决条件,然后运行 ​​./configure && make 并收到下一个错误:

Making all in platforms/unix
/usr/local/bin/bash ../../../libtool --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include  -I../../../include/platforms  -I../../../include/platforms/unix     -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c  -fPIC -DPIC -o .libs/uuid_gen_unix.o
uuid_gen_unix.c: In function 'axutil_uuid_get_mac_addr':
uuid_gen_unix.c:332: error: 'SIOCGARP' undeclared (first use in this function)

谷歌搜索后,我找到了使用 ./configure 'CPPFLAGS=-DHAVE_GETIFADDRS' 进行配置的建议。之后 make 命令几乎完成,但最后死亡并显示以下信息:

gcc -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -o .libs/test test.o  ../../axiom/src/om/.libs/libaxis2_axiom.so ../../util/src/.libs/libaxutil.so ../src/.libs/libneethi.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/om/.libs/libaxis2_axiom.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/parser/guththila/.libs/libaxis2_parser.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/guththila/src/.libs/libguththila.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src/.libs/libaxutil.so -lpthread -lz  -Wl,--rpath -Wl,/usr/local/wsf_c/lib
../../util/src/.libs/libaxutil.so: undefined reference to `ftime'

我应该怎样做才能在我的 FreeBSD 上完全构建 WSO2?

UPD1./configure 'CPPFLAGS=-DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat'

gcc -shared   -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive  -lcompat -lpthread -lz  -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value

UPD2 之后构建 在 ./configure CPPFLAGS='-fPIC -DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat' 之后构建

gcc -shared  .libs/hash.o .libs/allocator.o .libs/env.o .libs/error.o .libs/stream.o .libs/log.o .libs/string.o .libs/string_util.o .libs/qname.o .libs/array_list.o .libs/linked_list.o .libs/utils.o .libs/dir_handler.o .libs/file_handler.o .libs/class_loader.o .libs/network_handler.o .libs/file.o .libs/uuid_gen.o .libs/thread_pool.o .libs/property.o .libs/types.o .libs/param.o .libs/param_container.o .libs/dll_desc.o .libs/url.o .libs/stack.o .libs/generic_obj.o .libs/base64.o .libs/uri.o .libs/date_time.o .libs/base64_binary.o .libs/properties.o .libs/http_chunked_stream.o .libs/rand.o .libs/date_time_util.o .libs/version.o .libs/duration.o .libs/frame.o .libs/stomp.o .libs/md5.o .libs/digest_calc.o -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive  -lcompat -lpthread -lz  -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value
*** Error code 1

Stop in /usr/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src.

I have a problem with building WSO2 WSF/PHP on my FreeBSD 8.1. It seems that something broken in the source.

I check all prerequisites then run ./configure && make and receive next error:

Making all in platforms/unix
/usr/local/bin/bash ../../../libtool --tag=CC    --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include  -I../../../include/platforms  -I../../../include/platforms/unix     -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c -o uuid_gen_unix.lo uuid_gen_unix.c
mkdir .libs
 gcc -DHAVE_CONFIG_H -I. -I../../.. -I../../../include -I../../../include/platforms -I../../../include/platforms/unix -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -D_GNU_SOURCE -MT uuid_gen_unix.lo -MD -MP -MF .deps/uuid_gen_unix.Tpo -c uuid_gen_unix.c  -fPIC -DPIC -o .libs/uuid_gen_unix.o
uuid_gen_unix.c: In function 'axutil_uuid_get_mac_addr':
uuid_gen_unix.c:332: error: 'SIOCGARP' undeclared (first use in this function)

After googling I found an advice to configure with ./configure 'CPPFLAGS=-DHAVE_GETIFADDRS'. After that make command almost finished but die at the end with following information:

gcc -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -o .libs/test test.o  ../../axiom/src/om/.libs/libaxis2_axiom.so ../../util/src/.libs/libaxutil.so ../src/.libs/libneethi.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/om/.libs/libaxis2_axiom.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/axiom/src/parser/guththila/.libs/libaxis2_parser.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/guththila/src/.libs/libguththila.so /usr/home/alisachenko/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src/.libs/libaxutil.so -lpthread -lz  -Wl,--rpath -Wl,/usr/local/wsf_c/lib
../../util/src/.libs/libaxutil.so: undefined reference to `ftime'

What should I do to completely build WSO2 on my FreeBSD?

UPD1
Building after ./configure 'CPPFLAGS=-DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat'

gcc -shared   -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive  -lcompat -lpthread -lz  -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value

UPD2
Building after ./configure CPPFLAGS='-fPIC -DHAVE_GETIFADDRS' 'LDFLAGS=-lcompat'

gcc -shared  .libs/hash.o .libs/allocator.o .libs/env.o .libs/error.o .libs/stream.o .libs/log.o .libs/string.o .libs/string_util.o .libs/qname.o .libs/array_list.o .libs/linked_list.o .libs/utils.o .libs/dir_handler.o .libs/file_handler.o .libs/class_loader.o .libs/network_handler.o .libs/file.o .libs/uuid_gen.o .libs/thread_pool.o .libs/property.o .libs/types.o .libs/param.o .libs/param_container.o .libs/dll_desc.o .libs/url.o .libs/stack.o .libs/generic_obj.o .libs/base64.o .libs/uri.o .libs/date_time.o .libs/base64_binary.o .libs/properties.o .libs/http_chunked_stream.o .libs/rand.o .libs/date_time_util.o .libs/version.o .libs/duration.o .libs/frame.o .libs/stomp.o .libs/md5.o .libs/digest_calc.o -Wl,--whole-archive ../src/platforms/unix/.libs/libaxis2_unix.a -Wl,--no-whole-archive  -lcompat -lpthread -lz  -Wl,-soname -Wl,libaxutil.so.4 -o .libs/libaxutil.so.4
/usr/bin/ld: /usr/lib/libcompat.a(ftime.o): relocation R_X86_64_32 can not be used when making a shared object; recompile with -fPIC
/usr/lib/libcompat.a: could not read symbols: Bad value
*** Error code 1

Stop in /usr/src/wso2-wsf-php-src-2.1.0/wsf_c/axis2c/util/src.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小鸟爱天空丶 2024-11-22 20:40:18
./configure 'CPPFLAGS=-DHAVE_GETIFADDRS LDFLAGS==-lcompat'
./configure 'CPPFLAGS=-DHAVE_GETIFADDRS LDFLAGS==-lcompat'
野生奥特曼 2024-11-22 20:40:18

我还尝试在各种 FreeBSD AMD64 上运行 WSO2 但没有成功
我正在 ezjail 之上构建的监狱中编译 WSO2。
由于需要重新编译 libcompat,我是在“主”系统中进行的。剩下的一切都在监狱里完成。

  1. 在主系统(没有监狱)中,我在 makefile 中使用 -fPIC 重新编译了 libcompat (/usr/src/lib/libcompat),所以现在该行看起来像这样:

    CFLAGS+=-fPIC -DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale

    [root@system /usr/src/lib/libcompat]# make install
    安装-C -o root -g wheel -m 444 libcompat.a /usr/lib
    install -C -o root -g wheel -m 444 libcompat_p.a /usr/lib

  2. 然后
    我将 libcompat.a 和 libcompat_p.a 复制到 basejail 并切换到我进行编译的监狱

我发现了这个: http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/
这启发了我。
我修改了 wsf_c/axis2c/util/src/platforms/unix/uuid_gen_unix.c 并添加了
#包括< sys/param.h>
(我在这里放了     ^^^^ 空格,因为我它被 stackoverflow 门户错误地解析了)

3 。然后我修改了configure.m4并放置了以下路径
PHP_ADD_INCLUDE(/usr/local/include/libxml2/libxml) 替换原来的

4 。然后编译仍然有问题我添加了这些环境变量
导出 CPATH=/usr/local/include:/usr/local/include/libxml2:/usr/local/ssl/include/openssl::/usr/local/ssl/include
导出 LD_LIBRARY_PATH=/usr/local/lib

5 。最后我成功地编译了,没有错误

。/configure "CPPFLAGS=-fPIC -DHAVE_GETIFADDRS" "LDFLAGS=-lcompat"
制作
make install

我在远程服务器上的测试监狱还没有可用的 Web 界面,因此我无法在提供的示例上测试此安装,但我很确定我会成功,因为没有make 或 make install 期间出现错误。
Php -m 显示 wsf 模块没有任何段错误。
样品也运行良好。 我还无法获取 wsdls,但这只是时间问题。

您可能面临的重要问题是 openssl。如果我没记错的话,至少应该是 0.9.8 版。我正在使用 1.x。虽然
虽然这个设置在 Freebsd 8.x 上运行良好,但我无法让它在 FreeBSD 6.x 上运行。在 6.x 上,我终于成功构建了 WSO2,但是在 php 配置中包含 wsf.so 时出现了段错误...然后我放弃了 6.x 并专注于 freebsd 8.x,它似乎工作正常...刚刚开始使用此模块进行一些编程。

I am also trying to run WSO2 on various FreeBSD AMD64 without success.
I am compiling WSO2 in jail built on top of ezjail.
Since recompilation of libcompat is required I did it in "main" system. All the rest is done in the jail.

  1. In main system (without jail) I recompiled libcompat (/usr/src/lib/libcompat) with -fPIC in makefile, so now the line looks like that:

    CFLAGS+=-fPIC -DLIBC_SCCS -DSYSLIBC_SCCS -I${.CURDIR}/../libc/locale

    [root@system /usr/src/lib/libcompat]# make install
    install -C -o root -g wheel -m 444 libcompat.a /usr/lib
    install -C -o root -g wheel -m 444 libcompat_p.a /usr/lib

  2. Then
    I copied libcompat.a and libcompat_p.a into basejail and switched to jail where I made a compilation

I found this: http://bsd.dischaos.com/2008/05/14/wso-web-services-framework-on-freebsd/
which inspired me.
I modified wsf_c/axis2c/util/src/platforms/unix/uuid_gen_unix.c and added
#include < sys/param.h>
(I put      ^^^^ space here because I it was wrongly parsed by stackoverflow portal)

3 . Then I modified configure.m4 and I put the following path
PHP_ADD_INCLUDE(/usr/local/include/libxml2/libxml) replacing the original one

4 . Then still having problems with compilation I added these environment variables
export CPATH=/usr/local/include:/usr/local/include/libxml2:/usr/local/ssl/include/openssl::/usr/local/ssl/include
export LD_LIBRARY_PATH=/usr/local/lib

5 . And finally I managed to compile without errors

./configure "CPPFLAGS=-fPIC -DHAVE_GETIFADDRS" "LDFLAGS=-lcompat"
make
make install

My test jail on remote server doesnt have the web interface available yet and thus I couldn't test this installation on samples provided, but I am pretty sure that I would succeed since there were no errors during make nor during make install.
Php -m shows wsf module without any segfaults.
Samples are also working fine. I can't get wsdls yet, but it is rather matter of time.

The important problem you may face is openssl. It must be in ver 0.9.8 at least if I recall correctly. I am using 1.x. though
Although this setup is working fine on Freebsd 8.x I was unable to have it working on FreeBSD 6.x. On 6.x I finally built WSO2 successfully, but got segfaults when included wsf.so in php configuration ... then I gave up on 6.x and focused on freebsd 8.x where it seems to work fine ... just starting to do some programming with this module.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文