Linking Shared/Static library in Freeradius Module
Hello, I am writing a FreeRadius (Version 2) module for version Freeradius 2.1.10 . The module works fine. When i want to link a shared/static library from the Makefile of the module i get errors. I link to a static library and i run radius server with the module ( radiusd -X) then i get the error: /usr/local/etc/raddb/radiusd.conf[665]: Failed to link to module 'rlm_itap': file not found makefile of the freeradius module : *VERS = 2.1.10 CFLAGS = -DNDEBUG -Wall -I/usr/include \ -I/usr/ports/net/freeradius2/work/freeradius-server-$(VERS)/src LIBS = -lc -L. icc-wrapper.a ALL: rlm_itap.o rlm_itap-$(VERS).so* rlm_itap is the name of my module. When i remove *icc-wrapper.a , everything works fine. *For the shared library case. Everything works fine until the function from the shared library is called inside the module. I got the error: /libexec/ld-elf.so.1: /usr/local/lib/freeradius-2.1.10/rlm_itap.so: Undefined symbol "sendiccmsg" in that case. sendiccmsg is the only function i have in my shared library. The makefile of the freeradius module: VERS = 2.1.10 CFLAGS = -DNDEBUG -Wall -I/usr/include \ -I/usr/ports/net/freeradius2/work/freeradius-server-$(VERS)/src LIBS = -lc icc-wrapper.so ALL: rlm_itap.o rlm_itap-$(VERS).so rlm_itap.o: rlm_itap.c cc -g -fPIC -DPIC -c $(CFLAGS) rlm_itap.c rlm_itap-$(VERS).so: rlm_itap.o cc -g -shared -Wl,-soname,rlm_itap-$(VERS).so \ -o rlm_itap-$(VERS).so rlm_itap.o $(LIBS) install: ALL install rlm_itap-$(VERS).so /usr/local/lib/freeradius-$(VERS) ln -fs rlm_itap-$(VERS).so /usr/local/lib/freeradius-$(VERS)/rlm_itap.so clean: rm rlm_itap*.o rlm_itap*.so The static/shred library i am using is compiled as a C++ library with extern "C" in front of function definitions. Regards Resit Sahin
Resit Sahin wrote:
I am writing a FreeRadius (Version 2) module for version Freeradius 2.1.10 . The module works fine. When i want to link a shared/static library from the Makefile of the module i get errors.
You didn't follow the FreeRADIUS build process.
makefile of the freeradius module :
/VERS = 2.1.10 CFLAGS = -DNDEBUG -Wall -I/usr/include \ -I/usr/ports/net/freeradius2/work/freeradius-server-$(VERS)/src LIBS = -lc -L. icc-wrapper.a ALL: rlm_itap.o rlm_itap-$(VERS).so/
Uh... *why* did you do this? The server ships with *many* examples of building modules. The build system for the server takes care of all of the necessary magic to make it Just Work. By creating your own Makefile you've done more work than necessary, and ensured that the resulting module won't work with FreeRADIUS. Alan DeKok.
I have followed the steps here : http://wiki.freeradius.org/Modules2#Testing The makefile is "almost" the same with the makefile there. It is recommended to use your own make file in the wiki entry.... My module works fine without linking libraries. The problems arise when i try to link external libraries. Resit On 12/06/2011 05:36 PM, Alan DeKok wrote:
Resit Sahin wrote:
I am writing a FreeRadius (Version 2) module for version Freeradius 2.1.10 . The module works fine. When i want to link a shared/static library from the Makefile of the module i get errors. You didn't follow the FreeRADIUS build process.
makefile of the freeradius module :
/VERS = 2.1.10 CFLAGS = -DNDEBUG -Wall -I/usr/include \ -I/usr/ports/net/freeradius2/work/freeradius-server-$(VERS)/src LIBS = -lc -L. icc-wrapper.a ALL: rlm_itap.o rlm_itap-$(VERS).so/ Uh... *why* did you do this?
The server ships with *many* examples of building modules. The build system for the server takes care of all of the necessary magic to make it Just Work.
By creating your own Makefile you've done more work than necessary, and ensured that the resulting module won't work with FreeRADIUS.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Mustafa Reşit Şahin Endersys İş Tel: 0216 470 94 23 Dahili:306 Cep Tel:0507 707 68 12
Mustafa Reşit Şahin wrote:
I have followed the steps here :
Well, it's wrong. I'm not sure it was ever correct. I've deleted that example from the Wiki. Look at src/modules/rlm_example/Makefile. It works, and is correct. Edit it to build your module. It's a *lot* simpler. Alan DeKok.
I am trying to use src/modules/rlm_example/Makefile using configure files. In this makefile stated : # The RLM_LIBS definition should list ALL required libraries. # These libraries really should be pulled from the 'config.mak' # definitions, if at all possible. These definitions are also # echoed into another file in ../lib, where they're picked up by # ../main/Makefile for building the version of the server with # statically linked modules. Get it from autoconf. # Which file mentioned with "These definitions are also # echoed into another file in ../lib," ? I could not find this file. As far as i understand, i have to add shared/static libraries ( which i link from my new module ) into this file . So freeradius can find them. I consider this because i get the error : /libexec/ld-elf.so.1: /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.so: Undefined symbol "sendiccmsg" when i run radiusserver and send an autorization message to server. On 12/06/2011 06:00 PM, Alan DeKok wrote:
Mustafa Reşit Şahin wrote:
I have followed the steps here :
http://wiki.freeradius.org/Modules2#Testing Well, it's wrong. I'm not sure it was ever correct. I've deleted that example from the Wiki.
Look at src/modules/rlm_example/Makefile. It works, and is correct. Edit it to build your module. It's a *lot* simpler.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Mustafa Reşit Şahin Endersys İş Tel: 0216 470 94 23 Dahili:306 Cep Tel:0507 707 68 12
Mustafa Reşit Şahin wrote:
Which file mentioned with "These definitions are also # echoed into another file in ../lib," ?
Files automatically produced by the builds.
I could not find this file. As far as i understand, i have to add shared/static libraries ( which i link from my new module ) into this file . So freeradius can find them.
No. You just add them in the RLM_LIBS line.
I consider this because i get the error :
/libexec/ld-elf.so.1: /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.so: Undefined symbol "sendiccmsg"
when i run radiusserver and send an autorization message to server.
You probably need to re-build radiusd, too. Or... *show* what you did. This isn't hard. The current build process *can* link to static libraries, and *does* link to static libraries, and *works* when modules are linked to static libraries. If you follow the examples, it *should* work. Alan DeKok.
Hello, I will try to explain what i am trying to achive. I am developing a freeradius module called rlm_itap. This module uses a shared library called print.so (a library i use for test purposes.). There is only one procedure in the library and it is called : myprint() . I am able to run freeradius server with my own module : $ radiusd -X I send a test message with $ radtest testuser "pass" localhost 0 testing123 If i do not use myprint() function in my own module everything works fine and i am able to receive the incomming message: +- entering group authorize {...} ++[preprocess] returns ok ITAP: Received auth message =>*My own debug msg* But when i use the method myprint() from the library print.so , i get the error when i run the server and send a message with radtest : /# Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default +- entering group authorize {...} ++[preprocess] returns ok ITAP: Received auth message /libexec/ld-elf.so.1: /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.so: *Undefined symbol "myprint"*/ So this is the problem i am having. After your email i started to use autoconf and it is easier than writing my own makefile. But i am still not able to resolve this problem. As far as i understand freeradius is not able to see find print.so library. I have to find a way to show the server this library.... I prepare my module as : $ autoconf $ ./configure $ gmake clean $ gmake $ gmake install Here is some more information and my makefiles: *$ gmake * [root@vm1 /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap]# gmake for x in .libs/* rlm_itap.la; do \ rm -rf /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/lib/$x; \ ln -s /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap/$x /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/lib/$x; \ done [root@vm1 /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap]# gmake clean [root@vm1 /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap]# gmake /usr/local/bin/libtool --mode=compile cc -O2 -pipe -I/usr/local/include -L/usr/local/lib -DHAVE_LT_DLADVISE_INIT -DHAVE_LT_DLADVISE_INIT -fno-strict-aliasing -pthread -Wall -D_GNU_SOURCE -DNDEBUG -I/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src -I/usr/include -I/home/resit/radius/include/ -c rlm_itap.c libtool: compile: cc -O2 -pipe -I/usr/local/include -L/usr/local/lib -DHAVE_LT_DLADVISE_INIT -DHAVE_LT_DLADVISE_INIT -fno-strict-aliasing -pthread -Wall -D_GNU_SOURCE -DNDEBUG -I/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src -I/usr/include -I/home/resit/radius/include/ -c rlm_itap.c -fPIC -DPIC -o .libs/rlm_itap.o libtool: compile: cc -O2 -pipe -I/usr/local/include -L/usr/local/lib -DHAVE_LT_DLADVISE_INIT -DHAVE_LT_DLADVISE_INIT -fno-strict-aliasing -pthread -Wall -D_GNU_SOURCE -DNDEBUG -I/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src -I/usr/include -I/home/resit/radius/include/ -c rlm_itap.c -o rlm_itap.o
/dev/null 2>&1 /usr/local/bin/libtool --mode=link cc -release 2.1.10 \ -module -export-dynamic -rpath=/usr/lib:/usr/local/lib -o rlm_itap.la \ -rpath /usr/local/lib/freeradius-2.1.10 rlm_itap.lo rlm_itap.c /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/lib/libfreeradius-radius.la -lc -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so libtool: link: cc -shared .libs/rlm_itap.o -Wl,-rpath -Wl,/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/lib/.libs -Wl,-rpath -Wl,/usr/local/lib/freeradius-2.1.10 /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/lib/.libs/libfreeradius-radius.so -L/usr/local/lib -pthread -L/home/resit/radius/lib/ -pthread -pthread -Wl,-soname -Wl,rlm_itap-2.1.10.so -o .libs/rlm_itap-2.1.10.so libtool: link: (cd ".libs" && rm -f "rlm_itap.so" && ln -s "rlm_itap-2.1.10.so" "rlm_itap.so") libtool: link: ar cru .libs/rlm_itap.a rlm_itap.o libtool: link: ranlib .libs/rlm_itap.a libtool: link: ( cd ".libs" && rm -f "rlm_itap.la" && ln -s "../rlm_itap.la" "rlm_itap.la" ) for x in .libs/* rlm_itap.la; do \ rm -rf /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/lib/$x; \ ln -s /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap/$x /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/lib/$x; \ done
*$ gmake install : *[root@vm1 /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap]# gmake install gmake[1]: Entering directory `/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap' touch . gmake[1]: Leaving directory `/usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap' if [ "xrlm_itap" != "x" ]; then \ /usr/local/bin/libtool --mode=install /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/install-sh -c -c \ rlm_itap.la /usr/local/lib/freeradius-2.1.10/rlm_itap.la || exit $?; \ rm -f /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.la; \ ln -s rlm_itap.la /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.la || exit $?; \ fi libtool: install: warning: relinking `rlm_itap.la' libtool: install: (cd /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/modules/rlm_itap; /bin/sh /usr/local/bin/libtool --mode=relink cc -release 2.1.10 -module -export-dynamic -rpath=/usr/lib:/usr/local/lib -o rlm_itap.la -rpath /usr/local/lib/freeradius-2.1.10 rlm_itap.lo rlm_itap.c /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/src/lib/libfreeradius-radius.la -lc -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so ) libtool: relink: cc -shared .libs/rlm_itap.o -Wl,-rpath -Wl,/usr/local/lib/freeradius-2.1.10 -L/usr/local/lib/freeradius-2.1.10 -lfreeradius-radius -L/usr/local/lib -pthread -L/home/resit/radius/lib/ -pthread -pthread -Wl,-soname -Wl,rlm_itap-2.1.10.so -o .libs/rlm_itap-2.1.10.so libtool: install: /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/install-sh -c -c .libs/rlm_itap-2.1.10.soT /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.so libtool: install: (cd /usr/local/lib/freeradius-2.1.10 && { ln -s -f rlm_itap-2.1.10.so rlm_itap.so || { rm -f rlm_itap.so && ln -s rlm_itap-2.1.10.so rlm_itap.so; }; }) libtool: install: /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/install-sh -c -c .libs/rlm_itap.lai /usr/local/lib/freeradius-2.1.10/rlm_itap.la libtool: install: /usr/ports/net/freeradius2/work/freeradius-server-2.1.10/install-sh -c -c .libs/rlm_itap.a /usr/local/lib/freeradius-2.1.10/rlm_itap.a libtool: install: chmod 644 /usr/local/lib/freeradius-2.1.10/rlm_itap.a libtool: install: ranlib /usr/local/lib/freeradius-2.1.10/rlm_itap.a ---------------------------------------------------------------------- Libraries have been installed in: /usr/local/lib/freeradius-2.1.10 If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,-rpath -Wl,LIBDIR' linker flag See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- [root@vm1 /usr/local/lib/freeradius-2.1.10]# *nm rlm_itap-2.1.10.so* 00000000001011c0 A _DYNAMIC 00000000001013a8 A _GLOBAL_OFFSET_TABLE_ w _Jv_RegisterClasses 0000000000101388 d __CTOR_END__ 0000000000101380 d __CTOR_LIST__ 0000000000101398 d __DTOR_END__ 0000000000101390 d __DTOR_LIST__ 00000000001011b8 r __FRAME_END__ 00000000001013a0 d __JCR_END__ 00000000001013a0 d __JCR_LIST__ 0000000000101408 A __bss_start w __cxa_finalize@@FBSD_1.0 0000000000000b80 t __do_global_ctors_aux 0000000000000a00 t __do_global_dtors_aux 0000000000101000 d __dso_handle 0000000000101408 A _edata 0000000000101410 A _end 0000000000000bb8 T _fini 0000000000000970 T _init U cf_section_parse 0000000000101408 b completed.5133 U debug_flag 0000000000000a50 t frame_dummy U free@@FBSD_1.0 0000000000000aa0 t itap_accounting 0000000000000a80 t itap_authenticate 0000000000000ac0 t itap_authorize 0000000000000ab0 t itap_checksimul 0000000000000af0 t itap_detach 0000000000000b00 t itap_instantiate 0000000000000a90 t itap_preacct U log_debug 00000000001010a0 d module_config U myprint 0000000000101008 d p.5131 U rad_malloc 0000000000000c7f r rcsid 0000000000000c57 r rcsid_conffile_h 0000000000000c52 r rcsid_event_h 0000000000000c66 r rcsid_hash_h 0000000000000c75 r rcsid_libradius_h 0000000000000c61 r rcsid_md4_h 0000000000000c70 r rcsid_missing_h 0000000000000c43 r rcsid_modules_h 0000000000000c5c r rcsid_packet_h 0000000000000c7a r rcsid_radiusd_h 0000000000000c48 r rcsid_realms_h 0000000000000c4d r rcsid_stats_h 0000000000000c6b r rcsid_token_h 0000000000101020 D rlm_itap [root@vm1 /usr/local/lib/freeradius-2.1.10]# *ldd rlm_itap-2.1.10.so* rlm_itap-2.1.10.so: libfreeradius-radius-2.1.10.so => /usr/local/lib/freeradius-2.1.10/libfreeradius-radius-2.1.10.so (0x800c00000) libthr.so.3 => /lib/libthr.so.3 (0x800d21000) libc.so.7 => /lib/libc.so.7 (0x800647000) [root@vm1 /usr/local/lib/freeradius-2.1.10]#*ldd libfreeradius-radius-2.1.10.so * libfreeradius-radius-2.1.10.so: libthr.so.3 => /lib/libthr.so.3 (0x800c00000) libc.so.7 => /lib/libc.so.7 (0x800647000) *My makefile.in file* ####################################################################### TARGET = @targetname@ SRCS = rlm_itap.c HEADERS = icc-wrapper.h print.h RLM_CFLAGS = @itap_cflags@ -I/home/resit/radius/include/ RLM_LIBS = @itap_ldflags@ -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so RLM_INSTALL = install-itap ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) ## the rule that RLM_INSTALL tells the parent rules.mak to use. install-itap: touch . *my makefile :* ####################################################################### TARGET = rlm_itap SRCS = rlm_itap.c HEADERS = icc-wrapper.h print.h RLM_CFLAGS = -I/usr/include -I/home/resit/radius/include/ RLM_LIBS = -lc -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so RLM_INSTALL = install-itap ## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET. include ../rules.mak $(LT_OBJS): $(HEADERS) ## the rule that RLM_INSTALL tells the parent rules.mak to use. install-itap: touch . *my configure.in file: * AC_PREREQ([2.53]) AC_INIT(rlm_itap.c) # change 'itap' AC_REVISION($Revision$) AC_DEFUN(modname,[rlm_itap]) # change 'itap' if test x$with_[]modname != xno; then AC_PROG_CC AC_PROG_CPP dnl put configuration checks here. dnl set $fail to what's missing, on fatal errors. dnl use AC_MSG_WARN() on important messages. AC_CHECK_LIB(c, printf, [ itap_ldflags="$itap_ldflags -lc" ], [ fail=$fail" printf" ] ) AC_CHECK_HEADER(stdio.h, [ itap_cflags="$itap_cflags -I/usr/include" ], [ fail=$fail" stdio.h" ] ) AC_CHECK_HEADERS(stdio.h stdlib.h) # for the config.h defs AC_CHECK_FUNCS(printf) # for the config.h defs targetname=modname # keep this! Don't change! else targetname= # keep this! Don't change! echo \*\*\* module modname is disabled. # keep this! Don't change! fi dnl Don't change this section. if test x"$fail" != x""; then if test x"${enable_strict_dependencies}" = x"yes"; then AC_MSG_ERROR([set --without-]modname[ to disable it explicitly.]) else AC_MSG_WARN([silently not building ]modname[.]) AC_MSG_WARN([FAILURE: ]modname[ requires: $fail.]); targetname="" fi fi AC_SUBST(itap_cflags) # change 'itap' AC_SUBST(itap_ldflags) # change 'itap' AC_CONFIG_HEADER(config.h) # delete if you don't want a config.h file. AC_SUBST(targetname) # keep this! Don't change! AC_OUTPUT(Makefile) # keep this! Don't change! On 12/07/2011 04:55 PM, Alan DeKok wrote:
Mustafa Reşit Şahin wrote:
Which file mentioned with "These definitions are also # echoed into another file in ../lib," ? Files automatically produced by the builds.
I could not find this file. As far as i understand, i have to add shared/static libraries ( which i link from my new module ) into this file . So freeradius can find them. No. You just add them in the RLM_LIBS line.
I consider this because i get the error :
/libexec/ld-elf.so.1: /usr/local/lib/freeradius-2.1.10/rlm_itap-2.1.10.so: Undefined symbol "sendiccmsg"
when i run radiusserver and send an autorization message to server. You probably need to re-build radiusd, too.
Or... *show* what you did. This isn't hard.
The current build process *can* link to static libraries, and *does* link to static libraries, and *works* when modules are linked to static libraries. If you follow the examples, it *should* work.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Mustafa Reşit Şahin Endersys İş Tel: 0216 470 94 23 Dahili:306 Cep Tel:0507 707 68 12
Well, yes it seems to be problem. But there is one more thing. The libprint.so should reside in : /usr/lib or /usr/local/lib/ Considering my experience with writing a module for freeradius i think wiki page for module creation can be updated with following info: 1) Mentioning autoconf procedure. autoconf.in makefile.in files. running autoconf running ./configure building: gmake clean && gmake && gmake install Regards On 12/08/2011 04:58 PM, Fajar A. Nugraha wrote:
2011/12/8 Mustafa Reşit Şahin<resitsahin@gmail.com>:
My makefile.in file RLM_LIBS = @itap_ldflags@ -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so shouldn't it be "-lprint" instead of "/home/resit/radius/lib/print.so"?
-- Mustafa Reşit Şahin Endersys İş Tel: 0216 470 94 23 Dahili:306 Cep Tel:0507 707 68 12
Mustafa Reşit Şahin wrote:
Considering my experience with writing a module for freeradius i think wiki page for module creation can be updated with following info:
1) Mentioning autoconf procedure.
No. Autoconf is insane and complicated. There is no reason why normal people need to use it. I use it, and look how I turned out... For building modules, it should be VERY easy. See the examples in rlm_example. Change the names, add header files and libraries. That's it. Many other people have done this, and it works. Alan DeKok.
Mustafa Reşit Şahin wrote: ...
But when i use the method myprint() from the library print.so , i get the error when i run the server and send a message with radtest : ... -lc -L/home/resit/radius/lib/ /home/resit/radius/lib/print.so
This is a dynamic linker problem. You've put the library where ld.so cannot find it. Put the file into a normal directory, where the linker can find it. This isn't a FreeRADIUS problem. Alan DeKok.
2.1.10 yerine en son surum olan 2.1.12 kullanirsan daha yararli (http://freeradius.org/ dan indirebilirsin) 2011/12/6 Mustafa Reşit Şahin <resitsahin@gmail.com>
I have followed the steps here :
http://wiki.freeradius.org/**Modules2#Testing<http://wiki.freeradius.org/Modules2#Testing>
The makefile is "almost" the same with the makefile there.
It is recommended to use your own make file in the wiki entry....
My module works fine without linking libraries. The problems arise when i try to link external libraries.
Resit
On 12/06/2011 05:36 PM, Alan DeKok wrote:
Resit Sahin wrote:
I am writing a FreeRadius (Version 2) module for version Freeradius 2.1.10 . The module works fine. When i want to link a shared/static library from the Makefile of the module i get errors.
You didn't follow the FreeRADIUS build process.
makefile of the freeradius module :
/VERS = 2.1.10 CFLAGS = -DNDEBUG -Wall -I/usr/include \ -I/usr/ports/net/freeradius2/**work/freeradius-server-$(VERS) **/src LIBS = -lc -L. icc-wrapper.a ALL: rlm_itap.o rlm_itap-$(VERS).so/
Uh... *why* did you do this?
The server ships with *many* examples of building modules. The build system for the server takes care of all of the necessary magic to make it Just Work.
By creating your own Makefile you've done more work than necessary, and ensured that the resulting module won't work with FreeRADIUS.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/** list/users.html <http://www.freeradius.org/list/users.html>
-- Mustafa Reşit Şahin Endersys İş Tel: 0216 470 94 23 Dahili:306 Cep Tel:0507 707 68 12
- List info/subscribe/unsubscribe? See http://www.freeradius.org/** list/users.html <http://www.freeradius.org/list/users.html>
participants (5)
-
Alan DeKok -
Fajar A. Nugraha -
Mustafa Reşit Şahin -
Omer Faruk SEN -
Resit Sahin