Skip to contentSkip to conversation

configure.in: Declare a requirement for at least autoconf 2.50

PATCH Applied Theodore Ts'o 3 participants 15 messages Jul 21, 2011 – Aug 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 configure.in: Declare a requirement for at least autoconf 2.50

On Debian/Ubuntu systems, if autoconf version 2.13 is installed, autoconf will try to automatically figure out whether autoconf 2.13 or something more modern is required (since the autoconf maintainers, curses be upon them, didn't bother to maintain compatibility between autoconf 2.13 and 2.50). Unfortunately, the hueristics aren't perfect, and although the configure.in file looks superficially like it will be compatible with autoconf 2.13, it isn't. You will end up with a number of very subtle compilation failures if you use autoconf 2.13.

So declare a requirement for autoconf 2.50 using AC_PREREQ(2.50).

---
 configure.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
configure.in +1 -0
index 10c4c61..664c0e9 100644
@@ -1,4 +1,5 @@
 AC_INIT(include/libxfs.h)
+AC_PREREQ(2.50)
 AC_CONFIG_AUX_DIR([.])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_HEADER(include/platform_defs.h)
Signature · 1 line
1.7.4.1.22.gec8e1.dirty
#1 lore raw

PATCH 2/3 Build without enabling DEBUG by default

The tree currently will blow out with a build failure if -DDEBUG is specified.

---
 m4/package_globals.m4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
m4/package_globals.m4 +1 -1
index e469671..d2a3e2f 100644
@@ -17,7 +17,7 @@ AC_DEFUN([AC_PACKAGE_GLOBALS],
     test -z "$BUILD_VERSION" || pkg_release="$BUILD_VERSION"
     AC_SUBST(pkg_release)
 
-    DEBUG=${DEBUG:-'-DDEBUG'}		dnl  -DNDEBUG
+    DEBUG=${DEBUG:-'-DNDEBUG'}		dnl  -DNDEBUG
     debug_build="$DEBUG"
     AC_SUBST(debug_build)
 
Signature · 1 line
1.7.4.1.22.gec8e1.dirty
#12 lore raw

PATCH 3/3 mkfs: Link against libuuid after liblkid

In reply to Theodore Ts'o

The order in which libraries are searched matters if you are using static libraries. Since libblkid uses some functions from libuuid, it needs to come before libuuid in the link line.

---
 mkfs/Makefile |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
mkfs/Makefile +0 -3
index 8b61c2f..75da633 100644
@@ -11,10 +11,6 @@ FSTYP = fstyp
 HFILES = xfs_mkfs.h
 CFILES = maxtrres.c proto.c xfs_mkfs.c
 
-LLDLIBS = $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
-LTDEPENDENCIES = $(LIBXFS)
-LLDFLAGS = -static
#2 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

In reply to Theodore Ts'o
Quoted 2 lines · Theodore Ts'o

The tree currently will blow out with a build failure if -DDEBUG is specified.

This still doesn't make sense to me. libxfs explicily overrides DEBUG in the makefile:

# don't try linking xfs_repair with a debug libxfs. DEBUG = -DNDEBUG

we really need to figure out why your enviroment doesn't pick this up, especially as we've never seen that report from anybody else.

#14 lore raw
In reply to Theodore Ts'o
Quoted 11 lines · Theodore Ts'o

On Debian/Ubuntu systems, if autoconf version 2.13 is installed, autoconf will try to automatically figure out whether autoconf 2.13 or something more modern is required (since the autoconf maintainers, curses be upon them, didn't bother to maintain compatibility between autoconf 2.13 and 2.50). Unfortunately, the hueristics aren't perfect, and although the configure.in file looks superficially like it will be compatible with autoconf 2.13, it isn't. You will end up with a number of very subtle compilation failures if you use autoconf 2.13.

So declare a requirement for autoconf 2.50 using AC_PREREQ(2.50).

Thanks a lot, I've applied our xfsprogs and xfstests patches, and also ported the change to the xfsdump and dmapi repositories.

#13 lore raw

Re: [PATCH XFSPROGS 3/3] mkfs: Link against libuuid after liblkid

In reply to Theodore Ts'o
Quoted 3 lines · Theodore Ts'o

The order in which libraries are searched matters if you are using static libraries. Since libblkid uses some functions from libuuid, it needs to come before libuuid in the link line.

Thanks, applied.

author
#3 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

In reply to Christoph Hellwig
Quoted 9 lines · Christoph Hellwig
Quoted 2 lines · Theodore Ts'o

The tree currently will blow out with a build failure if -DDEBUG is specified.

This still doesn't make sense to me. libxfs explicily overrides DEBUG in the makefile:

# don't try linking xfs_repair with a debug libxfs. DEBUG = -DNDEBUG

I added some debugging statements in libxfs/Makefile, and found this (see below).

It looks like the problem is that GNU make 3.81 is doing an immediate expansion of this line in builddefs:

CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)

- Ted

LTCOMPILE is /bin/sh ../libtool --quiet --tag=CC --mode=compile gcc -I/kbuild/xfstests/bld/include -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -I. -g -O2 -DNDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall FCFLAGS is -I.
GCFLAGS is -g -O2 -DNDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I../include -DENABLE_GETTEXT
PCFLAGS is -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall
CFLAGS is -I/kbuild/xfstests/bld/include -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -I. -g -O2 -DNDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall CCF is gcc -I/kbuild/xfstests/bld/include -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -I. -g -O2 -DNDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall

#4 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

Quoted 2 lines · Ted Ts'o

I added some debugging statements in libxfs/Makefile, and found this (see below).

You can get most of this by simply using make V=1, not just in xfsprogs, but in most projects using silent make output (including those using automake)

Quoted 2 lines

It looks like the problem is that GNU make 3.81 is doing an immediate expansion of this line in builddefs:

I'm having GNU make 3.81 on most of my test systems as well, so that alone can't be the whole issue.

Quoted 4 lines

CFLAGS += $(FCFLAGS) $(GCFLAGS) $(PCFLAGS) $(LCFLAGS)

LTCOMPILE is /bin/sh ../libtool --quiet --tag=CC --mode=compile gcc -I/kbuild/xfstests/bld/include -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -g -O2 -DDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I./include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -I. -g -O2 -DNDEBUG -DVERSION="3.1.5" -DLOCALEDIR="//share/locale" -DPACKAGE="xfsprogs" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall

A typical V=1 compile line looks like:

/bin/bash ../libtool --quiet --tag=CC --mode=compile gcc -I. -g -O2 -DNDEBUG -DVERSION=\"3.1.5\" -DLOCALEDIR=\"/usr/share/locale\" -DPACKAGE=\"xfsprogs\" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char -fno-strict-aliasing -Wall -c xfs_dir2_sf.c

for me. The biggest thing is that you have another directory in your include path. How did you add that one? Did you add anything else special to the ./configure or make command lines?

author
#5 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

Quoted 4 lines · Christoph Hellwig

You can get most of this by simply using make V=1, not just in xfsprogs, but in most projects using silent make output (including those using automake)

Yeah, I know about V=1 (and I have been using it), but I wanted to know which of the many Makefile variables which finally make up $(CFLAGS) was getting set to which value, and V=1 doesn't do this.

Quoted 3 lines

for me. The biggest thing is that you have another directory in your include path. How did you add that one? Did you add anything else special to the ./configure or make command lines?

Yes I needed it because I wanted to do a hermetic build; that is, I didn't want to depend on the version of the acl, attr, dmapi, etc., shipped by the distribution. (This is actually more important when building xfstests, since I wanted to make sure we used the version of the xfsprogs headers shipped by the very tip of xfsprogs-dev, since in the past I've had problems because the distro-shipped header files were too old.)

The way I did that was by setting the environment CFLAGS to -I/kbuild/xfstests/bld/include. And that seems to be the problem. If CFLAGS is set as an environment variable, then it's set as a :=, which means that CFLAGS is set right away, the first time buildmacros is included.

How about this instead? A patch like this so that CFLAGS can be remembered at configure time:

include/builddefs.in +1 -0
index 4c8ec64..81ebfcd 100644
@@ -25,6 +25,7 @@ OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
 LOADERFLAGS = @LDFLAGS@
 LTLDFLAGS = @LDFLAGS@
+CFLAGS = @CFLAGS@
 
 LIBRT = @librt@
 LIBUUID = @libuuid@

Then I don't have to set an environment variable when running make; I just have to pass it to configure.

- Ted

#6 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

Quoted 7 lines · Ted Ts'o

Yes I needed it because I wanted to do a hermetic build; that is, I didn't want to depend on the version of the acl, attr, dmapi, etc., shipped by the distribution. (This is actually more important when building xfstests, since I wanted to make sure we used the version of the xfsprogs headers shipped by the very tip of xfsprogs-dev, since in the past I've had problems because the distro-shipped header files were too old.)

Given that you are on a Debian-ish environment, did you consider simply using pbuilder? I use that regularly to test clean package builds, without all these weird overrides.

Quoted 22 lines

The way I did that was by setting the environment CFLAGS to -I/kbuild/xfstests/bld/include. And that seems to be the problem. If CFLAGS is set as an environment variable, then it's set as a :=, which means that CFLAGS is set right away, the first time buildmacros is included.

How about this instead? A patch like this so that CFLAGS can be remembered at configure time:

include/builddefs.in +1 -0
index 4c8ec64..81ebfcd 100644
@@ -25,6 +25,7 @@ OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
 LOADERFLAGS = @LDFLAGS@
 LTLDFLAGS = @LDFLAGS@
+CFLAGS = @CFLAGS@
 
 LIBRT = @librt@
 LIBUUID = @libuuid@
Quoted 2 lines

Then I don't have to set an environment variable when running make; I just have to pass it to configure.

This looks much better, and is indeed similar to some other fixes we recently had to put in, probably due to changing make behaviour.

If you add a signoff and a proper description I'll put it into all the repositories.

#11 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

In reply to Christoph Hellwig
Quoted 1 line · Christoph Hellwig

On Fri, Jul 22, 2011 at 02:30:48PM -0400, Ted Ts'o wrote:

. . .

Review

Quoted 7 lines

A typical V=1 compile line looks like:

/bin/bash ../libtool --quiet --tag=CC --mode=compile gcc -I. -g -O2

(quoted diff) +0 -4
-DNDEBUG -DVERSION=\"3.1.5\" -DLOCALEDIR=\"/usr/share/locale\"
-DPACKAGE=\"xfsprogs\" -I../include -DENABLE_GETTEXT -D_GNU_SOURCE
-D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 -funsigned-char
-fno-strict-aliasing -Wall    -c xfs_dir2_sf.c

FWIW, I get a compile line for xfs_dir2_sf.c identical to what Christoph supplied.

Quoted 3 lines

for me. The biggest thing is that you have another directory in your include path. How did you add that one? Did you add anything else special to the ./configure or make command lines?

#7 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

In reply to Christoph Hellwig
Quoted 13 lines · Christoph Hellwig
Quoted 13 lines
include/builddefs.in +1 -0
index 4c8ec64..81ebfcd 100644
@@ -25,6 +25,7 @@ OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
 LOADERFLAGS = @LDFLAGS@
 LTLDFLAGS = @LDFLAGS@
+CFLAGS = @CFLAGS@
 
 LIBRT = @librt@
 LIBUUID = @libuuid@
Quoted 8 lines
Quoted 2 lines

Then I don't have to set an environment variable when running make; I just have to pass it to configure.

This looks much better, and is indeed similar to some other fixes we recently had to put in, probably due to changing make behaviour.

If you add a signoff and a proper description I'll put it into all the repositories.

Can you at least provide the signoff? I can take care of the rest if this means I can get it in ASAP.

#8 lore raw

Re: [PATCH XFSPROGS 2/3] Build without enabling DEBUG by default

Quoted 8 lines · Christoph Hellwig
Quoted 5 lines

This looks much better, and is indeed similar to some other fixes we recently had to put in, probably due to changing make behaviour.

If you add a signoff and a proper description I'll put it into all the repositories.

Can you at least provide the signoff? I can take care of the rest if this means I can get it in ASAP.

Ted,

can you please give me a signoff for this patch? I could probably just put it in anyway given how trivial it is. But let's just stick to the proper protocol if we can.

#9 lore raw

PATCH 1/1 Build using CFLAGS passed in at configure

In order to build xfsprogs in a hermetic build, we need be able to pass in -I and -L flags to the compiler and linker, respectively. This needs to be used by the configure script, but we also need to make sure these flags are used by the Makefiles as well.

---
 include/builddefs.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
include/builddefs.in +1 -0
index 4c8ec64..81ebfcd 100644
@@ -25,6 +25,7 @@ OPTIMIZER = @opt_build@
 MALLOCLIB = @malloc_lib@
 LOADERFLAGS = @LDFLAGS@
 LTLDFLAGS = @LDFLAGS@
+CFLAGS = @CFLAGS@
 
 LIBRT = @librt@
 LIBUUID = @libuuid@
Signature · 1 line
1.7.4.1.22.gec8e1.dirty
#10 lore raw

Re: [PATCH] Build using CFLAGS passed in at configure

Quoted 4 lines · Theodore Ts'o

In order to build xfsprogs in a hermetic build, we need be able to pass in -I and -L flags to the compiler and linker, respectively. This needs to be used by the configure script, but we also need to make sure these flags are used by the Makefiles as well.

Thanks a lot a Ted!

I've added this to xfsprogs, xfsdump and dmapi. xfstests actually already has it, sent in in 2009 by Arek for the same reason you want it in xfsprogs. Wish we would have been a bit better to propagate build system fixes.