Haproxy installation for an Solaris

Hi,

Is there any specific documentation pertaining to Installing haproxy in Solaris.

I am trying to install haproxy in solaris and getting error in my gmake command though gmake is installed in the host.

PFB the error. Please help here.

/usr/sfw/bin/gmake TARGET=solaris USE_STATIC_PCRE=1 USE_PCRE=1 USE_OPENSSL=1 USE_ZLIB=1 USE_CRYPT_H=1 USE_LIBCRYPT=1
gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H -DUSE_GETADDRINFO -DUSE_ZLIB -DENABLE_POLL -DUSE_OPENSSL -DUSE_PCRE -I/usr/include -DCONFIG_HAPROXY_VERSION=“1.7.10-a7dcc3b” -DCONFIG_HAPROXY_DATE=“2018/01/02”
-DBUILD_TARGET=’“solaris”’
-DBUILD_ARCH=’""’
-DBUILD_CPU=’“generic”’
-DBUILD_CC=’“gcc”’
-DBUILD_CFLAGS=’"-O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"’
-DBUILD_OPTIONS=’“USE_LIBCRYPT=1 USE_CRYPT_H=1 USE_ZLIB=1 USE_OPENSSL=1 USE_STATIC_PCRE=1”’
-c -o src/haproxy.o src/haproxy.c
gmake: gcc: Command not found
gmake: *** [src/haproxy.o] Error 127

GCC is installed properly. PFB.

GNU Make 3.82
Built for sparc-sun-solaris2.11
Copyright © 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Thanks

Hello,

gmake is installed. You are saying GCC is installed but then you are showing the output of gmake.

Unless gcc --version returns the version of GCC, it is not installed or not in the path.

As per README, you will also need GNU ld (check ld --version).

So you need all three: gmake, gcc and ld (gnu ld).

Thanks for the help Luka.

We have installed gcc which was missing earlier. Now we are getting the below error during installation.

ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
gmake: *** [haproxy] Error 1

Hi All,

I would also like to know if there is a separate installation files available for Solaris.

Thanks
Kiruthika

Like I said you need GNU ld. I guess you already fixed this since you now have a problem with gmake install?

There are no separate installation files. You have to follow README by installing the proper toolchain. If something is missing from those dependencies, we will add them.

Hi Luka,

Yes, GNU make, GNU ld, GCC is installed. Progressed to installation and facing the same issue. PFB the error.

install: haproxy was not found anywhere!
gmake: *** [install-bin] Error 2

Please let me know if I am missing something

Thanks
Kiruthika

Also on an another note, when the target is set gmake TARGET=solaris doesn’t result any error.
If any additional option is mentioned then the below error is thrown.

gmake TARGET=solaris USE_PCRE=1
gcc -Iinclude -Iebtree -Wall -O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -DTPROXY -DCONFIG_HAP_CRYPT -DNEED_CRYPT_H -DUSE_GETADDRINFO -DENABLE_POLL -DUSE_PCRE -I/usr/include -DCONFIG_HAPROXY_VERSION=“1.7.8” -DCONFIG_HAPROXY_DATE=“2017/07/07”
-DBUILD_TARGET=’“solaris”’
-DBUILD_ARCH=’""’
-DBUILD_CPU=’“generic”’
-DBUILD_CC=’“gcc”’
-DBUILD_CFLAGS=’"-O2 -g -fno-strict-aliasing -Wdeclaration-after-statement -fwrapv -fomit-frame-pointer -DFD_SETSIZE=65536 -D_REENTRANT -D_XOPEN_SOURCE=500 -D__EXTENSIONS__"’
-DBUILD_OPTIONS=’“USE_PCRE=1”’
-c -o src/haproxy.o src/haproxy.c
In file included from include/types/proxy.h:33:0,
from include/proto/log.h:32,
from include/common/cfgparse.h:29,
from src/haproxy.c:65:
include/common/regex.h:31:18: fatal error: pcre.h: No such file or directory
compilation terminated.
gmake: *** [src/haproxy.o] Error 1

Thanks
Kiruthika

Of course when you include new libraries like PCRE, you need to install the development version of that library first. You can’t just add new options without having that software installed.

When you have the executable (./haproxy -vv returns version information), then you can go ahead and execute gmake install). If that still fails, copy the init.d file and executable manually to the destination (/usr/local/sbin by default for the executable).

Hi,

We did install PCRE but both these options (USE_STATIC_PCRE=1 USE_PCRE=1) don’t work in the gmake command.
We proceeded with the installation. PFB the error we are getting. Please help.

install -d "/usr/local/sbin"
install haproxy "/usr/local/sbin"
haproxy installed as /etc/init.d/haproxy
install -d “/usr/local/share/man”/man1
install -m 644 doc/haproxy.1 “/usr/local/share/man”/man1
find: cycle detected for /lib/secure/32/
find: cycle detected for /lib/32/
find: cycle detected for /lib/crypto/32/
find: cycle detected for /usr/lib/security/32/
find: cycle detected for /usr/lib/brand/solaris10/32/
find: cycle detected for /usr/lib/rad/client/c/32/
find: cycle detected for /usr/lib/locale/en_US.UTF-8/LC_CTYPE/32/
find: cycle detected for /usr/lib/locale/en_US.UTF-8/LO_LTYPE/32/
find: cycle detected for /usr/lib/locale/en_US.UTF-8/32/
find: cycle detected for /usr/lib/lwp/32/
find: cycle detected for /usr/lib/link_audit/32/
find: cycle detected for /usr/lib/secure/32/
find: cycle detected for /usr/lib/32/
find: cycle detected for /usr/lib/elfedit/32/
find: cycle detected for /usr/lib/fm/topo/plugins/32/
find: cycle detected for /usr/lib/pool/32/
find: cycle detected for /usr/lib/gss/32/
install: haproxy.1 was not found anywhere!
gmake: *** [install-man] Error 2

Thanks
Kiruthika

Installing PCRE is not enough, you need to install the PCRE development version as I said:

The man-page was not installed due to some gmake issue. However the init.d scrip and the executable is fine, so you should be able to work with it.

Use gmake install-bin to avoid the problematic install-man triggered by gmake install.

If that works try the following patch to the Makefile with the gmake install:

diff --git a/Makefile b/Makefile
index 945dd5e..479fda3 100644
--- a/Makefile
+++ b/Makefile
@@ -846,8 +846,8 @@ src/dlmalloc.o: $(DLMALLOC_SRC) $(DEP)
        $(CC) $(COPTS) -DDEFAULT_MMAP_THRESHOLD=$(DLMALLOC_THRES) -c -o $@ $<

 install-man:
-       install -d "$(DESTDIR)$(MANDIR)"/man1
-       install -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)"/man1
+       install -d "$(DESTDIR)$(MANDIR)/man1"
+       install -m 644 doc/haproxy.1 "$(DESTDIR)$(MANDIR)/man1"

 EXCLUDE_DOCUMENTATION = lgpl gpl coding-style
 DOCUMENTATION = $(filter-out $(EXCLUDE_DOCUMENTATION),$(patsubst doc/%.txt,%,$(wildcard doc/*.txt)))

Thanks for the help. We will try and update if it works.

Thanks
Kiruthika