* configure.in: Add check for MINGW_CXX. Remove libiconv check.

* configure: Regenerate.
	* Makefile.in: Remove references to mingw and w32api directories.
	Use MINGW_CXX instead of mingw script to build MINGW_BINS.
	Check for libiconv with $CC --print-file-name.
	* cygcheck.cc: Use relative include paths for Cygwin headers.
	* path.cc: Ditto.
	* strace.cc: Ditto
	* mingw: Remove.
This commit is contained in:
Yaakov Selkowitz 2012-10-24 10:15:27 +00:00
parent 478bb995fb
commit 7c61aa7ece
8 changed files with 1276 additions and 1601 deletions

View File

@ -1,3 +1,17 @@
2012-10-24 Kai Tietz <ktietz70@googlemail.com>
Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Corinna Vinschen <corinna@vinschen.de>
* configure.in: Add check for MINGW_CXX. Remove libiconv check.
* configure: Regenerate.
* Makefile.in: Remove references to mingw and w32api directories.
Use MINGW_CXX instead of mingw script to build MINGW_BINS.
Check for libiconv with $CC --print-file-name.
* cygcheck.cc: Use relative include paths for Cygwin headers.
* path.cc: Ditto.
* strace.cc: Ditto
* mingw: Remove.
2012-10-19 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (cygcheck.exe): Add temporary (1.7.17-only) hack to

View File

@ -40,15 +40,11 @@ include $(srcdir)/../Makefile.common
.NOEXPORT:
.PHONY: all install clean realclean warn_dumper warn_cygcheck_zlib
ALL_LDLIBS := -lnetapi32 -ladvapi32
ALL_LDFLAGS := -static-libgcc -Wl,--enable-auto-import -B$(newlib_build)/libc -B$(w32api_lib) $(LDFLAGS) $(ALL_LDLIBS)
ALL_DEP_LDLIBS := $(cygwin_build)/libcygwin.a ${patsubst -l%,\
$(w32api_lib)/lib%.a,$(ALL_LDLIBS) -lkernel32 -luser32}
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
MINGW_LIB := $(mingw_build)/libmingw32.a
MINGW_LDLIBS := $(ALL_LDLIBS) $(MINGW_LIB)
MINGW_DEP_LDLIBS := $(ALL_DEP_LDLIBS) $(MINGW_LIB)
MINGW_CXX := ${srcdir}/mingw ${CXX} -I${updir}
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.
@ -74,7 +70,8 @@ path-mount.o: path.cc
mount.exe: path-mount.o
# Provide any necessary per-target variable overrides.
cygcheck.exe: MINGW_LDFLAGS += -B{w32api_lib} -lpsapi -lntdll -lmsvcrt
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
@ -83,21 +80,20 @@ strace.exe: MINGW_LDFLAGS += -lntdll
ldd.exe: ALL_LDFLAGS += -lpsapi
pldd.exe: ALL_LDFLAGS += -lpsapi
ldh.exe: MINGW_LDLIBS :=
ldh.exe: MINGW_LDFLAGS := -nostdlib -lkernel32
# Check for dumper's requirements and enable it if found.
LIBICONV := @libiconv@
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}
build_dumper := ${shell test -r $(libbfd) -a -r $(libintl) -a -n "$(libiconv)" -a -z "${bfdlink}" && 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 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: ALL_LDFLAGS += ${libbfd} ${libintl} -L$(bupdir1)/libiberty $(libiconv) -liberty -lz
else
all: warn_dumper
endif
@ -105,7 +101,7 @@ 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/mingw/libz.a,%/include/zlib.h,${patsubst %/lib/libz.a,%/include/zlib.h,$(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)
@ -160,7 +156,7 @@ endif
# 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): $(MINGW_DEP_LDLIBS)
$(MINGW_BINS): $(ALL_DEP_LDLIBS)
$(CYGWIN_BINS): $(ALL_DEP_LDLIBS)
clean:
@ -179,9 +175,6 @@ install: all
$(cygwin_build)/libcygwin.a: $(cygwin_build)/Makefile
@$(MAKE) -C $(@D) $(@F)
$(MINGW_LIB): $(mingw_build)/Makefile
@$(MAKE) -C $(@D) $(@F)
warn_dumper:
@echo '*** Not building dumper.exe since some required libraries or'
@echo '*** or headers are missing. Potential candidates are:'

2708
winsup/utils/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -20,12 +20,12 @@ LIB_AC_PROG_CXX
AC_ARG_PROGRAM
AC_CHECK_LIB(iconv, libiconv, libiconv=-liconv)
AC_SUBST(libiconv)
INSTALL="/bin/sh "`cd $srcdir/../..; echo $(pwd)/install-sh -c`
AC_PROG_INSTALL
AC_CHECK_PROGS(MINGW_CXX, ${target_cpu}-w64-mingw32-g++)
test -z "$MINGW_CXX" && AC_MSG_ERROR([no acceptable mingw g++ found in \$PATH])
AC_EXEEXT
AC_OUTPUT(Makefile)

View File

@ -22,11 +22,10 @@
#include "path.h"
#include "wide_path.h"
#include <getopt.h>
#include "cygwin/include/cygwin/version.h"
#include "cygwin/include/sys/cygwin.h"
#include "cygwin/include/mntent.h"
#include "cygwin/cygprops.h"
#include "cygwin/version.h"
#include "../cygwin/include/cygwin/version.h"
#include "../cygwin/include/sys/cygwin.h"
#include "../cygwin/include/mntent.h"
#include "../cygwin/cygprops.h"
#undef cygwin_internal
#include "loadlib.h"

View File

@ -1,99 +0,0 @@
#!/bin/bash
# Front-end kludge to cause a Cygwin gcc to default to
# an installed version of the MinGW components.
#
# Find the path to the compiler.
#
compiler=$1; shift
dir=$(cd $(dirname $("$compiler" -print-prog-name=ld))/../..; pwd)
#
# The mingw32 directory should live somewhere close by to the
# compiler. Search for it.
#
[ "$dir" = '/' ] && dir=''
mingw_dir=''
for d in "$dir"/*-mingw32 "$dir"/usr/*-mingw32 "$dir"/*-mingw* "$dir"/usr/*-mingw* \
/*-mingw32 /usr/*-mingw32 /*-mingw* /usr/*-mingw*; do
case "$d" in
*\**) continue ;;
*) if [ -d "$d"/sys-root/mingw ]; then
mingw_dir=$d/sys-root/mingw
else
mingw_dir=$d;
fi; break;
esac
done
if [ -z "$mingw_dir" ]; then
echo "$0: couldn't find i686-pc-mingw32 directory" 1>&2
exit 1
fi
#
# Inspect each argument throwing away ones that seem to try to include the
# Cygwin environment.
#
newargs=()
sawcomp() { return 1; }
sawcfile() { return 1; }
sawofile() { return 1; }
sawshared() { return 1; }
sawnostdinc() { return 1; }
sawnostdlib() { return 1; }
eatnext() { return 1; }
pushnext() { return 1; }
for f do
if eatnext; then
eatnext() { return 1; }
continue;
fi
if pushnext; then
pushnext() { return 1; }
else
case "$f" in
*cygwin/include*|*newlib|-mno-cygwin) continue ;;
-c|-E) sawcomp() { return 0; } ;;
-xc*) sawcfile() { return 0; } ;;
-isystem) eatnext() { return 0; }; continue ;;
-o) pushnext() { return 0; } ;;
-nostdinc*) sawnostdinc() { return 0; } ;;
-nostdlib) sawnostdlib() { return 0; } ;;
-shared|-Wl,-shared) sawshared() { return 0; } ;;
-*) ;;
*.cc|*.c|*.s|*.S|*.i|*.ii) sawcfile() { return 0; } ;;
*.o) sawofile() { return 0; };;
esac
fi
newargs[${#newargs[*]}]="$f"
done
# Set up a new set of arguments + also search the installed mingw
# directory.
set -- -B"$mingw_dir"/lib/ "${newargs[@]}"
# Add some default options depending on whether this looks like
# an attempt to link, compile, or both.
if sawcomp || sawcfile; then
ccdir=$(dirname $($compiler -print-libgcc-file-name))
sawnostdinc || set -- -isystem "$ccdir"/include -I"${mingw_dir}"/include "$@"
set -- -D__MINGW32__ -D__MSVCRT__ -DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ -U__CYGWIN__ -Uunix -U__unix__ -U__unix -U __CYGWIN32__ "$@"
if ! sawnostdinc; then
case "$compiler" in
*++*) set -- -nostdinc++ "$@" ;;
*) set -- -nostdinc "$@" ;;
esac
fi
fi
if sawofile || ! sawcfile || ! sawcomp; then
w32api=$($compiler -print-file-name=libc.a)
w32api=$(cd $(dirname "$w32api")/w32api; pwd)
set -- -Wl,-nostdlib -L"${w32api}" "$@"
! sawnostdlib && set -- -nostdlib "$@" -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -lmingw32 -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt
! sawnostdlib && ! sawshared && { sawofile || sawcfile; } && set -- "$mingw_dir"/lib/crt2.o "$@"
fi
# Execute the compiler with new mingw-specific options.
exec $compiler "$@"

View File

@ -23,9 +23,9 @@ details. */
#include <malloc.h>
#include <wchar.h>
#include "path.h"
#include "cygwin/include/cygwin/version.h"
#include "cygwin/include/sys/mount.h"
#include "cygwin/include/mntent.h"
#include "../cygwin/include/cygwin/version.h"
#include "../cygwin/include/sys/mount.h"
#include "../cygwin/include/mntent.h"
#include "testsuite.h"
#ifdef FSTAB_ONLY
#include <sys/cygwin.h>

View File

@ -27,9 +27,9 @@ details. */
#include <time.h>
#include <signal.h>
#include <errno.h>
#include "cygwin/include/sys/strace.h"
#include "cygwin/include/sys/cygwin.h"
#include "cygwin/include/cygwin/version.h"
#include "../cygwin/include/sys/strace.h"
#include "../cygwin/include/sys/cygwin.h"
#include "../cygwin/include/cygwin/version.h"
#include "path.h"
#undef cygwin_internal
#include "loadlib.h"