diff options
author | Christopher Faylor <me@cgf.cx> | 2012-11-23 17:22:47 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-11-23 17:22:47 +0400 |
commit | 4c36016b570670b75fa2f9f396fb297a04fd09bd (patch) | |
tree | 1708c166aba9c96b9e57be0d894a7bd46268e54d /winsup/utils/Makefile.in | |
parent | 1cfd36169ccdb79e115c3a9fa4c5fa2e1372ba27 (diff) |
ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.common: Revamp for new configury. Add default compilation
targets, include .E processing. Add magic for allowing "CFLAGS" to
control optimization options in "CXXFLAGS".
* configure.cygwin: New include for Cygwin configure.in's.
* acinclude.m4: Delete old definitions. Implement AC_WINDOWS_HEADERS,
AC_WINDOWS_LIBS, AC_CYGWIN_INCLUDES, target_builddir, winsup_srcdir.
* aclocal.m4: Regenerate.
* autogen.sh: New file.
* ccwrap: New script.
* c++wrap: New script.
* config.guess: New script.
* config.sub: New script.
* configure: Regenerate.
* configure.in: Eliminate LIB_AC_PROG_* calls in favor of standard.
Delete ancient target test.
* install-sh: New script.
cygserver/ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Revamp for new configury.
* configure.in: Revamp for new configury.
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
cygwin/ChangeLog:
2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* select.cc (select): Don't return -1 when we've timed out after
looping.
2012-11-22 Christopher Faylor <me.cygwin2012@cgf.cx>
* Makefile.in: Revamp for new configury.
(datarootdir): Add variable setting.
(winver_stamp): Accommodate changes to mkvers.sh setting.
(libc.a): Fix race when libm.a might not have been built yet.
* configure.in: Revamp for new configury.
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
* mkvers.sh: Find include directives via CFLAGS and friends rather than
assuming that w32api lives nearby.
utils/ChangeLog:
2012-11-12 Christopher Faylor <me.cygwin2012@cgf.cx>
* aclocal.m4: Regenerate.
* configure: Ditto.
* autogen.sh: New script.
* configure.in: Revamp for new configury.
* Makefile.in: Revamp for new configury. Rename ALL_* to just *.
Always use "VERBOSE" setting.
(MINGW_CXX): Don't include CFLAGS in definition.
(all): Define target first, before everything else so that it is the
default.
(ps.exe): Don't add useless -lcygwin.
(ldh.exe): For consistency, add to existing MINGW_LDFLAGS rather than
redefining them.
(cygcheck.exe): Always include -lz for MINGW_LDFLAGS. Don't try to
figure out where to find it.
(dumper.exe): Simplify check. Assume libraries are installed rather
than trying to retrieve from source tree.
(install): Just use /bin/mkdir to create directories.
(Makefile): Regenerate when standard dependencies change.
* dump_setup.cc: Always include zlib.h. Remove accommodations for it
possibly not existing.
* parse_pe.cc: Add define which allows building with installed
binutils package.
* dumper.cc: Ditto.
Diffstat (limited to 'winsup/utils/Makefile.in')
-rw-r--r-- | winsup/utils/Makefile.in | 128 |
1 files changed, 62 insertions, 66 deletions
diff --git a/winsup/utils/Makefile.in b/winsup/utils/Makefile.in index 76f79f1e3..c73957778 100644 --- a/winsup/utils/Makefile.in +++ b/winsup/utils/Makefile.in @@ -8,10 +8,27 @@ # Cygwin license. Please consult the file "CYGWIN_LICENSE" for # details. -SHELL:=@SHELL@ - srcdir:=@srcdir@ -VPATH:=@srcdir@ +target_builddir:=@target_builddir@ +winsup_srcdir:=@winsup_srcdir@ +configure_args=@configure_args@ + +export CC:=@CC@ +export CXX:=@CXX@ + +include ${srcdir}/../Makefile.common + +cygwin_build:=${target_builddir}/winsup/cygwin + +cygwin_headers:=@cygwin_headers@ + +# environment variables used by ccwrap +export CCWRAP_HEADERS:=. ${srcdir} $(call justdir,${cygwin_headers}) +export CCWRAP_SYSTEM_HEADERS:=${cygwin_headers} @newlib_headers@ +export CCWRAP_DIRAFTER_HEADERS:=@windows_headers@ + +WINDOWS_LIBDIR:=@windows_libdir@ + prefix:=@prefix@ exec_prefix:=@exec_prefix@ @@ -25,26 +42,17 @@ override INSTALL_DATA:=@INSTALL_DATA@ EXEEXT:=@EXEEXT@ EXEEXT_FOR_BUILD:=@EXEEXT_FOR_BUILD@ -CC:=@CC@ -CC_FOR_TARGET:=$(CC) -CXX:=@CXX@ -CXX_FOR_TARGET:=$(CXX) - CFLAGS:=@CFLAGS@ CXXFLAGS:=@CXXFLAGS@ override CXXFLAGS+=-fno-exceptions -fno-rtti -DHAVE_DECL_GETOPT=0 -include $(srcdir)/../Makefile.common - -.SUFFIXES: -.NOEXPORT: .PHONY: all install clean realclean warn_dumper warn_cygcheck_zlib -ALL_LDLIBS := -lnetapi32 -ladvapi32 -lkernel32 -luser32 -ALL_LDFLAGS := -static-libgcc -Wl,--enable-auto-import -B$(newlib_build)/libc $(LDFLAGS) $(ALL_LDLIBS) -ALL_DEP_LDLIBS := $(cygwin_build)/libcygwin.a +LDLIBS := -lnetapi32 -ladvapi32 -lkernel32 -luser32 +CYGWIN_LDFLAGS := -static-libgcc -Wl,--enable-auto-import -L${WINDOWS_LIBDIR} $(LDLIBS) +DEP_LDLIBS := $(cygwin_build)/libcygwin.a -MINGW_CXX := @MINGW_CXX@ $(CFLAGS) +MINGW_CXX := @MINGW_CXX@ # List all binaries to be linked in Cygwin mode. Each binary on this list # must have a corresponding .o of the same name. @@ -59,56 +67,51 @@ MINGW_BINS := ${addsuffix .exe,cygcheck cygwin-console-helper ldh strace} # list will will be compiled in Cygwin mode implicitly, so there is no # need for a CYGWIN_OBJS. MINGW_OBJS := bloda.o cygcheck.o dump_setup.o ldh.o path.o strace.o +MINGW_LDFLAGS:=-L${WINDOWS_LIBDIR} + +CYGCHECK_OBJS:=cygcheck.o bloda.o path.o dump_setup.o + +.PHONY: all +all: # If a binary should link in any objects besides the .o with the same # name as the binary, then list those here. strace.exe: path.o -cygcheck.exe: bloda.o path.o dump_setup.o +cygcheck.exe: cygcheck.o bloda.o path.o dump_setup.o path-mount.o: path.cc - $(CXX) -c $(CXXFLAGS) -DFSTAB_ONLY -I$(updir) $< -o $@ + ${COMPILE.cc} -c -DFSTAB_ONLY -o $@ $< mount.exe: path-mount.o # Provide any necessary per-target variable overrides. -cygcheck.exe: MINGW_CXXFLAGS += -idirafter $(cygwin_source)/include -idirafter $(newlib_source)/libc/include -cygcheck.exe: MINGW_LDFLAGS += -lpsapi -lntdll -cygpath.exe: ALL_LDFLAGS += -lcygwin -luserenv -lntdll -cygpath.exe: CXXFLAGS += -fno-threadsafe-statics -ps.exe: ALL_LDFLAGS += -lcygwin -lpsapi -lntdll + +cygcheck.exe: MINGW_LDFLAGS += -lpsapi -lntdll -lz +cygcheck.exe: ${CYGCHECK_OBJS} + +cygpath.o: CXXFLAGS += -fno-threadsafe-statics +cygpath.exe: CYGWIN_LDFLAGS += -luserenv -lntdll +ps.exe: CYGWIN_LDFLAGS += -lpsapi -lntdll strace.exe: MINGW_LDFLAGS += -lntdll -ldd.exe: ALL_LDFLAGS += -lpsapi -pldd.exe: ALL_LDFLAGS += -lpsapi +ldd.exe:CYGWIN_LDFLAGS += -lpsapi +pldd.exe: CYGWIN_LDFLAGS += -lpsapi -ldh.exe: MINGW_LDFLAGS := -nostdlib -lkernel32 +ldh.exe: MINGW_LDFLAGS += -nostdlib -lkernel32 # Check for dumper's requirements and enable it if found. -libiconv := ${shell $(CC) --print-file-name=libiconv.a} -libbfd := ${shell $(CC) -B$(bupdir2)/bfd/ --print-file-name=libbfd.a} -libintl := ${shell $(CC) -B$(bupdir2)/intl/ --print-file-name=libintl.a} -bfdlink := $(shell ${CC} -xc /dev/null -o /dev/null -c -B${bupdir2}/bfd/ -include bfd.h 2>&1) -build_dumper := ${shell test -r $(libbfd) -a -r $(libintl) -a -n "$(libiconv)" -a -z "${bfdlink}" && echo 1} +libbfd := $(call libname,libbfd.a) +build_dumper := $(shell test -r "$(libbfd)" && echo 1) + ifdef build_dumper CYGWIN_BINS += dumper.exe -dumper.o module_info.o parse_pe.o: CXXFLAGS += -I$(bupdir2)/bfd -I$(updir1)/include +dumper.o module_info.o parse_pe.o: CXXFLAGS += -I$(top_srcdir)/include dumper.o parse_pe.o: dumper.h dumper.exe: module_info.o parse_pe.o -dumper.exe: ALL_LDFLAGS += ${libbfd} ${libintl} -L$(bupdir1)/libiberty $(libiconv) -liberty -lz +dumper.exe: CYGWIN_LDFLAGS += -lbfd -lintl -liconv -liberty -lz else all: warn_dumper endif -# Check for availability of a MinGW libz and enable for cygcheck. -libz:=${shell x=$$(${MINGW_CXX} --print-file-name=libz.a); cd $$(dirname $$x); dir=$$(pwd); case "$$dir" in *mingw*) echo $$dir/libz.a ;; esac} -ifdef libz -zlib_h := -include ${patsubst %/lib/libz.a,%/include/zlib.h,$(libz)} -zconf_h := ${patsubst %/zlib.h,%/zconf.h,$(zlib_h)} -dump_setup.o: MINGW_CXXFLAGS += $(zconf_h) $(zlib_h) -cygcheck.exe: MINGW_LDFLAGS += $(libz) -else -all: warn_cygcheck_zlib -endif - all: Makefile $(CYGWIN_BINS) $(MINGW_BINS) # test harness support (note: the "MINGW_BINS +=" should come after the @@ -127,46 +130,38 @@ check: testsuite.exe ; $(<D)/$(<F) # the rest of this file contains generic rules # how to compile a MinGW object +${MINGW_OBJS}: override CXX:=${MINGW_CXX} +${MINGW_OBJS}: CCWRAP_HEADERS:=${srcdir} +${MINGW_OBJS}: CCWRAP_SYSTEM_HEADERS:= +# ${MINGW_OBJS}: CCWRAP_DIRAFTER_HEADERS:= $(MINGW_OBJS): %.o: %.cc -ifdef VERBOSE - $(MINGW_CXX) $c -o $(@D)/$(basename $@)$o $(MINGW_CXXFLAGS) $< -else - @echo $(MINGW_CXX) $c $(MINGW_CXXFLAGS) ... $(*F).cc;\ - $(MINGW_CXX) $c -o $(@D)/$(basename $@)$o $(MINGW_CXXFLAGS) $< -endif + c++wrap -c -o $@ ${CXXFLAGS} $(MINGW_CXXFLAGS) $< # how to link a MinGW binary $(MINGW_BINS): %.exe: %.o -ifdef VERBOSE - $(MINGW_CXX) $(MINGW_CXXFLAGS) -o $@ ${filter %.o,$^} $(MINGW_LDFLAGS) -else - @echo $(MINGW_CXX) -o $@ ${filter %.o,$^} ${filter-out -B%, $(MINGW_CXXFLAGS) $(MINGW_LDFLAGS)};\ $(MINGW_CXX) $(MINGW_CXXFLAGS) -o $@ ${filter %.o,$^} $(MINGW_LDFLAGS) -endif # how to link a Cygwin binary $(CYGWIN_BINS): %.exe: %.o -ifdef VERBOSE - $(CXX) -o $@ ${filter %.o,$^} -B$(cygwin_build)/ $(ALL_LDFLAGS) -else - @echo $(CXX) -o $@ ${filter %.o,$^} ... ${filter-out -B%, $(ALL_LDFLAGS)};\ - $(CXX) -o $@ ${filter %.o,$^} -B$(cygwin_build)/ $(ALL_LDFLAGS) -endif + ${CXX} -o $@ $(filter %.o,$^) -B${cygwin_build}/ ${LDFLAGS} ${CYGWIN_LDFLAGS} # note: how to compile a Cygwin object is covered by the pattern rule in Makefile.common # these dependencies ensure that the required in-tree libs are built first -$(MINGW_BINS): $(ALL_DEP_LDLIBS) -$(CYGWIN_BINS): $(ALL_DEP_LDLIBS) +$(MINGW_BINS): $(DEP_LDLIBS) +$(CYGWIN_BINS): $(DEP_LDLIBS) +.PHONY: clean clean: rm -f *.o $(CYGWIN_BINS) $(MINGW_BINS) path-testsuite.cc testsuite.exe +.PHONY: realclean realclean: clean rm -f Makefile config.cache +.PHONY: install install: all - $(SHELL) $(updir1)/mkinstalldirs $(DESTDIR)$(bindir) + /bin/mkdir -p ${DESTDIR}${bindir} for i in $(CYGWIN_BINS) ${filter-out testsuite.exe,$(MINGW_BINS)} ; do \ n=`echo $$i | sed '$(program_transform_name)'`; \ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(bindir)/$$n; \ @@ -175,6 +170,7 @@ install: all $(cygwin_build)/libcygwin.a: $(cygwin_build)/Makefile @$(MAKE) -C $(@D) $(@F) +.PHONY: warn_dumper warn_dumper: @echo '*** Not building dumper.exe since some required libraries or' @echo '*** or headers are missing. Potential candidates are:' @@ -183,5 +179,5 @@ warn_dumper: @echo '*** sources from sourceware.org. Then, configure and build these' @echo '*** libraries. Otherwise, you can safely ignore this warning.' -warn_cygcheck_zlib: - @echo '*** Building cygcheck without package content checking due to missing mingw libz.a.' +Makefile: Makefile.in config.status + /bin/sh ./config.status |