From 3343a3172e1ae6161a64837866447e06cabf6aca Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Thu, 10 Nov 2016 16:45:48 -0800 Subject: Configure cleanup Signed-off-by: Geoff Levand --- .gitignore | 1 - Makefile.am | 25 ++++--------------- bootstrap | 60 ++------------------------------------------ configure.ac | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac.in | 67 -------------------------------------------------- lib/Makefile.am | 10 ++++---- lib/bootstrap | 45 ++------------------------------- lib/configure.ac | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ lib/configure.ac.in | 67 -------------------------------------------------- lib/m4/README | 0 lib/version.sh | 46 ++++++++++++++++++++++++++++++++++ m4/README | 0 version.sh | 46 ++++++++++++++++++++++++++++++++++ 13 files changed, 245 insertions(+), 261 deletions(-) create mode 100644 configure.ac delete mode 100644 configure.ac.in create mode 100644 lib/configure.ac delete mode 100644 lib/configure.ac.in create mode 100644 lib/m4/README create mode 100755 lib/version.sh create mode 100644 m4/README create mode 100755 version.sh diff --git a/.gitignore b/.gitignore index 13e51c1..d740089 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,6 @@ config.guess config.h.in config.sub config.sub.orig -configure.ac configure depcomp install-sh diff --git a/Makefile.am b/Makefile.am index 4e41fc0..6b70b7c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,19 +1,8 @@ # # Copyright 2007 Sony Corp. # -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# + +AUTOMAKE_OPTIONS = foreign SUBDIRS = lib @@ -125,14 +114,10 @@ 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 $(srcdir)/m4 \ +EXTRA_DIST = bootstrap version.sh $(srcdir)/m4 \ $(addsuffix .in, $(composed_files)) -MAINTAINERCLEANFILES = config.* configure configure.ac depcomp \ - install-sh ltmain.sh Makefile.in missing $(PACKAGE)-*.gz +MAINTAINERCLEANFILES = aclocal.m4 compile config.* configure depcomp \ + install-sh ltmain.sh m4/*.m4 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 1218e9f..e72dad6 100755 --- a/bootstrap +++ b/bootstrap @@ -1,59 +1,3 @@ -#! /bin/bash -# bootstrap -- Use this script to create generated files from a VCS checkout -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#!/bin/sh -version= - -if [ "$1" ]; then - version=$1 -elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then - - # If available, use the git commit revision for the package version. - - # Add a date prefix for easy reading. - # date='2010-11-30 16:36:09 -0800' - - 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' ${date} g ${head}) - - # Add a '-dirty' postfix for uncommitted changes. - - if git diff-index HEAD | read dummy; then - version=`printf '%s%s' ${version} -dirty` - fi -else - # Default to current date and time. - - version="dev-$(date +%y.%m.%d-%H.%M.%S)" -fi - -set -x - -sed -e s,@version@,${version},g configure.ac.in > configure.ac - -aclocal -libtoolize --force --copy -autoheader -automake --foreign --add-missing --copy -autoconf - -pushd lib> /dev/null && ./bootstrap ${version} ; popd > /dev/null +exec autoreconf -f -i diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..f6fa250 --- /dev/null +++ b/configure.ac @@ -0,0 +1,71 @@ +# +# Copyright 2007 Sony Corp. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +AC_INIT([ps3-utils], + [m4_esyscmd_s([./version.sh])], + [Geoff Levand ]) + +AC_CONFIG_MACRO_DIRS([m4]) + +AC_PREFIX_DEFAULT([/usr/local]) + +AS_IF([test "x$CFLAGS" = "x"], [AC_SUBST([CFLAGS], [""])]) + +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_LIBTOOL + +AM_INIT_AUTOMAKE +LT_INIT + +AM_SILENT_RULES([yes]) + +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]) + +AC_OUTPUT diff --git a/configure.ac.in b/configure.ac.in deleted file mode 100644 index a927611..0000000 --- a/configure.ac.in +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright 2007 Sony Corp. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# - -AC_INIT([ps3-utils], [@version@], [Geoff Levand ]) - -AC_CONFIG_MACRO_DIR([m4]) - -AC_PREFIX_DEFAULT([/usr/local]) - -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]) - -AC_OUTPUT diff --git a/lib/Makefile.am b/lib/Makefile.am index 4aa8e90..6d61d7d 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2,6 +2,8 @@ # Copyright 2007 Sony Corp. # +AUTOMAKE_OPTIONS = foreign + ACLOCAL_AMFLAGS = -I m4 AM_CPPFLAGS = $(DEFAULT_CPPFLAGS) @@ -30,9 +32,7 @@ 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 $(srcdir)/m4 - -MAINTAINERCLEANFILES = config.* configure configure.ac Makefile.in +EXTRA_DIST = bootstrap version.sh $(srcdir)/m4 -maintainer-clean-local: - rm -rf m4 +MAINTAINERCLEANFILES = aclocal.m4 compile config.* configure depcomp \ + install-sh ltmain.sh m4/*.m4 Makefile.in missing diff --git a/lib/bootstrap b/lib/bootstrap index 9f28c42..e72dad6 100755 --- a/lib/bootstrap +++ b/lib/bootstrap @@ -1,44 +1,3 @@ -#! /bin/bash -# bootstrap -- Use this script to create generated files from a VCS checkout -# +#!/bin/sh -version= - -if [ "$1" ]; then - version=$1 -elif head=$(git rev-parse --short --verify HEAD 2>/dev/null); then - - # If available, use the git commit revision for the package version. - - # Add a date prefix for easy reading. - # date='2010-11-30 16:36:09 -0800' - - 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' ${date} g ${head}) - - # Add a '-dirty' postfix for uncommitted changes. - - if git diff-index HEAD | read dummy; then - version=`printf '%s%s' ${version} -dirty` - fi -else - # Default to current date and time. - - version="dev-$(date +%y.%m.%d-%H.%M.%S)" -fi - -set -x - -sed -e s,@version@,${version},g configure.ac.in > configure.ac - -aclocal -libtoolize --force --copy -autoheader -automake --foreign --add-missing --copy -autoconf +exec autoreconf -f -i diff --git a/lib/configure.ac b/lib/configure.ac new file mode 100644 index 0000000..e332c57 --- /dev/null +++ b/lib/configure.ac @@ -0,0 +1,68 @@ +# +# Copyright 2007 Sony Corp. +# + +AC_INIT([libps3-utils], + [m4_esyscmd_s([./version.sh])], + [Geoff Levand ]) + +AC_CONFIG_MACRO_DIRS([m4]) + +AC_PREFIX_DEFAULT([/usr/local]) + +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_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 ] +) + +AC_SUBST([LIBTOOL_DEPS]) +AC_SUBST([DESTDIR]) + +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile]) + +AC_OUTPUT diff --git a/lib/configure.ac.in b/lib/configure.ac.in deleted file mode 100644 index bd8704a..0000000 --- a/lib/configure.ac.in +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright 2007 Sony Corp. -# - -AC_INIT([libps3-utils], [@version@], [Geoff Levand ]) - -AC_CONFIG_MACRO_DIR([m4]) - -AC_PREFIX_DEFAULT([/usr/local]) - -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_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 ] -) - -AC_SUBST([LIBTOOL_DEPS]) -AC_SUBST([DESTDIR]) - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_FILES([Makefile]) -AC_CONFIG_SUBDIRS([lib]) - -AC_OUTPUT diff --git a/lib/m4/README b/lib/m4/README new file mode 100644 index 0000000..e69de29 diff --git a/lib/version.sh b/lib/version.sh new file mode 100755 index 0000000..32fd6ec --- /dev/null +++ b/lib/version.sh @@ -0,0 +1,46 @@ +#! /bin/bash +# +# version.sh: create a version string for use by configure.ac + +version= +datefmt='%Y%m%d' + +export GIT_DIR=$(dirname $0)/.git/ + +if head=$(git rev-parse --short=8 --verify HEAD 2>/dev/null); then + + suffix='' + # Add a '-dirty' suffix for uncommitted changes. + if git diff-index HEAD | read dummy; then + suffix=-dirty + fi + + if tag=$(git describe --tags --exact-match 2>/dev/null); then + # use a tag; remove any 'v' prefix from v tags + tag=${tag#v} + version=$(printf "%s%s" ${tag} ${suffix}) + else + # Use the git commit revision for the package version, and add + # a date prefix for easy comparisons. + date=$(git log --pretty=format:"%ct" -1 HEAD) + version=$(printf "%($datefmt)T.g%s%s" ${date} ${head} ${suffix}) + fi +else + # Check if a specific version is set, eg: by buildroot + if [ ! -z "$PACKAGE_VERSION" ]; + then + # Full git hash + len=$(echo -n "${PACKAGE_VERSION}" | wc -c) + if [[ ${len} == 40 ]]; then + version=`echo -n ${PACKAGE_VERSION} | \ + sed "s/^\([0-9a-f]\{7\}\).*/\1/;"` + else + version="$PACKAGE_VERSION" + fi + else + # Default to current date and time. + version="$(date +dev.$datefmt)" + fi +fi + +echo $version diff --git a/m4/README b/m4/README new file mode 100644 index 0000000..e69de29 diff --git a/version.sh b/version.sh new file mode 100755 index 0000000..32fd6ec --- /dev/null +++ b/version.sh @@ -0,0 +1,46 @@ +#! /bin/bash +# +# version.sh: create a version string for use by configure.ac + +version= +datefmt='%Y%m%d' + +export GIT_DIR=$(dirname $0)/.git/ + +if head=$(git rev-parse --short=8 --verify HEAD 2>/dev/null); then + + suffix='' + # Add a '-dirty' suffix for uncommitted changes. + if git diff-index HEAD | read dummy; then + suffix=-dirty + fi + + if tag=$(git describe --tags --exact-match 2>/dev/null); then + # use a tag; remove any 'v' prefix from v tags + tag=${tag#v} + version=$(printf "%s%s" ${tag} ${suffix}) + else + # Use the git commit revision for the package version, and add + # a date prefix for easy comparisons. + date=$(git log --pretty=format:"%ct" -1 HEAD) + version=$(printf "%($datefmt)T.g%s%s" ${date} ${head} ${suffix}) + fi +else + # Check if a specific version is set, eg: by buildroot + if [ ! -z "$PACKAGE_VERSION" ]; + then + # Full git hash + len=$(echo -n "${PACKAGE_VERSION}" | wc -c) + if [[ ${len} == 40 ]]; then + version=`echo -n ${PACKAGE_VERSION} | \ + sed "s/^\([0-9a-f]\{7\}\).*/\1/;"` + else + version="$PACKAGE_VERSION" + fi + else + # Default to current date and time. + version="$(date +dev.$datefmt)" + fi +fi + +echo $version -- cgit 1.2.3-korg