@@ -17,6 +17,11 @@ if TARGET_X86_64
1717COMMON_CFLAGS+=-mcmodel =small
1818endif
1919
20+ VERSION_CFLAGS = -DMSYS2_RUNTIME_COMMIT="\"@MSYS2_RUNTIME_COMMIT@\""
21+ VERSION_CFLAGS += -DMSYS2_RUNTIME_COMMIT_SHORT="\"@MSYS2_RUNTIME_COMMIT_SHORT@\""
22+ VERSION_CFLAGS += -DMSYS2_RUNTIME_COMMIT_HEX="@MSYS2_RUNTIME_COMMIT_HEX@"
23+ COMMON_CFLAGS += $(VERSION_CFLAGS )
24+
2025AM_CFLAGS =$(cflags_common ) $(COMMON_CFLAGS )
2126AM_CXXFLAGS =$(cxxflags_common ) $(COMMON_CFLAGS ) -fno-threadsafe-statics
2227
@@ -37,12 +42,12 @@ newlib_build=$(target_builddir)/newlib
3742toollibdir =$(tooldir ) /lib
3843toolincludedir =$(tooldir ) /include
3944
40- # Parameters used in building the cygwin .dll.
45+ # Parameters used in building the msys-2.0 .dll.
4146
42- DLL_NAME =cygwin1 .dll
43- NEW_DLL_NAME =new-cygwin1 .dll
44- DEF_FILE =cygwin .def
45- LIB_NAME =libcygwin .a
47+ DLL_NAME =msys-2.0 .dll
48+ NEW_DLL_NAME =new-msys-2.0 .dll
49+ DEF_FILE =msys .def
50+ LIB_NAME =libmsys-2.0 .a
4651
4752#
4853# sources
@@ -314,6 +319,7 @@ DLL_FILES= \
314319 miscfuncs.cc \
315320 mktemp.cc \
316321 msg.cc \
322+ msys2_path_conv.cc \
317323 mount.cc \
318324 net.cc \
319325 netdb.cc \
@@ -450,7 +456,7 @@ uname_version.c: .FORCE
450456version.cc : scripts/mkvers.sh include/cygwin/version.h winver.rc $(src_files )
451457 @echo " Making version.cc and winver.o" ; \
452458 export CC=" $( CC) " ; \
453- /bin/sh $(word 1,$^ ) $(word 2,$^ ) $(word 3,$^ ) $(WINDRES ) $(CFLAGS )
459+ /bin/sh $(word 1,$^ ) $(word 2,$^ ) $(word 3,$^ ) $(WINDRES ) $(CFLAGS ) $( VERSION_CFLAGS )
454460
455461winver.o : version.cc
456462
@@ -589,36 +595,35 @@ LIBSERVER = $(cygserver_blddir)/libcygserver.a
589595$(LIBSERVER ) :
590596 $(MAKE ) -C $(cygserver_blddir ) libcygserver.a
591597
592- # We build as new-cygwin1 .dll and rename at install time to overcome native
598+ # We build as new-msys-2.0 .dll and rename at install time to overcome native
593599# rebuilding issues (we don't want the build tools to see a partially built
594- # cygwin1 .dll and attempt to use it instead of the old one).
600+ # msys-2.0 .dll and attempt to use it instead of the old one).
595601
596602# linker script
597603LDSCRIPT =cygwin.sc
598604$(LDSCRIPT ) : $(LDSCRIPT ) .in
599605 $(AM_V_GEN )$(CC ) -E - -P < $^ -o $@
600606
601- # cygwin dll
607+ # msys-2.0 dll
602608# Set PE and export table header timestamps to zero for reproducible builds.
603609$(NEW_DLL_NAME ) : $(LDSCRIPT ) libdll.a $(VERSION_OFILES ) $(LIBSERVER ) \
604610 $(newlib_build ) /libm.a $(newlib_build ) /libc.a
605611 $(AM_V_CXXLD )$(CXX ) $(CXXFLAGS ) \
606612 -mno-use-libstdc-wrappers \
607- -Wl,--gc-sections -nostdlib -Wl,-T$(LDSCRIPT ) \
608- -Wl,--dynamicbase -static \
613+ -Wl,--gc-sections -nostdlib -Wl,-T$(LDSCRIPT ) -static \
609614 $$ {SOURCE_DATE_EPOCH:+-Wl,--no-insert-timestamp} \
610- -Wl,--heap=0 -Wl,--out-implib,cygdll .a -shared -o $@ \
615+ -Wl,--heap=0 -Wl,--out-implib,msysdll .a -shared -o $@ \
611616 -e @DLL_ENTRY@ $(DEF_FILE ) \
612617 -Wl,-whole-archive libdll.a -Wl,-no-whole-archive \
613618 $(VERSION_OFILES ) \
614619 $(LIBSERVER ) \
615620 $(newlib_build ) /libm.a \
616621 $(newlib_build ) /libc.a \
617- -lgcc -lkernel32 -lntdll -Wl,-Map,cygwin .map
622+ -lgcc -lkernel32 -lntdll -Wl,-Map,msys .map
618623 @$(MKDIR_P ) ${target_builddir} /winsup/testsuite/testinst/bin/
619624 $(AM_V_at )$(INSTALL_PROGRAM ) $(NEW_DLL_NAME ) ${target_builddir} /winsup/testsuite/testinst/bin/$(DLL_NAME )
620625
621- # cygwin import library
626+ # msys-2.0 import library
622627toolopts=--cpu =@target_cpu@ --ar=@AR@ --as=@AS@ --nm=@NM@ --objcopy=@OBJCOPY@
623628
624629$(DEF_FILE ) : scripts/gendef cygwin.din
@@ -631,13 +636,14 @@ sigfe.s: $(DEF_FILE) tlsoffsets
631636
632637LIBCOS =$(addsuffix .o,$(basename $(LIB_FILES ) ) )
633638$(LIB_NAME ) : $(DEF_FILE ) $(LIBCOS ) | $(NEW_DLL_NAME )
634- $(AM_V_GEN )$(srcdir ) /scripts/mkimport $(toolopts ) $(NEW_FUNCTIONS ) $@ cygdll .a $(wordlist 2,99,$^ )
639+ $(AM_V_GEN )$(srcdir ) /scripts/mkimport $(toolopts ) $(NEW_FUNCTIONS ) $@ msysdll .a $(wordlist 2,99,$^ )
635640
636641# sublibs
637642# import libraries for some subset of symbols indicated by given objects
638643speclib =\
639644 $(srcdir ) /scripts/speclib $(toolopts ) \
640645 --exclude='cygwin' \
646+ --exclude='msys' \
641647 --exclude='(?i:dll)' \
642648 --exclude='reloc' \
643649 --exclude='^main$$' \
@@ -687,7 +693,7 @@ all-local: $(LIB_NAME) $(SUBLIBS)
687693clean-local :
688694 -rm -f $(BUILT_SOURCES )
689695 -rm -f $(DEF_FILE ) sigfe.s
690- -rm -f cygwin.sc cygdll .a cygwin .map
696+ -rm -f cygwin.sc msysdll .a msys .map
691697 -rm -f $(NEW_DLL_NAME )
692698 -rm -f $(LIB_NAME ) $(SUBLIBS )
693699 -rm -f version.cc
@@ -705,7 +711,7 @@ man_MANS = regex/regex.3 regex/regex.7
705711install-exec-hook : install-libs
706712install-data-local : install-headers install-ldif
707713
708- install-libs :
714+ install-libs : install-toollibDATA
709715 @$(MKDIR_P ) $(DESTDIR )$(bindir )
710716 $(INSTALL_PROGRAM ) $(NEW_DLL_NAME ) $(DESTDIR )$(bindir ) /$(DLL_NAME )
711717 @$(MKDIR_P ) $(DESTDIR )$(toollibdir )
0 commit comments