diff mbox

[1/2] Fix out-of-tree builds

Message ID 1431873115-23794-2-git-send-email-mail@rotty.xx.vu
State Accepted
Headers show

Commit Message

mail@rotty.xx.vu May 17, 2015, 2:31 p.m. UTC
From: Andreas Rottmann <a.rottmann@gmx.at>

---
 src/sim/Makefile.am | 2 +-
 utils/Makefile.am   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Holger Freyther May 17, 2015, 4:11 p.m. UTC | #1
> On 17 May 2015, at 16:31, mail@rotty.xx.vu wrote:
> 
> From: Andreas Rottmann <a.rottmann@gmx.at>


What is the actual build error you are fixing here? Our Yocto/meta-telephony builds
use srcdir != builddir so I would like to see the actual build error and understand how
it occurs and what it is related to.
mail@rotty.xx.vu May 17, 2015, 5:11 p.m. UTC | #2
Holger Freyther <holger@freyther.de> writes:

>> On 17 May 2015, at 16:31, mail@rotty.xx.vu wrote:
>> 
>> From: Andreas Rottmann <a.rottmann@gmx.at>
>
>
> What is the actual build error you are fixing here? Our Yocto/meta-telephony builds
> use srcdir != builddir so I would like to see the actual build error and understand how
> it occurs and what it is related to.
>
I've included the build logs; the build steps were (on Debian jessie amd64):

% git clone git://git.osmocom.org/libosmocore.git
% cd libosmocore
% autoreconf -i
% mkdir _build
% cd _build
% autoreconf -i
src/gsm/Makefile.am:15: warning: source file 'milenage/aes-encblock.c' is in a subdirectory,
src/gsm/Makefile.am:15: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
src/gsm/Makefile.am:15: warning: source file 'milenage/aes-internal.c' is in a subdirectory,
src/gsm/Makefile.am:15: but option 'subdir-objects' is disabled
src/gsm/Makefile.am:15: warning: source file 'milenage/aes-internal-enc.c' is in a subdirectory,
src/gsm/Makefile.am:15: but option 'subdir-objects' is disabled
src/gsm/Makefile.am:15: warning: source file 'milenage/milenage.c' is in a subdirectory,
src/gsm/Makefile.am:15: but option 'subdir-objects' is disabled
src/sim/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
tests/Makefile.am:21: warning: source file 'a5/a5_test.c' is in a subdirectory,
tests/Makefile.am:21: but option 'subdir-objects' is disabled
tests/Makefile.am:21: warning: source file '../src/gsm/a5.c' is in a subdirectory,
tests/Makefile.am:21: but option 'subdir-objects' is disabled
tests/Makefile.am:31: warning: source file 'auth/milenage_test.c' is in a subdirectory,
tests/Makefile.am:31: but option 'subdir-objects' is disabled
tests/Makefile.am:34: warning: source file 'bits/bitrev_test.c' is in a subdirectory,
tests/Makefile.am:34: but option 'subdir-objects' is disabled
tests/Makefile.am:28: warning: source file 'comp128/comp128_test.c' is in a subdirectory,
tests/Makefile.am:28: but option 'subdir-objects' is disabled
tests/Makefile.am:37: warning: source file 'conv/conv_test.c' is in a subdirectory,
tests/Makefile.am:37: but option 'subdir-objects' is disabled
tests/Makefile.am:79: warning: source file 'fr/fr_test.c' is in a subdirectory,
tests/Makefile.am:79: but option 'subdir-objects' is disabled
tests/Makefile.am:67: warning: source file 'gb/bssgp_fc_test.c' is in a subdirectory,
tests/Makefile.am:67: but option 'subdir-objects' is disabled
tests/Makefile.am:70: warning: source file 'gb/gprs_bssgp_test.c' is in a subdirectory,
tests/Makefile.am:70: but option 'subdir-objects' is disabled
tests/Makefile.am:73: warning: source file 'gb/gprs_ns_test.c' is in a subdirectory,
tests/Makefile.am:73: but option 'subdir-objects' is disabled
tests/Makefile.am:43: warning: source file 'gsm0408/gsm0408_test.c' is in a subdirectory,
tests/Makefile.am:43: but option 'subdir-objects' is disabled
tests/Makefile.am:40: warning: source file 'gsm0808/gsm0808_test.c' is in a subdirectory,
tests/Makefile.am:40: but option 'subdir-objects' is disabled
tests/Makefile.am:25: warning: source file 'kasumi/kasumi_test.c' is in a subdirectory,
tests/Makefile.am:25: but option 'subdir-objects' is disabled
tests/Makefile.am:25: warning: source file '../src/gsm/kasumi.c' is in a subdirectory,
tests/Makefile.am:25: but option 'subdir-objects' is disabled
tests/Makefile.am:46: warning: source file 'lapd/lapd_test.c' is in a subdirectory,
tests/Makefile.am:46: but option 'subdir-objects' is disabled
tests/Makefile.am:76: warning: source file 'logging/logging_test.c' is in a subdirectory,
tests/Makefile.am:76: but option 'subdir-objects' is disabled
tests/Makefile.am:82: warning: source file 'loggingrb/loggingrb_test.c' is in a subdirectory,
tests/Makefile.am:82: but option 'subdir-objects' is disabled
tests/Makefile.am:49: warning: source file 'msgfile/msgfile_test.c' is in a subdirectory,
tests/Makefile.am:49: but option 'subdir-objects' is disabled
tests/Makefile.am:58: warning: source file 'sms/sms_test.c' is in a subdirectory,
tests/Makefile.am:58: but option 'subdir-objects' is disabled
tests/Makefile.am:55: warning: source file 'smscb/gsm0341_test.c' is in a subdirectory,
tests/Makefile.am:55: but option 'subdir-objects' is disabled
tests/Makefile.am:52: warning: source file 'smscb/smscb_test.c' is in a subdirectory,
tests/Makefile.am:52: but option 'subdir-objects' is disabled
tests/Makefile.am:85: warning: source file 'strrb/strrb_test.c' is in a subdirectory,
tests/Makefile.am:85: but option 'subdir-objects' is disabled
tests/Makefile.am:61: warning: source file 'timer/timer_test.c' is in a subdirectory,
tests/Makefile.am:61: but option 'subdir-objects' is disabled
tests/Makefile.am:64: warning: source file 'ussd/ussd_test.c' is in a subdirectory,
tests/Makefile.am:64: but option 'subdir-objects' is disabled
tests/Makefile.am:18: warning: source file 'utils/utils_test.c' is in a subdirectory,
tests/Makefile.am:18: but option 'subdir-objects' is disabled
tests/Makefile.am:88: warning: source file 'vty/vty_test.c' is in a subdirectory,
tests/Makefile.am:88: but option 'subdir-objects' is disabled
% ../configure --prefix=$HOME/.system/stow/libosmocore
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make sets $(MAKE)... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for ANSI C header files... (cached) yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking for size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for library containing dlopen... -ldl
checking for backtrace in -lexecinfo... no
checking for doxygen... /usr/bin/doxygen
checking if gcc supports -fvisibility=hidden... yes
checking whether struct tm has tm_gmtoff member... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for PCSC... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libosmocore.pc
config.status: creating libosmocodec.pc
config.status: creating libosmovty.pc
config.status: creating libosmogsm.pc
config.status: creating libosmogb.pc
config.status: creating libosmoctrl.pc
config.status: creating libosmosim.pc
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating src/vty/Makefile
config.status: creating src/codec/Makefile
config.status: creating src/sim/Makefile
config.status: creating src/gsm/Makefile
config.status: creating src/gb/Makefile
config.status: creating src/ctrl/Makefile
config.status: creating tests/Makefile
config.status: creating utils/Makefile
config.status: creating Doxyfile.core
config.status: creating Doxyfile.gsm
config.status: creating Doxyfile.vty
config.status: creating Doxyfile.codec
config.status: creating Makefile
config.status: creating config.h
config.status: executing tests/atconfig commands
config.status: executing depfiles commands
config.status: executing libtool commands
% make
make  all-recursive
make[1]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build'
Making all in include
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/include'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/include'
Making all in src
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src'
make  all-am
make[3]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src'
  CC       timer.lo
  CC       select.lo
  CC       signal.lo
  CC       msgb.lo
  CC       bits.lo
  CC       bitvec.lo
  CC       statistics.lo
  CC       write_queue.lo
  CC       utils.lo
  CC       socket.lo
  CC       logging.lo
  CC       logging_syslog.lo
  CC       rate_ctr.lo
  CC       gsmtap_util.lo
  CC       crc16.lo
  CC       panic.lo
  CC       backtrace.lo
  CC       conv.lo
  CC       application.lo
  CC       rbtree.lo
  CC       strrb.lo
  CC       loggingrb.lo
  CC       crc8gen.lo
  CC       crc16gen.lo
  CC       crc32gen.lo
  CC       crc64gen.lo
  CC       macaddr.lo
  CC       plugin.lo
  CC       talloc.lo
  CC       msgfile.lo
  CC       serial.lo
  CCLD     libosmocore.la
make[3]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src'
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src'
Making all in src/vty
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/vty'
  CC       buffer.lo
  CC       command.lo
  CC       vty.lo
  CC       vector.lo
  CC       utils.lo
  CC       telnet_interface.lo
  CC       logging_vty.lo
  CCLD     libosmovty.la
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/vty'
Making all in src/codec
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/codec'
  CC       gsm610.lo
  CC       gsm620.lo
  CC       gsm660.lo
  CC       gsm690.lo
  CCLD     libosmocodec.la
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/codec'
Making all in src/gsm
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/gsm'
  CC       a5.lo
  CC       rxlev_stat.lo
  CC       tlv_parser.lo
  CC       comp128.lo
  CC       comp128v23.lo
  CC       gsm_utils.lo
  CC       rsl.lo
  CC       gsm48.lo
  CC       gsm48_ie.lo
  CC       gsm0808.lo
  CC       sysinfo.lo
  CC       gprs_cipher_core.lo
  CC       gsm0480.lo
  CC       abis_nm.lo
  CC       gsm0502.lo
  CC       gsm0411_utils.lo
  CC       gsm0411_smc.lo
  CC       gsm0411_smr.lo
  CC       lapd_core.lo
  CC       lapdm.lo
  CC       kasumi.lo
  CC       auth_core.lo
  CC       auth_comp128v1.lo
  CC       auth_comp128v23.lo
  CC       auth_milenage.lo
  CC       aes-encblock.lo
  CC       aes-internal.lo
  CC       aes-internal-enc.lo
  CC       milenage.lo
  CC       gan.lo
  CC       ipa.lo
  CC       gsm0341.lo
  CCLD     libosmogsm.la
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/gsm'
Making all in src/gb
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/gb'
  CC       gprs_ns.lo
  CC       gprs_ns_frgre.lo
  CC       gprs_ns_vty.lo
  CC       gprs_bssgp.lo
  CC       gprs_bssgp_util.lo
  CC       gprs_bssgp_vty.lo
  CC       gprs_bssgp_bss.lo
  CC       common_vty.lo
  CCLD     libosmogb.la
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/gb'
Making all in src/ctrl
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/ctrl'
  CC       control_cmd.lo
  CC       control_if.lo
  CCLD     libosmoctrl.la
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/ctrl'
Making all in src/sim
make[2]: Entering directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/sim'
  CC       core.lo
In file included from ../../../include/osmocom/core/msgb.h:25:0,
                 from ../../../include/osmocom/sim/sim.h:4,
                 from ../../../src/sim/core.c:29:
../../../include/osmocom/core/bits.h:6:35: fatal error: osmocom/core/bit16gen.h: No such file or directory
 #include <osmocom/core/bit16gen.h>
                                   ^
compilation terminated.
Makefile:458: recipe for target 'core.lo' failed
make[2]: *** [core.lo] Error 1
make[2]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build/src/sim'
Makefile:507: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/.big/rotty/src/_readonly/libosmocore/_build'
Makefile:374: recipe for target 'all' failed
make: *** [all] Error 2
The error happens during the last step, obviously.

HTH, Rotty
Holger Freyther May 17, 2015, 5:22 p.m. UTC | #3
> On 17 May 2015, at 19:11, Andreas Rottmann <mail@rotty.xx.vu> wrote:
> 
> 
> In file included from ../../../include/osmocom/core/msgb.h:25:0,
>                 from ../../../include/osmocom/sim/sim.h:4,
>                 from ../../../src/sim/core.c:29:
> ../../../include/osmocom/core/bits.h:6:35: fatal error: osmocom/core/bit16gen.h: No such file or directory
> #include <osmocom/core/bit16gen.h>

thank you. I have amended the commit message and pushed it.
diff mbox

Patch

diff --git a/src/sim/Makefile.am b/src/sim/Makefile.am
index 185e8df..e241dc9 100644
--- a/src/sim/Makefile.am
+++ b/src/sim/Makefile.am
@@ -2,7 +2,7 @@ 
 # Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification
 LIBVERSION=0:0:0
 
-INCLUDES = $(all_includes) -I$(top_srcdir)/include
+AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir)/include
 AM_CFLAGS = -fPIC -Wall $(PCSC_CFLAGS)
 AM_LDFLAGS = $(COVERAGE_LDFLAGS)
 
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 41f91f9..63a32ed 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -1,5 +1,5 @@ 
 if ENABLE_UTILITIES
-AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include
 AM_CFLAGS = -Wall
 
 bin_PROGRAMS = osmo-arfcn osmo-auc-gen