Before I start, this is a compile problem (or so I think) and from what little I read in this forum, it looks ok to post. If not and you know the proper place to post, please let me know. Now for the good stuff....

I'm attempting to write a simple tool in C that needs to be compiled statically with mysql client support. It needs this (correct me if I'm wrong in what I say) because it will be used on the majority of Redhat'S and SuSE's OSes. Instead of compiling for each one of their glibc's and requiring that the mysql shared libraries are installed, I want to compile it once, statically for all of them (excluding the x86_64 and ia64).

When I run
----------------------------------------------------------------
CC = gcc
CFLAGS = -O2 -Wall -static
ALL:
gcc -O2 -Wall -static -o logger scsiInquiry.o sg_err.o sgScan.o logger.o /usr/lib/mysql/libmysqlclient.a
----------------------------------------------------------------

I get the following
--------------------------------------------------------------
/usr/lib/mysql/libmysqlclient.a(mf_pack.o)(.text+0x9ac): In function `expand_tilde':
: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/mysql/libmysqlclient.a(libmysql.o)(.text+0x7a7): In function `read_user_name':
: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/mysql/libmysqlclient.a(mf_pack.o)(.text+0x9b9): In function `expand_tilde':
: Using 'endpwent' in statically linked applications requir....
----------------------------------------------------------------


I have little experience compiling statically so I am uncertain of the error messages are but I am reading it as the libmysqlclient.a wasn't compiled statically like I understood it to be. Is this so? If so, is there any way for me to compile my program statically without having to recompile libmysqlclient.a statically?

My ultimate goal is to be able to have this program run on all of my lab's machines and only using a single binary. Is this doable?


fyi:
the compile system is SuSE 9.0 x86 w/ mysql 4.0.15.