public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Add without-library-checks
@ 2016-03-31 16:34 Peter Foley
  2016-04-01 12:16 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Foley @ 2016-03-31 16:34 UTC (permalink / raw)
  To: cygwin-patches; +Cc: Peter Foley

When cross-compiling a toolchan targeting cygwin, building cygwin1.dll
requires libgcc.
However, building libgcc requires the cygwin headers to be
installed.
Configuring cygwin requries the mingw-crt libraries, which require the
cygwin headers to be installed.
Work around this circular dependency by adding a
--without-library-checks configure option to skip cygwin's configure checks
for valid mingw-crt libraries.
Since the mingw-crt libraries only require the cygwin headers to be
installed, this allows us to successfully configure cygwin so that we
can only install the headers without trying to build any
libraries.

winsup/ChangeLog
configure.ac: add without-library-checks option
configure: regenerate
winsup/cygserver/ChangeLog
configure.ac: don't check AC_WINDOWS_LIBS when using without-library-checks
configure: regenerate
winsup/cygwin/ChangeLog
configure.ac: don't check AC_WINDOWS_LIBS when using without-library-checks
configure: regenerate

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
---
 winsup/configure              | 14 ++++++++++++++
 winsup/configure.ac           |  5 ++++-
 winsup/cygserver/configure    |  2 ++
 winsup/cygserver/configure.ac |  9 ++++++---
 winsup/cygwin/configure       |  2 ++
 winsup/cygwin/configure.ac    | 11 +++++++----
 6 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/winsup/configure b/winsup/configure
index 541c81b..5abf793 100755
--- a/winsup/configure
+++ b/winsup/configure
@@ -666,6 +666,7 @@ ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 with_mingw_progs
+with_library_checks
 with_windows_headers
 with_windows_libs
 '
@@ -1297,6 +1298,9 @@ Optional Packages:
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --without-mingw-progs   do not build programs using the mingw toolchain
                           (useful for cross-compiling)
+  --without-library-checks
+                          do not check for valid w32api libraries (useful for
+                          bootstraping a cross-compiler)
   --with-windows-headers=DIR
                           specify where the windows includes are located
   --with-windows-libs=DIR specify where the windows libraries are located
@@ -3370,6 +3374,14 @@ else
 fi
 
 
+# Check whether --with-library_checks was given.
+if test "${with_library_checks+set}" = set; then :
+  withval=$with_library_checks;
+else
+  with_library_checks=yes
+fi
+
+
 
 
 # Check whether --with-windows-headers was given.
@@ -3379,6 +3391,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_library_checks" != "xno"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3397,6 +3410,7 @@ fi
 
 
 
+fi
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
diff --git a/winsup/configure.ac b/winsup/configure.ac
index b04f044..3c27674 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -26,9 +26,12 @@ AC_PROG_CXX
 AC_PROG_CPP
 AC_LANG(C)
 AC_ARG_WITH([mingw-progs],[AS_HELP_STRING([--without-mingw-progs],[do not build programs using the mingw toolchain (useful for cross-compiling)])],[],[with_mingw_progs=yes])
+AC_ARG_WITH([library_checks],[AS_HELP_STRING([--without-library-checks],[do not check for valid w32api libraries (useful for bootstraping a cross-compiler)])],[],[with_library_checks=yes])
 
 AC_WINDOWS_HEADERS
-AC_WINDOWS_LIBS
+if test "x$with_library_checks" != "xno"; then
+    AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
diff --git a/winsup/cygserver/configure b/winsup/cygserver/configure
index 37caf57..c2112ed 100755
--- a/winsup/cygserver/configure
+++ b/winsup/cygserver/configure
@@ -3381,6 +3381,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_library_checks" != "xno"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3399,6 +3400,7 @@ fi
 
 
 
+fi
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
diff --git a/winsup/cygserver/configure.ac b/winsup/cygserver/configure.ac
index 5d1464b..3c96a57 100644
--- a/winsup/cygserver/configure.ac
+++ b/winsup/cygserver/configure.ac
@@ -9,7 +9,7 @@ dnl details.
 dnl
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)
+AC_PREREQ([2.59])
 AC_INIT([Cygwin Cygserver],[0],[cygwin@cygwin.com],[cygwin],[https://cygwin.com])
 AC_CONFIG_SRCDIR(cygserver.cc)
 AC_CONFIG_AUX_DIR(..)
@@ -26,7 +26,9 @@ AC_PROG_CPP
 AC_LANG(C)
 
 AC_WINDOWS_HEADERS
-AC_WINDOWS_LIBS
+if test "x$with_library_checks" != "xno"; then
+  AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
@@ -65,4 +67,5 @@ esac
 ])
 
 AC_CONFIGURE_ARGS
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/winsup/cygwin/configure b/winsup/cygwin/configure
index aa26015..8e69354 100755
--- a/winsup/cygwin/configure
+++ b/winsup/cygwin/configure
@@ -3392,6 +3392,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_library_checks" != "xno"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3410,6 +3411,7 @@ fi
 
 
 
+fi
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
diff --git a/winsup/cygwin/configure.ac b/winsup/cygwin/configure.ac
index fe8e038..efef76f 100644
--- a/winsup/cygwin/configure.ac
+++ b/winsup/cygwin/configure.ac
@@ -10,7 +10,7 @@ dnl details.
 dnl
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)
+AC_PREREQ([2.59])
 AC_INIT([Cygwin DLL],[0],[cygwin@cygwin.com],[cygwin],[https://cygwin.com])
 AC_CONFIG_SRCDIR(Makefile.in)
 AC_CONFIG_HEADER(config.h)
@@ -28,7 +28,9 @@ AC_PROG_CPP
 AC_LANG(C)
 
 AC_WINDOWS_HEADERS
-AC_WINDOWS_LIBS
+if test "x$with_library_checks" != "xno"; then
+  AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
@@ -99,7 +101,7 @@ case "$target_cpu" in
 		DIN_FILE="x86_64.din"
 		TLSOFFSETS_H="tlsoffsets64.h"
 		;;
-   *)		AC_MSG_ERROR(Invalid target processor \"$target_cpu\") ;;
+   *)		AC_MSG_ERROR([Invalid target processor "$target_cpu"]) ;;
 esac
 
 AC_CONFIGURE_ARGS
@@ -109,4 +111,5 @@ AC_SUBST(DLL_ENTRY)
 AC_SUBST(DEF_DLL_ENTRY)
 AC_SUBST(DIN_FILE)
 AC_SUBST(TLSOFFSETS_H)
-AC_OUTPUT(Makefile)
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
-- 
2.8.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add without-library-checks
  2016-03-31 16:34 [PATCH] Add without-library-checks Peter Foley
@ 2016-04-01 12:16 ` Corinna Vinschen
  2016-04-01 13:31   ` Peter Foley
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2016-04-01 12:16 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 1120 bytes --]

On Mar 31 12:33, Peter Foley wrote:
> When cross-compiling a toolchan targeting cygwin, building cygwin1.dll
> requires libgcc.
> However, building libgcc requires the cygwin headers to be
> installed.
> Configuring cygwin requries the mingw-crt libraries, which require the
> cygwin headers to be installed.
> Work around this circular dependency by adding a
> --without-library-checks configure option to skip cygwin's configure checks
> for valid mingw-crt libraries.
> Since the mingw-crt libraries only require the cygwin headers to be
> installed, this allows us to successfully configure cygwin so that we
> can only install the headers without trying to build any
> libraries.

Can we please fold the --without-mingw-progs and --without-library-checks
into a single option?  Given the task is basically the same, the option
name should reflect something along the lines of "cross-build",
"bootstrap", and "stage 1", IMO.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add without-library-checks
  2016-04-01 12:16 ` Corinna Vinschen
@ 2016-04-01 13:31   ` Peter Foley
  2016-04-01 15:11     ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Foley @ 2016-04-01 13:31 UTC (permalink / raw)
  To: cygwin-patches

On Fri, Apr 1, 2016 at 8:16 AM, Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
> Can we please fold the --without-mingw-progs and --without-library-checks
> into a single option?  Given the task is basically the same, the option
> name should reflect something along the lines of "cross-build",
> "bootstrap", and "stage 1", IMO.

Sure,
Maybe --with-cross-bootstrap?
I'll respin this when I get a chance.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add without-library-checks
  2016-04-01 13:31   ` Peter Foley
@ 2016-04-01 15:11     ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2016-04-01 15:11 UTC (permalink / raw)
  To: cygwin-patches

[-- Attachment #1: Type: text/plain, Size: 624 bytes --]

On Apr  1 09:31, Peter Foley wrote:
> On Fri, Apr 1, 2016 at 8:16 AM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > Can we please fold the --without-mingw-progs and --without-library-checks
> > into a single option?  Given the task is basically the same, the option
> > name should reflect something along the lines of "cross-build",
> > "bootstrap", and "stage 1", IMO.
> 
> Sure,
> Maybe --with-cross-bootstrap?

Sounds good.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-01 15:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-31 16:34 [PATCH] Add without-library-checks Peter Foley
2016-04-01 12:16 ` Corinna Vinschen
2016-04-01 13:31   ` Peter Foley
2016-04-01 15:11     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).