Link with libradius, too
[freeradius.git] / src / modules / rlm_eap / Makefile.in
index a01f02d..1e20588 100644 (file)
@@ -3,30 +3,34 @@
 #
 
 TARGET      = @targetname@
-SRCS        = rlm_eap.c eap.c mem.c state.c
+SRCS        = rlm_eap.c eap.c mem.c
 HEADERS     = eap.h rlm_eap.h
 RLM_CFLAGS  = $(INCLTDL) -Ilibeap
-CLIENTLIBS  = libeap/libeap.la
-RLM_LIBS    = libeap/libeap.la $(LIBLTDL)
+CLIENTLIBS  = libeap/$(LIBPREFIX)freeradius-eap.la
+RLM_LIBS    = libeap/$(LIBPREFIX)freeradius-eap.la $(LIBLTDL)
 RLM_INSTALL = install-subdirs
 RLM_SUBDIRS = libeap @eaptypes@
 RLM_UTILS   = radeapclient
 
 #
-#  Statically link a few modules.
+# Not using shared libraries, add in ALL known static modules
+# at build time.
 #
-STATIC_OBJS += $(shell ls -1 types/rlm_eap_md5/rlm_eap_md5.a types/rlm_eap_leap/rlm_eap_leap.a types/rlm_eap_tls/rlm_eap_tls.a types/rlm_eap_ttls/rlm_eap_ttls.a types/rlm_eap_sim/rlm_eap_sim.a 2>/dev/null)
+#ifneq ($(USE_SHARED_LIBS),yes)
+#RLM_LIBS  += $(shell for x in types/rlm_eap*/rlm_eap*.la;do echo -dlpreopen $$x;done)
+#endif
 
-## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
-include ../rules.mak
+.PHONY: all install-subdirs common
 
-$(STATIC_OBJS): $(HEADERS)
+#
+# We need $(LIBPREFIX)freeradius-eap.la before we can build anything else
+#
+all: common
 
-$(DYNAMIC_OBJS): $(HEADERS)
+$(LT_OBJS): $(HEADERS)
 
-radeapclient: radeapclient.lo
-       $(MAKE) $(MFLAGS) -C libeap $(WHAT_TO_MAKE)
-       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -static -o radeapclient radeapclient.lo $(CLIENTLIBS) $(LIBS)
+radeapclient: radeapclient.lo $(CLIENTLIBS)
+       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(RLM_LDFLAGS) -o radeapclient radeapclient.lo $(LIBRADIUS) $(CLIENTLIBS) $(LIBS) $(OPENSSL_LIBS)
 
 radeapclient.lo: radeapclient.c $(HEADERS)
        $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(RLM_CFLAGS) -c radeapclient.c
@@ -35,10 +39,17 @@ install-subdirs:
        @$(MAKE) $(MFLAGS) WHAT_TO_MAKE=install common
        $(LIBTOOL) --mode=install $(INSTALL) -m 755 $(INSTALLSTRIP) radeapclient$(EXEEXT) $(R)$(bindir)
 
-common:
-       @for dir in $(RLM_SUBDIRS); do  \
-               echo "Making $(WHAT_TO_MAKE) in $$dir..."; \
-               (cd $$dir && $(MAKE) $(MFLAGS) $(WHAT_TO_MAKE)) || exit $?;\
-       done
+.PHONY: common $(RLM_SUBDIRS)
+
+common: $(RLM_SUBDIRS)
 
-.PHONY: all install-subdirs common static dynamic
+types: libeap
+
+$(RLM_SUBDIRS):
+       @echo "Making $(WHAT_TO_MAKE) in $@..."
+       @$(MAKE) $(MFLAGS) -C $@ $(WHAT_TO_MAKE)
+
+libeap/$(LIBPREFIX)freeradius-eap.la: libeap
+
+## this uses the RLM_CFLAGS and RLM_LIBS and SRCS defs to make TARGET.
+include ../rules.mak