I was compiling PHP (4.0.6) with Apache (1.3.20) and IMAP (UW imap-2000c) on Redhat 7.1 and ran into these problems...
/usr/lib/libc-client.a(osdep.o): In function auth_gssapi_valid':
/usr/src/bs/BUILD/imap-4.7/c-client/auth_gss.c:86: undefined reference togss_m
...
I don't remember where I found this solution, but here it is:
After running configure, edit the apache Makefile (found in the apache.1.3.x/src folder) and add the following lines just ABOVE the comment that says
(End of automatically generated section)
IMAP_LD_LIBS= -Wl,-rpath,/usr/kerberos/lib -lc-client -L/usr/kerberos/lib -lkrb5 -lgssapi_krb5 ${SSL_LDFLAGS} -Wl,-rpath,${SSL_LIBDIR}
LIBS1= -Wl,-rpath,/usr/include//lib -rdynamic -L/usr/include//lib -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 ${IMAP_LD_LIBS} -lpam -lc-client -ldl -lmysqlclient -lpam -lgd -lt1 -ljpeg -lcrypt -lssl -lcrypto -lresolv -lm -ldl -lnsl -lresolv -lm -lcrypt
I was able to successfully make and make install Apache after adding these lines.
Hope this saves someone some time and misery,
Phil