Browse Source

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.
sh3port_dev
Christopher Faylor 7 years ago
parent
commit
4c36016b57
39 changed files with 6285 additions and 4688 deletions
  1. +19
    -0
      winsup/ChangeLog
  2. +27
    -136
      winsup/Makefile.common
  3. +76
    -36
      winsup/acinclude.m4
  4. +0
    -62
      winsup/aclocal.m4
  5. +17
    -0
      winsup/autogen.sh
  6. +6
    -0
      winsup/c++wrap
  7. +50
    -0
      winsup/ccwrap
  8. +1537
    -0
      winsup/config.guess
  9. +1789
    -0
      winsup/config.sub
  10. +431
    -410
      winsup/configure
  11. +49
    -0
      winsup/configure.cygwin
  12. +15
    -18
      winsup/configure.in
  13. +8
    -0
      winsup/cygserver/ChangeLog
  14. +17
    -12
      winsup/cygserver/Makefile.in
  15. +78
    -856
      winsup/cygserver/aclocal.m4
  16. +4
    -0
      winsup/cygserver/autogen.sh
  17. +556
    -447
      winsup/cygserver/configure
  18. +13
    -4
      winsup/cygserver/configure.in
  19. +18
    -0
      winsup/cygwin/ChangeLog
  20. +55
    -34
      winsup/cygwin/Makefile.in
  21. +78
    -856
      winsup/cygwin/aclocal.m4
  22. +4
    -0
      winsup/cygwin/autogen.sh
  23. +500
    -468
      winsup/cygwin/configure
  24. +15
    -18
      winsup/cygwin/configure.in
  25. +19
    -5
      winsup/cygwin/mkvers.sh
  26. +0
    -3
      winsup/cygwin/sched.cc
  27. +1
    -1
      winsup/cygwin/select.cc
  28. +1
    -3
      winsup/cygwin/winsup.h
  29. +520
    -0
      winsup/install-sh
  30. +26
    -0
      winsup/utils/ChangeLog
  31. +62
    -66
      winsup/utils/Makefile.in
  32. +78
    -856
      winsup/utils/aclocal.m4
  33. +4
    -0
      winsup/utils/autogen.sh
  34. +195
    -381
      winsup/utils/configure
  35. +12
    -5
      winsup/utils/configure.in
  36. +1
    -9
      winsup/utils/dump_setup.cc
  37. +1
    -0
      winsup/utils/dumper.cc
  38. +1
    -0
      winsup/utils/parse_pe.cc
  39. +2
    -2
      winsup/utils/strace.cc

+ 19
- 0
winsup/ChangeLog View File

@@ -1,3 +1,22 @@
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.

2012-11-07 Christopher Faylor <me.cygwin2012@cgf.cx>

* mingw: Delete obsolete directory.


+ 27
- 136
winsup/Makefile.common View File

@@ -8,154 +8,45 @@
# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
# details.

# This makefile requires GNU make.
define justdir
$(patsubst %/,%,$(dir $1))
endef

CFLAGS_COMMON:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0 -D_SDKDDKVER_H
MALLOC_DEBUG:=#-DMALLOC_DEBUG -I/cygnus/src/uberbaum/winsup/cygwin/dlmalloc
MALLOC_OBJ:=#/cygnus/src/uberbaum/winsup/cygwin/dlmalloc/malloc.o
define libname
$(realpath $(shell ${CC} --print-file-name=$1 $2))
endef

override srcdir:=${shell cd $(srcdir); pwd}
ifneq (,${filter-out /%,$(srcdir)})
updir:=$(srcdir)/..
updir1:=$(updir)/..
else
updir:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(srcdir)):::}}
ifneq (,${findstring /,$(updir)})
updir1:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(updir)):::}}
else
updir1:=$(updir)/..
endif
endif
export PATH:=${winsup_srcdir}:${PATH}

pwd:=${shell pwd}
ifneq "${filter winsup%,${notdir $(pwd)}}" ""
here:=${pwd}/cygwin
else
here:=${dir $(pwd)}cygwin
endif
bupdir:=${shell cd $(here)/..; pwd}
ifneq (,${filter-out /%,$(bupdir)})
bupdir1:=../..
bupdir2:=../../..
else
ifneq (,${findstring /,$(bupdir)})
bupdir1:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(bupdir)):::}}
else
bupdir1:=$(bupdir)/..
endif
ifneq (,${findstring /,$(bupdir1)})
bupdir2:=${patsubst %:::,%,${patsubst %/:::,%,$(dir $(bupdir1)):::}}
else
bupdir2:=$(bupdir1)/..
endif
endif
# Allow CFLAGS=-O,-g to control CXXFLAGS too
opt=$(filter -O%,${CFLAGS}) $(filter -g,${CFLAGS})
override CXXFLAGS:=${filter-out -g,$(filter-out -O%,${CXXFLAGS})} ${opt}

newlib_source:=$(updir1)/newlib
newlib_build:=$(bupdir1)/newlib
cygwin_build:=$(bupdir)/cygwin
cygwin_source:=$(updir)/cygwin
utils_build:=$(bupdir)/utils
utils_source:=$(updir)/utils
ifeq (,${findstring $(newlib_source)/libc/include,$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)})
newlib_include:=-I$(newlib_source)/libc/include
endif
ifeq (,${findstring $(cygwin_source)/include,$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)})
cygwin_include:=-I$(cygwin_source)/include
endif
cflags_common:=-Wall -Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin -fmessage-length=0
COMPILE.cc=c++wrap ${CXXFLAGS} -fno-rtti -fno-exceptions ${cflags_common}
COMPILE.c=ccwrap ${CFLAGS} ${cflags_common}

nostdincxx:=-nostdinc++
top_srcdir:=$(call justdir,${winsup_srcdir})
top_builddir:=$(call justdir,${target_builddir})

nostdlib:=-nostdlib

ifeq (,${nostdlib})
nostdinc:=
endif

INCLUDES:=-I. $(cygwin_include) -I$(cygwin_source) $(newlib_include)
ifdef CONFIG_DIR
INCLUDES+=-I$(CONFIG_DIR)
endif

MINGW_LDFLAGS:=-static
MINGW_CFLAGS:=
MINGW_CXXFLAGS:=

GCC_DEFAULT_OPTIONS:=$(CFLAGS_COMMON) $(CFLAGS_CONFIG) $(INCLUDES)

# Link in libc and libm from newlib

LIBC:=$(newlib_build)/libc/libc.a
LIBM:=$(newlib_build)/libm/libm.a
CRT0:=$(cygwin_build)/crt0.o

ALL_CFLAGS=$(DEFS) $(MALLOC_DEBUG) $(CFLAGS) $(GCC_DEFAULT_OPTIONS)
ALL_CXXFLAGS=$(DEFS) $(MALLOC_DEBUG) $(CXXFLAGS) $(GCC_DEFAULT_OPTIONS)

ifndef PREPROCESS
c=-c
o=.o
else
c=-E -dD
o=.E
endif

libgcc:=${subst \,/,${shell $(CC_FOR_TARGET) -print-libgcc-file-name}}
gcc_libdir:=${word 1,${dir $(libgcc)}}
ifeq (,${findstring $(gcc_libdir),$(CFLAGS) $(CXXFLAGS) $(CXX) $(CC)})
GCC_INCLUDE:=${subst //,/,-I$(gcc_libdir)/include}
endif
cygwin_build:=${target_builddir}/winsup/cygwin
newlib_build:=${target_builddir}/newlib

COMPILE_CXX=$(CXX) $c $(if $($(*F)_STDINCFLAGS),,$(nostdincxx) $(nostdinc)) \
$(ALL_CXXFLAGS) $(GCC_INCLUDE) -fno-rtti -fno-exceptions
COMPILE_CC=$(CC) $c $(if $($(*F)_STDINCFLAGS),,$(nostdinc)) $(ALL_CFLAGS) $(GCC_INCLUDE)

vpath %.a $(cygwin_build):$(newlib_build)/libc:$(newlib_build)/libm

MAKEOVERRIDES_WORKAROUND=${wordlist 2,1,a b c}

ifneq ($(MAKEOVERRIDES_WORKAROUND),)
override MAKE:=$(MAKE) $(MAKEOVERRIDES)
MAKEOVERRIDES:=
export MAKEOVERRIDES
endif

ifdef RPATH_ENVVAR
VERBOSE=1
endif
nostdlib:=-nostdlib

ifneq "${findstring -B,$(COMPILE_CXX) $(COMPILE_CC)}" ""
VERBOSE=1
endif
VPATH:=${srcdir}

.PRECIOUS: %.o
.SUFFIXES:
.SUFFIXES: .c .cc .def .a .o .d .s .E

%.o: %.cc
ifdef VERBOSE
$(COMPILE_CXX) -o $(@D)/$(*F)$o $<
else
@echo $(CXX) $c $(CXXFLAGS) ... $(*F).cc
@$(COMPILE_CXX) -o $(@D)/$(*F)$o $<
endif
$(strip ${COMPILE.cc} -c -o $@ $<)

%.o: %.c
ifdef VERBOSE
$(COMPILE_CC) -o $(@D)/$(*F)$o $<
else
@echo $(CC) $c $(CFLAGS) ... $(*F).c
@$(COMPILE_CC) -o $(@D)/$(*F)$o $<
endif

$(bupdir1)/libiberty/%.o: $(updir1)/libiberty/%.c
@$(MAKE) -C $(@D) $(@F)

all:

# For auto-rebuilding the Makefile

.PRECIOUS: Makefile
$(strip ${COMPILE.c} -c -o $@ $<)

Makefile: Makefile.in $(srcdir)/configure.in config.status
$(SHELL) config.status
%.E: %.cc
$(strip ${COMPILE.cc} -E -dD -o $@ $<)

config.status: configure
$(SHELL) config.status --recheck
%.E: %.c
$(strip ${COMPILE.c} -E -dD -o $@ $<)

+ 76
- 36
winsup/acinclude.m4 View File

@@ -1,43 +1,83 @@
dnl This provides configure definitions used by all the winsup
dnl This provides configure definitions used by all the cygwin
dnl configure.in files.

# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
# link an executable. This should really be fixed in autoconf
# itself.

AC_DEFUN([LIB_AC_PROG_CC_GNU],
[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi])])

AC_DEFUN([LIB_AC_PROG_CC],
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_TOOL(CC, gcc, gcc)
: ${CC:=gcc}
AC_PROG_CC
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_DEFUN([AC_WINDOWS_HEADERS],[
AC_ARG_WITH(
[windows-headers],
[AS_HELP_STRING([--with-windows-headers=DIR],
[specify where the windows includes are located])],
[test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-headers])]
)
])

AC_DEFUN([LIB_AC_PROG_CXX],
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_TOOL(CXX, g++, g++)
if test -z "$CXX"; then
AC_CHECK_TOOL(CXX, g++, c++, , , )
: ${CXX:=g++}
AC_PROG_CXX
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_DEFUN([AC_WINDOWS_LIBS],[
AC_ARG_WITH(
[windows-libs],
[AS_HELP_STRING([--with-windows-libs=DIR],
[specify where the windows libraries are located])],
[test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-libs])]
)
windows_libdir=$(realdirpath "$with_windows_libs")
if test -z "$windows_libdir"; then
windows_libdir=$(realdirpath $(${ac_cv_prog_CC:-$CC} -xc /dev/null -Wl,--verbose=1 -lntdll 2>&1 | sed -rn 's%^.*\s(\S+)/libntdll\..*succeeded%\1%p'))
if test -z "$windows_libdir"; then
AC_MSG_ERROR([cannot find windows library files])
fi
fi
AC_SUBST(windows_libdir)
]
)

AC_DEFUN([AC_CYGWIN_INCLUDES], [
addto_CPPFLAGS -nostdinc
: ${ac_cv_prog_CXX:=$CXX}
: ${ac_cv_prog_CC:=$CC}

cygwin_headers=$(realdirpath "$winsup_srcdir/cygwin/include")
if test -z "$cygwin_headers"; then
AC_MSG_ERROR([cannot find $winsup_srcdir/cygwin/include directory])
fi

newlib_headers=$(realdirpath $winsup_srcdir/../newlib/libc/include)
if test -z "$newlib_headers"; then
AC_MSG_ERROR([cannot find newlib source directory: $winsup_srcdir/../newlib/libc/include])
fi
newlib_headers="$target_builddir/newlib/targ-include $newlib_headers"

CXXFLAGS='$(CFLAGS)'
if test -n "$with_windows_headers"; then
if test -e "$with_windows_headers/windef.h"; then
windows_headers="$with_windows_headers"
else
AC_MSG_ERROR([cannot find windef.h in specified --with-windows-headers path: $saw_windows_headers]);
fi
elif test -d "$winsup_srcdir/w32api/include/windef.h"; then
windows_headers="$winsup_srcdir/w32api/include"
else
windows_headers=$(cd $($ac_cv_prog_CC -xc /dev/null -E -include windef.h 2>/dev/null | sed -n 's%^# 1 "\([^"]*\)/windef\.h".*$%\1%p' | head -n1) 2>/dev/null && pwd)
if test -z "$windows_headers" -o ! -d "$windows_headers"; then
AC_MSG_ERROR([cannot find windows header files])
fi
fi
CC=$ac_cv_prog_CC
CXX=$ac_cv_prog_CXX
export CC
export CXX
AC_SUBST(windows_headers)
AC_SUBST(newlib_headers)
AC_SUBST(cygwin_headers)
])

AC_DEFUN([AC_CONFIGURE_ARGS], [
configure_args=X
for f in $ac_configure_args; do
case "$f" in
*--srcdir*) ;;
*) configure_args="$configure_args $f" ;;
esac
done
configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)')
AC_SUBST(configure_args)
])

AC_SUBST(target_builddir)
AC_SUBST(winsup_srcdir)

+ 0
- 62
winsup/aclocal.m4 View File

@@ -11,66 +11,4 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

# GCC_NO_EXECUTABLES
# -----------------
# FIXME: The GCC team has specific needs which the current Autoconf
# framework cannot solve elegantly. This macro implements a dirty
# hack until Autoconf is able to provide the services its users
# need.
#
# Several of the support libraries that are often built with GCC can't
# assume the tool-chain is already capable of linking a program: the
# compiler often expects to be able to link with some of such
# libraries.
#
# In several of these libraries, workarounds have been introduced to
# avoid the AC_PROG_CC_WORKS test, that would just abort their
# configuration. The introduction of AC_EXEEXT, enabled either by
# libtool or by CVS autoconf, have just made matters worse.
#
# Unlike the previous AC_NO_EXECUTABLES, this test does not
# disable link tests at autoconf time, but at configure time.
# This allows AC_NO_EXECUTABLES to be invoked conditionally.
AC_DEFUN_ONCE([GCC_NO_EXECUTABLES],
[m4_divert_push([KILL])

AC_BEFORE([$0], [_AC_COMPILER_EXEEXT])
AC_BEFORE([$0], [AC_LINK_IFELSE])

m4_define([_AC_COMPILER_EXEEXT],
AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
# FIXME: Cleanup?
AS_IF([AC_TRY_EVAL(ac_link)], [gcc_no_link=no], [gcc_no_link=yes])
if test x$gcc_no_link = xyes; then
# Setting cross_compile will disable run tests; it will
# also disable AC_CHECK_FILE but that's generally
# correct if we can't link.
cross_compiling=yes
EXEEXT=
else
m4_defn([_AC_COMPILER_EXEEXT])dnl
fi
)

m4_define([AC_LINK_IFELSE],
if test x$gcc_no_link = xyes; then
AC_MSG_ERROR([Link tests are not allowed after [[$0]].])
fi
m4_defn([AC_LINK_IFELSE]))

dnl This is a shame. We have to provide a default for some link tests,
dnl similar to the default for run tests.
m4_define([AC_FUNC_MMAP],
if test x$gcc_no_link = xyes; then
if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
ac_cv_func_mmap_fixed_mapped=no
fi
fi
if test "x${ac_cv_func_mmap_fixed_mapped}" != xno; then
m4_defn([AC_FUNC_MMAP])
fi)

m4_divert_pop()dnl
])# GCC_NO_EXECUTABLES

m4_include([acinclude.m4])

+ 17
- 0
winsup/autogen.sh View File

@@ -0,0 +1,17 @@
#!/bin/sh -e
if ! /usr/bin/test -e config.guess; then
/usr/bin/wget -q -O config.guess 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
/bin/chmod a+x config.guess
fi
if ! /usr/bin/test -e config.sub; then
/usr/bin/wget -q -O config.sub 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
/bin/chmod a+x config.sub
fi
/usr/bin/aclocal --force
/usr/bin/autoconf -f
/bin/rm -rf autom4te.cache
res=0
for d in cygwin utils cygserver; do
(cd $d && exec ./autogen.sh) || res=1
done
exit $res

+ 6
- 0
winsup/c++wrap View File

@@ -0,0 +1,6 @@
#!/usr/bin/perl
use strict;
use File::Basename;
my $pgm = basename($0);
(my $wrapper = $pgm) =~ s/\+\+/c/o;
exec $wrapper, '++', @ARGV;

+ 50
- 0
winsup/ccwrap View File

@@ -0,0 +1,50 @@
#!/usr/bin/perl
use Cwd;
use strict;
my $cxx;
my $ccorcxx;
if ($ARGV[0] ne '++') {
$ccorcxx = 'CC';
$cxx = 0;
} else {
shift @ARGV;
$ccorcxx = 'CXX';
$cxx = 1;
}
die "$0: $ccorcxx environment variable does not exist\n" unless exists $ENV{$ccorcxx};
my @compiler = split ' ', $ENV{$ccorcxx};
if ("@ARGV" !~ / -nostdinc/o) {
my $fd;
push @compiler, ($cxx ? '-xc++' : '-xc');
if (!open $fd, '-|') {
open STDERR, '>&', \*STDOUT;
exec @compiler, '/dev/null', '-v', '-E', '-o', '/dev/null' or die "*** error execing $compiler[0] - $!\n";
}
$compiler[1] =~ s/xc/nostdinc/o;
push @compiler, '-nostdinc' if $cxx;
push @compiler, '-I' . $_ for split ' ', $ENV{CCWRAP_HEADERS};
push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_SYSTEM_HEADERS};
my $finding_paths = 0;
while (<$fd>) {
if (/^\*\*\*/o) {
print;
} elsif ($_ eq "#include <...> search starts here:\n") {
$finding_paths = 1;
} elsif (!$finding_paths) {
next;
} elsif ($_ eq "End of search list.\n") {
last;
} elsif (!m%w32api|mingw.*/include%o) {
chomp;
s/^\s+//;
push @compiler, '-isystem', Cwd::abs_path($_);
}
}
push @compiler, '-isystem', $_ for split ' ', $ENV{CCWRAP_DIRAFTER_HEADERS};
close $fd;
}

push @compiler, @ARGV;

print join(' ', '+', @compiler), "\n" if $ENV{CCWRAP_VERBOSE};
exec @compiler or die "$0: $compiler[0] failed to execute\n";

+ 1537
- 0
winsup/config.guess
File diff suppressed because it is too large
View File


+ 1789
- 0
winsup/config.sub
File diff suppressed because it is too large
View File


+ 431
- 410
winsup/configure
File diff suppressed because it is too large
View File


+ 49
- 0
winsup/configure.cygwin View File

@@ -0,0 +1,49 @@
addto_CPPFLAGS() {
local f
for f; do
case " $CPPFLAGS " in
*\ $f\ *) ;;
*) CPPFLAGS="$CPPFLAGS $f" ;;
esac
done
}

realdirpath() {
[ -z "$1" ] && return 1
(cd "$1" 2>/dev/null && pwd)
if test $? -ne 0; then
return 1
else
return 0
fi
}

for d in . .. ../.. ../../..; do
if test -e "$srcdir/$d/configure.cygwin"; then
winsup_srcdir=$(realdirpath "$srcdir/$d")
break
fi
done

if test -z "$winsup_srcdir"; then
echo "cannot find directory containing configure.cygwin" 1>&2
exit 1
fi

case "$srcdir" in
*/newlib*) lookfor=newlib ;;
*/winsup*) lookfor=winsup ;;
*) lookfor=. ;;
esac

for d in . .. ../.. ../../..; do
if test -d "$d/$lookfor"; then
target_builddir=$(realdirpath "$d")
break
fi
done

if test -z "$target_builddir"; then
echo "cannot determine top build dir, looking for $lookfor" 1>&2
exit 1
fi

+ 15
- 18
winsup/configure.in View File

@@ -1,6 +1,6 @@
dnl Autoconf configure script for Cygwin.
dnl Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
dnl 2009 Red Hat, Inc.
dnl 2009, 2010, 2011, 2012 Red Hat, Inc.
dnl
dnl This file is part of Cygwin.
dnl
@@ -12,30 +12,27 @@ dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)dnl
AC_INIT(Makefile.in)
AC_CONFIG_AUX_DIR(..)

INSTALL=`cd $srcdir/..; echo $(pwd)/install-sh -c`
. ${srcdir}/configure.cygwin

AC_WINDOWS_HEADERS
AC_WINDOWS_LIBS

AC_PROG_INSTALL
AC_NO_EXECUTABLES
AC_CANONICAL_SYSTEM

GCC_NO_EXECUTABLES

LIB_AC_PROG_CC
LIB_AC_PROG_CXX

AC_LANG_C
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_LANG(C)
AC_LANG(C++)

INSTALL_LICENSE=
AC_CYGWIN_INCLUDES

case "$target" in
*cygwin*)
if ! test -d $srcdir/cygwin; then
AC_MSG_ERROR("No cygwin dir. Can't build Cygwin. Exiting...")
fi
AC_CONFIG_SUBDIRS(cygwin cygserver lsaauth utils doc)
INSTALL_LICENSE="install-license"
;;
esac
AC_CONFIG_SUBDIRS(cygwin utils cygserver lsaauth doc)
INSTALL_LICENSE="install-license"

AC_SUBST(INSTALL_LICENSE)



+ 8
- 0
winsup/cygserver/ChangeLog View File

@@ -1,3 +1,11 @@
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.

2012-10-25 Corinna Vinschen <corinna@vinschen.de>

* bsd_helper.cc (adjust_identity_info): Fix typo in log message.


+ 17
- 12
winsup/cygserver/Makefile.in View File

@@ -7,10 +7,22 @@
# 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

# environment variables used by ccwrap
export CCWRAP_HEADERS:=$(dir ${srcdir})/cygwin ${cygwin_build}
export CCWRAP_SYSTEM_HEADERS:=@cygwin_headers@ @newlib_headers@
export CCWRAP_DIRAFTER_HEADERS:=@windows_headers@

DESTDIR=
prefix:=${DESTDIR}@prefix@
@@ -24,20 +36,12 @@ INSTALL:=@INSTALL@
INSTALL_PROGRAM:=@INSTALL_PROGRAM@
INSTALL_DATA:=@INSTALL_DATA@

CC:=@CC@
CC_FOR_TARGET:=$(CC)
CXX:=@CXX@
CXX_FOR_TARGET:=$(CXX)
AR:=@AR@

include $(srcdir)/../Makefile.common

CFLAGS:=@CFLAGS@
override CXXFLAGS=@CXXFLAGS@
override CXXFLAGS+=-MMD -DHAVE_DECL_GETOPT=0 -D__OUTSIDE_CYGWIN__ -DSYSCONFDIR="\"$(sysconfdir)\""

.SUFFIXES: .c .cc .a .o .d

OBJS:= cygserver.o client.o process.o msg.o sem.o shm.o threaded_queue.o \
transport.o transport_pipes.o \
bsd_helper.o bsd_log.o bsd_mutex.o \
@@ -78,9 +82,10 @@ $(cygwin_build)/%.o: $(cygwin_source)/%.c
@$(MAKE) -C $(@D) $(@F)

Makefile: Makefile.in configure
./config.status

lib%.o: %.cc
${filter-out -D__OUTSIDE_CYGWIN__, $(COMPILE_CXX)} -c -I$(updir)/cygwin -I$(bupdir)/cygwin -o $(@D)/${basename $(@F)}$o $<
${filter-out -D__OUTSIDE_CYGWIN__, $(COMPILE.cc)} -c -o $(@D)/${basename $(@F)}.o $<

libcygserver.a: $(LIBOBJS)
$(AR) crus $@ $?


+ 78
- 856
winsup/cygserver/aclocal.m4 View File

@@ -1,875 +1,97 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
# generated automatically by aclocal 1.12.1 -*- Autoconf -*-

dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Copyright (C) 1996-2012 Free Software Foundation, Inc.

dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# lib-prefix.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

dnl From Bruno Haible.

dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])

dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])

dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
prefix="$acl_save_prefix"
])

dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])

# lib-link.m4 serial 6 (gettext-0.14.3)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl From Bruno Haible.

AC_PREREQ(2.50)
dnl This provides configure definitions used by all the cygwin
dnl configure.in files.

dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
dnl augments the CPPFLAGS variable.
AC_DEFUN([AC_LIB_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
])
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
dnl results of this search when this library appears as a dependency.
HAVE_LIB[]NAME=yes
undefine([Name])
undefine([NAME])
AC_DEFUN([AC_WINDOWS_HEADERS],[
AC_ARG_WITH(
[windows-headers],
[AS_HELP_STRING([--with-windows-headers=DIR],
[specify where the windows includes are located])],
[test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-headers])]
)
])

dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
dnl searches for libname and the libraries corresponding to explicit and
dnl implicit dependencies, together with the specified include files and
dnl the ability to compile and link the specified testcode. If found, it
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])

dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([$1], [$2])

dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
dnl because if the user has installed lib[]Name and not disabled its use
dnl via --without-lib[]Name-prefix, he wants to use it.
ac_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)

AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIB[]NAME"
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
LIBS="$ac_save_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
AC_MSG_CHECKING([how to link with lib[]$1])
AC_MSG_RESULT([$LIB[]NAME])
else
HAVE_LIB[]NAME=no
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
dnl $INC[]NAME either.
CPPFLAGS="$ac_save_CPPFLAGS"
LIB[]NAME=
LTLIB[]NAME=
fi
AC_SUBST([HAVE_LIB]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
undefine([Name])
undefine([NAME])
])
AC_DEFUN([AC_WINDOWS_LIBS],[
AC_ARG_WITH(
[windows-libs],
[AS_HELP_STRING([--with-windows-libs=DIR],
[specify where the windows libraries are located])],
[test -z "$withval" && AC_MSG_ERROR([must specify value for --with-windows-libs])]
)
windows_libdir=$(realdirpath "$with_windows_libs")
if test -z "$windows_libdir"; then
windows_libdir=$(realdirpath $(${ac_cv_prog_CC:-$CC} -xc /dev/null -Wl,--verbose=1 -lntdll 2>&1 | sed -rn 's%^.*\s(\S+)/libntdll\..*succeeded%\1%p'))
if test -z "$windows_libdir"; then
AC_MSG_ERROR([cannot find windows library files])
fi
fi
AC_SUBST(windows_libdir)
]
)

AC_DEFUN([AC_CYGWIN_INCLUDES], [
addto_CPPFLAGS -nostdinc
: ${ac_cv_prog_CXX:=$CXX}
: ${ac_cv_prog_CC:=$CC}

cygwin_headers=$(realdirpath "$winsup_srcdir/cygwin/include")
if test -z "$cygwin_headers"; then
AC_MSG_ERROR([cannot find $winsup_srcdir/cygwin/include directory])
fi

dnl Determine the platform dependent parameters needed to use rpath:
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
dnl hardcode_direct, hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
dnl Tell automake >= 1.10 to complain if config.rpath is missing.
m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
. ./conftest.sh
rm -f ./conftest.sh
acl_cv_rpath=done
])
wl="$acl_cv_wl"
libext="$acl_cv_libext"
shlibext="$acl_cv_shlibext"
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
hardcode_direct="$acl_cv_hardcode_direct"
hardcode_minus_L="$acl_cv_hardcode_minus_L"
dnl Determine whether the user wants rpath handling at all.
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not hardcode runtime library paths],
:, enable_rpath=yes)
])
newlib_headers=$(realdirpath $winsup_srcdir/../newlib/libc/include)
if test -z "$newlib_headers"; then
AC_MSG_ERROR([cannot find newlib source directory: $winsup_srcdir/../newlib/libc/include])
fi
newlib_headers="$target_builddir/newlib/targ-include $newlib_headers"

dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib$1-prefix],
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
if test -n "$with_windows_headers"; then
if test -e "$with_windows_headers/windef.h"; then
windows_headers="$with_windows_headers"
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
AC_MSG_ERROR([cannot find windef.h in specified --with-windows-headers path: $saw_windows_headers]);
fi
])
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
LTLIB[]NAME=
INC[]NAME=
rpathdirs=
ltrpathdirs=
names_already_handled=
names_next_round='$1 $2'
while test -n "$names_next_round"; do
names_this_round="$names_next_round"
names_next_round=
for name in $names_this_round; do
already_handled=
for n in $names_already_handled; do
if test "$n" = "$name"; then
already_handled=yes
break
fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call.
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
eval value=\"\$LIB$uppername\"
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
eval value=\"\$LTLIB$uppername\"
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
else
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
dnl that this library doesn't exist. So just drop it.
:
fi
else
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
dnl and the already constructed $LIBNAME/$LTLIBNAME.
found_dir=
found_la=
found_so=
found_a=
if test $use_additional = yes; then
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
found_dir="$additional_libdir"
found_so="$additional_libdir/lib$name.$shlibext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
else
if test -f "$additional_libdir/lib$name.$libext"; then
found_dir="$additional_libdir"
found_a="$additional_libdir/lib$name.$libext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
fi
fi
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
case "$x" in
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
found_dir="$dir"
found_so="$dir/lib$name.$shlibext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
else
if test -f "$dir/lib$name.$libext"; then
found_dir="$dir"
found_a="$dir/lib$name.$libext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
fi
fi
;;
esac
if test "X$found_dir" != "X"; then
break
fi
done
fi
if test "X$found_dir" != "X"; then
dnl Found the library.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $found_dir"
fi
dnl The hardcoding into $LIBNAME is system dependent.
if test "$hardcode_direct" = yes; then
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
dnl resulting binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $found_dir"
fi
else
dnl Rely on "-L$found_dir".
dnl But don't add it if it's already contained in the LDFLAGS
dnl or the already constructed $LIBNAME
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
fi
if test "$hardcode_minus_L" != no; then
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to the
dnl compiler. So give up. No hardcoding. This affects only
dnl very old systems.
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
fi
fi
fi
fi
else
if test "X$found_a" != "X"; then
dnl Linking with a static library.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
else
dnl We shouldn't come here, but anyway it's good to have a
dnl fallback.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
fi
fi
dnl Assume the include files are nearby.
additional_includedir=
case "$found_dir" in
*/lib | */lib/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
additional_includedir="$basedir/include"
;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
dnl 3. if it's already present in $CPPFLAGS or the already
dnl constructed $INCNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
for x in $CPPFLAGS $INC[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $INCNAME.
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
fi
fi
fi
fi
fi
dnl Look for dependencies.
if test -n "$found_la"; then
dnl Read the .la file. It defines the variables
dnl dlname, library_names, old_library, dependency_libs, current,
dnl age, revision, installed, dlopen, dlpreopen, libdir.
save_libdir="$libdir"
case "$found_la" in
*/* | *\\*) . "$found_la" ;;
*) . "./$found_la" ;;
esac
libdir="$save_libdir"
dnl We use only dependency_libs.
for dep in $dependency_libs; do
case "$dep" in
-L*)
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LIBNAME.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LTLIBNAME.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
fi
fi
fi
fi
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
if test "$enable_rpath" != no; then
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $dir"
fi
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $dir"
fi
fi
;;
-l*)
dnl Handle this in the next round.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
;;
*.la)
dnl Handle this in the next round. Throw away the .la's
dnl directory; it is already contained in a preceding -L
dnl option.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
;;
*)
dnl Most likely an immediate library name.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
;;
esac
done
fi
else
dnl Didn't find the library; assume it is in the system directories
dnl known to the linker and runtime loader. (All the system
dnl directories known to the linker should also be known to the
dnl runtime loader, otherwise the system is severely misconfigured.)
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
fi
fi
fi
done
done
if test "X$rpathdirs" != "X"; then
if test -n "$hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user must
dnl pass all path elements in one option. We can arrange that for a
dnl single library, but not when more than one $LIBNAMEs are used.
alldirs=
for found_dir in $rpathdirs; do
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
done
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
acl_save_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
dnl The -rpath options are cumulative.
for found_dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$found_dir"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
fi
fi
if test "X$ltrpathdirs" != "X"; then
dnl When using libtool, the option that works for both libraries and
dnl executables is -R. The -R options are cumulative.
for found_dir in $ltrpathdirs; do
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
])

dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
dnl unless already present in VAR.
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
dnl contains two or three consecutive elements that belong together.
AC_DEFUN([AC_LIB_APPENDTOVAR],
[
for element in [$2]; do
haveit=
for x in $[$1]; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X$element"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
[$1]="${[$1]}${[$1]:+ }$element"
fi
done
])

# lib-ld.m4 serial 3 (gettext-0.13)
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

dnl Subroutines of libtool.m4,
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
dnl with libtool.m4.

dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;;
*)
acl_cv_prog_gnu_ld=no ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])

dnl From libtool-1.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD],
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)]
[re_direlt='/[^/][^/]*/\.\./']
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
elif test -d "$winsup_srcdir/w32api/include/windef.h"; then
windows_headers="$winsup_srcdir/w32api/include"
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(acl_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;;
*)
test "$with_gnu_ld" != yes && break ;;
esac
windows_headers=$(cd $($ac_cv_prog_CC -xc /dev/null -E -include windef.h 2>/dev/null | sed -n 's%^# 1 "\([^"]*\)/windef\.h".*$%\1%p' | head -n1) 2>/dev/null && pwd)
if test -z "$windows_headers" -o ! -d "$windows_headers"; then
AC_MSG_ERROR([cannot find windows header files])
fi
done
IFS="$ac_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
CC=$ac_cv_prog_CC
CXX=$ac_cv_prog_CXX
export CC
export CXX
AC_SUBST(windows_headers)
AC_SUBST(newlib_headers)
AC_SUBST(cygwin_headers)
])

dnl This provides configure definitions used by all the winsup
dnl configure.in files.

# FIXME: We temporarily define our own version of AC_PROG_CC. This is
# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
# are probably using a cross compiler, which will not be able to fully
# link an executable. This should really be fixed in autoconf
# itself.

AC_DEFUN([LIB_AC_PROG_CC_GNU],
[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
[dnl The semicolon is to pacify NeXT's syntax-checking cpp.
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi])])

AC_DEFUN([LIB_AC_PROG_CC],
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_TOOL(CC, gcc, gcc)
: ${CC:=gcc}
AC_PROG_CC
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
AC_DEFUN([AC_CONFIGURE_ARGS], [
configure_args=X
for f in $ac_configure_args; do
case "$f" in
*--srcdir*) ;;
*) configure_args="$configure_args $f" ;;
esac
done
configure_args=$(/usr/bin/expr "$configure_args" : 'X \(.*\)')
AC_SUBST(configure_args)
])

AC_DEFUN([LIB_AC_PROG_CXX],
[AC_BEFORE([$0], [AC_PROG_CPP])dnl
AC_CHECK_TOOL(CXX, g++, g++)
if test -z "$CXX"; then
AC_CHECK_TOOL(CXX, g++, c++, , , )
: ${CXX:=g++}
AC_PROG_CXX
test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi

CXXFLAGS='$(CFLAGS)'
])
AC_SUBST(target_builddir)
AC_SUBST(winsup_srcdir)


+ 4
- 0
winsup/cygserver/autogen.sh View File

@@ -0,0 +1,4 @@
#!/bin/sh -e
/usr/bin/aclocal --acdir=..
/usr/bin/autoconf -f
exec /bin/rm -rf autom4te.cache

+ 556
- 447
winsup/cygserver/configure
File diff suppressed because it is too large
View File


+ 13
- 4
winsup/cygserver/configure.in View File

@@ -11,16 +11,24 @@ dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)dnl
AC_INIT(cygserver.cc)
AC_CONFIG_AUX_DIR(..)

AC_CONFIG_AUX_DIR(../..)
. ${srcdir}/../configure.cygwin

INSTALL=`cd $srcdir/../..; echo $(pwd)/install-sh -c`
AC_WINDOWS_HEADERS
AC_WINDOWS_LIBS

AC_PROG_INSTALL
AC_NO_EXECUTABLES
AC_CANONICAL_SYSTEM

LIB_AC_PROG_CC
LIB_AC_PROG_CXX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_LANG(C)
AC_LANG(C++)

AC_CYGWIN_INCLUDES

case "$with_cross_host" in
""|*cygwin*)
@@ -54,4 +62,5 @@ no) ;;
esac
])

AC_CONFIGURE_ARGS
AC_OUTPUT(Makefile)

+ 18
- 0
winsup/cygwin/ChangeLog View File

@@ -1,3 +1,21 @@
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.

2012-11-21 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>

* termios.cc (cfsetspeed): New function.


+ 55
- 34
winsup/cygwin/Makefile.in View File

@@ -1,28 +1,35 @@
# Makefile.in for Cygwin.
# Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
# 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
#
# This file is part of Cygwin.
#
# This software is a copyrighted work licensed under the terms of the
# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
# details.
# configure_input: @configure_input@

# This makefile requires GNU make.
#
# Include common definitions for winsup directory
# The following assignments are "inputs" to Makefile.common
#
CC:=@CC@
CC_FOR_TARGET:=$(CC)

srcdir:=@srcdir@
CONFIG_DIR:=$(srcdir)/config/@CONFIG_DIR@
target_builddir:=@target_builddir@
winsup_srcdir:=@winsup_srcdir@
configure_args=@configure_args@

export CC:=@CC@
export CXX:=@CXX@

CFLAGS?=@CFLAGS@
CXXFLAGS?=@CXXFLAGS@

include ${srcdir}/../Makefile.common

SHELL:=@SHELL@
objdir:=.
# environment variables used by ccwrap
export CCWRAP_HEADERS:=. ${srcdir}
export CCWRAP_SYSTEM_HEADERS:=@cygwin_headers@ @newlib_headers@
export CCWRAP_DIRAFTER_HEADERS:=@windows_headers@

VPATH:=$(srcdir):$(CONFIG_DIR):$(srcdir)/regex:$(srcdir)/lib:$(srcdir)/libc
VPATH+=$(CONFIG_DIR) $(srcdir)/regex $(srcdir)/lib $(srcdir)/libc

target_alias:=@target_alias@
build_alias:=@build_alias@
@@ -35,6 +42,7 @@ bindir:=@bindir@
libdir:=@libdir@
mandir:=@mandir@
sysconfdir:=@sysconfdir@
datarootdir:=@datarootdir@
ifeq ($(target_alias),$(host_alias))
ifeq ($(build_alias),$(host_alias))
tooldir:=$(exec_prefix)
@@ -52,17 +60,24 @@ override INSTALL:=@INSTALL@
override INSTALL_PROGRAM:=@INSTALL_PROGRAM@
override INSTALL_DATA:=@INSTALL_DATA@

WINDOWS_LIBDIR:=@windows_libdir@

cygserver_blddir:=${target_builddir}/winsup/cygserver
LIBSERVER:=${cygserver_blddir}/libcygserver.a

LIBC:=$(newlib_build)/libc/libc.a
LIBM:=$(newlib_build)/libm/libm.a
CRT0:=$(cygwin_build)/crt0.o

#
# --enable options from configure
#
MT_SAFE:=@MT_SAFE@
DEFS:=@DEFS@
CCEXTRA:=
CFLAGS?=@CFLAGS@
override CFLAGS+=-MMD ${$(*F)_CFLAGS} -Werror -fmerge-constants -ftracer \
-mno-use-libstdc-wrappers $(CCEXTRA)
CXX=@CXX@
override CXXFLAGS=@CXXFLAGS@
CCEXTRA=
COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Werror -fmerge-constants -ftracer $(CCEXTRA)
COMPILE.cc+=${COMMON_CFLAGS} -mno-use-libstdc-wrappers
COMPILE.c+=${COMMON_CFLAGS}

AR:=@AR@
AR_FLAGS:=qv
@@ -169,6 +184,13 @@ EXCLUDE_STATIC_OFILES:=$(addprefix --exclude=,\
spawn.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

GMON_OFILES:=gmon.o mcount.o profil.o

NEW_FUNCTIONS:=$(addprefix --replace=,\
@@ -227,7 +249,6 @@ NEW_FUNCTIONS:=$(addprefix --replace=,\
API_VER:=$(srcdir)/include/cygwin/version.h

LIB_NAME:=libcygwin.a
LIBSERVER:=@LIBSERVER@
SUBLIBS:=libpthread.a libutil.a ${CURDIR}/libm.a ${CURDIR}/libc.a libdl.a libresolv.a librt.a
EXTRALIBS:=libautomode.a libbinmode.a libtextmode.a libtextreadmode.a
INSTOBJS:=automode.o binmode.o textmode.o textreadmode.o
@@ -299,9 +320,6 @@ cxx_STDINCFLAGS:=yes
.PHONY: all force dll_ofiles install all_target install_target all_host install_host \
install install-libs install-headers

.SUFFIXES:
.SUFFIXES: .c .cc .def .a .o .d .s

all_host=@all_host@
install_host=@install_host@

@@ -386,7 +404,7 @@ uninstall-man:

clean:
-rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h $(srcdir)/tlsoffsets.h $(srcdir)/devices.cc
-@$(MAKE) -C $(bupdir)/cygserver libclean
-@$(MAKE) -C ${cygserver_blddir} libclean

maintainer-clean realclean: clean
@echo "This command is intended for maintainers to use;"
@@ -396,7 +414,7 @@ maintainer-clean realclean: clean

# Rule to build cygwin.dll
$(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp
$(CXX) $(CXXFLAGS) -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) -static \
$(CXX) $(CXXFLAGS) -L${WINDOWS_LIBDIR} -Wl,--gc-sections $(nostdlib) -Wl,-T$(firstword $^) -static \
-Wl,--heap=0 -Wl,--out-implib,cygdll.a -shared -o $@ \
-e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
$(MALLOC_OBJ) $(LIBSERVER) $(LIBM) $(LIBC) \
@@ -416,8 +434,12 @@ ${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME}
$(TEST_LIB_NAME): $(LIB_NAME)
perl -p -e 'BEGIN{binmode(STDIN); binmode(STDOUT);}; s/cygwin1/cygwin0/g' < $? > $@

$(LIBSERVER): $(bupdir)/cygserver/Makefile
$(MAKE) -C $(bupdir)/cygserver libcygserver.a
$(LIBSERVER): ${cygserver_blddir}/Makefile
$(MAKE) -C ${cygserver_blddir} libcygserver.a

${cygserver_blddir}/Makefile:
mkdir -p ${@D}
cd ${@D} && exec /bin/sh $(dir ${srcdir})/cygserver/configure ${configure_args}

dll_ofiles: $(DLL_OFILES)

@@ -436,10 +458,10 @@ globals.h: mkglobals_h globals.cc
${DLL_OFILES} ${LIBCOS}: globals.h

shared_info_magic.h: cygmagic shared_info.h
/bin/sh $(word 1,$^) $@ "${COMPILE_CXX} -E -x c++" $(word 2,$^) SHARED_MAGIC 'class shared_info' USER_MAGIC 'class user_info'
/bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) SHARED_MAGIC 'class shared_info' USER_MAGIC 'class user_info'

child_info_magic.h: cygmagic child_info.h
/bin/sh $(word 1,$^) $@ "${COMPILE_CXX} -E -x c++" $(word 2,$^) CHILD_INFO_MAGIC 'class child_info'
/bin/sh $(word 1,$^) $@ "${COMPILE.cc} -E -x c++" $(word 2,$^) CHILD_INFO_MAGIC 'class child_info'

dcrt0.o sigproc.o: child_info_magic.h

@@ -448,7 +470,7 @@ shared.o: shared_info_magic.h
$(srcdir)/devices.cc: gendevices devices.in devices.h
${wordlist 1,2,$^} $@

${CURDIR}/libc.a: ${LIB_NAME} ./libm.a libpthread.a libutil.a
${CURDIR}/libc.a: ${LIB_NAME} ${CURDIR}/libm.a libpthread.a libutil.a
${speclib} -v ${@F}

${CURDIR}/libm.a: ${LIB_NAME} $(LIBM)
@@ -474,17 +496,18 @@ ${EXTRALIBS}: lib%.a: %.o

winver_stamp: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES)
@echo "Making version.o and winver.o";\
$(SHELL) ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) && \
$(COMPILE_CXX) -c -o version.o version.cc && \
/bin/sh ${word 1,$^} ${word 2,$^} ${word 3,$^} $(WINDRES) ${CFLAGS} $(addprefix -I,${CCWRAP_SYSTEM_HEADERS} ${CCWRAP_DIRAFTER_HEADERS}) S&& \
$(COMPILE.cc) -c -o version.o version.cc && \
touch $@

Makefile: cygwin.din
Makefile: cygwin.din ${srcdir}/Makefile.in
/bin/sh ./config.status

$(DEF_FILE): gendef cygwin.din $(srcdir)/tlsoffsets.h
$^ $@ sigfe.s

$(srcdir)/tlsoffsets.h: gentls_offsets cygtls.h
$^ $@ $(COMPILE_CXX) -c
$^ $@ $(COMPILE.cc) -c

sigfe.s: $(DEF_FILE)
@[ -s $@ ] || \
@@ -494,8 +517,6 @@ sigfe.s: $(DEF_FILE)
sigfe.o: sigfe.s
$(CC) -c -o $@ $<

winsup.h: config.h

ctags: CTAGS
tags: CTAGS
CTAGS:


+ 78
- 856
winsup/cygwin/aclocal.m4 View File

@@ -1,875 +1,97 @@
dnl aclocal.m4 generated automatically by aclocal 1.4-p6
# generated automatically by aclocal 1.12.1 -*- Autoconf -*-

dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# Copyright (C) 1996-2012 Free Software Foundation, Inc.

dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

# lib-prefix.m4 serial 4 (gettext-0.14.2)
dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

dnl From Bruno Haible.

dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])

dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux* | gnu* | k*bsd*-gnu) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])

dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"