• I had to install DBD::mysql for monitoring mysql replication status using check_replication.pl plugin for nagios.
    Unfortunately, perl package included with solaris 10 is a 32 Bit binary and we're using Mysql 64 bit mysql package on our server. So, the build process was a bit complex. Follows a step by step guide for building DBD::mysql under solaris 10.

  • Download and install 32 Bit Mysql binaries and libs (even if you have 64 bits binaires and libs, 32 bits libs are required).

  • Download and install gcc with its dependencies and its friends (make, ldd) for solaris 10 from sun freeware.

  • Begin the installation of DBD::mysql via perl -MCPAN -e 'reinstall DBD::mysql' . This step will end with the errors.

    •       gcc: unrecognized option `-KPIC'
            cc1: error: invalid option `t'
            cc1: error: invalid option `t'
            make: *** [dbdimp.o] Error 1
            /usr/local/bin/make  -- NOT OK
  • Change the directory to cpan temporary build directory usin the cd command. The build directory can be displayed via echo "o conf" | perl -MCPAN -e shell | grep build_dir

  • Under the build directory, one should see a directory named DBD-mysql-???. This directory contains all the source files for building DBD::mysql

  • Recreate the makefile using the command /usr/bin/perl Makefile.PL --with-mysql=/path/to/mysql32 --mysql_config=/path/to/mysql32/bin/mysql_config. This step should finish without errors. If it ends with errors, recheck if mysql 32 bit, gcc and friends are correctly installed.

  • Edit the file Makefile, replace xarch=sparc by mcpu=v9 and CC=ld by CC=gcc.

  • Start the compliation by make.

    • If it stops with the message
              /bin/sh: cc: not found
              make: *** [dbdimp.o] Error 1

      then edit the file Makefile and replace CC=cc by CC=gcc

  • Restart the compliation by make.

    • If it stops with the message
                gcc: unrecognized option `-KPIC'`

      then edit the file Makefile, and remove -KPIC option on the line starting with CCCDLFLAGS =)

    • If it stops with the message
                gcc: language ildoff not recognized
                gcc: language space not recognized
                gcc: language O3 not recognized

      then edit the file Makefile and remove -xO3, -xspace and -xildoff options on the line starting with OPTIMIZE =.

    • If it stops with the message
                gcc: language arch=v8 not recognized
         

      then edit the file Makefile, and replace xarch=v8 by m32 on the line starting with CCFLAGS =

    • If it stops with the message
                cc1: error: invalid option `t'

      then edit the file Makefile, and remove the option -mt on the line statring with INC =

  • Once the build process is complete, install the built binaries by make install

    After the installation, the nagios' replication check plugin should be usable.