Commit Graph

82 Commits (fad531e5233343e34f517e46050d860b6225dae0)

Author SHA1 Message Date
David Sterba 7c41d25ec6 btrfs-progs: do not install static binaries over non-static
The builds should be able to coexist, so we don't want to forcibly
overwite the standard version.

Signed-off-by: David Sterba <dsterba@suse.com>
2015-08-31 19:25:11 +02:00
David Sterba 36cc0b67f7 btrfs-progs: Makefile: fix typo, dependencies for cmds-* files
The dependency generation skipped all cmds-*.c files due to a typo
in variable name, since day one.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-06-16 17:15:03 +02:00
David Sterba 10b6b0b3a8 btrfs-progs: tests: add driver script for misc tests
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-06-02 15:56:43 +02:00
David Sterba b51cc1d325 btrfs-progs: tests: add script to clean intermediate images
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-05-25 16:10:58 +02:00
David Sterba c8927d5116 btrfs-progs: cleanup, rename *disk_usage* files to usage
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-04-22 18:21:48 +02:00
David Sterba 047dd1bf5d btrfs-progs: tests: split make rule for fsck and convert tests, fix prerequisities
We'd like to run each class of tests separately. There were some missing
prerequisities that should be/are verified by the tests, makefile rules
have been synced.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-04-07 18:36:59 +02:00
Qu Wenruo a1231346d6 btrfs-progs: Move -rdynamic linker only option to LDFLAGS
Same thing as clang cleanup patch commit 040b3f11ba
"btrfs-progs: Makefile: Move linker only option to LDFLAGS"

But the move to autoconfig seems using old Makefile.
So do it again.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-11 19:08:41 +01:00
Qu Wenruo 68351e4162 btrfs-progs: Add new find-root.[ch] infrastructure
Introduce new find-root.[ch] infrastructure which has better tree root
judgment and uses much less codes to do it.

The new infrastructure will only record tree blocks with highest level
among its generation, and do better judgment whether the found tree block
is the desired one(level + generation check other than the original
generation only check).

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-11 18:34:04 +01:00
David Sterba 9b31d84fce btrfs-progs: build, do not install everything by default
Commit 878affd47d ("btrfs-progs: build more utilities by default")
resulted in installation of new utilities, that were not installed
before. Make them build but do not install them.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-05 16:12:09 +01:00
David Sterba dfbbe312ad btrfs-progs: autoconf: do not force fortify flags
Make it default, but let the user override it.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-05 15:11:40 +01:00
David Sterba f00d59d78f btrfs-progs: autoconf: largefile support is driven by configure
Don't force it in the makefile.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-05 15:05:23 +01:00
David Sterba 005526d065 btrfs-progs: autoconf: move custom CFLAGS from makefile
Keep only flags that are required to build properly, current fine
tunings are moved to the optional defaults in configure and can be
overriden by the user.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-05 15:05:21 +01:00
David Sterba 4aa32c9deb btrfs-progs: build, use the static library for the utilities
Commit 2c2e6c4e12 ("btrfs-progs: autoconf: cleanup compilation
flags usage") added the shared library to the linking command so the
resulting binaries depend dependent on libbtrfs.so. This is not
intended.

Reported-by: WorMzy Tykashi <wormzy.tykashi@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-04 18:45:54 +01:00
David Sterba 779499a9ad btrfs-progs: build, fix the source of btrfsck symlink
The installed symlink points to the absolute path of btrfs,
a relative link is enough.

Reported-by: WorMzy Tykashi <wormzy.tykashi@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-04 18:10:23 +01:00
David Sterba f47834dd1b btrfs-progs: autoconf: set exec_prefix in makefile
Lost in the conversion and breaks the build unless set explicitly.

Reported-by: WorMzy Tykashi <wormzy.tykashi@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-04 18:08:23 +01:00
David Sterba 99c53e440e btrfs-progs: autoconf: check btrfs-convert dependencies
Use the standard pkg-config checks.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 17:13:57 +01:00
David Sterba 1275c4fc1b btrfs-progs: autoconf: make btrfs-convert build optional
Proposed at https://github.com/kdave/btrfs-progs/pull/6, I've added the
configure options.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 17:13:55 +01:00
David Sterba d90978c9cc btrfs-progs: autoconf: generate documentation makefile as well
This is plain move to .in.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-03 15:42:34 +01:00
Qu Wenruo aae2c8421b btrfs-progs: Add btrfs_get_extent() and btrfs_punch_hole().
Add btrfs_get_extent() and btrfs_punch_hole() for btrfs-progs.

Btrfs_get_extent() will act much like kernel one, return the first
extent that covers the given range.
The difference will be that progs btrfs_get_extent() can't handle
no-holes feature, which means caller should handle it carefully.

Btrfs_punch_hole() will punch a hole in given range of given inode,
however it differs from kernel one since it won't zero any page or drop
any extents if there is any extent in the hole range.

These functions are mainly used for later I_ERR_FILE_EXTENT_DISCOUNT
repair function.

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-02-02 14:16:38 +01:00
David Sterba 878affd47d btrfs-progs: build more utilities by default
Get better build coverage, btrfs-fragments require external libraries.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 19:06:47 +01:00
David Sterba 58f92c7caf btrfs-progs: build, use autoconf to detect RM
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 19:03:23 +01:00
David Sterba 412c9c3428 btrfs-progs: build, clean all generated files
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:28:37 +01:00
David Sterba 5989e9dd50 btrfs-progs: build, make build test work again
We need to regenerate version.h after clean-all.

Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:16:10 +01:00
Karel Zak badb4a15af btrfs-progs: autoconf: add --disable-documentation
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak a22c3a0dcf btrfs-progs: autoconf: add --disable-backtrace
It's better to use ./configure than manually edit Makefile.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak 67b1307955 btrfs-progs: autoconf: clean generated files, make version.h stuff more robust
- add rule to generated version.h when any relevant stuff changed
- add rule to clean generated files on "make clean-all"

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak 2c2e6c4e12 btrfs-progs: autoconf: cleanup compilation flags usage
- define basic default CFLAGS in configure.ac, because:

   * autoconf default is -g -O2, but btrfs uses -g -O1

   * it's better to follow autoconf; standard way to modify
     CFLAGS is to call:  CFLAGS="foo bar" ./configure

- move all flags to one place in Makefile.in

- don't use AM_CFLAGS, the CFLAGS and STATIC_CFLAGS are enough

- don't mix objects and flags in $LIBS, it's more readable to
  add $(libs) to make rules

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak 8e14f8de17 btrfs-progs: autoconf: use paths and $*_LIBS from ./configure
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak 27a807277b btrfs-progs: autoconf: check for build programs in ./configure
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:01:00 +01:00
Karel Zak 04743d0043 btrfs-progs: autoconf: use ./configure to generate version.h
The original homemade solution is unnecessary, autotools provides better
infrastructure to generate files.

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 18:00:59 +01:00
Karel Zak bb6b4fea9f btrfs-progs: autoconf: use config.h
- the header file is generated by ./configure, the standard autotools
  way is to use -include config.h on compiler command line rather than
  include the file directly from code

- remove _GNU_SOURCE from code, the macros is already defined in config.h
  by AC_USE_SYSTEM_EXTENSIONS autoconf macro

Signed-off-by: Karel Zak <kzak@redhat.com>
[_GNU_SOURCE changes already done]
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 17:55:44 +01:00
Karel Zak 48e728d112 btrfs-progs: autoconf: add ./configure script
- add ./autogen.sh script (necessary after git clean/clone)
- add ./configure.ac
- copy autotool helper scripts from automake
- modify version.sh to be usable from the configure script
- rename Makefile to Makefile.in and use basic variables from configure.ac

Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
2015-01-28 17:55:36 +01:00