Merge branch 'charon-cmd'
[strongswan.git] / src / checksum / Makefile.am
index 7a8a7a3..aabd96e 100644 (file)
-ipsec_LTLIBRARIES = libchecksum.la
-noinst_PROGRAMS = checksum_builder
-
+# this lib is not built until make install is called (see rules at the bottom)
+EXTRA_LTLIBRARIES = libchecksum.la
+ipseclib_LTLIBRARIES = $(LIBCHECKSUM_LIBS)
 nodist_libchecksum_la_SOURCES = checksum.c
-libchecksum_la_LDFLAGS = -module -avoid-version
+libchecksum_la_LDFLAGS = -module -avoid-version -rpath '$(ipseclibdir)'
 
+noinst_PROGRAMS = checksum_builder
 checksum_builder_SOURCES = checksum_builder.c
-checksum_builder_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+checksum_builder_LDADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libhydra/libhydra.la \
+       $(top_builddir)/src/libcharon/libcharon.la \
+       $(DLLIB)
 
-BUILT_SOURCES = checksum.c
 CLEANFILES = checksum.c
-INCLUDES = -I$(top_srcdir)/src/libstrongswan
-AM_CFLAGS = -rdynamic
+INCLUDES = \
+       -I$(top_srcdir)/src/libstrongswan \
+       -I$(top_srcdir)/src/libhydra \
+       -I$(top_srcdir)/src/libcharon
+AM_CFLAGS = \
+       -DPLUGINDIR=\"${DESTDIR}${plugindir}\" \
+       -rdynamic
+
+# we keep track of build dependencies in deps and use libs to store the paths
+# to the installed libraries. for executables we use the built files directly
+# as these are not relinked during installation.
+deps = $(top_builddir)/src/libstrongswan/libstrongswan.la
+libs = $(DESTDIR)$(ipseclibdir)/libstrongswan.so
+exes =
+
+if !MONOLITHIC
+  AM_CFLAGS += -DS_PLUGINS=\""${s_plugins}\""
+endif
+
+if USE_LIBHYDRA
+  deps += $(top_builddir)/src/libhydra/libhydra.la
+  libs += $(DESTDIR)$(ipseclibdir)/libhydra.so
+if !MONOLITHIC
+  AM_CFLAGS += -DH_PLUGINS=\""${h_plugins}\""
+endif
+endif
+
+if USE_LIBIPSEC
+  deps += $(top_builddir)/src/libipsec/libipsec.la
+  libs += $(DESTDIR)$(ipseclibdir)/libipsec.so
+endif
+
+if USE_TLS
+  deps += $(top_builddir)/src/libtls/libtls.la
+  libs += $(DESTDIR)$(ipseclibdir)/libtls.so
+endif
+
+if USE_RADIUS
+  deps += $(top_builddir)/src/libradius/libradius.la
+  libs += $(DESTDIR)$(ipseclibdir)/libradius.so
+endif
+
+if USE_LIBTNCCS
+  deps += $(top_builddir)/src/libtnccs/libtnccs.la
+  libs += $(DESTDIR)$(ipseclibdir)/libtnccs.so
+endif
+
+if USE_SIMAKA
+  deps += $(top_builddir)/src/libsimaka/libsimaka.la
+  libs += $(DESTDIR)$(ipseclibdir)/libsimaka.so
+endif
+
+if USE_IMCV
+  deps += $(top_builddir)/src/libimcv/libimcv.la
+  libs += $(DESTDIR)$(ipseclibdir)/libimcv.so
+endif
 
-libs = $(shell find $(top_builddir)/src/libstrongswan $(top_builddir)/src/charon \
-                       -name 'libstrongswan*.so')
+if USE_PTS
+  deps += $(top_builddir)/src/libpts/libpts.la
+  libs += $(DESTDIR)$(ipseclibdir)/libpts.so
+endif
 
 if USE_CHARON
-  libs += $(top_builddir)/src/charon/.libs/charon
+  deps += $(top_builddir)/src/libcharon/libcharon.la
+  libs += $(DESTDIR)$(ipseclibdir)/libcharon.so
+  exes += $(top_builddir)/src/charon/.libs/charon
+if !MONOLITHIC
+  AM_CFLAGS += -DC_PLUGINS=\""${c_plugins}\""
+endif
 endif
 
-if USE_PLUTO
-  libs += $(top_builddir)/src/pluto/.libs/pluto
+if USE_CMD
+  exes += $(top_builddir)/src/charon-cmd/.libs/charon-cmd
 endif
 
 if USE_TOOLS
-  libs += $(top_builddir)/src/openac/.libs/openac
-  libs += $(top_builddir)/src/pki/.libs/pki
-  libs += $(top_builddir)/src/scepclient/.libs/scepclient
+  exes += $(top_builddir)/src/openac/.libs/openac
+  exes += $(top_builddir)/src/pki/.libs/pki
+  exes += $(top_builddir)/src/scepclient/.libs/scepclient
+endif
+
+if USE_ATTR_SQL
+  exes += $(top_builddir)/src/libhydra/plugins/attr_sql/.libs/pool
 endif
 
-if USE_SQL
-  libs += $(top_builddir)/src/charon/plugins/sql/.libs/pool
+if USE_IMV_ATTESTATION
+  exes += $(top_builddir)/src/libpts/plugins/imv_attestation/.libs/attest
 endif
 
-checksum.c : checksum_builder $(libs)
-               ./checksum_builder $(libs) > checksum.c
+checksum.c : checksum_builder $(deps) $(exes)
+               ./checksum_builder $(libs) $(exes) > checksum.c
+
+install-data-hook : $(EXTRA_LTLIBRARIES)
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
+
+uninstall-hook :
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
+
+clean-local :
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES