Arch Linux源码安装corosync成功

Arch Linux源码安装corosync成功

[xy@archlinux ~]$ uname -rp
5.13.5-arch1-1 unknown
[xy@archlinux ~]$ cat /etc/os-release
NAME=“Arch Linux”
直接安装找不到
[xy@archlinux ~]$ sudo pacman -S pacemaker
error: target not found: pacemaker
arch网站也搜索不到包
https://archlinux.org/packages/?sort=&q=pacemaker&maintainer=&flagged=

参考Pacemaker官网 确实没有支持arch
https://wiki.clusterlabs.org/wiki/Pacemaker
Installation Channels
Vendor Packages
Pacemaker is available pre-packaged from many major Linux distributions, including Debian, Fedora, openSUSE, Red Hat Enterprise Linux, SUSE Linux Enterprise Server, and Ubuntu LTS.

只能源码安装,gcc直接到11了,满足大于5的要求
[xy@archlinux ~]$ sudo pacman -S gcc

resolving dependencies...
looking for conflicting packages...

Packages (4) binutils-2.36.1-3  elfutils-0.185-1  libmpc-1.2.1-1  gcc-11.1.0-1

Total Download Size:    40.80 MiB
Total Installed Size:  199.45 MiB

:: Proceed with installation? [Y/n]

参考之前的文档,安装好相关的软件包
[xy@archlinux ~]$ sudo pacman -S make git autoconf automake libtool

warning: libtool-2.4.6+42+gb88cebd5-16 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (12) gc-8.0.4-4  guile-2.2.7-1  m4-1.4.19-1  perl-error-0.17029-3  perl-mailtools-2.21-5  perl-timedate-2.33-3  texinfo-6.8-1  autoconf-2.71-1  automake-1.16.3-1  git-2.32.0-1
              libtool-2.4.6+42+gb88cebd5-16  make-4.3-3

Total Download Size:   15.93 MiB
Total Installed Size:  94.08 MiB
Net Upgrade Size:      91.88 MiB

:: Proceed with installation? [Y/n] y

由于安装问题,更新了系统,新内核
[xy@archlinux ~]$ uname -rp
5.13.10-arch1-1 unknown

参考官网方法:https://wiki.clusterlabs.org/wiki/SourceInstall
1、First Steps

[xy@archlinux ~]$ export PREFIX=/usr
添加组失败
[xy@archlinux ~]$ sudo getent group haclient >/dev/null || groupadd -r haclient
groupadd: Permission denied.
groupadd: cannot lock /etc/group; try again later.
[xy@archlinux ~]$ grep hac /etc/group
[xy@archlinux ~]$ ls -l /etc/group
-rw-r--r-- 1 root root 692 Aug 19 13:07 /etc/group
[xy@archlinux ~]$ lsattr /etc/group
--------------e------- /etc/group
[xy@archlinux ~]$ uname -rp
5.13.10-arch1-1 unknown
[xy@archlinux ~]$ getent group haclient
[xy@archlinux ~]$ echo $?
2
正确命令
[xy@archlinux ~]$ getent group haclient >/dev/null || sudo groupadd -r haclient
[xy@archlinux ~]$ getent passwd hacluster >/dev/null || sudo useradd -r -g haclient -d /var/lib/heartbeat/cores/hacluster -s /sbin/nologin -c "cluster user" hacluster
[xy@archlinux ~]$

2、LibQB
[xy@archlinux ~]$ sudo chmod 777 /usr/local/src
[xy@archlinux ~]$ cd /usr/local/src
[xy@archlinux src]$ git clone git://github.com/ClusterLabs/libqb.git
[xy@archlinux src]$ cd libqb/
[xy@archlinux libqb]$ ./autogen.sh && ./configure --prefix=$PREFIX

报错:

[xy@archlinux libqb]$ ./autogen.sh && ./configure --prefix=$PREFIX
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
autoreconf: running: /usr/bin/autoconf --force
configure.ac:44: warning: The macro `AC_PROG_LIBTOOL' is obsolete.
configure.ac:44: You should run autoupdate.
m4/libtool.m4:99: AC_PROG_LIBTOOL is expanded from...
configure.ac:44: the top level
configure.ac:85: warning: The macro `AC_PROG_CC_C99' is obsolete.
configure.ac:85: You should run autoupdate.
./lib/autoconf/c.m4:1659: AC_PROG_CC_C99 is expanded from...
configure.ac:85: the top level
configure.ac:128: warning: $as_echo is obsolete; use AS_ECHO(["message"]) instead
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/ax_pthread.m4:88: AX_PTHREAD is expanded from...
configure.ac:128: the top level
configure.ac:191: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:191: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:191: the top level
configure.ac:282: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:282: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:282: the top level
configure.ac:290: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:290: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:290: the top level
configure.ac:297: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:297: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
configure.ac:297: the top level
configure.ac:471: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:471: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
configure.ac:471: the top level
configure.ac:495: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:495: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
configure.ac:495: the top level
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:20: installing 'build-aux/compile'
configure.ac:38: installing 'build-aux/config.guess'
configure.ac:38: installing 'build-aux/config.sub'
configure.ac:22: installing 'build-aux/install-sh'
configure.ac:22: installing 'build-aux/missing'
doxygen2man/Makefile.am: installing 'build-aux/depcomp'
parallel-tests: installing 'build-aux/test-driver'
autoreconf: Leaving directory '.'
: About to consume a checked out tree (dedicated for maintenance!)...
: Now run ./configure && make
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for vfork.h... no
checking for sys/param.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking whether the linker accepts -Wl,--enable-new-dtags... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
configure: building in place srcdir:.
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for gawk... (cached) gawk
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for pkg-config... no
checking for doxygen... no
checking for eu-readelf... eu-readelf
checking for a Python interpreter with version >= 2.6... none
configure: Sanitizing prefix: /usr
configure: Sanitizing exec_prefix: NONE
checking whether gcc is Clang... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking whether more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... yes
checking for library containing dlopen... -ldl
checking for library containing socket... none required
checking for library containing gethostbyname... none required
checking for library containing clock_gettime... none required
./configure: line 20599: syntax error near unexpected token `SYSTEMD,'
./configure: line 20599: `PKG_CHECK_MODULES(SYSTEMD, libsystemd, have_systemd=yes,have_systemd=no)'
[xy@archlinux libqb]$

查看config.log发现缺少很多h头文件,还有就是python找不到命令
[xy@archlinux libqb]$ sudo pacman -S python

resolving dependencies...
looking for conflicting packages...

Packages (2) libnsl-1.3.0-2  python-3.9.6-1

Total Download Size:   11.02 MiB
Total Installed Size:  52.79 MiB

:: Proceed with installation? [Y/n] y

重新执行是分开
[xy@archlinux libqb]$ ./autogen.sh
[xy@archlinux libqb]$ ./configure --prefix=$PREFIX
还是差不多的报错,只是少了这些

checking for a Python interpreter with version >= 2.6... python
checking for python... /usr/bin/python
checking for python version... 3.9
checking for python prefix... /usr
checking for python exec_prefix... /usr
checking for python platform... linux
checking for python script directory... ${PYTHON_PREFIX}/lib/python3.9/site-packages
checking for python extension module directory... ${PYTHON_EXEC_PREFIX}/lib/python3.9/site-packages

[xy@archlinux libqb]$ sudo pacman -S core/linux-headers
参考案例 syntax error on PKG_CHECK_MODULES

切换用户后,注意重新运行 export PREFIX=/usr

[xy@archlinux libqb]$ sudo pacman -S pkg-config
看报错继续安装
[xy@archlinux libqb]$ sudo pacman -S doxygen
报错变化不大,其余都一样
checking for pkg-config… pkg-config
checking for doxygen… doxygen

通过aclocal --help可以看到确认搜索路径的方法
[xy@archlinux corosync]$ aclocal --print-ac-dir
/usr/share/aclocal
等同作用 export ACLOCAL_PATH=/usr/share/aclocal
看起来路径也没有错

[xy@archlinux corosync]$ ls /usr/share/aclocal
README            glib-2.0.m4      gsettings.m4       ksba.m4        libcurl.m4    ltdl.m4         nls.m4
ac_check_krb5.m4  glib-gettext.m4  guile.m4           lib-ld.m4      libgcrypt.m4  ltoptions.m4    npth.m4
audit.m4          gpg-error.m4     host-cpu-c-abi.m4  lib-link.m4    libtool.m4    ltsugar.m4      pkg.m4
cap-ng.m4         gpgme.m4         iconv.m4           lib-prefix.m4  libxml.m4     ltversion.m4    po.m4
gettext.m4        gpgrt.m4         intlmacosx.m4      libassuan.m4   ltargz.m4     lt~obsolete.m4  progtest.m4
[xy@archlinux corosync]$ 

参考资料:再也不担心构建错误了

执行autoreconf --force --install之后,configure成功了!!万分感谢!

[xy@archlinux libqb]$ echo $ACLOCAL_PATH

[xy@archlinux libqb]$ make maintainer-clean
make: *** No rule to make target 'maintainer-clean'.  Stop.
[xy@archlinux libqb]$ autoreconf --force --install

make
sudo make install
执行顺利

CoroSync

git clone git://github.com/corosync/corosync.git
cd corosync
./autogen.sh
./configure --prefix=$PREFIX
报错:

[xy@archlinux corosync]$ ./configure --prefix=$PREFIX
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for vfork.h... no
checking for sys/param.h... yes
checking for sys/select.h... yes
checking for sys/socket.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether make supports nested variables... (cached) yes
configure: enable inter-library dependencies: yes
configure: Sanitizing exec_prefix: NONE
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for groff... groff
checking for augtool... no
checking for dot... no
checking for doxygen... doxygen
checking for awk... (cached) gawk
checking for bash... /usr/bin/bash
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for working volatile... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for egrep... (cached) /usr/bin/grep -E
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for arpa/inet.h... yes
checking for fcntl.h... yes
checking for limits.h... yes
checking for netdb.h... yes
checking for netinet/in.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/ioctl.h... yes
checking for sys/param.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking for sys/time.h... yes
checking for syslog.h... yes
checking for unistd.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for getopt.h... yes
checking for malloc.h... yes
checking for utmpx.h... yes
checking for ifaddrs.h... yes
checking for stddef.h... yes
checking for sys/file.h... yes
checking for sys/uio.h... yes
checking for struct sockaddr_in.sin_len... no
checking for struct sockaddr_in6.sin6_len... no
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_controllen... yes
checking for struct msghdr.msg_flags... yes
checking for struct msghdr.msg_accrights... no
checking for struct msghdr.msg_accrightslen... no
checking for uid_t in sys/types.h... yes
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for LIBQB... yes
checking for qb_log_thread_priority_set in -lqb... yes
checking for qb_log_file_reopen in -lqb... yes
checking for pthread_create in -lpthread... yes
checking for socket in -lsocket... no
checking for knet... no
configure: error: Package requirements (libknet) were not met:

Package 'libknet', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables knet_CFLAGS
and knet_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
[xy@archlinux corosync]$

knet libknet 都安装不了

[xy@archlinux corosync]$ sudo pacman -S libknet
error: target not found: libknet
[xy@archlinux corosync]$ sudo pacman -S augtool dot
error: target not found: augtool
error: target not found: dot
[xy@archlinux corosync]$ sudo pacman -S knet
error: target not found: knet
[xy@archlinux corosync]$ 

来一把
[xy@archlinux corosync]$ make maintainer-clean
make: *** No rule to make target ‘maintainer-clean’. Stop.
[xy@archlinux corosync]$ autoreconf --force --install
没有用

[xy@archlinux corosync]$ cat INSTALL 安装包谈到依赖库
KNET (https://kronosnet.org/).

补安装依赖库knet
[xy@archlinux corosync]$ cd …
[xy@archlinux src]$ git clone https://github.com/kronosnet/kronosnet

[xy@archlinux kronosnet]$ ./autogen.sh
[xy@archlinux kronosnet]$ ./configure
报错:

checking pkg-config is at least version 0.9.0... yes
checking for valgrind... no
checking for cov-build... no
checking for cov-analyze... no
checking for cov-format-errors... no
checking for nss... no
configure: error: Package requirements (nss) were not met:

Package 'nss', required by 'virtual:world', not found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables nss_CFLAGS
and nss_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
[xy@archlinux kronosnet]$ 

[xy@archlinux kronosnet]$ sudo pacman -S valgrind
[xy@archlinux kronosnet]$ sudo pacman -S nss

报错

checking for lzo2... no
checking for lzo/lzo1x.h... no
configure: error: "missing required lzo/lzo1x.h header"

[xy@archlinux kronosnet]$ sudo pacman -S lzo

报错

checking for sys/epoll.h... yes
checking for kevent... no
checking for netinet/sctp.h... no
configure: error: "missing required SCTP headers"
[xy@archlinux kronosnet]$
[xy@archlinux kronosnet]$

[xy@archlinux kronosnet]$ sudo pacman -S kevent netinet libsctp-dev 一个包都没有

套娃,搞不定了。
不是有源码就能安装的。
arch这样追求最新功能的,看来对可靠性的适配没有那么完善。

不死心
参考资料: netinet/sctp.h: No such file or directory
安装工具lksctp-tools成功,并包含了netinet/sctp.h。之前搜索到了,觉得不对,就没有安装,我去
https://archlinux.org/packages/?sort=&q=sctp&maintainer=&flagged=

[root@archlinux xy]# pacman -Qs sctp
local/lksctp-tools 1.0.17-3
    An implementation of the SCTP protocol
[root@archlinux xy]#
[root@archlinux xy]# pacman -Ql lksctp-tools
lksctp-tools /usr/
lksctp-tools /usr/bin/
lksctp-tools /usr/bin/checksctp
lksctp-tools /usr/bin/sctp_darn
lksctp-tools /usr/bin/sctp_status
lksctp-tools /usr/bin/sctp_test
lksctp-tools /usr/bin/withsctp
lksctp-tools /usr/include/
lksctp-tools /usr/include/netinet/
lksctp-tools /usr/include/netinet/sctp.h

重新来
export PREFIX=/usr
./configure通过了
make
sudo make install

继续安装corosync

cd corosync
./configure --prefix=$PREFIX
通过,记录一下

corosync configuration:
  Version                  = 3.1.5
  Prefix                   = /usr
  Executables              = ${exec_prefix}/sbin
  Man pages                = ${datarootdir}/man
  Doc dir                  = ${datarootdir}/doc/${PACKAGE_TARNAME}
  Libraries                = ${exec_prefix}/lib
  Header files             = ${prefix}/include
  Arch-independent files   = ${datarootdir}
  State information        = ${prefix}/var
  System configuration     = ${prefix}/etc
  System init.d directory  = ${prefix}/etc/init.d
  System systemd directory = /usr/lib/systemd/system
  Log directory            = ${prefix}/var/log/cluster
  Log rotate directory     = ${prefix}/etc/logrotate.d
  corosync config dir      = ${prefix}/etc/corosync
  init config directory    = ${sysconfdir}/sysconfig
  Features                 = pie relro bindnow

corosync build info:
  Library SONAME           = 5.0.0
  CFG Library SONAME       = 7.3.0
  CPG Library SONAME       = 4.1.0
  QUORUM Library SONAME    = 5.1.0
  SAM Library SONAME       = 4.4.0
  VOTEQUORUM Library SONAME  = 8.0.0
  CMAP Library SONAME      = 4.1.0
  Default optimization     = -O3
  Default debug options    = -ggdb3
  Extra compiler warnings  =
  Env. defined CFLAG       = -g -O2
  Env. defined CPPFLAGS    =
  Env. defined LDFLAGS     =
  ANSI defined CPPFLAGS    =
  Coverage     CFLAGS      =
  Coverage     LDFLAGS     =
  Fatal War.   CFLAGS      =
  Final        CFLAGS      =  -g -O2  -fPIC -DPIC  -fPIE -O3 -ggdb3       -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wwrite-strings -Wcast-align -Wbad-function-cast -Wmissing-format-attribute -Wformat=2 -Wformat-security -Wformat-nonliteral -Wno-long-long -Wno-strict-aliasing          -pthread
  Final        CPPFLAGS    =    -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_builddir)/include/corosync -I$(top_srcdir)/include/corosync
  Final        LDFLAGS     =    -fPIC -DPIC  -pie -Wl,-z,relro -Wl,-z,now  -Wl,--as-needed

make
sudo make install
都成功了
找到了/usr/bin/corosync,配置文件 /usr/etc/corosync/corosync.conf.example ,文档在/usr/share/doc/corosync

你可能感兴趣的:(Linux,编译)