]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Run autoupdate and clean up autoconf usage
authorPaul Smith <psmith@gnu.org>
Mon, 4 Jul 2022 13:47:24 +0000 (09:47 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 9 Jul 2022 14:46:47 +0000 (10:46 -0400)
We can assume that the return type of a signal handler is void.
We can assume that, if sys/time.h exists, it can be included
with time.h.

* bootstrap: Get the latest version
* configure.ac: Require a newer version of autoconf.
Remove unnecessary AC_PROG_CC_C99 (already have AC_PROC_CC).
Remove unnecessary AC_AIX, AC_ISC_POSIX, AC_MINIX.
Remove unnecessary AC_HEADER_STDC, AC_HEADER_TIME, AC_TYPE_SIGNAL.
Use strerror to search for the cposix library.
* src/commands.c (fatal_error_signal): Assume return type is void.
* src/commands.h: Ditto.
* src/job.c: Ditto.
* src/job.h: Ditto.
* src/main.c: Ditto.
* src/makeint.h: Ditto.
Don't bother with TIME_WITH_SYS_TIME.
* src/remote-cstms.c: Check HAVE_SYS_TIME_H.
* src/config.ami.template: Remove RETSIGTYPE.
* src/config.h-vms.template: Ditto.
* src/config.h.W32.template: Ditto.
Remove TIME_WITH_SYS_TIME.

14 files changed:
bootstrap
bootstrap.conf
configure.ac
src/commands.c
src/commands.h
src/config.ami.template
src/config.h-vms.template
src/config.h.W32.template
src/job.c
src/job.h
src/main.c
src/makeint.h
src/posixos.c
src/remote-cstms.c

index 70fd73cc745073f9e5bced1137a6c5115b6d7b6c..1f375eef2fd515a6c2cc07210ddf23a5b32c12e9 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2019-01-04.17; # UTC
+scriptversion=2022-06-04.00; # UTC
 
 # Bootstrap this package from checked-out sources.
 
-# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2022 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
@@ -47,7 +47,7 @@ PERL="${PERL-perl}"
 
 me=$0
 
-default_gnulib_url=git://git.sv.gnu.org/gnulib
+default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
 
 usage() {
   cat <<EOF
@@ -71,7 +71,9 @@ Options:
  --no-git                 do not use git to update gnulib.  Requires that
                           --gnulib-srcdir point to a correct gnulib snapshot
  --skip-po                do not download po files
-
+EOF
+  bootstrap_print_option_usage_hook
+  cat <<EOF
 If the file $me.conf exists in the same directory as this script, its
 contents are read as shell variables to configure the bootstrap.
 
@@ -113,6 +115,12 @@ Running without arguments will suffice in most cases.
 EOF
 }
 
+copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
+copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law."
+
 # warnf_ FORMAT-STRING ARG1...
 warnf_ ()
 {
@@ -154,6 +162,18 @@ gnulib_files=
 : ${AUTOPOINT=autopoint}
 : ${AUTORECONF=autoreconf}
 
+# A function to be called for each unrecognized option.  Returns 0 if
+# the option in $1 has been processed by the function.  Returns 1 if
+# the option has not been processed by the function.  Override it via
+# your own definition in bootstrap.conf
+
+bootstrap_option_hook() { return 1; }
+
+# A function to be called in order to print the --help information
+# corresponding to user-defined command-line options.
+
+bootstrap_print_option_usage_hook() { :; }
+
 # A function to be called right after gnulib-tool is run.
 # Override it via your own definition in bootstrap.conf.
 bootstrap_post_import_hook() { :; }
@@ -170,7 +190,7 @@ po_download_command_format=\
  https://translationproject.org/latest/%s/"
 
 # Prefer a non-empty tarname (4th argument of AC_INIT if given), else
-# fall back to the package name (1st argument with munging)
+# fall back to the package name (1st argument with munging).
 extract_package_name='
   /^AC_INIT(\[*/{
      s///
@@ -187,8 +207,11 @@ extract_package_name='
      p
   }
 '
-package=$(sed -n "$extract_package_name" configure.ac) \
-  || die 'cannot find package name in configure.ac'
+package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null)
+if test -z "$package"; then
+  package=$(sed -n "$extract_package_name" configure.ac) \
+      || die 'cannot find package name in configure.ac'
+fi
 gnulib_name=lib$package
 
 build_aux=build-aux
@@ -290,6 +313,116 @@ find_tool ()
   eval "export $find_tool_envvar"
 }
 
+# Strip blank and comment lines to leave significant entries.
+gitignore_entries() {
+  sed '/^#/d; /^$/d' "$@"
+}
+
+# If $STR is not already on a line by itself in $FILE, insert it at the start.
+# Entries are inserted at the start of the ignore list to ensure existing
+# entries starting with ! are not overridden.  Such entries support
+# whitelisting exceptions after a more generic blacklist pattern.
+insert_if_absent() {
+  file=$1
+  str=$2
+  test -f $file || touch $file
+  test -r $file || die "Error: failed to read ignore file: $file"
+  duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
+  if [ "$duplicate_entries" ] ; then
+    die "Error: Duplicate entries in $file: " $duplicate_entries
+  fi
+  linesold=$(gitignore_entries $file | wc -l)
+  linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
+  if [ $linesold != $linesnew ] ; then
+    { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
+      || die "insert_if_absent $file $str: failed"
+  fi
+}
+
+# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
+# insert_if_absent.
+insert_vc_ignore() {
+  vc_ignore_file="$1"
+  pattern="$2"
+  case $vc_ignore_file in
+  *.gitignore)
+    # A .gitignore entry that does not start with '/' applies
+    # recursively to subdirectories, so prepend '/' to every
+    # .gitignore entry.
+    pattern=$(echo "$pattern" | sed s,^,/,);;
+  esac
+  insert_if_absent "$vc_ignore_file" "$pattern"
+}
+
+symlink_to_dir()
+{
+  src=$1/$2
+  dst=${3-$2}
+
+  test -f "$src" && {
+
+    # If the destination directory doesn't exist, create it.
+    # This is required at least for "lib/uniwidth/cjk.h".
+    dst_dir=$(dirname "$dst")
+    if ! test -d "$dst_dir"; then
+      mkdir -p "$dst_dir"
+
+      # If we've just created a directory like lib/uniwidth,
+      # tell version control system(s) it's ignorable.
+      # FIXME: for now, this does only one level
+      parent=$(dirname "$dst_dir")
+      for dot_ig in x $vc_ignore; do
+        test $dot_ig = x && continue
+        ig=$parent/$dot_ig
+        insert_vc_ignore $ig "${dst_dir##*/}"
+      done
+    fi
+
+    if $copy; then
+      {
+        test ! -h "$dst" || {
+          echo "$me: rm -f $dst" &&
+          rm -f "$dst"
+        }
+      } &&
+      test -f "$dst" &&
+      cmp -s "$src" "$dst" || {
+        echo "$me: cp -fp $src $dst" &&
+        cp -fp "$src" "$dst"
+      }
+    else
+      # Leave any existing symlink alone, if it already points to the source,
+      # so that broken build tools that care about symlink times
+      # aren't confused into doing unnecessary builds.  Conversely, if the
+      # existing symlink's timestamp is older than the source, make it afresh,
+      # so that broken tools aren't confused into skipping needed builds.  See
+      # <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
+      test -h "$dst" &&
+      src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
+      dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
+      test "$src_i" = "$dst_i" &&
+      both_ls=$(ls -dt "$src" "$dst") &&
+      test "X$both_ls" = "X$dst$nl$src" || {
+        dot_dots=
+        case $src in
+        /*) ;;
+        *)
+          case /$dst/ in
+          *//* | */../* | */./* | /*/*/*/*/*/)
+             die "invalid symlink calculation: $src -> $dst";;
+          /*/*/*/*/)    dot_dots=../../../;;
+          /*/*/*/)      dot_dots=../../;;
+          /*/*/)        dot_dots=../;;
+          esac;;
+        esac
+
+        echo "$me: ln -fs $dot_dots$src $dst" &&
+        ln -fs "$dot_dots$src" "$dst"
+      }
+    fi
+  }
+}
+
 # Override the default configuration, if necessary.
 # Make sure that bootstrap.conf is sourced from the current directory
 # if we were invoked as "sh bootstrap".
@@ -320,6 +453,12 @@ do
   --help)
     usage
     exit;;
+  --version)
+    set -e
+    echo "bootstrap $scriptversion"
+    echo "$copyright"
+    exit 0
+    ;;
   --gnulib-srcdir=*)
     GNULIB_SRCDIR=${option#--gnulib-srcdir=};;
   --skip-po)
@@ -335,7 +474,7 @@ do
   --no-git)
     use_git=false;;
   *)
-    die "$option: unknown option";;
+    bootstrap_option_hook $option || die "$option: unknown option";;
   esac
 done
 
@@ -346,50 +485,9 @@ if test -n "$checkout_only_file" && test ! -r "$checkout_only_file"; then
   die "Bootstrapping from a non-checked-out distribution is risky."
 fi
 
-# Strip blank and comment lines to leave significant entries.
-gitignore_entries() {
-  sed '/^#/d; /^$/d' "$@"
-}
-
-# If $STR is not already on a line by itself in $FILE, insert it at the start.
-# Entries are inserted at the start of the ignore list to ensure existing
-# entries starting with ! are not overridden.  Such entries support
-# whitelisting exceptions after a more generic blacklist pattern.
-insert_if_absent() {
-  file=$1
-  str=$2
-  test -f $file || touch $file
-  test -r $file || die "Error: failed to read ignore file: $file"
-  duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
-  if [ "$duplicate_entries" ] ; then
-    die "Error: Duplicate entries in $file: " $duplicate_entries
-  fi
-  linesold=$(gitignore_entries $file | wc -l)
-  linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
-  if [ $linesold != $linesnew ] ; then
-    { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
-      || die "insert_if_absent $file $str: failed"
-  fi
-}
-
-# Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
-# insert_if_absent.
-insert_vc_ignore() {
-  vc_ignore_file="$1"
-  pattern="$2"
-  case $vc_ignore_file in
-  *.gitignore)
-    # A .gitignore entry that does not start with '/' applies
-    # recursively to subdirectories, so prepend '/' to every
-    # .gitignore entry.
-    pattern=$(echo "$pattern" | sed s,^,/,);;
-  esac
-  insert_if_absent "$vc_ignore_file" "$pattern"
-}
-
 # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
 found_aux_dir=no
-grep '^[        ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'\])' configure.ac \
+grep '^[        ]*AC_CONFIG_AUX_DIR(\['"$build_aux"'])' configure.ac \
     >/dev/null && found_aux_dir=yes
 grep '^[        ]*AC_CONFIG_AUX_DIR('"$build_aux"')' configure.ac \
     >/dev/null && found_aux_dir=yes
@@ -665,9 +763,26 @@ if $use_gnulib; then
       shallow=
       if test -z "$GNULIB_REVISION"; then
         git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+        git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
+          || cleanup_gnulib
+      else
+        git fetch -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
+        mkdir -p "$gnulib_path"
+        # Only want a shallow checkout of $GNULIB_REVISION, but git does not
+        # support cloning by commit hash. So attempt a shallow fetch by commit
+        # hash to minimize the amount of data downloaded and changes needed to
+        # be processed, which can drastically reduce download and processing
+        # time for checkout. If the fetch by commit fails, a shallow fetch can
+        # not be performed because we do not know what the depth of the commit
+        # is without fetching all commits. So fallback to fetching all commits.
+        git -C "$gnulib_path" init
+        git -C "$gnulib_path" remote add origin \
+            ${GNULIB_URL:-$default_gnulib_url}
+        git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \
+          || git -C "$gnulib_path" fetch origin \
+          || cleanup_gnulib
+        git -C "$gnulib_path" reset --hard FETCH_HEAD
       fi
-      git clone $shallow ${GNULIB_URL:-$default_gnulib_url} "$gnulib_path" \
-        || cleanup_gnulib
 
       trap - 1 2 13 15
     fi
@@ -784,75 +899,6 @@ case $SKIP_PO in
   fi;;
 esac
 
-symlink_to_dir()
-{
-  src=$1/$2
-  dst=${3-$2}
-
-  test -f "$src" && {
-
-    # If the destination directory doesn't exist, create it.
-    # This is required at least for "lib/uniwidth/cjk.h".
-    dst_dir=$(dirname "$dst")
-    if ! test -d "$dst_dir"; then
-      mkdir -p "$dst_dir"
-
-      # If we've just created a directory like lib/uniwidth,
-      # tell version control system(s) it's ignorable.
-      # FIXME: for now, this does only one level
-      parent=$(dirname "$dst_dir")
-      for dot_ig in x $vc_ignore; do
-        test $dot_ig = x && continue
-        ig=$parent/$dot_ig
-        insert_vc_ignore $ig "${dst_dir##*/}"
-      done
-    fi
-
-    if $copy; then
-      {
-        test ! -h "$dst" || {
-          echo "$me: rm -f $dst" &&
-          rm -f "$dst"
-        }
-      } &&
-      test -f "$dst" &&
-      cmp -s "$src" "$dst" || {
-        echo "$me: cp -fp $src $dst" &&
-        cp -fp "$src" "$dst"
-      }
-    else
-      # Leave any existing symlink alone, if it already points to the source,
-      # so that broken build tools that care about symlink times
-      # aren't confused into doing unnecessary builds.  Conversely, if the
-      # existing symlink's timestamp is older than the source, make it afresh,
-      # so that broken tools aren't confused into skipping needed builds.  See
-      # <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00326.html>.
-      test -h "$dst" &&
-      src_ls=$(ls -diL "$src" 2>/dev/null) && set $src_ls && src_i=$1 &&
-      dst_ls=$(ls -diL "$dst" 2>/dev/null) && set $dst_ls && dst_i=$1 &&
-      test "$src_i" = "$dst_i" &&
-      both_ls=$(ls -dt "$src" "$dst") &&
-      test "X$both_ls" = "X$dst$nl$src" || {
-        dot_dots=
-        case $src in
-        /*) ;;
-        *)
-          case /$dst/ in
-          *//* | */../* | */./* | /*/*/*/*/*/)
-             die "invalid symlink calculation: $src -> $dst";;
-          /*/*/*/*/)    dot_dots=../../../;;
-          /*/*/*/)      dot_dots=../../;;
-          /*/*/)        dot_dots=../;;
-          esac;;
-        esac
-
-        echo "$me: ln -fs $dot_dots$src $dst" &&
-        ln -fs "$dot_dots$src" "$dst"
-      }
-    fi
-  }
-}
-
 version_controlled_file() {
   parent=$1
   file=$2
@@ -970,7 +1016,7 @@ bootstrap_post_import_hook \
 # Uninitialized submodules are listed with an initial dash.
 if $use_git && git submodule | grep '^-' >/dev/null; then
   die "some git submodules are not initialized. "     \
-      "Run 'git submodule init' and bootstrap again."
+      "Run 'git submodule update --init' and bootstrap again."
 fi
 
 # Remove any dangling symlink matching "*.m4" or "*.[ch]" in some
@@ -1064,7 +1110,7 @@ bootstrap_epilogue
 
 echo "$0: done.  Now you can run './configure'."
 
-# Local variables:
+# Local Variables:
 # eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
index af397c5465421119c780fb0ef02321bb95796fec..74c87b27fa94b748e52d984d5f4cdbffa6f1a684 100644 (file)
@@ -18,6 +18,9 @@
 # Allow bootstrap to know that this is not a package
 checkout_only_file=README.git
 
+# Always copy files rather than symlink
+copy=true
+
 # Additional xgettext options to use.  Use "\\\newline" to break lines.
 # Ensure that all our magical output macros are correctly marked as
 # C (printf) format strings.
index 3564e237083a3c1b8591f4b9d4a8675bf457c41f..d43cfd783688163d02b80a21aa19bb55351d55f4 100644 (file)
@@ -18,7 +18,7 @@
 
 AC_INIT([GNU make],[4.3.90],[bug-make@gnu.org])
 
-AC_PREREQ([2.69])
+AC_PREREQ([2.71])
 
 # Autoconf setup
 AC_CONFIG_AUX_DIR([build-aux])
@@ -38,9 +38,6 @@ AM_INIT_AUTOMAKE([1.16.1 foreign -Werror -Wall])
 AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_CC
 
-# GNU Gnulib requires C99, so I guess we might as well too...
-AC_PROG_CC_C99
-
 # Configure gnulib
 gl_EARLY
 gl_INIT
@@ -54,9 +51,6 @@ AC_CHECK_PROG([PERL], [perl], [perl], [perl])
 
 # Specialized system macros
 AC_CANONICAL_HOST
-AC_AIX
-AC_ISC_POSIX
-AC_MINIX
 AC_C_BIGENDIAN
 
 # Enable gettext, in "external" mode.
@@ -69,20 +63,18 @@ AM_GNU_GETTEXT([external])
 AC_SYS_LARGEFILE
 
 # Checks for libraries.
+AC_SEARCH_LIBS([strerror],[cposix])
 AC_SEARCH_LIBS([getpwnam], [sun])
 
-# Checks for header files.
-AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_STAT
-AC_HEADER_TIME
+
 AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
-                  memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
+                  memory.h sys/param.h sys/resource.h sys/timeb.h sys/time.h \
                   sys/select.h sys/file.h spawn.h])
 
 AM_PROG_CC_C_O
 AC_C_CONST
-AC_TYPE_SIGNAL
 AC_TYPE_UID_T
 AC_TYPE_PID_T
 AC_TYPE_OFF_T
@@ -254,8 +246,7 @@ AS_IF([test "$PATH_SEPARATOR" = ';'],
 AC_SUBST([REMOTE]) REMOTE=stub
 use_customs=false
 AC_ARG_WITH([customs],
-[AC_HELP_STRING([--with-customs=DIR],
-                [enable remote jobs via Customs--see README.customs])],
+[AS_HELP_STRING([--with-customs=DIR],[enable remote jobs via Customs--see README.customs])],
 [ AS_CASE([$withval], [n|no], [:],
     [make_cppflags="$CPPFLAGS"
      AS_CASE([$withval],
@@ -278,14 +269,12 @@ AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
 # See if the user asked to handle case insensitive file systems.
 AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
 AC_ARG_ENABLE([case-insensitive-file-system],
-  AC_HELP_STRING([--enable-case-insensitive-file-system],
-                 [assume file systems are case insensitive]),
+  AS_HELP_STRING([--enable-case-insensitive-file-system],[assume file systems are case insensitive]),
   [AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
 
 # See if we can handle the job server feature, and if the user wants it.
 AC_ARG_ENABLE([job-server],
-  AC_HELP_STRING([--disable-job-server],
-                 [disallow recursive make communication during -jN]),
+  AS_HELP_STRING([--disable-job-server],[disallow recursive make communication during -jN]),
   [make_cv_job_server="$enableval" user_job_server="$enableval"],
   [make_cv_job_server="yes"])
 
@@ -323,8 +312,7 @@ AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
   [[#include <dlfcn.h>]])
 
 AC_ARG_ENABLE([load],
-  AC_HELP_STRING([--disable-load],
-                 [disable support for the 'load' operation]),
+  AS_HELP_STRING([--disable-load],[disable support for the 'load' operation]),
   [make_cv_load="$enableval" user_load="$enableval"],
   [make_cv_load="yes"])
 
@@ -374,8 +362,7 @@ AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
 # Use posix_spawn if we have support and the user didn't disable it
 
 AC_ARG_ENABLE([posix-spawn],
-  AC_HELP_STRING([--disable-posix-spawn],
-                 [disable support for posix_spawn()]),
+  AS_HELP_STRING([--disable-posix-spawn],[disable support for posix_spawn()]),
   [make_cv_posix_spawn="$enableval" user_posix_spawn="$enableval"],
   [make_cv_posix_spawn="yes"])
 
index c048004b74ca8752f3dc66cff5948d4d582faf20..154d5dea50f17b93955153cc8508cb1a8f55b3f0 100644 (file)
@@ -482,7 +482,7 @@ int handling_fatal_signal = 0;
 
 /* Handle fatal signals.  */
 
-RETSIGTYPE
+void
 fatal_error_signal (int sig)
 {
 #ifdef __MSDOS__
index 48df68c769f228e6da289814014a4f300368a52c..508157f2bd42546c62277b1052df181839031a27 100644 (file)
@@ -37,7 +37,7 @@ struct commands
 struct file;
 struct child;
 
-RETSIGTYPE fatal_error_signal (int sig);
+void fatal_error_signal (int sig);
 void execute_file_commands (struct file *file);
 void print_commands (const struct commands *cmds);
 void delete_child_targets (struct child *child);
index 4628452fc36eef58f019f5b27b00b8cc4c3dda58..0e8373189e5276456ea14f521616b8b92830752e 100644 (file)
@@ -134,9 +134,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Define if you need to in order for stat and other things to work.  */
 /* #undef _POSIX_SOURCE */
 
-/* Define as the return type of signal handlers (int or void).  */
-#define RETSIGTYPE void
-
 /* Define if the setvbuf function takes the buffering type as its second
    argument and the buffer pointer as the third, as on System V
    before release 3.  */
index fb3e770845c348ebe8b86d4df16fd9cc778f7229..00dc521826eef85babc14226848cdf85017f9f72 100644 (file)
@@ -172,9 +172,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* Define to 1 if you need to in order for stat and other things to work.  */
 /* #undef _POSIX_SOURCE */
 
-/* Define as the return type of signal handlers (int or void).  */
-#define RETSIGTYPE void
-
 /* Define to 1 if the setvbuf function takes the buffering type as its second
    argument and the buffer pointer as the third, as on System V
    before release 3.  */
index 9ac3c61b2d604b7b4ad1c5047bf00d2ebec6b789..bb1bffa99a3e544f7f38f1d9faf5201289bfb14e 100644 (file)
@@ -404,9 +404,6 @@ char *ttyname (int);
 /* Define to the character that separates directories in PATH. */
 #define PATH_SEPARATOR_CHAR ';'
 
-/* Define as the return type of signal handlers ('int' or 'void'). */
-#define RETSIGTYPE void
-
 /* Define to the name of the SCCS 'get' command. */
 #define SCCS_GET "echo no sccs get"
 
@@ -438,11 +435,6 @@ char *ttyname (int);
 /* Define to 1 on System V Release 4. */
 /* #undef SVR4 */
 
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#ifdef __MINGW32__
-#define TIME_WITH_SYS_TIME 1
-#endif
-
 /* Define to 1 for Encore UMAX. */
 /* #undef UMAX */
 
index b68fb63804deb7dc01a778c6ca6de4b0997d9cd8..8e61c06680c6b9e64acdb234fa8ace454dc86cff 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -609,7 +609,7 @@ child_error (struct child *child,
 
 static unsigned int dead_children = 0;
 
-RETSIGTYPE
+void
 child_handler (int sig UNUSED)
 {
   ++dead_children;
index 7a06f81f54696dbb3d39268827c2ad7603b865c9..35dab0052f638b52b9b3bf9e753a795e5bd5cf11 100644 (file)
--- a/src/job.h
+++ b/src/job.h
@@ -68,7 +68,7 @@ struct child
 extern struct child *children;
 
 /* A signal handler for SIGCHLD, if needed.  */
-RETSIGTYPE child_handler (int sig);
+void child_handler (int sig);
 int is_bourne_compatible_shell(const char *path);
 void new_job (struct file *file);
 void reap_children (int block, int err);
index 859846f408f38391611699e43ce6ba0e5e202446..5d8792b0ec136d18bc4c4aa81da31bee02d25269 100644 (file)
@@ -607,7 +607,7 @@ int fatal_signal_mask;
 # if !defined HAVE_SIGACTION
 #  define bsd_signal signal
 # else
-typedef RETSIGTYPE (*bsd_signal_ret_t) (int);
+typedef void (*bsd_signal_ret_t) (int);
 
 static bsd_signal_ret_t
 bsd_signal (int sig, bsd_signal_ret_t func)
@@ -724,7 +724,7 @@ expand_command_line_file (const char *name)
 /* Toggle -d on receipt of SIGUSR1.  */
 
 #ifdef SIGUSR1
-static RETSIGTYPE
+static void
 debug_signal_handler (int sig UNUSED)
 {
   db_level = db_level ? DB_NONE : DB_BASIC;
index 47c7a6005f79fdaf07e52aaa3f0d4590ca562327..c37b1a0d138721aa46858d7915709c7a03c7ada2 100644 (file)
@@ -94,16 +94,10 @@ char *alloca ();
    unless <sys/timeb.h> has been included first.  */
 # include <sys/timeb.h>
 #endif
-#if TIME_WITH_SYS_TIME
+#if HAVE_SYS_TIME_H
 # include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-#  include <sys/time.h>
-# else
-#  include <time.h>
-# endif
 #endif
+#include <time.h>
 
 #include <errno.h>
 
@@ -138,10 +132,6 @@ extern int errno;
 # define POSIX 1
 #endif
 
-#ifndef RETSIGTYPE
-# define RETSIGTYPE     void
-#endif
-
 #ifndef sigmask
 # define sigmask(sig)   (1 << ((sig) - 1))
 #endif
index f6adc6859da8829bb25f61a20b3bb3d0fd5ff807..9eecfcde287f60e8c7e7f8a2c78e0afef874c207 100644 (file)
@@ -356,7 +356,7 @@ jobserver_acquire (int timeout)
    during the section mentioned above, the read(2) will be invoked with an
    invalid FD and will return immediately with EBADF.  */
 
-static RETSIGTYPE
+static void
 job_noop (int sig UNUSED)
 {
 }
index ce1a33f3dadb23537ef04defb068944c0736ab5e..49cea18b3ad33340e99444aa3a33931caa7d445d 100644 (file)
@@ -25,7 +25,9 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "commands.h"
 #include "debug.h"
 
-#include <sys/time.h>
+#if HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
 #include <netdb.h>
 
 #include "customs.h"