Skip to content

Commit

Permalink
build: include a dummy config.sub and config.guess in releases
Browse files Browse the repository at this point in the history
There is no hard requirement for a config.guess and config.sub script in
the release tarball. By passing --build=... and --host=... to
./configure, the scripts are not executed.  When doing local builds, the
./autogen.sh script (by running automake) will place a config.guess and
config.sub script in the root of the source tree. Upon creation of the
release ('make dist') tarball, the scripts are replaced by dummy copies
from the build-aux/ directory.

The main advantage to not include these scripts in the repository, is
that there is no need to track upstream updates for them either.

Change-Id: I5e930988a9e849ec5d0c84d2e30e61f2a9685f45
BUG: 1223937
Reported-by: Emmanuel Dreyfus <manu@netbsd.org>
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/14503
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
  • Loading branch information
nixpanic authored and kalebskeithley committed May 24, 2016
1 parent 4394291 commit bfd43dc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ config.*
configure
cscope.*
depcomp
INSTALL
install-sh
ltmain.sh
Makefile
Expand Down
3 changes: 2 additions & 1 deletion Makefile.am
Expand Up @@ -44,7 +44,8 @@ dist-hook: gen-VERSION gen-ChangeLog
-rm -fr $(distdir)/contrib/argp-standalone/autom4te.cache
-rm -fr $(distdir)/contrib/argp-standalone/.deps
-rm -fr $(distdir)/contrib/umountd/.deps
-rm -fr $(distdir)/config.{guess,sub}
-cp -f $(top_srcdir)/build-aux/config.sub.dist $(distdir)/config.sub
-cp -f $(top_srcdir)/build-aux/config.guess.dist $(distdir)/config.guess

.PHONY: gen-VERSION gen-ChangeLog

Expand Down
2 changes: 1 addition & 1 deletion autogen.sh
Expand Up @@ -85,7 +85,7 @@ $TOOL --automake --copy --force
echo Running ${AUTOCONF}...
$AUTOCONF
echo Running ${AUTOMAKE}...
$AUTOMAKE --add-missing --copy --foreign
$AUTOMAKE --add-missing --force-missing --copy --foreign

# Run autogen in the argp-standalone sub-directory
echo "Running autogen.sh in argp-standalone ..."
Expand Down
14 changes: 14 additions & 0 deletions build-aux/config.guess.dist
@@ -0,0 +1,14 @@
#!/bin/sh
#
# This script is intentionally left empty. Distributions that package GlusterFS
# may want to to replace it with an updated copy from the automake project.
#

cat << EOM
It is not expected to execute this script. When you are building from a
released tarball (generated with 'make dist'), you are expected to pass
--build=... and --host=... to ./configure or replace this config.guess script
in the sources with an updated version.
EOM

exit 0
14 changes: 14 additions & 0 deletions build-aux/config.sub.dist
@@ -0,0 +1,14 @@
#!/bin/sh
#
# This script is intentionally left empty. Distributions that package GlusterFS
# may want to to replace it with an updated copy from the automake project.
#

cat << EOM
It is not expected to execute this script. When you are building from a
released tarball (generated with 'make dist'), you are expected to pass
--build=... and --host=... to ./configure or replace this config.sub script in
the sources with an updated version.
EOM

exit 0
12 changes: 10 additions & 2 deletions glusterfs.spec.in
Expand Up @@ -190,13 +190,16 @@ BuildRequires: systemd-units

Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: bison flex
BuildRequires: gcc make automake libtool
BuildRequires: gcc make libtool
BuildRequires: ncurses-devel readline-devel
BuildRequires: libxml2-devel openssl-devel
BuildRequires: libaio-devel libacl-devel
BuildRequires: python-devel
BuildRequires: python-ctypes
BuildRequires: userspace-rcu-devel >= 0.7
%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
BuildRequires: automake
%endif
%if ( 0%{?rhel} && 0%{?rhel} <= 5 )
BuildRequires: e2fsprogs-devel
%else
Expand Down Expand Up @@ -575,7 +578,12 @@ CFLAGS=-DUSE_INSECURE_OPENSSL
export CFLAGS
%endif

./autogen.sh && %configure \
# RHEL6 and earlier need to manually replace config.guess and config.sub
%if ( 0%{?rhel} && 0%{?rhel} <= 6 )
./autogen.sh
%endif

%configure \
%{?_with_cmocka} \
%{?_with_debug} \
%{?_with_tmpfilesdir} \
Expand Down

0 comments on commit bfd43dc

Please sign in to comment.