Commit Graph

70 Commits (a46300fe703a03185575ad1b45ff03e90d76f04c)

Author SHA1 Message Date
Darrick J. Wong a46300fe70 misc: create better-packaged static analysis reports
Fix some minor bugs relating to passing CFLAGS to cppcheck, and
package the cppcheck output into nicer looking reports.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-05-11 18:32:07 -04:00
Theodore Ts'o c9bc7484cc Merge branch 'maint' into next
Conflicts:
	e2fsck/pass1.c
2014-05-11 18:30:11 -04:00
David Michael 4e2d9f7f4e Add a make variable for the pkgconfig install dir
Adding the pkgconfigdir variable allows specifying an installation
location for pkg-config files independent of libdir.

Signed-off-by: David Michael <fedora.dm0@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-05-07 10:51:50 -04:00
Darrick J. Wong f1605243a4 all: Introduce cppcheck static checking for make C=1
Introduce more static checking via cppcheck.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-14 09:32:50 -04:00
Theodore Ts'o fedfb27fe5 Add coverage testing using gcov
To check the coverage of e2fsprogs's regression test, do the
following:

	configure --enable-gcov
	make -j8 ; make -j8 check ; make coverage.txt

The coverage information will be the coverage.txt and *.gcov files in
the build directories.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-02-23 00:17:09 -05:00
Theodore Ts'o 6c59a665da configure: fix --with-diet-libc
Newer versions of autoconf pull in AC_PROG_GCC as part of
AC_CANONICAL_HOST.  So we need check for WITH_DIET_LIBC earlier in
configure.in.

Also, e2fsprogs now needs functions which are found in diet libc's
compat library.  So add support for autoconf's LIBS function, and
automatically set libs to include -lcompat.

Finally, disable compiling e4defrag by deault if --with-diet-libc is
specified because the program has too many glibc dependencies.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-01-05 22:58:16 -05:00
Theodore Ts'o 5f16f6c337 Fix optional static code analysis using sparse
Commit 832cb612: "e2fsprogs: add (optional) sparse checking to the
build" breaks systems that are not using GNU make.  In addition, it
breaks if the developer tries to build in a subdirectory (i.e., if he
or she tries running "make" in the misc or e2fsck or lib/ext2fs
directory), since CHECK_CMD is not set.

Fix this by moving the sparse setup to MCONFIG.

Cc: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-10-23 20:09:12 -04:00
Theodore Ts'o c1986ecb6f Fix blhc (Build Log Hardening Check) warnings
The Build Log Hardening Check is a debian tool which scans the output
of a package build making sure that the security hardening flags are
used when compiling and linking all of binaries in a package.

For the most part we were passing CFLAGS, CPPFLAGS, and LDFLAGS down
to the compiler and link commands, but there there were one or two
exceptions.  In addition, there where a few places in "make install"
where the V=1 option was not being honored, which triggered blhc
warnings since it couldn't analyze those commands.

The e2fsck.static was the only binary that was not getting built and
packaged with the hardening flags, but I've fixed all of the blhc
warnings so in the future it will be obvious if we regress.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-06-13 16:06:44 -04:00
Theodore Ts'o 183c73b026 Teach build system to install relative symlinks if requested
Add a configure option, --enable-relative-symlinks, which will use
relative symlinks for the ELF shared library files.

Addresses-Sourceforge-Bug: #3520767

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-12 23:34:33 -04:00
Theodore Ts'o 8f9d708f6a libquota: only build a static library
Since the libquota library has namespace contamination issues, don't
build a shared library and link against it statically.  Don't include
it as part of the Debian packages.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-19 13:39:38 -04:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00
Aditya Kali f239fefc14 e2fsprogs: add quota library to e2fsprogs
This patch adds the quota library (ported form Jan Kara's quota-tools) in
e2fsprogs in order to make quotas as a first class supported feature in Ext4.
This patch also provides interface in lib/quota/mkquota.h that will be used by
mke2fs, tune2fs, e2fsck, etc. to initialize and update quota files.
This first version of the quota library does not support reading existing quota
files. This support will be added in the near future.
Thanks to Jan Kara for his work on quota-tools. Most of the files in this patch
are taken as-is from quota tools and were simply modified to work with
libext2fs in e2fsprogs.

Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-08-31 15:21:40 -04:00
Theodore Ts'o 9b3018a82e e2fsck: catch termination signals and print information about them
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-08-11 14:56:49 -04:00
Theodore Ts'o 5f70f2e647 MCONFIG: Fix dependency definitions for the static and profiled blkid library
The dependency definitions for DEPSTATIC_LIBBLKID and
DEPPROFILED_LIBBLKID incorrectly referenced the non-dependency macros
(i.e., STATIC_LIBUUID instead of DEPSTATIC_LIBUUID).  This resulted in
-luuid showing up as a Makefile dependency, which is of course wrong.

Addresses-Debian-Bug: #604629

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-11-26 19:35:10 -05:00
Theodore Ts'o 5aa6c3f61c Add configure options --enable-symlink-build and --enable-symlink-install
These options allow e2fsprogs to be built using symlinks instead of
hard links, and to be installed using symlinks instead of hard links,
respectively.

Addresses-Sourceforge-Bug: #1436294

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 19:21:42 -04:00
Theodore Ts'o bcb915b0d0 Enhance build system so that "make V=1" works like the Linux Kernel
If gmake is available, the developer can use "make V=1" instead of
using a configure-time switch, --enable-verbose-makecmds, to see all
of the commands executed by the Makefile.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 18:19:10 -04:00
Theodore Ts'o c13351f6c5 Add support for configure --enable-verbose-makecmds
Some people don't want to see the concise "kernel-style" make output.
This configure option allows build engines that want to see the full
set of commands executed by the makefile to get what they want.  Most
people will find this more distracting than useful, unless they need
to debug the Makefiles.

(It is not necessary to rerun configure to enable this verbose make
output temprarily; if a developer wants to do a quick debug of a
directory's makefile, he or she can simply edit the definition of the
$(E) and $(Q) variables in the Makefile; instructions can be found in
the MCONFIG file which is included in at the beginning of every
Makefile.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-02 00:11:17 -04:00
Theodore Ts'o a6a1c0815c Fix Makefile dependencies for libcom_err
The e2fsprogs makefiles were using the same Makefile variable
LIBCOM_ERR for the link-line arguments as well as the dependencies.
Since LIBCOM_ERR can now include non-file arguments such as
"-lpthread", we need to use a separate DEPLIBCOM_ERR variable that
only has build file dependencies.

Do the same thing for STATIC_LIBCOM_ERR and PROFILED_LIBCOM_ERR.

Addresses-Sourceforge-Patches: #2813809

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 22:06:51 -04:00
Theodore Ts'o 4a1e15a8ba Fix compilation problem when building with --disable-uuid
The MCONFIG.in file used $(LIBUUID) in the definition of DEPLIBBLKID,
when it should have used $(DEPLIBUUID) instead.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-01 17:20:24 -04:00
Scott James Remnant 39fd3d4f13 configure.in: add --disable-libuuid option
Add an option to switch between the private (in-tree) libuuid and
public (in-system installed) library.  The private version is still
enabled by default.

Signed-off-by: Scott James Remnant <scott@netsplit.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2009-06-29 00:36:45 -04:00
Theodore Ts'o 14b596d409 configure.in: add --disable-libblkid option
Add an option to switch between the private (in-tree) libblkid and
public (in-system installed) library.  The private version is still
enabled by default.

If --disable-libblkid is specified the findfs(8) program, which is a
variant of tune2fs, is also not built or installed.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-04-22 09:18:30 -04:00
Theodore Ts'o ad64399d15 Add support to build profiled binaries in the misc directory
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 12:34:28 -05:00
Theodore Ts'o 992a2f7f68 e2fsck: Fix build of e2fsck.profiled if profiling is enabled
It's been a while since I've done a build using "configure
--enable-profile", and some bitrot had set into the Makefiles...

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-11-15 12:12:57 -05:00
Theodore Ts'o d7f45af802 libcom_err: Use sem_post/sem_init to prevent race conditions
SuSE has been carrying a patch for a long time to prevent a largely
theoretical race condition if a multi-threaded application adds and
removes error tables in multiple threads.  Unfortunately SuSE's
approach breaks compatibility by forcing applications to link and
compile with the -pthread option; using pthread mutexes has
historically been problematic.

This commit fixes things in a more portable way by using
sem_post/sem_wait instead, which is an older interface that doesn't
require the pthreads library.  Linux happens to implement
sem_post/sem_init using futexes, and -lrt ends up pulling in
-lpthread, but the advantage of using POSIX semaphores is that
applications don't have to be built using -pthread, unlike the use of
pthread mutexes.

The add_error_table() and remove_error_table() interfaces are the
preferred interfaces and locking protection have been added to only
these interfaces.  I have not added locking protection to the
generated initialize_xxx_error_table and initialize_xxx_error_table_r
interfaces, to avoid adding symbol dependencies that would cause a
library to fail to work when linking against older com_err libraries
that do not export et_list_lock() and et_list_unlock().  Threaded
applications shouldn't be using these interfaces in any case.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-12 10:15:26 -04:00
Theodore Ts'o 29551cacca Fix e2initrd_helper, blkid, and fsck from linking with unneeded libraries
... especially when using ELF shared libraries.  We only need to link
with a library if the executable uses that library directly.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-04 22:39:20 -04:00
Theodore Ts'o 55da987650 Improve ELF shared library handling
Pass in -rpath-link option to the linker so that blkid will build
correctly on systems that don't have libcom_err.so.2 installed.

Fix debugfs to only try to link with -ldl when building without shared
libraries; with ELF shared libraries, the library which requires -ldl
(libss.so) can required the library dependency itself.

Fix how we build tune2fs.static so that we use @LDFLAG_STATIC@, via
$(LDFLAGS_STATIC), instead of hard-coding the use of -static.

Addresses-Sourceforge-Bug: #2088537

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-09-02 23:12:38 -04:00
Theodore Ts'o 7515a74478 Remove use of devmapper library by the blkid library
The devmapper library is no longer needed given commit f4e89bcd.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-26 23:56:00 -04:00
Theodore Ts'o 9d99416ea3 Fix dependency for $(LIBSS) when an explicit dlopen() library is needed
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-06-07 21:53:35 -04:00
Theodore Ts'o daf7a6e5d1 Fix tst_extents build when building w/o dynamic libraries
$(LIBSS) should automatically include @DLOPEN_LIB@ so the right thing
happens for programs that need to use the ss library.

Reorder the library link order for tst_extents since the blkid library
uses libuuid functions.

Thanks to Eric Sandeen for pointing this problem out!

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-04-17 16:56:09 -04:00
Theodore Ts'o a4ece35911 Use pkg-config to determine where to find the devmapper library
Fedora and Red Hat puts the devmapper library in different locations
compared to Debian, so we use pkg-config.  Unfortunately Debian's
devmapper.pc file is buggy (See Debian Bug #390243), so we have to
work around it.

Historically, e2fsprogs has tried not to depend on pkg-config, since
its answers are so often **wrong** (the Debian bug has been ignored
for over a year), so I'm hoping I'm not going to regret this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-01-03 12:36:59 -05:00
Theodore Ts'o 19c000e816 Update WFLAGS to suppress spurious warning messages
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-11-14 23:40:19 -05:00
Theodore Ts'o b6b65c3de4 Add datarootdir definition for compatibility with autoconf 2.60
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-22 00:14:26 -04:00
Theodore Ts'o cce2f497e0 Fix Debian FTBFS problem caused by devmapper library using pthreads
Addresses Debian bug: #388718

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-10-01 22:18:08 -04:00
Matthias Andree abcfdfda7a Read mke2fs.conf and e2fsck.conf from root_sysconfdir rather than harcoded /etc. 2006-06-10 16:08:18 +02:00
Theodore Ts'o 9dc6ad1ecb Change mke2fs to use /etc/mke2fs.conf as a configuration file
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-23 22:00:01 -05:00
Karel Zak 4db2f59a71 Add device-mapper support to the blkid library
On systems where is multi-path storage device is problem with duplicated
filesystems. The solution is select "the best" device. This is possible
by device-mapper library.

Short quotation from RH bugzilla:

With my patch, all dm devices remains in libblkid cache.

Only the top level dm devices are given high priority
and more appropriate node names (i.e. /dev/mapper/*) are used.

For example, if we have linear mapped dm device "ov1" over
dm device "disk1p3" which is multipath mapped to /dev/sdd3 and /dev/sdh3:
  # dmsetup.static ls --tree
  ov1 (253:5) <-- /dev/mapper/ov1 or /dev/dm-5
   `-disk1p3 (253:4) <-- /dev/mapper/disk1p3 or /dev/dm-4
      `-disk1 (253:0)
         |- (8:112) <-- /dev/sdh
         `- (8:48) <-- /dev/sdd

Original version of blkid will show:
  # ./orig/blkid -t LABEL=mpdisk1p3 -l
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"

With my patch, blkid will show:
  # ./deptree/blkid -t LABEL=mpdisk1p3 -l
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"

In blkid cache, all devices are listed:

  # ./orig/blkid -t LABEL=mpdisk1p3
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-5: LABEL="mpdisk1p3" ... TYPE="ext3"

  # ./deptree/blkid -t LABEL=mpdisk1p3
  /dev/mapper/ov1: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdd3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/sdh3: LABEL="mpdisk1p3" ... TYPE="ext3"
  /dev/dm-4: LABEL="mpdisk1p3" ... TYPE="ext3"

For more details see discussion on:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=156324

Addresses Red Hat Bug: #156324

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Peter Jones <pjones@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2006-03-08 14:17:28 -05:00
Theodore Ts'o dd947da232 Fix cross-compilation problems when CFLAGS contain target-specific options
Use BUILD_CCFLAGS and BUILD_LDFLAGS instead of CCFLAGS and LDFLAGS in
the build system when building files in the util directory which are
needed during the build process.  This avoids potential problems when
cross-compiling some of the options are not recognized as valid by the
host compiler.  (Addresses Sourceforge Bug #1261547)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-11-09 18:37:07 -04:00
Theodore Ts'o 98919bdb2e Add support for maintainer mode, which enables the makefile rules
to rebuild the configure script from configure.in, and to reubuild the 
.gmo files in po directory.
2005-02-04 10:43:58 -05:00
Matthias Andree 290806abc3 MCONFIG.in:
Rearrange -I options to give local includes precedence over
  /usr/local/include, to unbreak the build when an older
  e2fsprogs version (with includes) is installed under
  /usr/local (for instance, on FreeBSD).
2005-01-20 03:17:31 +01:00
Theodore Ts'o 6d4022786d Use MKINSTALLDIRS macro so that the Makefiles can find the script
correctly.

Update Makefile dependencies.

Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.

Remove sync from e2fsck's "make all" target.
2004-12-14 21:46:26 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Theodore Ts'o 2b5901d9c7 Remove the a.out DLL support, since it's been obsolete and unmaintained
for a long time now.
2004-11-19 17:06:47 -05:00
Theodore Ts'o dd60705665 Refine the build process to avoid re-running subst all the time on
some generated files, by having subst update the modtime on these 
files even when the generated file hasn't changed.  We do this with 
generated files that do not have any downstream dependencies.
2004-04-03 13:53:46 -05:00
Theodore Ts'o 032a763f97 MCONFIG.in: Make the gcc-wall print more warnings to catch
signed vs. unsigned problems.
2003-11-26 23:18:56 -05:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o c6f35b8a82 MCONFIG.in, configure.in: Only put the intl directory in the -I
search path if we are using --with-internal-gettext.
	Otherwise causes compatibility problems with the woody
	glibc.   (Addresses Debian bug #193372)
2003-05-17 16:29:27 -04:00
Theodore Ts'o a04eba3f88 Update to gettext 0.11.5. We now enable NLS support by default.
Fixed up support for using the internal intl library.
2003-05-03 16:35:17 -04:00
Theodore Ts'o e12f2ae74c Integrate new blkid library. 2003-01-23 16:45:16 -05:00
Theodore Ts'o 482afc442d Makefile.in (install): Search all compression extensions when
deleting old man pages.
2002-10-31 03:32:34 -05:00
Theodore Ts'o b5ffeadece Integrate ext2ed into the e2fsprogs build system, and make minimal changes so
that it will compile on modern systems.  The top-level makefile does not recurse
into the ext2ed directory for now, pending determination of whether the original
author is still maintaining ext2ed.

The documentation files have been renamed to remove the version from the filename.
In addition, the SGML files have been converted from LinuxDoc to DocBook.

The way root_bindir, root_sbindir, and root_libdir have been changed so that 
if root_prefix is not set, the values set by the configure command-line options to
set the directory names using --bindir, --sbindir, --libdir will affect the
root_bindir, et.al Makefile variables.
2002-05-11 19:17:00 -04:00