The ./configure script incorrectly sets up the linker flags for the server build on Solaris 10, if the Sun compiler (Studio 11, but I suspect it's generic to all compilers):
setenv CC cc
./configure --enable-server --with-mysql=/usr/sfw
This fails to link when it comes to (trimmed):
cc -g -o zabbix_server -L/usr/sfw/lib/mysql
...
-lmysqlclient
...
There are actually two errors here:
- It's looking in /usr/sfw/lib/mysql when the library is in /usr/sfw/lib. The extra mysql in the path is incorrect
- There's no corresponding -R, so that even if it were to link it would be unable to find the library at runtime
If I use /usr/sfw/bin/gcc, then the build succeeds. But this is by accident, because that gcc happens to look in /usr/sfw/lib anyway.
Furthermore, as far as I can tell the build with cc is unoptimized - I can't see any -O being specified (although -g is). Mind you, the gcc build has the optimization turned down to -O2 from the normal -O.
setenv CC cc
./configure --enable-server --with-mysql=/usr/sfw
This fails to link when it comes to (trimmed):
cc -g -o zabbix_server -L/usr/sfw/lib/mysql
...
-lmysqlclient
...
There are actually two errors here:
- It's looking in /usr/sfw/lib/mysql when the library is in /usr/sfw/lib. The extra mysql in the path is incorrect
- There's no corresponding -R, so that even if it were to link it would be unable to find the library at runtime
If I use /usr/sfw/bin/gcc, then the build succeeds. But this is by accident, because that gcc happens to look in /usr/sfw/lib anyway.
Furthermore, as far as I can tell the build with cc is unoptimized - I can't see any -O being specified (although -g is). Mind you, the gcc build has the optimization turned down to -O2 from the normal -O.
Comment