automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if vs. ifdef in Makefile.am


From: ljh
Subject: Re: if vs. ifdef in Makefile.am
Date: Fri, 3 Mar 2023 20:14:56 +0800

Hi,

Thanks for the hint. I did not know this before.

Found it here, autoconf manual 16.3:
> cd to the directory where you want the object files and executables to 
> go and run the configure script. configure automatically checks for 
> the source code in the directory that configure is in and in ... 
> This is known as a VPATH build.

$ bash ../src/autogen.sh 
autoreconf: 'configure.ac' or 'configure.in' is required
$

But `autoreconf -i` only runs in directory where configure.ac lives. It
generates a lot temporary files in the source directory.


$ tree -a
.
?????? build
??   ?????? config.h
??   ?????? config.log
??   ?????? config.status
??   ?????? foo
??   ??   ?????? .deps
??   ??   ??   ?????? libfoo_la-foo.Plo
??   ??   ?????? libfoo.la
??   ??   ?????? libfoo_la-foo.lo
??   ??   ?????? libfoo_la-foo.o
??   ??   ?????? .libs
??   ??   ??   ?????? libfoo.la -> ../libfoo.la
??   ??   ??   ?????? libfoo_la-foo.o
??   ??   ??   ?????? libfoo.lai
??   ??   ??   ?????? libfoo.so -> libfoo.so.5.2.3
??   ??   ??   ?????? libfoo.so.5 -> libfoo.so.5.2.3
??   ??   ??   ?????? libfoo.so.5.2.3
??   ??   ?????? Makefile
??   ?????? libtool
??   ?????? main
??   ??   ?????? .deps
??   ??   ??   ?????? main.Po
??   ??   ?????? .libs
??   ??   ??   ?????? main
??   ??   ?????? main
??   ??   ?????? main.o
??   ??   ?????? Makefile
??   ?????? Makefile
??   ?????? stamp-h1
?????? src
    ?????? aclocal.m4
    ?????? ar-lib
    ?????? autogen.sh
    ?????? autom4te.cache
    ??   ?????? output.0
    ??   ?????? output.1
    ??   ?????? output.2
    ??   ?????? requests
    ??   ?????? traces.0
    ??   ?????? traces.1
    ??   ?????? traces.2
    ?????? compile
    ?????? config.guess
    ?????? config.h.in
    ?????? config.sub
    ?????? configure
    ?????? configure.ac
    ?????? depcomp
    ?????? foo
    ??   ?????? foo.c
    ??   ?????? foo.h
    ??   ?????? Makefile.am
    ??   ?????? Makefile.in
    ?????? install-sh
    ?????? ltmain.sh
    ?????? m4
    ??   ?????? libtool.m4
    ??   ?????? lt~obsolete.m4
    ??   ?????? ltoptions.m4
    ??   ?????? ltsugar.m4
    ??   ?????? ltversion.m4
    ?????? main
    ??   ?????? main.c
    ??   ?????? Makefile.am
    ??   ?????? Makefile.in
    ?????? Makefile.am
    ?????? Makefile.in
    ?????? missing

12 directories, 56 files
$ 

$ ./main/.libs/main 
main
foo
main: ../../src/main/main.c:18: main: Assertion `0' failed.
$ 

$ ldd ./main/.libs/main 
        linux-vdso.so.1 (0x00007ffd6c1fe000)
        libasan.so.6 => /lib/x86_64-linux-gnu/libasan.so.6 
(0x00007f826b130000)
        libfoo.so.5 => 
/home/ljh/Documents/hello_autotools/build/./main/.libs/../../foo/.libs/libfoo.so.5
 (0x00007f826b12b000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f826af56000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f826af50000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 
(0x00007f826af2e000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f826adea000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 
(0x00007f826adce000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f826bb18000)
$

reply via email to

[Prev in Thread] Current Thread [Next in Thread]