Skip to contentSkip to conversation

cleanup build system a bit.

PATCH New Fabio Massimo Di Nitto 4 participants 18 messages Apr 24, 2007 – Apr 27, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cleanup build system a bit.

Hi all,

the patch in attachment if the first big pass to cleanup the entire build system on CVS HEAD as of 24-Apr-2007. Sorry if it's a bz2 file but otherwise it won't pass the mailing list filtering limit of 100KB and it's one of those patches that either you take in full or not (except a bunch of small details).

 193 files changed, 1927 insertions(+), 8223 deletions(-)

This patch does:

- centralize all the configure scripts into the top level one:
- all configurable options are now available as such with details and help.
- no more need to run configure N times for each subdir.
- better autodetection for kernel_src.
- add tons of other options such as alternate CC or LD_FLAGS override and more.
- allow override of release_major and release_minor.
- centralize all the different subproject/make/* files in the top level:
- expanded and integraded all the defines.mk.input into a clean one.
- centralize copyright.cf file at the toplevel. config/copyright.cf and make it a default include directory for all projects so that there is no more need to specify it manually.
- centralize scripts at the top level as appropriate.
- remove all the projects/configure projects/make/* projects/scripts/*
- change top level Makefile includes:
- implement several targets and add appropriate dependencies.
- split between kernel and userland targets.
- changes to all subprojects Makefiles:
- make use of the top level defines.mk.
- make use of centralized scripts.
- make use of all configurable options.
- cleanup TARGET= OBJS= CFLAGS= LDFLAGS= usage and make it consistent across the entire tree. (see below for a more detailed explanation)
- fix make targets for libs.
- call linker with proper options and fix static/dynamic linking.
- attempt to use the use the same targets all over for consistency.
- fix install/uninstall targets.
- convert some toplevel project Makefile to be just "passtrough". This is no different from what it was before except it takes 4 lines instead of N duplicates lines. It will change in the next patch set to integrate proper dependency calculation. See for example cman/Makefile.
- probably more...

The way in which I rewrote the Makefile follows some kind of template. For (or what i believe to be) better readability, I used this schema:

TARGET= foo
OBJS= foo.o

CFLAGS += -Ddefinition
CFLAGS += compiler options such as -O2 or -Wall
CFLAGS += system includes or configured includes
CFLAGS += includes coming from inside the project for ex: -I../include

similar order applies to LDFLAGS.

While at it i also fixed these 4 details:

cluster/fence/agents/xvm/vm_states.c: fix include path for openais.

cluster/gfs/gfs_quota/layout.c: fix include path to be consistent with the
rest of the tree.
(see: https://www.redhat.com/archives/cluster-devel/2007-April/msg00115.html)

cluster/group/lib/libgroup.c: add missing include. Spotted after fixing the
Makefile and triggered by adding -Wall.

cluster/rgmanager/src/clulib/clulog.c: remove unrequired include.

TODO:

somebody from RH should please verify that config/copyright.cf is correct. The oldest RH copyright is from 2004 and i updated from 2006 to 2007.

top level configure:
- fix hardencoded use of xml2-config and make it optional

top level makefile:
- verify latest_tags: srpms: tarballs: targets.
I have personally never used them and for what i can tell they haven't been in used for ages.

verify rgmanager/src/Makefile for check: target

verify rgmanager/src/daemon/Makefile dtest and rg_test OBJ list.
- see OBJS2 and OBJS3 build of resrule*.o.

While I did pay an awful amount of attention not to break anything, there is a chance that something might have gone wrong.

Please double check and apply.

Thanks
Fabio

Signature · 15 lines
I'm going to make him an offer he can't refuse.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cleanup_configure.bz2
Type: application/x-bzip
Size: 32594 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070424/b42b5aa8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 890 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070424/b42b5aa8/attachment.sig>
#1 lore raw

PATCH 1/1 cleanup build system a bit.

Just spotten on IRC by Patrick.

Please apply after the previous patch.

Thanks
Fabio

Signature · 5 lines
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: group.diff
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070424/e3384a22/attachment.ksh>
#2 lore raw

PATCH 1/1 cleanup build system a bit.

Quoted 14 lines · Fabio Massimo Di Nitto

Just spotten on IRC by Patrick.

Please apply after the previous patch.

Thanks
Fabio

Signature · 3 lines
I'm going to make him an offer he can't refuse.

diff -Naurd cluster.orig2/group/daemon/Makefile cluster/group/daemon/Makefile

group/daemon/Makefile line 30

Quoted 8 lines
group/daemon/Makefile +1 -1
@@ -24,7 +24,7 @@
 CFLAGS += -I${cmanincdir}
 CFLAGS += -I. -I../include/ -I../lib/
 
-LDFLAGS += -L${cmanlibdir} -L${openaislibdir} -L{libdir} -lcman -lcpg
+LDFLAGS += -L${cmanlibdir} -L${openaislibdir} -L${libdir} -lcman -lcpg
 
 all: ${TARGET}
 

FWIW, this is an overhaul not a cleanup. ;)

I'm fine with it, but I want more people to comment.

(expecting minor bugs to be found, but easy to fix)

-- Lon

Signature · 1 line
Lon Hohberger - Software Engineer - Red Hat, Inc.
#3 lore raw

PATCH 1/1 cleanup build system a bit.

Quoted 2 lines · Lon Hohberger

FWIW, this is an overhaul not a cleanup. ;)

details :P

Quoted 4 lines

I'm fine with it, but I want more people to comment.

(expecting minor bugs to be found, but easy to fix)

sure.. i am of course dealing to fix them as soon as they arise.

Thanks
Fabio

Signature · 1 line
I'm going to make him an offer he can't refuse.
#4 lore raw

PATCH 1/1 cleanup build system a bit.

In reply to Fabio Massimo Di Nitto
Quoted 4 lines · Fabio Massimo Di Nitto

TODO:

somebody from RH should please verify that config/copyright.cf is correct. The oldest RH copyright is from 2004 and i updated from 2006 to 2007.

Looks good

Quoted 4 lines

top level makefile:
- verify latest_tags: srpms: tarballs: targets.
I have personally never used them and for what i can tell they haven't been in used for ages.

latest_tags, build_srpms, tarballs are from the old, old build system, they can definitely be removed.

I think this patch is something that we can commit to the -HEAD branch and start using for FC8 and beyond. We shouldn't have a problem patching up any minor issues that crop up. I vote for committing this patch.

Thanks,
Chris

#5 lore raw

PATCH 1/1 cleanup build system a bit.

Hi Chris,

Quoted 7 lines · Chris Feist
Quoted 4 lines · Fabio Massimo Di Nitto

top level makefile:
- verify latest_tags: srpms: tarballs: targets.
I have personally never used them and for what i can tell they haven't been in used for ages.

Quoted 6 lines

latest_tags, build_srpms, tarballs are from the old, old build system, they can definitely be removed.

I think this patch is something that we can commit to the -HEAD branch and start using for FC8 and beyond. We shouldn't have a problem patching up any minor issues that crop up. I vote for committing this patch.

Thanks for the feedback. I will provide a patch to cleanup those once/if the main patch will make it in CVS.

Cheers
Fabio

Signature · 1 line
I'm going to make him an offer he can't refuse.
#8 lore raw

PATCH 1/1 cleanup build system a bit.

In reply to Fabio Massimo Di Nitto
Quoted 1 line · Fabio Massimo Di Nitto

Hi all,

There is a new patch in attachment that address (including a rediff towards new Makefile in CVS HEAD):

Quoted 2 lines

verify rgmanager/src/daemon/Makefile dtest and rg_test OBJ list.
- see OBJS2 and OBJS3 build of resrule*.o.

what Chris Feist reported:

Quoted 2 lines

latest_tags, build_srpms, tarballs are from the old, old build system, they can definitely be removed.

and the typo reported by Patrick on IRC.

No other changes have been done.

Thanks
Fabio

Signature · 8 lines
I'm going to make him an offer he can't refuse.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bigfat.diff.bz2
Type: application/x-bzip
Size: 32743 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070426/d27e2d7c/attachment.bin>
#9 lore raw

PATCH 1/1 cleanup build system a bit.

Quoted 1 line · Fabio Massimo Di Nitto

No other changes have been done.

So far I have seen a few "thumbs up" on the patch. If nobody objects I would like to commit it in CVS HEAD together with a bunch of other small fixes I have in the queue (patches will follow and are based on top of this one).

Thanks
Fabio

Signature · 1 line
I'm going to make him an offer he can't refuse.
#10 lore raw

PATCH 1/8 Fix configure help typo

Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 002_fix_configure_typo.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/8143a019/attachment.ksh>
#11 lore raw

PATCH 2/8 [Cluster-devel] [PATCH 002/008]

In reply to Fabio Massimo Di Nitto

Fix configure parameter check for libexecdir.

Signature · 5 lines
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 003_fix_missing_configure_check.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/dc9a7c43/attachment.ksh>
#12 lore raw

PATCH 3/8 Fix --release_* check

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 004_fix_release_checking.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/c8381fd7/attachment.ksh>
#13 lore raw

PATCH 4/8 gnbd_export: convert harcoded DEFAULT_GETUID to build flag

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 005_gnbd_make_default_getuid_configurable.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/6137109d/attachment.ksh>
#14 lore raw

PATCH 5/8 Fix userland: target depends

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 006_fix_top_makefile_dependencies.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/822641aa/attachment.ksh>
#15 lore raw

PATCH 6/8 Fix make all target in passtrough Makefiles and make them more consistent

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 007_fix_passtrough_makefiles.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/f99e3de7/attachment.ksh>
#16 lore raw

PATCH 7/8 Readd -Werror to rgmanager dropped by mistake in the big cleanup.

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 008_rgmanager_readd_werror.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/2ec0c28e/attachment.ksh>
#17 lore raw

PATCH 8/8 Readd SHAREDIR define to rgmanager/src/daemons/Makefile

In reply to Fabio Massimo Di Nitto
Signature · 6 lines
-- 
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 009_rgmanager_needs_sharedir.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/bcfb4247/attachment.ksh>
#6 lore raw

PATCH 1/1 cleanup build system a bit.

In reply to Fabio Massimo Di Nitto
Quoted 3 lines · Fabio Massimo Di Nitto
Quoted 3 lines

I think this patch is something that we can commit to the -HEAD branch and start using for FC8 and beyond. We shouldn't have a problem patching up any minor issues that crop up. I vote for committing this patch.

Hi Fabio,

This looks like a good patch to me. I've been too busy to look at it in any great detail, but I did look at the highlights. I have a minor concern about the Makefile in gfs2/mkfs: IIRC, it looked like the default "Make" (all) specified only mkfs.gfs2 as the target, whereas we need to be sure to that gfs2_jadd and gfs2_grow get built as well. Er, well, I guess you don't have gfs2_grow yet (but I do). Maybe it's already assured with some magic and trickery, as it often happens in many Makefiles, but that will be apparent soon enough if/when I get a chance to try it.

As with any change with so many things affected, there might be some minor glitches or gotchas that we'll find, but I think we can work around those as we encounter them. Good job!

Regards,

Bob Peterson
Red Hat Cluster Suite

#7 lore raw

PATCH 1/1 cleanup build system a bit.

Quoted 9 lines · Robert Peterson
Quoted 3 lines · Fabio Massimo Di Nitto
Quoted 3 lines

I think this patch is something that we can commit to the -HEAD branch and start using for FC8 and beyond. We shouldn't have a problem patching up any minor issues that crop up. I vote for committing this patch.

Hi Fabio,

This looks like a good patch to me. I've been too busy to look at it in any great detail, but I did look at the highlights.

great thanks.

Quoted 4 lines

I have a minor concern
about the Makefile in gfs2/mkfs: IIRC, it looked like the default "Make" (all) specified only mkfs.gfs2 as the target, whereas we need to be sure to that gfs2_jadd and gfs2_grow get built as well.

Right.. patch in attachment to turn the Makefile in line with the others.

Quoted 2 lines

Er, well, I guess you don't
have gfs2_grow yet (but I do).

well i can't really cope with stuff that's not in CVS yet :))) really.. even when i try hard ;)

Quoted 3 lines

Maybe it's already assured with some magic
and trickery, as it often happens in many Makefiles, but that will be apparent soon enough if/when I get a chance to try it.

Once you commit gfs2_grow in CVS HEAD, i can add it to the Makefile.

Quoted 3 lines

As with any change with so many things affected, there might be some minor glitches or gotchas that we'll find, but I think we can work around those as we encounter them.

I got a CVS access, so i can fix most of them once they are reported tho I was asked to always ask for patch review before applying, so it's just a matter for somebody to ACK.

Quoted 1 line

Good job!

Thanks
Fabio

PS I plan to commit sometime on monday EU time. If you can add gfs2_grow i will merge the Makefiles at the same time.

Signature · 5 lines
I'm going to make him an offer he can't refuse.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 010_gfs2_mkfs_cleanup.dpatch
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20070427/186d3702/attachment.ksh>