<br><font size=2 face="sans-serif">Hello,</font>
<br>
<br><font size=2 face="sans-serif">I was having problems compiling freeradius-1.0.5
on Solaris 10 (sparc) that were rather difficult to troubleshoot. I
managed to get the compilation completed successfully, but it seems that
maybe there could be some changes to improve the experience others have
with compiling freeradius on Solaris 10 in the future.</font>
<br>
<br><font size=2 face="sans-serif">The problem I had, and another poster
had, centers around configuring freeradius to compile with openssl. The
full set of configure options I used were as follows:</font>
<br>
<br><font size=2 face="sans-serif">./configure \</font>
<br><font size=2 face="sans-serif"> --prefix=/usr/local/freeradius
\</font>
<br><font size=2 face="sans-serif"> --with-threads
\</font>
<br><font size=2 face="sans-serif"> --with-ldap
\</font>
<br><font size=2 face="sans-serif"> --with-openssl-includes=/usr/sfw/include/openssl
\</font>
<br><font size=2 face="sans-serif"> --with-openssl-libraries=/usr/sfw/lib
\</font>
<br><font size=2 face="sans-serif"> --with-rlm-ldap-include-dir=/usr/local/openldap/include
\</font>
<br><font size=2 face="sans-serif"> --with-rlm-ldap-lib-dir=/usr/local/openldap/lib
\</font>
<br>
<br><font size=2 face="sans-serif">With no changes to my environment I
get the following error:</font>
<br><font size=2 face="sans-serif">....</font>
<br><font size=2 face="sans-serif">gcc -L../lib -o radwho radwho.o
util.o log.o conffile.o -L/usr/sfw/lib -lssl -L/usr/sfw/lib -lcrypto -lnsl
-lresolv -lsocket -lposix4 -lpthread -lradius -lcrypt</font>
<br><font size=2 face="sans-serif">Undefined
first referenced</font>
<br><font size=2 face="sans-serif"> symbol
in
file</font>
<br><font size=2 face="sans-serif">MD5Init
../lib/libradius.a(radius.o)
(symbol belongs to implicit dependency /usr/lib/libmd5.so.1)</font>
<br><font size=2 face="sans-serif">MD5Final
../lib/libradius.a(radius.o)
(symbol belongs to implicit dependency /usr/lib/libmd5.so.1)</font>
<br><font size=2 face="sans-serif">MD5Update
../lib/libradius.a(radius.o)
(symbol belongs to implicit dependency /usr/lib/libmd5.so.1)</font>
<br><font size=2 face="sans-serif">ld: fatal: Symbol referencing errors.
No output written to radwho</font>
<br><font size=2 face="sans-serif">...</font>
<br>
<br><font size=2 face="sans-serif">The error does not occur when I run
the configure from above leaving out the two openssl options.</font>
<br><font size=2 face="sans-serif">This was fixed by adding the following
to my environment:</font>
<br><font size=2 face="sans-serif">LIBS=-lmd5</font>
<br><font size=2 face="sans-serif">export LIBS</font>
<br><font size=2 face="sans-serif">* - This issue and workaround was mentioned
by a previous poster.</font>
<br>
<br><font size=2 face="sans-serif">Should md5 be added to the list of libraries
automatically defined during the configure process for the above?</font>
<br>
<br>
<br><font size=2 face="sans-serif">Then I get the following error:</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">gcc -g -O2 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS
-DOPENSSL_NO_KRB5 -I/usr/sfw/include/openssl -Wall -D_GNU_SOURCE -g -Wshadow
-Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls
-Wundef -I../include -DHOSTINFO=\"\" -DRADIUSD_VERSION=\"1.0.5\"
-c radclient.c</font>
<br><font size=2 face="sans-serif">radclient.c: In function `main':</font>
<br><font size=2 face="sans-serif">radclient.c:788: error: `RADIUS_DICTIONARY'
undeclared (first use in this function)</font>
<br><font size=2 face="sans-serif">radclient.c:788: error: (Each undeclared
identifier is reported only once</font>
<br><font size=2 face="sans-serif">radclient.c:788: error: for each function
it appears in.)</font>
<br><font size=2 face="sans-serif">gmake[4]: *** [radclient.o] Error 1</font>
<br><font size=2 face="sans-serif">gmake[4]: Leaving directory `/tmp/freeradius-1.0.5/src/main'</font>
<br><font size=2 face="sans-serif">...</font>
<br>
<br><font size=2 face="sans-serif">This was a rather perplexing error as
upon investigation of the radclient.c source and the freeradius-1.0.5/src/include
directory, RADIUS_DICTIONARY is defined in ../include/conf.h and radclient.c
has an include statement for conf.h. It is even more perplexing when
investigating the gcc command from above, clearly the conf.h should be
findable through the "-I../include" portion of the command. Following
a suggestion, I set my CFLAGS env variable to CFLAGS="-I../include
-I/usr/local/openldap/include" to force the -I../include to appear
further up in the gcc command. To my surprise that allowed the compilation
to finish successfully. </font>
<br>
<br><font size=2 face="sans-serif">After further investigation we discovered
that there is also a "conf.h" file in the /usr/sfw/include/openssl
directory which appears before the -I../include in the gcc command formed
above. Therefore the radclient.c sees the openssl conf.h which does
not have the `RADIUS_DICTIONARY' defined, thus the error. I checked
the openssl source not from Sun and they have a "conf.h" as well.</font>
<br>
<br><font size=2 face="sans-serif">I could imagine a couple of possible
fixes for this issue:</font>
<br><font size=2 face="sans-serif">1) Modify configure to place the -I/usr/sfw/include/openssl
(the ssl include path) to be after the -I../include?</font>
<br><font size=2 face="sans-serif">or</font>
<br><font size=2 face="sans-serif">2) Change the name of conf.h to something
more descriptive and specific to freeradius to avoid conflicts like this?</font>
<br>
<br><font size=2 face="sans-serif">Another interesting aspect is that with
1.0.4, it seems as if the --with-openssl-lib= option wasn't really working,
because even with that set it wouldn't find ssl or libcrypt unless I set
LD_LIBRARY_PATH. Now with 1.0.5 I don't have to set LD_LIBRARY_PATH.</font>
<br><font size=2 face="sans-serif"><br>
-Garrett Marks<br>
</font>