Hi All

It seems that compiling MySQL on a Solaris 8 box is a non-trivial task if your
environment is different to the MySQL developers (whatever that is). It has
taken me a couple of days, hacking & trawling the mailing list to get a
successful compile. I thought I would share my findings with others, and hope
that maybe it might be incorporated into the build and documentation (do I have
to submit a bug??).

Regards

John

Solaris Environment:
* Solaris 8 02/02 + July 2002 Recommended Patches
* gcc version 3.1.1
* Sun ld in /usr/ccs/bin
* mysql-3.23.51
* Extra libraries (such as zlib) installed in /usr/local/lib
NOTE: Setting LD_LIBRARY_PATH is required even though we tell the compiler to
look for libraries in /usr/local/lib. sigh.
LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
export LD_LIBRARY_PATH

* Hack to ./configure because it *assumes* we are using gnu ld, but we only want
to use Sun ld, which just doesn't like these options and dies with:
Error:
/usr/ccs/bin/ld: illegal option -- -
ld: fatal: option -d has illegal argument `efsym'

johnw@dawkins% diff -c configure /var/tmp/mysql-3.23.51/configure
*** configure   Tue Aug 13 16:56:07 2002
--- /var/tmp/mysql-3.23.51/configure    Mon Jun  3 20:39:20 2002
***************
*** 3827,3837 ****
    then
      if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
      then
!       if test "$ac_cv_prog_gnu_ld" = "yes"
!       then
!         CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW"
!         CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0"
!       fi
      fi
    fi
  fi
--- 3827,3834 ----
    then
      if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
      then
!       CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW"
!       CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0"
      fi
    fi
  fi

* Configure options as per documentation:
CC=gcc CFLAGS="-O3" LDFLAGS="-L/usr/local/lib" CXX=gcc  CXXFLAGS="-O3
-felide-constructors -fno-exceptions -fno-rtti" ./configure
--prefix=/usr/local/mysql --with-low-memory --enable-assembler 
Would very much like to include "CXXLD=g++" into configure line so I don't have
to hack client/Makefile, et al but it is ignored.

* Hack to client/Makefile, mysys/Makefile, sql/Makefile as we are using Sun's ld
and CXX=gcc, but don't want to get "__cxa_pure_virtual symbol not found" error.
Ref solution from MySQL mailing list:
http://www.geocrawler.com/archives/3/8/2001/11/50/7205532/
CXXLD = g++

* Edit config.h so that
#define SOCKET_SIZE_TYPE size_t
as per "Problems Compiling?" section of manual.
I do not understand autoconf enough to work out why it is having problems
picking this up.



In the documentation, at the top of the section entitled "Problems Compiling?",
it is stated that "All MySQL programs compile cleanly for us with no warnings on
Solaris using `gcc'.". I really think that this needs to be qualified a bit
more. Looking through the MySQL lists, it seems like compiling on Solaris for a
lot of people is a major saga. Could you also state:
* version of Solaris
* version of gcc
* whether you are using Sun ld or Gnu ld
* location of libraries and binaries such as libz and ld

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to