From 66760ee42fd8c627cb2a32fea23908f3e08d164c Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sun, 25 Feb 2007 18:38:41 +0100 Subject: [PATCH] Update to use gnulib, and newer autoconf, automake conventions. Add build-from-checkout instructions. * README-hacking: New file. Mostly copied from coreutils' README-cvs. * bootstrap: Generate ChangeLog here, if needed/possible, before invoking tools that require its presence. * autogen.sh: Remove this file. It's superseded by bootstrap. Use gnulib, modernize some uses of autoconf, automake, etc. * bootstrap, bootstrap.conf: New files. * configure.ac: Modernize. Require the latest stable releases: autoconf-2.61, automake-1.10. Require gettext-0.15. Use more modern form of AC_INIT, etc. Now that the version string must be hard-coded in the AC_INIT line, add code to ensure it agrees with the PED_* and LT_* variables. Use AM_CPPFLAGS, not CFLAGS Remove obsolete setting of ALL_LINGUAS. Don't set CFLAGS=-D_GNU_SOURCE=1 explicitly , since that's already done via AC_GNU_SOURCE, which gnulib pulls in by default, through gl_EARLY. Use gl_INIT and gl_EARLY. * Makefile.am (SUBDIRS): Add lib. (EXTRA_DIST): Remove names that are automatically included. * lib/Makefile.am: New file. --- Makefile.am | 15 +++++------ README-hacking | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ autogen.sh | 10 -------- bootstrap.conf | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 40 ++++++++++++++--------------- lib/Makefile.am | 1 + 6 files changed, 174 insertions(+), 40 deletions(-) create mode 100644 README-hacking delete mode 100755 autogen.sh create mode 100644 bootstrap.conf create mode 100644 lib/Makefile.am diff --git a/Makefile.am b/Makefile.am index 1ab5f13..9dbbd09 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,13 +1,8 @@ ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = po libparted parted partprobe include doc debug +SUBDIRS = po lib libparted parted partprobe include doc debug -EXTRA_DIST = config.rpath \ - ABOUT-NLS \ - AUTHORS \ +EXTRA_DIST = \ BUGS \ - COPYING \ - THANKS \ - TODO \ libparted.pc.in \ parted.spec.in \ parted.m4 \ @@ -28,7 +23,7 @@ dist-hook: parted.spec baseline_file = ${top_srcdir}/scripts/data/abi/baseline_symbols.txt extract_symvers = $(top_srcdir)/scripts/extract_symvers -current_symbols.txt: ${extract_symvers} +current_symbols.txt: ${extract_symvers} -@(sh ${extract_symvers} libparted/.libs/libparted.so current_symbols.txt) baseline_symbols: @@ -58,6 +53,8 @@ check-abi: baseline_symbols current_symbols.txt && (echo "ABI has changed. Please, update you ABI package version."; exit 1) \ || exit 0 +MOSTLYCLEANDIRS = m4 + MAINTAINERCLEANFILES = ABOUT-NLS \ ChangeLog \ INSTALL \ @@ -73,4 +70,4 @@ MAINTAINERCLEANFILES = ABOUT-NLS \ install-sh \ ltmain.sh \ missing \ - mkinstalldirs \ No newline at end of file + mkinstalldirs diff --git a/README-hacking b/README-hacking new file mode 100644 index 0000000..a42557d --- /dev/null +++ b/README-hacking @@ -0,0 +1,70 @@ +-*- outline -*- + +These notes intend to help people working on the checked-out sources. +These requirements do not apply when building from a distribution tarball. + +* Requirements + +Only the sources are installed in the GIT repository (to ease the +maintenance, merges etc.), therefore you will have to get the latest +stable versions of the maintainer tools we depend upon, including: + +- Automake +- Autoconf +- Bison +- Gettext +- Gzip +- Libtool +- Tar +- Wget + +As of this writing, the latest stable version of Gzip is 1.2.4 but we +suggest using test version 1.3.5 (or later, if one becomes available). + +Valgrind is also highly recommended, if +Valgrind supports your architecture. + +Only building the initial full source tree will be a bit painful. +Later, a plain `git-pull && make' should be sufficient. + +* First GIT checkout + +Obviously, if you are reading these notes, you did manage to check out +this package from GIT. The next step is to get other files needed to +build, which are extracted from other source packages: + + $ ./bootstrap + +And there you are! Just + + $ ./configure + $ make + $ make check + +At this point, there should be no difference between your local copy, +and the GIT master copy: + + $ git-diff + +should output no difference. + +Enjoy! + +----- + +Copyright (C) 2002-2007 Free Software Foundation, Inc. + +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., 51 Franklin Street, Fifth Floor, Boston, MA +02110-1301, USA. diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index e165239..0000000 --- a/autogen.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -git log --pretty=medium | fold -s > ChangeLog -mkdir -p m4 -aclocal -I m4 -autoconf -f -autoheader -autopoint -f -libtoolize -c -f -automake -a -c diff --git a/bootstrap.conf b/bootstrap.conf new file mode 100644 index 0000000..b874d93 --- /dev/null +++ b/bootstrap.conf @@ -0,0 +1,78 @@ +# Bootstrap configuration. + +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. + +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + + +# We don't need these modules, even though gnulib-tool mistakenly +# includes them because of gettext and fchdir dependencies. +avoided_gnulib_modules=' + --avoid=lock + --avoid=size_max + --avoid=xsize + --avoid=canonicalize-lgpl +' + +# These modules are obsolete and can probably be removed soon, +# but leave them in for now to minimize changes. +obsolete_gnulib_modules=' + atexit free memchr memcmp memcpy memmove memset rename + strcspn strtod strtol utime +' + +# gnulib modules used by this package. +gnulib_modules=" + $avoided_gnulib_modules + $obsolete_gnulib_modules + alloca announce-gen assert + calloc config-h configmake + closeout + fdl + gettext + gnupload + inttypes + lib-ignore + malloc + realloc + rpmatch + safe-read + stdbool + version-etc-fsf +" + +# Additional xgettext options to use. Use "\\\newline" to break lines. +XGETTEXT_OPTIONS=$XGETTEXT_OPTIONS'\\\ + --from-code=UTF-8\\\ + --flag=asprintf:2:c-format --flag=vasprintf:2:c-format\\\ + --flag=asnprintf:3:c-format --flag=vasnprintf:3:c-format\\\ + --flag=wrapf:1:c-format\\\ +' + +# Gettext supplies these files, but we don't need them since +# we don't have an intl subdirectory. +excluded_files=' + m4/glibc2.m4 + m4/intdiv0.m4 + m4/lcmessage.m4 + m4/lock.m4 + m4/printf-posix.m4 + m4/size_max.m4 + m4/uintmax_t.m4 + m4/ulonglong.m4 + m4/visibility.m4 + m4/xsize.m4 +' diff --git a/configure.ac b/configure.ac index 38b17f6..5d65ead 100644 --- a/configure.ac +++ b/configure.ac @@ -4,9 +4,13 @@ dnl Free Software Foundation, Inc. dnl dnl This file may be modified and/or distributed without restriction. -AC_PREREQ(2.50) +AC_PREREQ(2.61) +AC_INIT([GNU parted],[1.9.9],[bug-parted@gnu.org]) -AC_INIT(include/parted/parted.h) +AC_CONFIG_SRCDIR(include/parted/parted.h) + +AC_CONFIG_HEADERS([lib/config.h:lib/config.h.in]) +AC_CONFIG_AUX_DIR(build-aux) dnl Versioning dnl Shamelessly pulled straight from glib's configure.in ... @@ -30,18 +34,17 @@ LT_RELEASE=$PED_MAJOR_VERSION.$PED_MINOR_VERSION LT_CURRENT=`expr $PED_MICRO_VERSION - $PED_INTERFACE_AGE` LT_REVISION=$PED_INTERFACE_AGE LT_AGE=`expr $PED_BINARY_AGE - $PED_INTERFACE_AGE` - AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) -PACKAGE=parted -VERSION=$PED_VERSION - -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +# Ensure that the PED_*-specified version is the same as the literal +# in the AC_INIT line, above. +test $PACKAGE_VERSION = $PED_VERSION || + AC_MSG_ERROR(configure.ac: version mismatch: $PACKAGE_VERSION != $PED_VERSION) -AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE([1.10 dist-bzip2]) AC_CANONICAL_HOST case "$host_os" in @@ -159,21 +162,23 @@ fi dnl make libc threadsafe (not required for us, but useful other users of dnl libparted) -CFLAGS="$CFLAGS -D_REENTRANT" +AM_CPPFLAGS="$AM_CPPFLAGS -D_REENTRANT" dnl Check for programs. AC_ISC_POSIX AC_PROG_CC AC_PROG_GCC_TRADITIONAL AM_PROG_CC_C_O -AC_GNU_SOURCE + +gl_EARLY dnl This test must come as early as possible after the compiler configuration dnl tests, because the choice of the file model can (in principle) affect dnl whether functions and headers are available, whether they work, etc. AC_SYS_LARGEFILE -CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=${ac_cv_sys_file_offset_bits}" +gl_INIT + AC_CHECK_SIZEOF(off_t, 64, [ #include #include @@ -193,11 +198,8 @@ libraries.) fi AM_PROG_LIBTOOL -dnl Initialize i18n: -ALL_LINGUAS="ca cs da de es fr gl id it ja nl nn hu pl pt pt_BR ru sv tr uk vi zh_CN zh_TW" -AM_GNU_GETTEXT_VERSION([0.12.1]) +AM_GNU_GETTEXT_VERSION([0.15]) AM_GNU_GETTEXT([external]) -CFLAGS="$CFLAGS -DLOCALEDIR=\"\\\"$datadir/locale\\\"\"" if test "$USE_INCLUDED_LIBINTL" = "yes"; then AC_MSG_ERROR( GNU Parted requires gettext to be installed for compilation - @@ -328,8 +330,6 @@ dnl Check for OS specific libraries dnl GNU/Hurd: if test "$OS" = gnu; then - CFLAGS="$CFLAGS -D_GNU_SOURCE=1" - dnl libshouldbeinlibc AC_CHECK_LIB(shouldbeinlibc, vm_deallocate, OS_LIBS="$OS_LIBS -lshouldbeinlibc", @@ -460,12 +460,9 @@ if test "$with_readline" = yes; then LIBS="$OLD_LIBS" fi -OLD_CFLAGS="$CFLAGS" -CFLAGS=-D_GNU_SOURCE=1 AC_CHECK_FUNCS(canonicalize_file_name) -CFLAGS="$OLD_CFLAGS" -CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format" +# CFLAGS="$CFLAGS -W -Wall -Wno-unused -Wno-switch -Wno-format" if test "$enable_Werror" = yes; then CFLAGS="$CFLAGS -Werror" @@ -479,6 +476,7 @@ AC_SUBST(BUILDINFO) AC_OUTPUT([ Makefile +lib/Makefile include/Makefile include/parted/Makefile libparted/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am new file mode 100644 index 0000000..6635f70 --- /dev/null +++ b/lib/Makefile.am @@ -0,0 +1 @@ +include gnulib.mk -- 2.11.0