summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Levand <geoff@infradead.org>2013-05-22 14:28:50 +0800
committerGeoff Levand <geoff@infradead.org>2013-05-22 14:28:50 +0800
commit4268a6023c22e861c0345b655c3f4b0d013fe6fe (patch)
treea155142362ffb8b036846895e892d7a470694f09
parent9fb845c7aa67f774223fdfabb2351cef709dbca7 (diff)
downloadps3-utils-4268a6023c22e861c0345b655c3f4b0d013fe6fe.tar.gz
Cleanup autotools files
General cleanup and enhancement of the autotools build files. Signed-off-by: Geoff Levand <geoff@infradead.org>
-rw-r--r--Makefile.am41
-rwxr-xr-xbootstrap27
-rw-r--r--configure.ac.in42
-rw-r--r--lib/Makefile.am32
-rwxr-xr-xlib/bootstrap27
-rw-r--r--lib/configure.ac.in58
6 files changed, 138 insertions, 89 deletions
diff --git a/Makefile.am b/Makefile.am
index 04c1edc..4e41fc0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,14 +15,19 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-if COND_DEBUG
- extra_cppflags = -DDEBUG
-else
- extra_cppflags = -DNDEBUG
-endif
-
SUBDIRS = lib
+ACLOCAL_AMFLAGS = -I m4
+
+AM_CPPFLAGS = -I$(srcdir)/lib $(DEFAULT_CPPFLAGS)
+AM_CFLAGS = $(DEFAULT_CFLAGS)
+AM_LDFLAGS = -Llib
+
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status libtool
+
composed_bin_scripts =
bin_SCRIPTS = $(composed_bin_scripts)
@@ -44,21 +49,6 @@ composed_mans = \
man_MANS = $(composed_mans)
-AM_CPPFLAGS = -I$(srcdir)/lib
-
-AM_CFLAGS = $(extra_cppflags) \
- -g \
- -Wall \
- -W \
- -Wunused \
- -Wstrict-prototypes \
- -Wmissing-prototypes \
- -Wmissing-declarations \
- -Wredundant-decls \
- -Winline
-
-AM_LDFLAGS = -Llib
-
bin_PROGRAMS = ps3-video-mode
sbin_PROGRAMS = ps3-flash-util
@@ -135,9 +125,14 @@ ps3-video-mode.8: Makefile $(srcdir)/ps3-video-mode.8.in
composed_files = $(composed_mans) $(composed_bin_scripts) \
$(composed_sbin_scripts)
-EXTRA_DIST = bootstrap configure.ac.in $(addsuffix .in, $(composed_files))
+EXTRA_DIST = bootstrap configure.ac.in $(srcdir)/m4 \
+ $(addsuffix .in, $(composed_files))
-MAINTAINERCLEANFILES = aclocal.m4 config.* configure configure.ac depcomp \
+MAINTAINERCLEANFILES = config.* configure configure.ac depcomp \
install-sh ltmain.sh Makefile.in missing $(PACKAGE)-*.gz
CLEANFILES = $(composed_files) $(addsuffix .tmp, $(composed_files))
+
+maintainer-clean-local:
+ rm -rf m4
+
diff --git a/bootstrap b/bootstrap
index 3323f9d..1218e9f 100755
--- a/bootstrap
+++ b/bootstrap
@@ -23,26 +23,17 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
# If available, use the git commit revision for the package version.
- months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \
- Sep:09 Oct:10 Nov:11 Dec:12"
-
# Add a date prefix for easy reading.
+ # date='2010-11-30 16:36:09 -0800'
- date=$(git log --pretty=format:"%cD" -1 HEAD)
-
- # date='Fri, 2 Aug 2007 19:36:06 -0700'
-
- date=${date##*, }
- date=${date% [0-9][0-9]:*}
- day=${date%* [A-Z][a-z][a-z] *}
- year=${date##* [A-Z][a-z][a-z] 20}
- month=${date##${day} }
- month=${month%% 20${year}}
- month=${months##*${month}:}
- month=${month%% *}
- [ ! ${day#[0-9][0-9]} ] || day="0$day"
+ date=$(git log --pretty=format:"%ci" -1 HEAD)
+ date=${date##20}
+ date=${date%%:[0-9][0-9] *}
+ date=${date//-/.}
+ date=${date// /.}
+ date=${date//:/.}
- version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head})
+ version=$(printf '%s-%s%s' ${date} g ${head})
# Add a '-dirty' postfix for uncommitted changes.
@@ -50,7 +41,7 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
version=`printf '%s%s' ${version} -dirty`
fi
else
- # Default to date and time.
+ # Default to current date and time.
version="dev-$(date +%y.%m.%d-%H.%M.%S)"
fi
diff --git a/configure.ac.in b/configure.ac.in
index 8dabe01..a927611 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -15,17 +15,51 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-AC_INIT([ps3-utils], [@version@], [Geoff Levand <geoffrey.levand@am.sony.com>])
+AC_INIT([ps3-utils], [@version@], [Geoff Levand <geoff@infradead.org>])
+
+AC_CONFIG_MACRO_DIR([m4])
AC_PREFIX_DEFAULT([/usr/local])
-AC_ARG_ENABLE([debug],
- [AS_HELP_STRING([--enable-debug], [enable debugging support])])
-AM_CONDITIONAL([COND_DEBUG], [test "x${enable_debug}" = "xyes"])
+AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])])
+AC_PROG_CC
+AC_PROG_INSTALL
AC_PROG_LIBTOOL
+
AM_INIT_AUTOMAKE
+LT_INIT
+
+default_cflags="--std=gnu99 -g \
+ -Wall -W -Wunused -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wredundant-decls"
+
+AC_ARG_ENABLE(
+ [werror],
+ [AS_HELP_STRING([--enable-werror],
+ [build programs with -Werror]
+ )],
+ [default_cflags="$default_cflags -Werror"]
+)
+
+AC_ARG_ENABLE(
+ [debug],
+ [AS_HELP_STRING([--enable-debug],
+ [build programs with extra debug info [default=no]]
+ )],
+ [],
+ [enable_debug=check]
+)
+
+AS_IF(
+ [test "x$enable_debug" = "xyes"],
+ [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O0 -DDEBUG"])],
+ [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O2 -DNDEBUG"])]
+)
+
+AC_SUBST([LIBTOOL_DEPS])
AC_SUBST([DESTDIR])
+
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_SUBDIRS([lib])
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0119bf4..252bd00 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,24 +15,17 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-if COND_DEBUG
- extra_cppflags = -DDEBUG
-else
- extra_cppflags = -DNDEBUG
-endif
+ACLOCAL_AMFLAGS = -I m4
-include_HEADERS = ps3-flash.h ps3-av.h
+AM_CPPFLAGS = $(DEFAULT_CPPFLAGS)
+AM_CFLAGS = $(DEFAULT_CFLAGS)
+
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
-AM_CFLAGS = $(extra_cppflags) \
- -g \
- -Wall \
- -W \
- -Wunused \
- -Wstrict-prototypes \
- -Wmissing-prototypes \
- -Wmissing-declarations \
- -Wredundant-decls \
- -Winline
+libtool: $(LIBTOOL_DEPS)
+ $(SHELL) ./config.status libtool
+
+include_HEADERS = ps3-flash.h ps3-av.h
lib_LTLIBRARIES = libps3-utils.la
@@ -50,6 +43,9 @@ libps3_utils_la_DEPENDENCIES = Makefile
libps3_utils_la_SOURCES = flash.c flash-db.c
libps3_utils_la_LDFLAGS = -version-info 3:0:1 ${EXTRA_LDFLAGS}
-EXTRA_DIST = bootstrap configure.ac.in
+EXTRA_DIST = bootstrap configure.ac.in $(srcdir)/m4
+
+MAINTAINERCLEANFILES = config.* configure configure.ac Makefile.in
-MAINTAINERCLEANFILES = aclocal.m4 config.* configure configure.ac Makefile.in
+maintainer-clean-local:
+ rm -rf m4
diff --git a/lib/bootstrap b/lib/bootstrap
index 68037f1..d4aa15a 100755
--- a/lib/bootstrap
+++ b/lib/bootstrap
@@ -23,26 +23,17 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
# If available, use the git commit revision for the package version.
- months="Jan:01 Feb:02 Mar:03 Apr:04 May:05 Jun:06 Jul:07 Aug:08 \
- Sep:09 Oct:10 Nov:11 Dec:12"
-
# Add a date prefix for easy reading.
+ # date='2010-11-30 16:36:09 -0800'
- date=$(git-log --pretty=format:"%cD" -1 HEAD)
-
- # date='Fri, 2 Aug 2007 19:36:06 -0700'
-
- date=${date##*, }
- date=${date% [0-9][0-9]:*}
- day=${date%* [A-Z][a-z][a-z] *}
- year=${date##* [A-Z][a-z][a-z] 20}
- month=${date##${day} }
- month=${month%% 20${year}}
- month=${months##*${month}:}
- month=${month%% *}
- [ ! ${day#[0-9][0-9]} ] || day="0$day"
+ date=$(git log --pretty=format:"%ci" -1 HEAD)
+ date=${date##20}
+ date=${date%%:[0-9][0-9] *}
+ date=${date//-/.}
+ date=${date// /.}
+ date=${date//:/.}
- version=$(printf '%s.%s.%s-%s%s' ${year} ${month} ${day} g ${head})
+ version=$(printf '%s-%s%s' ${date} g ${head})
# Add a '-dirty' postfix for uncommitted changes.
@@ -50,7 +41,7 @@ elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then
version=`printf '%s%s' ${version} -dirty`
fi
else
- # Default to date and time.
+ # Default to current date and time.
version="dev-$(date +%y.%m.%d-%H.%M.%S)"
fi
diff --git a/lib/configure.ac.in b/lib/configure.ac.in
index dd25151..f5cf4e8 100644
--- a/lib/configure.ac.in
+++ b/lib/configure.ac.in
@@ -15,24 +15,66 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
-AC_INIT([libps3-utils], [@version@], [Geoff Levand <geoffrey.levand@am.sony.com>])
+AC_INIT([libps3-utils], [@version@], [Geoff Levand <geoff@infradead.org>])
+
+AC_CONFIG_MACRO_DIR([m4])
AC_PREFIX_DEFAULT([/usr/local])
-AC_ARG_ENABLE([debug],
- [AS_HELP_STRING([--enable-debug], [enable debugging support])])
-AM_CONDITIONAL([COND_DEBUG], [test "x${enable_debug}" = "xyes"])
+AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])])
+AC_PROG_CC
+AC_PROG_INSTALL
AC_PROG_LIBTOOL
+
AM_INIT_AUTOMAKE
-AC_SUBST([DESTDIR])
+LT_INIT
+
+default_cflags="--std=gnu99 -g \
+ -Wall -W -Wunused -Wstrict-prototypes -Wmissing-prototypes \
+ -Wmissing-declarations -Wredundant-decls"
+
+AC_ARG_ENABLE(
+ [werror],
+ [AS_HELP_STRING([--enable-werror],
+ [build programs with -Werror]
+ )],
+ [default_cflags="$default_cflags -Werror"]
+)
+
+AC_ARG_ENABLE(
+ [debug],
+ [AS_HELP_STRING([--enable-debug],
+ [build programs with extra debug info [default=no]]
+ )],
+ [],
+ [enable_debug=check]
+)
+
+AS_IF(
+ [test "x$enable_debug" = "xyes"],
+ [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O0 -DDEBUG"])],
+ [AC_SUBST([DEFAULT_CFLAGS], ["$default_cflags -O2 -DNDEBUG"])]
+)
AC_CHECK_HEADERS([asm/ps3av.h])
-AC_CHECK_DECLS([PS3AV_MODE_MASK, PS3AV_MODE_RGB, PS3AV_MODE_FULL, \
-PS3AV_MODE_WHITE, PS3AV_MODE_COLOR, PS3AV_MODE_DITHER, PS3AV_MODE_HDCP_OFF],
- [], [], [#include <asm/ps3av.h>])
+AC_CHECK_DECLS([PS3AV_MODE_MASK, \
+ PS3AV_MODE_RGB, \
+ PS3AV_MODE_FULL, \
+ PS3AV_MODE_WHITE, \
+ PS3AV_MODE_COLOR, \
+ PS3AV_MODE_DITHER, \
+ PS3AV_MODE_HDCP_OFF],
+ [],
+ [],
+ [#include <asm/ps3av.h>]
+)
+
+AC_SUBST([LIBTOOL_DEPS])
+AC_SUBST([DESTDIR])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
+AC_CONFIG_SUBDIRS([lib])
AC_OUTPUT