Skip to contentSkip to conversation

fix version number

PATCH New Mike Frysinger 1 participant 7 messages Oct 19, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 fix version number

We're at 3.6.22 now, not 3.6.21.

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 0473be1..54b2271 100644
@@ -6,7 +6,7 @@ AC_PREREQ(2.50)
 AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
 AH_TEMPLATE([ENABLE_DEBUG], [Define for enable debug info.])
 
-AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.21)
+AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.22)
 AM_MAINTAINER_MODE
 
 dnl We install in /sbin, the utils are to be available on boot
Signature · 1 line
1.7.12
#1 lore raw

PATCH 2/7 configure: update automake invocation

This converts away from the old/deprecated AM_INIT_AUTOMAKE method.

Also enable the nice silent build by default.

---
 configure.ac | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
configure.ac +3 -2
index 54b2271..3822163 100644
@@ -1,12 +1,13 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(version.h)
+AC_INIT([reiserfsprogs], [3.6.22], [[email protected]])
 AC_CANONICAL_HOST
 AC_PREREQ(2.50)
 
 AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
 AH_TEMPLATE([ENABLE_DEBUG], [Define for enable debug info.])
 
-AM_INIT_AUTOMAKE(reiserfsprogs, 3.6.22)
+AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules])
+AM_SILENT_RULES([yes])
 AM_MAINTAINER_MODE
 
 dnl We install in /sbin, the utils are to be available on boot
Signature · 1 line
1.7.12
#2 lore raw

PATCH 3/7 update gitignore

In reply to Mike Frysinger
---
 .gitignore | 10 ++++++++++
 1 file changed, 10 insertions(+)
.gitignore +10 -0
index 0df7c35..cfc63d9 100644
@@ -1,3 +1,6 @@
+*~
+*.[ao]
+
 INSTALL
 Makefile.in
 aclocal.m4
@@ -19,3 +22,10 @@ config.status
 include/config.h
 include/credits.h
 include/stamp-h1
+
+reiserfsprogs-*.tar.*
+/debugreiserfs/debugreiserfs
+/fsck/reiserfsck
+/mkreiserfs/mkreiserfs
+/resize_reiserfs/resize_reiserfs
+/tune/reiserfstune
Signature · 1 line
1.7.12
#3 lore raw

PATCH 4/7 drop -fPIC usage

In reply to Mike Frysinger

We don't create any libraries so there's no need to build with -fPIC. Drop it all.

---
 configure.ac | 12 ------------
 1 file changed, 12 deletions(-)
configure.ac +0 -12
index 3822163..50e42f3 100644
@@ -50,14 +50,6 @@ AC_ARG_ENABLE(debug, [  --enable-debug          enable extra checks],
 	      enable_debug=no
 )
 
-dnl Check for the compiler pic option.
-AC_CACHE_CHECK([whether -fPIC works], [pic], [
-	saved_CPPFLAGS="$CPPFLAGS"
-	CPPFLAGS="-fPIC -DPIC"
-	AC_TRY_COMPILE(, , [pic=yes], [pic=no])
-	CPPFLAGS="$saved_CPPFLAGS"
-])
-
 # Checking for compiler warning options
 AC_CACHE_CHECK([whether -Wuninitialized works], [uninitialized], [
 	saved_CPPFLAGS="$CPPFLAGS"
@@ -149,10 +141,6 @@ else
 	fi
 fi
 
-if test x$pic = xyes; then
-	CFLAGS="$CFLAGS -fPIC -DPIC"
-fi
-
 AC_OUTPUT(
     include/Makefile 
     mkreiserfs/Makefile 
Signature · 1 line
1.7.12
#4 lore raw

PATCH 5/7 clean up compiler flag handling

In reply to Mike Frysinger

ENABLE_DEBUG isn't used anywhere, so punt it.

--enable-debug is only used to control whether to enable -W flags by default. But there's no harm just always doing that, so drop the configure flag and enable the -W flags when they're available.

AC_CACHE_CHECK requires cache vars have "_cv_" in their name, so tweak all the cache var names to include that.

That leaves us with the PRESET_CFLAGS logic which is pointless nowadays as autoconf largely does the same thing for us. It'll default to using '-O2 -g -Wall' if the compiler supports it, so no need to do it.

---
 configure.ac | 56 +++++++++++++++++---------------------------------------
 1 file changed, 17 insertions(+), 39 deletions(-)
configure.ac +17 -39
index 50e42f3..8f280a6 100644
@@ -4,7 +4,6 @@ AC_CANONICAL_HOST
 AC_PREREQ(2.50)
 
 AH_TEMPLATE([HAVE_LIBUUID], [Define for enable libuuid using.])
-AH_TEMPLATE([ENABLE_DEBUG], [Define for enable debug info.])
 
 AM_INIT_AUTOMAKE([1.11.1 dist-xz silent-rules])
 AM_SILENT_RULES([yes])
@@ -15,10 +14,6 @@ dnl AC_PREFIX(/)
 
 AM_CONFIG_HEADER(include/config.h)
 
-AC_SUBST(sbindir)
-
-PRESET_CFLAGS=$CFLAGS
-
 dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_AWK 
@@ -45,30 +40,25 @@ AC_C_INLINE
 AC_TYPE_SIZE_T
 AC_STRUCT_ST_RDEV
 
-AC_ARG_ENABLE(debug, [  --enable-debug          enable extra checks], 
-	      enable_debug=yes,
-	      enable_debug=no
-)
-
 # Checking for compiler warning options
-AC_CACHE_CHECK([whether -Wuninitialized works], [uninitialized], [
+AC_CACHE_CHECK([whether -Wuninitialized works], [ac_cv_wuninitialized_flag], [
 	saved_CPPFLAGS="$CPPFLAGS"
 	CPPFLAGS="-O1 -Wuninitialized"
-	AC_TRY_COMPILE(, , [uninitialized=yes], [uninitialized=no])
+	AC_TRY_COMPILE(, , [ac_cv_wuninitialized_flag=yes], [ac_cv_wuninitialized_flag=no])
 	CPPFLAGS="$saved_CPPFLAGS"
 ])
 
-AC_CACHE_CHECK([whether -Wno-unused-parameter works], [no_unused_parameter], [
+AC_CACHE_CHECK([whether -Wno-unused-parameter works], [ac_cv_wno_unused_parameter_flag], [
 	saved_CPPFLAGS="$CPPFLAGS"
 	CPPFLAGS="-Wno-unused-parameter"
-	AC_TRY_COMPILE(, , [no_unused_parameter=yes], [no_unused_parameter=no])
+	AC_TRY_COMPILE(, , [ac_cv_wno_unused_parameter_flag=yes], [ac_cv_wno_unused_parameter_flag=no])
 	CPPFLAGS="$saved_CPPFLAGS"
-		])
+])
 
-AC_CACHE_CHECK([whether -Wredundant-decls works], [redundant_decls], [
+AC_CACHE_CHECK([whether -Wredundant-decls works], [ac_cv_wredundant_decls_flag], [
 	saved_CPPFLAGS="$CPPFLAGS"
 	CPPFLAGS="-Wredundant-decls"
-	AC_TRY_COMPILE(, , [redundant_decls=yes], [redundant_decls=no])
+	AC_TRY_COMPILE(, , [ac_cv_wredundant_decls_flag=yes], [ac_cv_wredundant_decls_flag=no])
 	CPPFLAGS="$saved_CPPFLAGS"
 ])
 
@@ -115,30 +105,18 @@ AC_ARG_ENABLE(io-failure-emulation,
   fi
 ])
 
-if test x$enable_debug = xyes; then
-	if test "x" = "x$PRESET_CFLAGS"; then
-		CFLAGS="-g -Wall"
-	fi
-	
-	if test x$no_unused_parameter = xyes; then
-		CFLAGS="$CFLAGS -Wno-unused-parameter"
-	else
-		CFLAGS="$CFLAGS -Wno-unused"
-	fi
+if test "x$ac_cv_wno_unused_parameter_flag" = xyes; then
+	CFLAGS="$CFLAGS -Wno-unused-parameter"
+else
+	CFLAGS="$CFLAGS -Wno-unused"
+fi
 	
-	if test x$redundant_decls = xyes; then
-		CFLAGS="$CFLAGS -Wredundant-decls"
-	fi
+if test "x$ac_cv_wredundant_decls_flag" = xyes; then
+	CFLAGS="$CFLAGS -Wredundant-decls"
+fi
 	
-	if test x$uninitialized = xyes; then
-		CFLAGS="$CFLAGS -Wuninitialized -O1"
-	else
-		CFLAGS="$CFLAGS -O2"
-	fi
-else
-	if test "x" = "x$PRESET_CFLAGS"; then
-		CFLAGS="-g -Wall -O2"
-	fi
+if test "x$ac_cv_wuninitialized_flag" = xyes; then
+	CFLAGS="$CFLAGS -Wuninitialized"
 fi
 
 AC_OUTPUT(
Signature · 1 line
1.7.12
#5 lore raw

PATCH 6/7 clean up io-failure-emulation logic a bit

In reply to Mike Frysinger

Use standard autoconf macros rather than open coding the logic.

---
 configure.ac | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
configure.ac +5 -6
index 8f280a6..14d7563 100644
@@ -98,12 +98,11 @@ fi
 
 dnl Never enable this. It is for debugging only
 AC_ARG_ENABLE(io-failure-emulation,
-[  --enable-io-failure-emulation      Never use that. It is for debugging only],
-[ if test "$enableval" = "yes" ; then
-    echo -e "\nCarefull! IO failure emulation is ON\n"
-    AC_DEFINE(IO_FAILURE_EMULATION, 1, [gets set when configure --enable-io-failure-emulation])
-  fi
-])
+	[AS_HELP_STRING([--enable-io-failure-emulation], [Never use this. It is for debugging only])])
+if test "$enable_io_failure_emulation" = "yes" ; then
+	AC_MSG_WARN([Careful! IO failure emulation is ON])
+	AC_DEFINE(IO_FAILURE_EMULATION, 1, [gets set when configure --enable-io-failure-emulation])
+fi
 
 if test "x$ac_cv_wno_unused_parameter_flag" = xyes; then
 	CFLAGS="$CFLAGS -Wno-unused-parameter"
Signature · 1 line
1.7.12
#6 lore raw

PATCH 7/7 fix out of tree builds

In reply to Mike Frysinger

This allows you to build out of tree like:
mkdir build
../configure
make

This also fixes make distcheck since that uses the above mechanism.

---
 Makefile.am                 | 7 +------
 configure.ac                | 2 ++
 debugreiserfs/Makefile.am   | 2 +-
 fsck/Makefile.am            | 2 +-
 mkreiserfs/Makefile.am      | 2 +-
 resize_reiserfs/Makefile.am | 2 +-
 tune/Makefile.am            | 2 +-
 7 files changed, 8 insertions(+), 11 deletions(-)
Makefile.am +1 -6
index bcb518d..46d975b 100644
@@ -1,8 +1,3 @@
 SUBDIRS = include lib reiserfscore fsck debugreiserfs resize_reiserfs mkreiserfs tune
 
-noinst_DATA = reiserfsprogs.spec
-
-EXTRA_DIST = CREDITS version.h
-
-dist-hook:
-	cp -f reiserfsprogs.spec $(distdir)
+EXTRA_DIST = CREDITS version.h reiserfsprogs.spec
configure.ac +2 -0
index 14d7563..1d266a5 100644
@@ -118,6 +118,8 @@ if test "x$ac_cv_wuninitialized_flag" = xyes; then
 	CFLAGS="$CFLAGS -Wuninitialized"
 fi
 
+CPPFLAGS="-I\$(top_srcdir)/include $CPPFLAGS"
+
 AC_OUTPUT(
     include/Makefile 
     mkreiserfs/Makefile 
debugreiserfs/Makefile.am +1 -1
index 1a6eeb9..faf9877 100644
@@ -4,4 +4,4 @@ debugreiserfs_SOURCES = debugreiserfs.c pack.c unpack.c stat.c corruption.c scan
 man_MANS = debugreiserfs.8
 EXTRA_DIST = $(man_MANS)
 
-LDADD = $(top_srcdir)/reiserfscore/libcore.a $(top_srcdir)/lib/libmisc.a
+LDADD = $(top_builddir)/reiserfscore/libcore.a $(top_builddir)/lib/libmisc.a
fsck/Makefile.am +1 -1
index f2f0d9a..8f01ee2 100644
@@ -7,7 +7,7 @@ ufile.c check_tree.c info.c super.c fsck.h
 man_MANS = reiserfsck.8
 EXTRA_DIST = $(man_MANS)
 
-reiserfsck_LDADD = $(top_srcdir)/reiserfscore/libcore.a $(top_srcdir)/lib/libmisc.a
+reiserfsck_LDADD = $(top_builddir)/reiserfscore/libcore.a $(top_builddir)/lib/libmisc.a
 
 install-exec-hook:
 	$(LN_S) reiserfsck $(DESTDIR)$(sbindir)/fsck.reiserfs
mkreiserfs/Makefile.am +1 -1
index aed0cfa..1a06f52 100644
@@ -4,7 +4,7 @@ mkreiserfs_SOURCES = mkreiserfs.c
 man_MANS = mkreiserfs.8
 EXTRA_DIST = $(man_MANS)
 
-LDADD = $(top_srcdir)/reiserfscore/libcore.a $(top_srcdir)/lib/libmisc.a
+LDADD = $(top_builddir)/reiserfscore/libcore.a $(top_builddir)/lib/libmisc.a
 
 install-exec-hook:
 	$(LN_S) mkreiserfs $(DESTDIR)$(sbindir)/mkfs.reiserfs
resize_reiserfs/Makefile.am +1 -1
index 240b18b..8cee04e 100644
@@ -4,5 +4,5 @@ resize_reiserfs_SOURCES = fe.c resize_reiserfs.c do_shrink.c resize.h
 man_MANS = resize_reiserfs.8
 EXTRA_DIST = $(man_MANS)
 
-LDADD = $(top_srcdir)/reiserfscore/libcore.a $(top_srcdir)/lib/libmisc.a
+LDADD = $(top_builddir)/reiserfscore/libcore.a $(top_builddir)/lib/libmisc.a
 
tune/Makefile.am +1 -1
index a76c669..c503956 100644
@@ -5,5 +5,5 @@ reiserfstune_SOURCES = tune.c tune.h
 man_MANS = reiserfstune.8
 EXTRA_DIST = $(man_MANS)
 
-LDADD = $(top_srcdir)/reiserfscore/libcore.a $(top_srcdir)/lib/libmisc.a
+LDADD = $(top_builddir)/reiserfscore/libcore.a $(top_builddir)/lib/libmisc.a
 
Signature · 1 line
1.7.12