[PATCH 0/7] Yet more Makefile/configure cleanups

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/7] Yet more Makefile/configure cleanups

Jon TURNEY
For ease of reviewing, this patch series doesn't contain changes to
generated files which would be made by an autoreconf.

Jon Turney (7):
  Remove intro2man.stamp on clean
  Drop AC_SUBST(build_exeext)
  Remove autoconf variable DLL_NAME
  Drop autoconf variable all_host
  Remove Makefile contents conditional on PREPROCESS, which is never
    defined
  Remove rules for building libcygwin_s.a
  Drop passing '-c' compiler flag into gentls_offsets

 winsup/cygserver/configure.ac | 11 ------
 winsup/cygwin/Makefile.in     | 36 +++-----------------
 winsup/cygwin/configure.ac    | 14 --------
 winsup/cygwin/mkstatic        | 63 -----------------------------------
 winsup/doc/Makefile.in        |  5 +--
 winsup/doc/configure.ac       |  2 --
 6 files changed, 8 insertions(+), 123 deletions(-)
 delete mode 100755 winsup/cygwin/mkstatic

--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 1/7] Remove intro2man.stamp on clean

Jon TURNEY
---
 winsup/doc/Makefile.in | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/winsup/doc/Makefile.in b/winsup/doc/Makefile.in
index bcf0c1fb2..cb46a91cf 100644
--- a/winsup/doc/Makefile.in
+++ b/winsup/doc/Makefile.in
@@ -61,8 +61,9 @@ clean:
  rm -f Makefile.dep
  rm -f *.html *.html.gz
  rm -Rf cygwin-api cygwin-ug cygwin-ug-net faq
- rm -f *.1 utils2man.stamp
- rm -f *.3 api2man.stamp
+ rm -f api2man.stamp intro2man.stamp utils2man.stamp
+ rm -f *.1
+ rm -f *.3
  rm -f *.info* charmap
 
 install: install-all
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 2/7] Drop AC_SUBST(build_exeext)

Jon TURNEY
In reply to this post by Jon TURNEY
The autoconf variable build_exeext isn't defined, and (since the doc
subdirectory doesn't build any executables) it's value isn't used.
---
 winsup/doc/configure.ac | 2 --
 1 file changed, 2 deletions(-)

diff --git a/winsup/doc/configure.ac b/winsup/doc/configure.ac
index 8364dc79e..32e52415a 100644
--- a/winsup/doc/configure.ac
+++ b/winsup/doc/configure.ac
@@ -20,7 +20,5 @@ AC_CANONICAL_TARGET
 
 AC_PROG_CC
 
-AC_SUBST(build_exeext)
-
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 3/7] Remove autoconf variable DLL_NAME

Jon TURNEY
In reply to this post by Jon TURNEY
Remove autoconf variable DLL_NAME, which has a constant value which is
only used in one place.
---
 winsup/cygwin/Makefile.in  | 4 ++--
 winsup/cygwin/configure.ac | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index cb9924b3a..89e1b7567 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -102,8 +102,8 @@ RUNTESTFLAGS =
 # native rebuilding issues (we don't want the build tools to see a partially
 # built cygwin.dll and attempt to use it instead of the old one).
 
-DLL_NAME:=@DLL_NAME@
-TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,@DLL_NAME@}
+DLL_NAME:=cygwin1.dll
+TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,$(DLL_NAME)}
 TEST_LIB_NAME:=libcygwin0.a
 STATIC_LIB_NAME:=libcygwin_s.a
 DIN_FILE=@DIN_FILE@ common.din
diff --git a/winsup/cygwin/configure.ac b/winsup/cygwin/configure.ac
index aafc4d925..658247099 100644
--- a/winsup/cygwin/configure.ac
+++ b/winsup/cygwin/configure.ac
@@ -61,14 +61,12 @@ esac
 
 case "$target_cpu" in
    i?86)
- DLL_NAME="cygwin1.dll"
  DLL_ENTRY="_dll_entry@12"
  DEF_DLL_ENTRY="dll_entry@12"
  DIN_FILE="i686.din"
  TLSOFFSETS_H="tlsoffsets.h"
  ;;
    x86_64)
- DLL_NAME="cygwin1.dll"
  DLL_ENTRY="dll_entry"
  DEF_DLL_ENTRY="dll_entry"
  DIN_FILE="x86_64.din"
@@ -78,7 +76,6 @@ case "$target_cpu" in
 esac
 
 AC_CONFIGURE_ARGS
-AC_SUBST(DLL_NAME)
 AC_SUBST(DLL_ENTRY)
 AC_SUBST(DEF_DLL_ENTRY)
 AC_SUBST(DIN_FILE)
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 4/7] Drop autoconf variable all_host

Jon TURNEY
In reply to this post by Jon TURNEY
The autoconf variable all_host is used to make building of the stub
library used by the testsuite conditional on not cross-compiling.

Make it unconditional, so we will notice if it's broken when
cross-compiling.
---
 winsup/cygserver/configure.ac | 11 -----------
 winsup/cygwin/Makefile.in     | 10 ++--------
 winsup/cygwin/configure.ac    | 11 -----------
 3 files changed, 2 insertions(+), 30 deletions(-)

diff --git a/winsup/cygserver/configure.ac b/winsup/cygserver/configure.ac
index 4ff784e47..e1b29debf 100644
--- a/winsup/cygserver/configure.ac
+++ b/winsup/cygserver/configure.ac
@@ -27,17 +27,6 @@ AC_LANG(C++)
 
 AC_CYGWIN_INCLUDES
 
-case "$with_cross_host" in
-  ""|*cygwin*)
-    all_host="all_host"
-    ;;
-  *)
-    all_host=
-    ;;
-esac
-
-AC_SUBST(all_host)
-
 AC_CHECK_TOOL(AR, ar, ar)
 AC_CHECK_TOOL(AS, as, as)
 AC_CHECK_TOOL(RANLIB, ranlib, ranlib)
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 89e1b7567..9b07d9833 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -572,17 +572,11 @@ exec_CFLAGS:=-fno-builtin-execve
 fhandler_proc_CFLAGS+=-DUSERNAME="\"$(USER)\"" -DHOSTNAME="\"$(HOSTNAME)\""
 fhandler_proc_CFLAGS+=-DGCC_VERSION="\"`$(CC) -v 2>&1 | tail -n 1`\""
 
-.PHONY: all force dll_ofiles install all_target all_host \
+.PHONY: all force dll_ofiles install \
  install install-libs install-headers \
  clean distclean realclean maintainer-clean
 
-all_host=@all_host@
-
-all: all_target $(all_host)
-
-all_target: $(TARGET_LIBS)
-
-all_host: $(TEST_LIB_NAME)
+all: $(TARGET_LIBS) $(TEST_LIB_NAME)
 
 force:
 
diff --git a/winsup/cygwin/configure.ac b/winsup/cygwin/configure.ac
index 658247099..cf9bbaba1 100644
--- a/winsup/cygwin/configure.ac
+++ b/winsup/cygwin/configure.ac
@@ -29,17 +29,6 @@ AC_LANG(C++)
 
 AC_CYGWIN_INCLUDES
 
-case "$with_cross_host" in
-  ""|*cygwin*)
-    all_host="all_host"
-    ;;
-  *)
-    all_host=
-    ;;
-esac
-
-AC_SUBST(all_host)
-
 AC_CHECK_TOOL(AR, ar, ar)
 AC_CHECK_TOOL(AS, as, as)
 AC_CHECK_TOOL(DLLTOOL, dlltool, dlltool)
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 5/7] Remove Makefile contents conditional on PREPROCESS, which is never defined

Jon TURNEY
In reply to this post by Jon TURNEY
---
 winsup/cygwin/Makefile.in | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 9b07d9833..c3aa7a186 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -424,13 +424,6 @@ EXCLUDE_STATIC_OFILES:=$(addprefix --exclude=,\
 
 VERSION_OFILES:=version.o winver.o
 
-ifdef PREPROCESS
-override DLL_OFILES:=$(patsubst %.o,%_E,${DLL_OFILES})
-override EXCLUDE_STATIC_OFILES:=$(patsubst %.o,%_E,${EXCLUDE_STATIC_OFILES})
-override EXTRA_OFILES=$(patsubst %.o,%_E,${DLL_OFILES}))
-override MALLOC_OFILES:=$(patsubst %.o,%.E,${MALLOC_OFILES})
-endif #PREPROCESS
-
 ifeq ($(target_cpu),x86_64)
 # Needed by mcountFunc.S to choose the right code path and symbol names
 ASFLAGS:=-D_WIN64
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 6/7] Remove rules for building libcygwin_s.a

Jon TURNEY
In reply to this post by Jon TURNEY
Untouched since added in 66a83f3e, and described as 'non-working'.
---
 winsup/cygwin/Makefile.in | 13 --------
 winsup/cygwin/mkstatic    | 63 ---------------------------------------
 2 files changed, 76 deletions(-)
 delete mode 100755 winsup/cygwin/mkstatic

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index c3aa7a186..0add2320b 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -105,7 +105,6 @@ RUNTESTFLAGS =
 DLL_NAME:=cygwin1.dll
 TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,$(DLL_NAME)}
 TEST_LIB_NAME:=libcygwin0.a
-STATIC_LIB_NAME:=libcygwin_s.a
 DIN_FILE=@DIN_FILE@ common.din
 DEF_FILE:=cygwin.def
 TLSOFFSETS_H:=@TLSOFFSETS_H@
@@ -413,15 +412,6 @@ DLL_OFILES:= \
  $(MATH_OFILES) \
  $(TZCODE_OFILES)
 
-EXCLUDE_STATIC_OFILES:=$(addprefix --exclude=,\
- cygtls.o \
- dcrt0.o \
- exceptions.o \
- fork.o \
- signal.o \
- spawn.o \
-)
-
 VERSION_OFILES:=version.o winver.o
 
 ifeq ($(target_cpu),x86_64)
@@ -675,9 +665,6 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIB
 $(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME)
  ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $(wordlist 2,99,$^)
 
-${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME}
- perl -d $< -x ${EXCLUDE_STATIC_OFILES} --library=${LIBC} --library=${LIBM} --ar=${AR} $@ cygwin.map
-
 # Rule to make stub library used by testsuite
 # dependency set to $(LIB_NAME) to accommodate make -j2.
 $(TEST_LIB_NAME): $(LIB_NAME)
diff --git a/winsup/cygwin/mkstatic b/winsup/cygwin/mkstatic
deleted file mode 100755
index 1a488f80c..000000000
--- a/winsup/cygwin/mkstatic
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/perl
-use strict;
-use Cwd;
-use Getopt::Long;
-use File::Temp qw/tempdir/;
-use File::Basename;
-
-sub xsystem(@);
-
-my @exclude = ();
-my @library = ();
-my $ar;
-our $x;
-GetOptions('exclude=s'=>\@exclude, 'library=s'=>\@library, 'ar=s'=>\$ar, 'x!'=>\$x);
-
-die "$0: must specify --ar\n" unless defined $ar;
-my $lib = shift or die "$0: missing lib argument\nusage: $0 lib [map-file]\n";
-$lib = Cwd::abs_path($lib);
-
-my %excludes = map {($_, 1)} @exclude;
-my $libraries = join('|', map {quotemeta} @library);
-
-my %sources = ();
-while (<>) {
-    my ($source, $file, $absfile);
-    if (m%^($libraries)\(([^)]*)\)%o) {
- $source = $1;
- $absfile = $file = $2;
-    } elsif (/^LOAD\s+(.*\.o)$/o) {
- $source = '.';
- $file = $1;
- $absfile = Cwd::abs_path($file);
-    } else {
- next;
-    }
-    push @{$sources{$source}}, $absfile unless $excludes{$file} || $excludes{$source};
-}
-
-my $here = getcwd();
-my $dir = tempdir(CLEANUP=>1);
-chdir $dir;
-my @files = ();
-for (sort keys %sources) {
-    if ($_ eq '.') {
- xsystem '/bin/cp', '-a', @{$sources{$_}}, '.';
-    } else {
- xsystem $ar, 'x',  $_, @{$sources{$_}}, '.';
-    }
-    push @files, map {basename($_)} @{$sources{$_}};
-}
-
-unlink $lib;
-xsystem $ar, 'crs', $lib, sort @files;
-exit 0;
-
-sub xsystem(@) {
-    print join(' ', 'x', @_), "\n" if $x;
-    system(@_) == 0 or die "$0: $_[0] $_[1] $_[2]... exited with non-zero status\n";
-}
-
-END {
-    chdir '/tmp'; # Allow $dir directory removal on Windows
-}
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

[PATCH 7/7] Drop passing '-c' compiler flag into gentls_offsets

Jon TURNEY
In reply to this post by Jon TURNEY
That script appends a '-E', since we only use $(CC) to preprocess, and
thus adding '-c' is having no effect.
---
 winsup/cygwin/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in
index 0add2320b..ec5d1efed 100644
--- a/winsup/cygwin/Makefile.in
+++ b/winsup/cygwin/Makefile.in
@@ -761,7 +761,7 @@ $(DEF_FILE): gendef $(srcdir)/$(TLSOFFSETS_H) $(DIN_FILE)
  $(word 1,$^) --cpu=${target_cpu} --output-def=$@  --tlsoffsets=$(word 2,$^) $(wordlist 3,99,$^)
 
 $(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h
- $^ $@ $(target_cpu) $(COMPILE.cc) -c || rm $@
+ $^ $@ $(target_cpu) $(COMPILE.cc) || rm $@
 
 sigfe.s: $(DEF_FILE)
  @[ -s $@ ] || \
--
2.29.0

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 0/7] Yet more Makefile/configure cleanups

Corinna Vinschen-2
In reply to this post by Jon TURNEY
On Oct 31 15:08, Jon Turney wrote:

> For ease of reviewing, this patch series doesn't contain changes to
> generated files which would be made by an autoreconf.
>
> Jon Turney (7):
>   Remove intro2man.stamp on clean
>   Drop AC_SUBST(build_exeext)
>   Remove autoconf variable DLL_NAME
>   Drop autoconf variable all_host
>   Remove Makefile contents conditional on PREPROCESS, which is never
>     defined
>   Remove rules for building libcygwin_s.a
>   Drop passing '-c' compiler flag into gentls_offsets
>
>  winsup/cygserver/configure.ac | 11 ------
>  winsup/cygwin/Makefile.in     | 36 +++-----------------
>  winsup/cygwin/configure.ac    | 14 --------
>  winsup/cygwin/mkstatic        | 63 -----------------------------------
>  winsup/doc/Makefile.in        |  5 +--
>  winsup/doc/configure.ac       |  2 --
>  6 files changed, 8 insertions(+), 123 deletions(-)
>  delete mode 100755 winsup/cygwin/mkstatic
>
> --
> 2.29.0

Looks good, I checked full build from scratch and partial
build from inside the cygwin dir.  Please push.


Thanks,
Corinna