From patchwork Sun May 17 14:31:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mail@rotty.xx.vu X-Patchwork-Id: 473173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 151B8140A98 for ; Mon, 18 May 2015 00:38:51 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id D05215E98; Sun, 17 May 2015 14:38:50 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org X-Greylist: delayed 402 seconds by postgrey-1.34 at lists.osmocom.org; Sun, 17 May 2015 14:38:46 UTC Received: from yade.xx.vu (yade.xx.vu [IPv6:2a01:4f8:d16:342::2]) by lists.osmocom.org (Postfix) with ESMTP id 0DEF45E57 for ; Sun, 17 May 2015 14:38:45 +0000 (UTC) Received: by yade.xx.vu (Postfix, from userid 1000) id 3290523D891; Sun, 17 May 2015 16:32:00 +0200 (CEST) From: mail@rotty.xx.vu To: openbsc@lists.osmocom.org Subject: [PATCH 2/2] Add subdir-objects automake option Date: Sun, 17 May 2015 16:31:55 +0200 Message-Id: <1431873115-23794-3-git-send-email-mail@rotty.xx.vu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431873115-23794-1-git-send-email-mail@rotty.xx.vu> References: <1431873115-23794-1-git-send-email-mail@rotty.xx.vu> X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andreas Rottmann Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From: Andreas Rottmann Having subdir-objects enabled is recommended by automake 1.14, to avoid future incompatibilities. However, adding that option breaks out-of-tree builds, and also seems to break "make distclean" for in-tree builds. The reason is that apparently, automake with subdir-objects enabled cannot cope with source files in a different, non-child directory. To avoid that, instead of referencing the source files, we (just) link against that library. --- configure.ac | 2 +- tests/Makefile.am | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index acd153d..dccc564 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT([libosmocore], m4_esyscmd([./git-version-gen .tarball-version]), [openbsc@lists.osmocom.org]) -AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6]) +AM_INIT_AUTOMAKE([subdir-objects foreign dist-bzip2 no-dist-gzip 1.6]) AC_CONFIG_TESTDIR(tests) dnl kernel style compile messages diff --git a/tests/Makefile.am b/tests/Makefile.am index 8db2533..efbea3b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir)/include +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ @@ -18,12 +18,13 @@ endif utils_utils_test_SOURCES = utils/utils_test.c utils_utils_test_LDADD = $(top_builddir)/src/libosmocore.la -a5_a5_test_SOURCES = a5/a5_test.c ../src/gsm/a5.c +a5_a5_test_SOURCES = a5/a5_test.c a5_a5_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la a5_a5_test_LDFLAGS = -static -kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c ../src/gsm/kasumi.c +kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c kasumi_kasumi_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la +kasumi_kasumi_test_LDFLAGS = -static comp128_comp128_test_SOURCES = comp128/comp128_test.c comp128_comp128_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gsm/libosmogsm.la