Re: [PATCH 1/2] build: SOURCES file lists must be static

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

 



 (CC: to Stepan and Diego)

On Sat, Apr 09, 2011 at 02:11:34PM +0200, Jan Engelhardt wrote:
> $(top_srcdir) is not static, and thus causes visible problems were one
> to use the "subdir-objects" automake option.

Well, the "subdir-objects" are not officially supported by util-linux
build system. You have to manually modify configure.ac to enable this
feature. I'm not sure if we want to support this kind of customization.

If you want to separate source code and build stuff then you can use
out-of-tree build 

    mkdir ../build; cd ../build; ../util-linux/configure; make  

It works.

The "subdir-objects" feature is mostly designed for non-recursive
build systems, I think it does not make sense for recursive Makefiles.

Diego has tried to implement non-recursive Makefiles for util-linux. 
http://thread.gmane.org/gmane.linux.utilities.util-linux-ng/3297

Unfortunately we didn't found time to finalize this task.

> -fsck_minix_SOURCES = fsck.minix.c minix.h $(top_srcdir)/lib/ismounted.c
> +fsck_minix_SOURCES = fsck.minix.c minix.h @top_srcdir@/lib/ismounted.c

I think that "SOURCES has to be static" is not exact definition. You
can use $() or AM_CONDITIONALs there.

The automake is smart enough to generate correct paths to sources dir,
if the _SOURCES paths are relative to the Makefile.am, it means that

  SOURCES=../lib/foo.c

is 

  `test -f '../lib/foo.c' || echo '$(srcdir)/'`../lib/foo.c

in the final Makefile.

You're right that $(top_srcdir) in the _SOURCES is probably not ideal
solution, but @top_srcdir@ seems more like a _hack_ than a real solution. 

If I good understand then _SOURCES is also used for file types evaluation, 
etc. For automake a path with @...@ is a string, not usable path.

IMHO it would be better to rewrite the build system to non-recursive
version _or_ ignore the problem with $(top_srcdir) in the _SOURCES.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux