构建脚本:
if [ -f ${PWD_PATH}/succeed/protobuf-c ]; then
echo "git clone https://github.com/protobuf-c/protobuf-c.git"
eval "git clone https://github.com/protobuf-c/protobuf-c.git"
eval 'cd protobuf-c && git checkout v1.4.0 && ./autogen.sh && ./configure && make -j$(nproc) && sudo make install'
eval 'sudo ln -sf /usr/local/lib/libprotobuf-c.so.1.0.0 /usr/lib/libprotobuf-c.so.1'
echo "done" > ${PWD_PATH}/succeed/protobuf-c
fi
echo
echo -e "${GREEN}[*] build protobuf-c succeed!${NC}"
在构建protobuf-c时,它显示以下警告。我该如何解决?应该对构建脚本进行哪些特定的更改?
/usr/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c protobuf-c/libprotobuf-c.la '/usr/local/lib'
libtool: install: /usr/bin/install -c protobuf-c/.libs/libprotobuf-c.so.1.0.0 /usr/local/lib/libprotobuf-c.so.1.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libprotobuf-c.so.1.0.0 libprotobuf-c.so.1 || { rm -f libprotobuf-c.so.1 && ln -s libprotobuf-c.so.1.0.0 libprotobuf-c.so.1; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libprotobuf-c.so.1.0.0 libprotobuf-c.so || { rm -f libprotobuf-c.so && ln -s libprotobuf-c.so.1.0.0 libprotobuf-c.so; }; })
libtool: install: /usr/bin/install -c protobuf-c/.libs/libprotobuf-c.lai /usr/local/lib/libprotobuf-c.la
libtool: install: /usr/bin/install -c protobuf-c/.libs/libprotobuf-c.a /usr/local/lib/libprotobuf-c.a
libtool: install: chmod 644 /usr/local/lib/libprotobuf-c.a
libtool: install: ranlib /usr/local/lib/libprotobuf-c.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
这不是警告,只是一条信息性消息。
Libraries have been installed in:
/usr/local/lib
..
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
这通常是安装本地编译库的正确位置,您只需检查它是否存在于/etc/ld.so.conf
中,就像消息中所说的那样。在现代Linux上,路径通常在/etc/ld.so.conf.d/libc.conf
中,并包含在主配置文件中。
如果要安装到/usr/lib
,可以使用./configure --prefix=/usr
进行配置。但这可能与从包管理器安装的库相冲突。