[PATCH 5/5] Add with-only-headers

Peter Foley pefoley2@pefoley.com
Mon Mar 21 17:16:00 GMT 2016


When cross-compiling a toolchan targeting cygwin, building cygwin1.dll
requires libstdc++v3 to be built.
However, building libstdc++v3 requires the cygwin headers to be
installed.
Work around this circular dependency by adding a --with-only-headers
configure option to only install the headers without trying to build any
libraries.

winsup/ChangeLog
Makefile.in: add special install target for with-only-headers
configure.ac: add with-only-headers option
configure: regenerate
winsup/cygserver/ChangeLog
configure.ac: don't check AC_WINDOWS_LIBS when using with-only-headers
configure: regenerate
winsup/cygwin/ChangeLog
configure.ac: don't check AC_WINDOWS_LIBS when using with-only-headers
configure: regenerate

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
---
 winsup/Makefile.in            |  5 +++++
 winsup/configure              | 15 ++++++++++++++-
 winsup/configure.ac           |  8 ++++++--
 winsup/cygserver/configure    |  3 ++-
 winsup/cygserver/configure.ac | 12 +++++++-----
 winsup/cygwin/configure       |  3 ++-
 winsup/cygwin/configure.ac    | 14 ++++++++------
 7 files changed, 44 insertions(+), 16 deletions(-)

diff --git a/winsup/Makefile.in b/winsup/Makefile.in
index 1fdf93a..76da977 100644
--- a/winsup/Makefile.in
+++ b/winsup/Makefile.in
@@ -69,7 +69,12 @@ install-license: CYGWIN_LICENSE COPYING
 	  ${INSTALL} $$i $(DESTDIR)$(prefix)/share/doc/Cygwin ; \
 	done
 
+ifeq (@with_only_headers@,yes)
+install: Makefile
+	@${MAKE} -C cygwin install-headers
+else
 install: Makefile $(INSTALL_LICENSE) $(INSTALL_SUBDIRS)
+endif
 
 clean: $(CLEAN_SUBDIRS)
 
diff --git a/winsup/configure b/winsup/configure
index 57c3378..55a5490 100755
--- a/winsup/configure
+++ b/winsup/configure
@@ -596,6 +596,7 @@ cygwin_headers
 newlib_headers
 windows_headers
 windows_libdir
+with_only_headers
 CPP
 ac_ct_CXX
 CXXFLAGS
@@ -665,6 +666,7 @@ target_builddir'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
+with_only_headers
 with_windows_headers
 with_windows_libs
 '
@@ -1294,6 +1296,8 @@ if test -n "$ac_init_help"; then
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-only-headers     only install headers 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
@@ -3359,6 +3363,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+# Check whether --with-only-headers was given.
+if test "${with_only_headers+set}" = set; then :
+  withval=$with_only_headers;
+fi
+
+
+
 
 
 # Check whether --with-windows-headers was given.
@@ -3368,6 +3379,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_only_headers" != "xyes"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3386,6 +3398,7 @@ fi
 
 
 
+fi
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -3433,7 +3446,7 @@ export CXX
 
 
 
-if test "x$cross_compiling" != xyes; then
+if test "x$cross_compiling" != "xyes"; then
 
 
 subdirs="$subdirs utils lsaauth"
diff --git a/winsup/configure.ac b/winsup/configure.ac
index ce4f4bb..01c61dc 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -25,15 +25,19 @@ AC_PROG_CC
 AC_PROG_CXX
 AC_PROG_CPP
 AC_LANG(C)
+AC_ARG_WITH([only-headers],[AS_HELP_STRING([--with-only-headers],[only install headers for bootstraping a cross-compiler])])
+AC_SUBST(with_only_headers)
 
 AC_WINDOWS_HEADERS
-AC_WINDOWS_LIBS
+if test "x$with_only_headers" != "xyes"; then
+    AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
 AC_CYGWIN_INCLUDES
 
-if test "x$cross_compiling" != xyes; then
+if test "x$cross_compiling" != "xyes"; then
     AC_CONFIG_SUBDIRS([utils lsaauth])
 fi
 
diff --git a/winsup/cygserver/configure b/winsup/cygserver/configure
index a4feae1..dd8f4de 100755
--- a/winsup/cygserver/configure
+++ b/winsup/cygserver/configure
@@ -2106,7 +2106,6 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3382,6 +3381,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_only_headers" != "xyes"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3400,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 4e2cb45..d04c39f 100644
--- a/winsup/cygserver/configure.ac
+++ b/winsup/cygserver/configure.ac
@@ -9,9 +9,8 @@ dnl details.
 dnl
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)dnl
-AC_INIT([Cygwin Cygserver], 0,
-	cygwin@cygwin.com, cygwin, https://cygwin.com)
+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(..)
 
@@ -19,7 +18,7 @@ AC_CONFIG_AUX_DIR(..)
 
 AC_PROG_INSTALL
 AC_NO_EXECUTABLES
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_TARGET
 
 AC_PROG_CC
 AC_PROG_CXX
@@ -27,7 +26,9 @@ AC_PROG_CPP
 AC_LANG(C)
 
 AC_WINDOWS_HEADERS
+if test "x$with_only_headers" != "xyes"; then
 AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
@@ -66,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 522fae6..4d6b449 100755
--- a/winsup/cygwin/configure
+++ b/winsup/cygwin/configure
@@ -2117,7 +2117,6 @@ test -n "$target_alias" &&
     NONENONEs,x,x, &&
   program_prefix=${target_alias}-
 
-
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3393,6 +3392,7 @@ if test "${with_windows_headers+set}" = set; then :
 fi
 
 
+if test "x$with_only_headers" != "xyes"; then
 
 
 # Check whether --with-windows-libs was given.
@@ -3411,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 fc7697b..29b1e0c 100644
--- a/winsup/cygwin/configure.ac
+++ b/winsup/cygwin/configure.ac
@@ -10,9 +10,8 @@ dnl details.
 dnl
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.59)dnl
-AC_INIT([Cygwin DLL], 0,
-	cygwin@cygwin.com, cygwin, https://cygwin.com)
+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)
 AC_CONFIG_AUX_DIR(..)
@@ -21,7 +20,7 @@ AC_CONFIG_AUX_DIR(..)
 
 AC_PROG_INSTALL
 AC_NO_EXECUTABLES
-AC_CANONICAL_SYSTEM
+AC_CANONICAL_TARGET
 
 AC_PROG_CC
 AC_PROG_CXX
@@ -29,7 +28,9 @@ AC_PROG_CPP
 AC_LANG(C)
 
 AC_WINDOWS_HEADERS
+if test "x$with_only_headers" != "xyes"; then
 AC_WINDOWS_LIBS
+fi
 
 AC_LANG(C++)
 
@@ -100,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
@@ -110,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.7.4



More information about the Cygwin-patches mailing list