[PATCH 0/4] Still more Makefile/configure cleanups

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

[PATCH 0/4] Still more Makefile/configure cleanups

Jon TURNEY
Jon Turney (4):
  Use grep in text mode to look for version strings
  Drop duplicate C++ flags used to build utils
  Fix 'make check' in utils
  Testsuite Makefile cleanup

 winsup/testsuite/Makefile.in        | 15 ++-------------
 winsup/testsuite/config/default.exp |  2 +-
 winsup/utils/Makefile.in            |  6 +++---
 winsup/utils/path.h                 |  2 ++
 winsup/utils/testsuite.h            | 16 ++++++++--------
 5 files changed, 16 insertions(+), 25 deletions(-)

--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 1/4] Use grep in text mode to look for version strings

Jon TURNEY
Invoke grep in text mode when looking for version strings inside cygwin
DLL, so it outputs something more informative than:

  Binary file ../cygwin/cygwin0.dll matches
---
 winsup/testsuite/config/default.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/testsuite/config/default.exp b/winsup/testsuite/config/default.exp
index 3936979a6..8033ea627 100644
--- a/winsup/testsuite/config/default.exp
+++ b/winsup/testsuite/config/default.exp
@@ -1,7 +1,7 @@
 proc winsup_version {} {
     global env
     global rootme
-    clone_output "\n[exec grep ^%%% $rootme/../cygwin/cygwin0.dll]\n"
+    clone_output "\n[exec grep -a ^%%% $rootme/../cygwin/cygwin0.dll]\n"
     if { [info exists env(CYGWIN)] } {
         clone_output "CYGWIN=$env(CYGWIN)\n"
     } else {
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 2/4] Drop duplicate C++ flags used to build utils

Jon TURNEY
In reply to this post by Jon TURNEY
'-fno-exceptions -fno-rtti' are already present in the compile command
COMPILE.cc set by Makefile.common, so we don't need to add them to
CXXFLAGS as well.
---
 winsup/utils/Makefile.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
index e21874027..a9d66a5ee 100644
--- a/winsup/utils/Makefile.in
+++ b/winsup/utils/Makefile.in
@@ -19,7 +19,7 @@ CFLAGS:=@CFLAGS@
 CXXFLAGS:=@CXXFLAGS@
 INCLUDES:=@INCLUDES@
 override CFLAGS+=${CFLAGS_COMMON}
-override CXXFLAGS+=-fno-exceptions -fno-rtti ${CFLAGS_COMMON}
+override CXXFLAGS+=${CFLAGS_COMMON}
 
 include ${srcdir}/../Makefile.common
 
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 3/4] Fix 'make check' in utils

Jon TURNEY
In reply to this post by Jon TURNEY
This has a test of the path translation code used in various
utilities (mount, cygpath, strace).

MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e.
The isys member of mnt_t struct was removed in b677a99b.

> $ make check
[...]
> total tests: 63
> pass       : 63 (100.0%)
> fail       : 0 (0.0%)
---
 winsup/utils/Makefile.in |  4 ++--
 winsup/utils/path.h      |  2 ++
 winsup/utils/testsuite.h | 16 ++++++++--------
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in
index a9d66a5ee..46ca13c04 100644
--- a/winsup/utils/Makefile.in
+++ b/winsup/utils/Makefile.in
@@ -123,9 +123,9 @@ MINGW_BINS += testsuite.exe
 MINGW_OBJS += path-testsuite.o testsuite.o
 testsuite.exe: path-testsuite.o
 path-testsuite.cc: path.cc ; @test -L $@ || ln -sf ${filter %.cc,$^} $@
-path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE
+path-testsuite.o: MINGW_CXXFLAGS += -DTESTSUITE -Wno-error=write-strings
 # this is necessary because this .c lives in the build dir instead of src
-path-testsuite.o: MINGW_CXX := ${patsubst -I.,-I$(utils_source),$(MINGW_CXX)}
+path-testsuite.o: MINGW_CXXFLAGS += -I$(srcdir)
 path-testsuite.cc path.cc testsuite.cc: testsuite.h
 check: testsuite.exe ; $(<D)/$(<F)
 
diff --git a/winsup/utils/path.h b/winsup/utils/path.h
index ee7c28a7a..af5deeba6 100644
--- a/winsup/utils/path.h
+++ b/winsup/utils/path.h
@@ -22,7 +22,9 @@ int get_word (HANDLE, int);
 int get_dword (HANDLE, int);
 bool from_fstab_line (mnt_t *m, char *line, bool user);
 
+#ifndef TESTSUITE
 extern mnt_t mount_table[255];
+#endif
 extern int max_mount_entry;
 
 #ifndef SYMLINK_MAX
diff --git a/winsup/utils/testsuite.h b/winsup/utils/testsuite.h
index 4ed9eb2c4..d0a47b23a 100644
--- a/winsup/utils/testsuite.h
+++ b/winsup/utils/testsuite.h
@@ -29,14 +29,14 @@ details. */
 
 #if defined(TESTSUITE_MOUNT_TABLE)
 static mnt_t mount_table[] = {
-/* native                 posix               flags                        issys */
- { TESTSUITE_ROOT,        (char*)"/",                MOUNT_BINARY | MOUNT_SYSTEM, 1 },
- { "O:\\other",           (char*)"/otherdir",        MOUNT_BINARY | MOUNT_SYSTEM, 1 },
- { "S:\\some\\dir",       (char*)"/somedir",         MOUNT_BINARY | MOUNT_SYSTEM, 1 },
- { TESTSUITE_ROOT"\\bin", (char*)"/usr/bin",         MOUNT_BINARY | MOUNT_SYSTEM, 1 },
- { TESTSUITE_ROOT"\\lib", (char*)"/usr/lib",         MOUNT_BINARY | MOUNT_SYSTEM, 1 },
- { ".",                   (char*)TESTSUITE_CYGDRIVE, MOUNT_BINARY | MOUNT_SYSTEM | MOUNT_CYGDRIVE, 1 },
- { NULL,                  (char*)NULL,               0,                           0 }
+/* native                 posix               flags */
+ { TESTSUITE_ROOT,        (char*)"/",                MOUNT_SYSTEM},
+ { "O:\\other",           (char*)"/otherdir",        MOUNT_SYSTEM},
+ { "S:\\some\\dir",       (char*)"/somedir",         MOUNT_SYSTEM},
+ { TESTSUITE_ROOT"\\bin", (char*)"/usr/bin",         MOUNT_SYSTEM},
+ { TESTSUITE_ROOT"\\lib", (char*)"/usr/lib",         MOUNT_SYSTEM},
+ { ".",                   (char*)TESTSUITE_CYGDRIVE, MOUNT_SYSTEM | MOUNT_CYGDRIVE},
+ { NULL,                  (char*)NULL,               0}
 };
 
 
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

[PATCH 4/4] Testsuite Makefile cleanup

Jon TURNEY
In reply to this post by Jon TURNEY
Drop unused variables CC_FOR_TARGET, GCC_INCLUDE, ALL_CFLAGS
Stop exporting CC, CFLAGS
Drop unused, empty targets force, dll_ofiles, all_target
---
 winsup/testsuite/Makefile.in | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/winsup/testsuite/Makefile.in b/winsup/testsuite/Makefile.in
index 4948a0bc7..d29112491 100644
--- a/winsup/testsuite/Makefile.in
+++ b/winsup/testsuite/Makefile.in
@@ -46,8 +46,6 @@ TESTSUP_INCLUDES:=-I$(libltp_srcdir)/include
 #
 
 CC:=@CC@
-# FIXME: Which is it, CC or CC_FOR_TARGET?
-CC_FOR_TARGET:=$(CC)
 ifneq (,$(CFLAGS))
   override CFLAGS+= -MD $(TESTSUP_INCLUDES)
 else
@@ -66,9 +64,6 @@ include $(srcdir)/../Makefile.common
 
 VPATH+=$(libltp_srcdir)/lib
 
-override CC:=$(CC) $(GCC_INCLUDE)
-export CC
-
 RUNTESTFLAGS =
 
 ifdef VERBOSE
@@ -80,20 +75,16 @@ RUNTIME=$(cygwin_build)/cygwin0.dll $(cygwin_build)/libcygwin0.a
 TESTSUP_LIB_NAME:=libltp.a
 TESTSUP_OFILES:=${sort ${addsuffix .o,${basename ${notdir ${wildcard $(libltp_srcdir)/lib/*.c}}}}}
 
-override ALL_CFLAGS:=${filter-out -O%,$(ALL_CFLAGS)}
 override COMPILE_CC:=${filter-out -O%,$(COMPILE_CC)}
 override CFLAGS:=${filter-out -O%,$(CFLAGS)}
-export CFLAGS
 
-.PHONY: all force dll_ofiles install all_target
+.PHONY: all install
 
 .SUFFIXES:
 .SUFFIXES: .c .cc .def .a .o .d
 
 all: $(TESTSUP_LIB_NAME)
 
-force:
-
 install:
 
 clean:
@@ -114,8 +105,6 @@ $(TESTSUP_LIB_NAME): $(TESTSUP_OFILES)
 $(RUNTIME) : $(cygwin_build)/Makefile
  @$(MAKE) --no-print-dir -C $(@D) $(@F)
 
-# Rule to make stub library used by "make check"
-
 #
 
 # These targets are for the dejagnu testsuites. The file site.exp
@@ -147,7 +136,7 @@ site.exp: ./config.status Makefile
  @echo "set target_alias $(target_alias)" >> ./tmp0
  @echo "set CC \"$(CC)\"" >> ./tmp0
 # CFLAGS is set even though it's empty to show we reserve the right to set it.
- @echo "set CFLAGS \"$(ALL_CFLAGS)\"" >> ./tmp0
+ @echo "set CFLAGS \"\"" >> ./tmp0
  @echo "set MINGW_CXX \"$(MINGW_CXX)\"" >> ./tmp0
  @echo "set tmpdir $(tmpdir)" >> ./tmp0
  @echo "set testdll_tmpdir $(testdll_tmpdir)" >> ./tmp0
--
2.29.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 3/4] Fix 'make check' in utils

Corinna Vinschen-2
In reply to this post by Jon TURNEY
Hi Jon,

On Nov 12 19:46, Jon Turney wrote:
> This has a test of the path translation code used in various
> utilities (mount, cygpath, strace).
>
> MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e.
> The isys member of mnt_t struct was removed in b677a99b.

issys?

Other than that typo, the series LGTM.


Thanks,
Corinna