Merge branch 'charon-cmd'
[strongswan.git] / src / checksum / Makefile.am
index aaed128..aabd96e 100644 (file)
-ipsec_LTLIBRARIES = libchecksum.la
+# 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 -rpath '$(ipseclibdir)'
+
 noinst_PROGRAMS = checksum_builder
+checksum_builder_SOURCES = checksum_builder.c
+checksum_builder_LDADD = \
+       $(top_builddir)/src/libstrongswan/libstrongswan.la \
+       $(top_builddir)/src/libhydra/libhydra.la \
+       $(top_builddir)/src/libcharon/libcharon.la \
+       $(DLLIB)
 
-libchecksum_la_SOURCES = checksum.c
+CLEANFILES = checksum.c
+INCLUDES = \
+       -I$(top_srcdir)/src/libstrongswan \
+       -I$(top_srcdir)/src/libhydra \
+       -I$(top_srcdir)/src/libcharon
+AM_CFLAGS = \
+       -DPLUGINDIR=\"${DESTDIR}${plugindir}\" \
+       -rdynamic
 
-checksum_builder_SOURCES = checksum_builder.c
-checksum_builder_LDADD = $(top_builddir)/src/libstrongswan/libstrongswan.la
+# 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
+
+if USE_PTS
+  deps += $(top_builddir)/src/libpts/libpts.la
+  libs += $(DESTDIR)$(ipseclibdir)/libpts.so
+endif
+
+if USE_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_CMD
+  exes += $(top_builddir)/src/charon-cmd/.libs/charon-cmd
+endif
+
+if USE_TOOLS
+  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_IMV_ATTESTATION
+  exes += $(top_builddir)/src/libpts/plugins/imv_attestation/.libs/attest
+endif
+
+checksum.c : checksum_builder $(deps) $(exes)
+               ./checksum_builder $(libs) $(exes) > checksum.c
 
-BUILT_SOURCES = checksum.c
-CLEANFILES = checksum.c checksum_builder
-INCLUDES = -I$(top_srcdir)/src/libstrongswan
-AM_CFLAGS = -rdynamic
+install-data-hook : $(EXTRA_LTLIBRARIES)
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
 
-libs = $(shell find $(top_builddir)/src -name 'libstrongswan*.so')
+uninstall-hook :
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
 
-checksum.c : checksum_builder $(libs)
-               ./checksum_builder $(libs) > checksum.c
+clean-local :
+       $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES