I suspect MySQL was compiled with a different compiler, probably the Sun compiler and not GCC, so there is a clash of compiler options. See if those -x options come out when you run mysql_config. You may need to use a GCC-compiled MySQL, or Sun-compiled Python.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attempting this install on a Sun V210 running Sol9, any assistance would be appreciated!
python setup.py build
running build
running build_py
creating build
creating build/lib.solaris-2.9-sun4u-2.4
copying mysql_exceptions.py -> build/lib.solaris-2.9-sun4u-2.4
creating build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/init.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/converters.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/connections.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/cursors.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/sets.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/times.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/stringtimes.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/mxdatetimes.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
copying MySQLdb/pytimes.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb
creating build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/init.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.solaris-2.9-sun4u-2.4/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.solaris-2.9-sun4u-2.4
gcc -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/mysql/include -I/usr/local/include/python2.4 -c _mysql.c -o build/temp.solaris-2.9-sun4u-2.4/_mysql.o -I/usr/local/mysql/include -xO3 -mt -D_FORTEC -xarch=v8
gcc: warning:
-x arch=v8' after last input file has no effect cc1: error: invalid option
t'error: command 'gcc' failed with exit status 1
I suspect MySQL was compiled with a different compiler, probably the Sun compiler and not GCC, so there is a clash of compiler options. See if those -x options come out when you run mysql_config. You may need to use a GCC-compiled MySQL, or Sun-compiled Python.