Compile Kerberos from source
Get the source (i.e. krb5-1.15.tar.gz)
http://web.mit.edu/kerberos/
For Linux and Solaris:
Copy the source to /opt/mydir/kerberos
tar -xvf krb5-1.15.tar.gz
## gunzip -c krb5-1.15.tar.gz | tar xvf -
mkdir linux-gcc3
cd krb5-1.15/src
Do not re-use the same extracted source code directory for both Linux and Solaris!.
Extracting source code directory for each platform.
For Solaris SPARC 9, we need to create a link from inttypes.h to stdint.h
cd /usr/include
ln -s inttypes.h stdint.h
For 64 bit, adding the option CC="cc -m64"
./configure CC="cc -m64" --prefix=/opt/mydir/kerberos/solaris-2.x 2>&1 | tee conf_log.log
make 2>&1 | tee make.log
make install
For Solaris SPARC 9, we had an error with Kerberos5-1.13.1 (it's OK in 1.14+)
IN_ARITHMETIC,E_NO_IMPLICIT_DECL_ALLOWED,E_ATTRIBUTE_PARAM_UNDEFINED -D_REENTRANT -c main.c
"main.c", line 818: operand cannot have void type: op "!="
"main.c", line 818: operands have incompatible types:
void "!=" int
cc: acomp failed for main.c
make[2]: *** [main.o] Error 2
make[2]: Leaving directory `/opt/mydir/kerberos/krb5-1.13.1/src/clients/ksu'
make[1]: *** [all-recurse] Error 1
Open /opt/mydir/kerberos/krb5-1.13.1/src/clients/ksu/main.c
Edit line 818
From
if (unsetenv(KRB5_ENV_CCNAME) != 0) {
retval = errno;
com_err(prog_name, retval, _("while clearing the value of %s"),
KRB5_ENV_CCNAME);
return retval;
}
To
unsetenv(KRB5_ENV_CCNAME);
/* retval = errno;
com_err(prog_name, retval, _("while clearing the value of %s"),
KRB5_ENV_CCNAME);
return retval;
*/
For Solaris SPARC 9, we have these error with Kerberos5-1.15:
From
"ev.c", line 564: missing operand
"verto-k5ev.c", line 213: warning: syntax error: empty declaration
vi krb5-1.15/src/util/verto/ev.c
Line: 564
#include#if (defined INTPTR_MAX ? INTPTR_MAX : ULONG_MAX) > 0xffffffffU #define ECB_PTRSIZE 8 #else #define ECB_PTRSIZE 4 #endif
To
#include#define ECB_PTRSIZE 8
And
From
"net-server.c", line 852: undefined symbol: AI_NUMERICSERV
vi krb5-1.15/src/include/fake-addrinfo.h
Line: 513
/* Fudge things on older gai implementations. */ /* AIX 4.3.3 is based on RFC 2133; no AI_NUMERICHOST. */ #ifndef AI_NUMERICHOST # define AI_NUMERICHOST 0 #endif
To
/* Fudge things on older gai implementations. */ /* AIX 4.3.3 is based on RFC 2133; no AI_NUMERICHOST. */ #ifndef AI_NUMERICHOST # define AI_NUMERICHOST 0 #endif #ifndef AI_NUMERICSERV # define AI_NUMERICSERV 0 #endif
To build the static library for Unix
./configure CC="cc -m64" --disable-shared --enable-static --prefix=/opt/mydir/kerberos/static/solaris-2.x 2>&1 | tee conf_log.log
In Kerberos 5-1.14
Add "-lm" into ${LIBS}
LIBS = -lresolv -lsocket -lnsl -lm
In these files:
- /opt/mydir/kerberos/kerberos5-1.14/static/tmp_sol/krb5-1.14/src/kdc/Makefile
- /opt/mydir/kerberos/kerberos5-1.14/static/tmp_sol/krb5-1.14/src/kadmin/server/Makefile
Because: The ceil() function is implemented in the math library, libm.so. By default, the linker does not link against this library when invoked via the gcc frontend. To link against that library, pass -lm on the command line to gcc.
For Windows
Lazy? Download the installer from:
http://web.mit.edu/kerberos/kfw-4.0/kfw-4.0.html
TO COMPILE THE SOURCE
I used the Visual Studio 2010 to compile it.
For Visual C++ 6.0, you can try to use the msinttypes project that fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio 6.0.
For Visual Studio 2013 - It has somes error and I can't resolve them. :(
Download the gawk
Extract it to C:\gawk
Install Cygwin to get or find these files:
mv.exe
rm.exe
cat.exe
sed.exe
Copy them to C:\gawk\bin
Create the folder
C:\buildtools\kerberos\krb5-1.13\win32
SET PATH=%PATH%;C:\gawk\bin
32 bit dynamic library
set CPU=i386
# Open the VS 2010 x86
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
set KRB_INSTALL_DIR=C:\buildtools\kerberos\krb5-1.13\win32
cd C:\buildtools\kerberos\krb5-1.13\src
nmake -f Makefile.in prep-windows
nmake NODEBUG=1
nmake install NODEBUG=1
64 bit dynamic library
Do not re-use the extracted source code directory!. Extract source code directory for each platform.
set CPU=AMD64
# Open the VS 2010 x64
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" amd64
set KRB_INSTALL_DIR=C:\buildtools\kerberos\krb5-1.13\win64
cd C:\buildtools\kerberos\krb5-1.13\src
nmake -f Makefile.in prep-windows
nmake NODEBUG=1
nmake install NODEBUG=1
Note for Kerberos 5-1.14 and Visual Studio 2010
- Remove or commnet out these lines of code in these files:
+ kerberos5-1.14\krb5-1.14\src\lib\Makefile (line 319)
+ kerberos5-1.14\krb5-1.14\src\windows\kfwlogon\Makefile (line 275)
!if defined(VISUALSTUDIOVERSION) && $(VISUALSTUDIOVERSION:.=) >= 140
WINCRTEXTRA = ucrt.lib vcruntime.lib
!endif
- Find machine which has Visual Studio 2013 (or later) and copy these files:
In the C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin
uicc.exe
uicc.xsd
uiccdll.dll
Copy them to C:\gawk\bin