From e09a6a35797379a5d7be830741ab48ab1a22e45e Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Fri, 6 Jul 2012 23:18:59 +0000 Subject: [PATCH] Make libzrtp build non-recursive This eliminates the recursive makefiles for libzrtp (we still recurse to build bnlib). Object files, library files, and executables (including tests) are now produced in the root directory. --- libs/libzrtp/.gitignore | 6 ++- libs/libzrtp/Makefile.am | 62 ++++++++++++++++++++++++++++- libs/libzrtp/build/Makefile.am | 55 ------------------------- libs/libzrtp/build/test/Makefile.am | 46 --------------------- libs/libzrtp/configure.in | 2 +- 5 files changed, 67 insertions(+), 104 deletions(-) delete mode 100644 libs/libzrtp/build/Makefile.am delete mode 100644 libs/libzrtp/build/test/Makefile.am diff --git a/libs/libzrtp/.gitignore b/libs/libzrtp/.gitignore index 7510e5e64c..9f4002095f 100644 --- a/libs/libzrtp/.gitignore +++ b/libs/libzrtp/.gitignore @@ -1,5 +1,9 @@ # -*- mode:conf -*- +/*.a +/*.dat +/*.o /.cproject +/.deps /.project /.stamp-doc /Makefile @@ -7,7 +11,7 @@ /_configs.sed /aclocal.m4 /autom4te.cache/* -/build/ +/cache_test /config.* /config/* /configure diff --git a/libs/libzrtp/Makefile.am b/libs/libzrtp/Makefile.am index 22596c1e35..f42a72dbe9 100644 --- a/libs/libzrtp/Makefile.am +++ b/libs/libzrtp/Makefile.am @@ -44,8 +44,68 @@ if ZRTP_BUILD_ENTERPRISE libzrtp_include_HEADERS += $(top_srcdir)/include/zrtp_ec.h endif +lib_LIBRARIES = libzrtp.a + +libzrtp_a_CPPFLAGS = \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/. \ + -I$(top_srcdir)/third_party/bgaes \ + -I$(top_srcdir)/third_party/bnlib + +libzrtp_a_LIBADD = $(top_srcdir)/third_party/bnlib/libbn.a + +libzrtp_a_SOURCES = $(top_srcdir)/src/zrtp.c \ + $(top_srcdir)/src/zrtp_crc.c \ + $(top_srcdir)/src/zrtp_crypto_aes.c \ + $(top_srcdir)/src/zrtp_crypto_atl.c \ + $(top_srcdir)/src/zrtp_crypto_hash.c \ + $(top_srcdir)/src/zrtp_crypto_pk.c \ + $(top_srcdir)/src/zrtp_crypto_sas.c \ + $(top_srcdir)/src/zrtp_datatypes.c \ + $(top_srcdir)/src/zrtp_engine.c \ + $(top_srcdir)/src/zrtp_iface_scheduler.c \ + $(top_srcdir)/src/zrtp_iface_sys.c \ + $(top_srcdir)/src/zrtp_initiator.c \ + $(top_srcdir)/src/zrtp_legal.c \ + $(top_srcdir)/src/zrtp_list.c \ + $(top_srcdir)/src/zrtp_log.c \ + $(top_srcdir)/src/zrtp_pbx.c \ + $(top_srcdir)/src/zrtp_protocol.c \ + $(top_srcdir)/src/zrtp_responder.c \ + $(top_srcdir)/src/zrtp_rng.c \ + $(top_srcdir)/src/zrtp_srtp_builtin.c \ + $(top_srcdir)/src/zrtp_string.c \ + $(top_srcdir)/src/zrtp_utils.c \ + $(top_srcdir)/src/zrtp_utils_proto.c \ + \ + $(top_srcdir)/third_party/bgaes/aes_modes.c \ + $(top_srcdir)/third_party/bgaes/aescrypt.c \ + $(top_srcdir)/third_party/bgaes/aeskey.c \ + $(top_srcdir)/third_party/bgaes/aestab.c \ + $(top_srcdir)/third_party/bgaes/sha1.c \ + $(top_srcdir)/third_party/bgaes/sha2.c\ + \ + $(top_srcdir)/src/zrtp_iface_cache.c + $(top_srcdir)/src/zrtp_engine_driven.c +if ZRTP_BUILD_ENTERPRISE +libzrtp_a_SOURCES +=$(top_srcdir)/src/zrtp_crypto_ec.c \ + $(top_srcdir)/src/zrtp_crypto_ecdh.c +endif + +check_PROGRAMS = cache_test + +cache_test_CPPFLAGS = -I$(top_srcdir)/include \ + -I$(top_srcdir)/. \ + -I$(top_srcdir)/test \ + -I$(top_srcdir)/test/cmockery \ + -I$(top_srcdir)/third_party/bgaes \ + -I$(top_srcdir)/third_party/bnlib + +cache_test_SOURCES = $(top_srcdir)/test/cmockery/cmockery.c \ + $(top_srcdir)/test/cache_test.c +cache_test_LDADD = libzrtp.a $(top_srcdir)/third_party/bnlib/libbn.a -lpthread + SUBDIRS = third_party/bnlib -SUBDIRS += build if HAVE_DOXYGEN doc: .stamp-doc diff --git a/libs/libzrtp/build/Makefile.am b/libs/libzrtp/build/Makefile.am deleted file mode 100644 index 26a8e9ae41..0000000000 --- a/libs/libzrtp/build/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved. -# Contact: http://philzimmermann.com -# -# Viktor Krikun -# - -INCLUDES = -I$(top_srcdir)/include \ - -I$(top_srcdir)/. \ - -I$(top_srcdir)/third_party/bgaes \ - -I$(top_srcdir)/third_party/bnlib - -lib_LIBRARIES = libzrtp.a - -libzrtp_a_LIBADD = $(top_srcdir)/third_party/bnlib/libbn.a - -libzrtp_a_SOURCES = $(top_srcdir)/src/zrtp.c \ - $(top_srcdir)/src/zrtp_crc.c \ - $(top_srcdir)/src/zrtp_crypto_aes.c \ - $(top_srcdir)/src/zrtp_crypto_atl.c \ - $(top_srcdir)/src/zrtp_crypto_hash.c \ - $(top_srcdir)/src/zrtp_crypto_pk.c \ - $(top_srcdir)/src/zrtp_crypto_sas.c \ - $(top_srcdir)/src/zrtp_datatypes.c \ - $(top_srcdir)/src/zrtp_engine.c \ - $(top_srcdir)/src/zrtp_iface_scheduler.c \ - $(top_srcdir)/src/zrtp_iface_sys.c \ - $(top_srcdir)/src/zrtp_initiator.c \ - $(top_srcdir)/src/zrtp_legal.c \ - $(top_srcdir)/src/zrtp_list.c \ - $(top_srcdir)/src/zrtp_log.c \ - $(top_srcdir)/src/zrtp_pbx.c \ - $(top_srcdir)/src/zrtp_protocol.c \ - $(top_srcdir)/src/zrtp_responder.c \ - $(top_srcdir)/src/zrtp_rng.c \ - $(top_srcdir)/src/zrtp_srtp_builtin.c \ - $(top_srcdir)/src/zrtp_string.c \ - $(top_srcdir)/src/zrtp_utils.c \ - $(top_srcdir)/src/zrtp_utils_proto.c \ - \ - $(top_srcdir)/third_party/bgaes/aes_modes.c \ - $(top_srcdir)/third_party/bgaes/aescrypt.c \ - $(top_srcdir)/third_party/bgaes/aeskey.c \ - $(top_srcdir)/third_party/bgaes/aestab.c \ - $(top_srcdir)/third_party/bgaes/sha1.c \ - $(top_srcdir)/third_party/bgaes/sha2.c\ - \ - $(top_srcdir)/src/zrtp_iface_cache.c - $(top_srcdir)/src/zrtp_engine_driven.c -if ZRTP_BUILD_ENTERPRISE -libzrtp_a_SOURCES +=$(top_srcdir)/src/zrtp_crypto_ec.c \ - $(top_srcdir)/src/zrtp_crypto_ecdh.c -endif - -SUBDIRS = test diff --git a/libs/libzrtp/build/test/Makefile.am b/libs/libzrtp/build/test/Makefile.am deleted file mode 100644 index 7b4b148114..0000000000 --- a/libs/libzrtp/build/test/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ - -# Copyright (c) 2006-2009 Philip R. Zimmermann. All rights reserved. -# Contact: http://philzimmermann.com -# -# Viktor Krikun -# - - - -INCLUDES = -I$(top_srcdir)/include \ - -I$(top_srcdir)/include/enterprise \ - -I$(top_srcdir)/. \ - -I$(top_srcdir)/test \ - -I$(top_srcdir)/test/cmockery \ - -I$(top_srcdir)/third_party/bgaes \ - -I$(top_srcdir)/third_party/bnlib - - -check_PROGRAMS = cache_test - -### ZRTP Cache testing - -cache_test_SOURCES = $(top_srcdir)/test/cmockery/cmockery.c \ - $(top_srcdir)/test/cache_test.c -cache_test_LDADD = ../libzrtp.a $(top_srcdir)/third_party/bnlib/libbn.a -lpthread - - -SUBDIRS = . - -check: -# @ ./cache_test - -# check: -# @echo "" -# @echo "*========================================================================*" -# @echo "* starting libZRTP tests *" -# @echo "*========================================================================*" -# @echo "" -# @./libzrtp_test -# -# @echo "" -# @echo "*========================================================================*" -# @echo "* In case you have a test FAILED send the generated log file *" -# @echo "* with your comment to . *" -# @echo "*========================================================================*" -# @echo "" diff --git a/libs/libzrtp/configure.in b/libs/libzrtp/configure.in index eeb1e5d224..bbb2d5d751 100644 --- a/libs/libzrtp/configure.in +++ b/libs/libzrtp/configure.in @@ -105,4 +105,4 @@ AM_CONDITIONAL([HAVE_DOXYGEN], # # Genearte Makefiles -AC_OUTPUT([Makefile build/Makefile build/test/Makefile]) +AC_OUTPUT([Makefile])