[PATCH] libgloss: merge wince configure script up a level

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Move the minor wince-specific logic to a dedicated file & namespace
them so we can merge its configure logic up a level.  The makefile
is a bit tricky, but maybe it still works.
---
 libgloss/Makefile.am        |    4 +
 libgloss/Makefile.in        |  152 +-
 libgloss/aclocal.m4         |   59 +-
 libgloss/configure          |  108 +-
 libgloss/configure.ac       |    3 +-
 libgloss/wince/Makefile.am  |   13 -
 libgloss/wince/Makefile.in  |  753 ------
 libgloss/wince/Makefile.inc |    8 +
 libgloss/wince/acinclude.m4 |    5 +
 libgloss/wince/aclocal.m4   | 1109 ---------
 libgloss/wince/configure    | 4369 -----------------------------------
 libgloss/wince/configure.ac |   32 -
 12 files changed, 283 insertions(+), 6332 deletions(-)
 delete mode 100644 libgloss/wince/Makefile.am
 delete mode 100644 libgloss/wince/Makefile.in
 create mode 100644 libgloss/wince/Makefile.inc
 create mode 100644 libgloss/wince/acinclude.m4
 delete mode 100644 libgloss/wince/aclocal.m4
 delete mode 100755 libgloss/wince/configure
 delete mode 100644 libgloss/wince/configure.ac

diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am
index b180309ca238..5b5a6b47c4f4 100644
--- a/libgloss/Makefile.am
+++ b/libgloss/Makefile.am
@@ -3,6 +3,7 @@
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Variables that will accumulate in subdirs.
+bin_PROGRAMS =
 check_PROGRAMS =
 info_TEXINFOS =
 PHONY =
@@ -68,3 +69,6 @@ endif
 if CONFIG_LIBNOSYS
 include libnosys/Makefile.inc
 endif
+if CONFIG_WINCE
+include wince/Makefile.inc
+endif
diff --git a/libgloss/configure.ac b/libgloss/configure.ac
index a47334280348..f9d037066bc3 100644
--- a/libgloss/configure.ac
+++ b/libgloss/configure.ac
@@ -96,7 +96,7 @@ case "${target}" in
 	AC_CONFIG_SUBDIRS([sparc])
 	;;
   sh*-*-pe | mips*-*-pe | *arm*-wince-pe)
-	AC_CONFIG_SUBDIRS([wince])
+	config_wince=true
 	;;
   mips*-*-*)
 	AC_CONFIG_SUBDIRS([mips])
@@ -244,6 +244,7 @@ esac
 
 AM_CONDITIONAL(CONFIG_BFIN, test x$config_bfin = xtrue)
 AM_CONDITIONAL(CONFIG_IQ2000, test x$config_iq2000 = xtrue)
+AM_CONDITIONAL(CONFIG_WINCE, test x$config_wince = xtrue)
 
 dnl For now, don't bother configuring testsuite
 dnl
diff --git a/libgloss/wince/Makefile.am b/libgloss/wince/Makefile.am
deleted file mode 100644
index d32e4184c363..000000000000
--- a/libgloss/wince/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-## Process this file with automake to produce Makefile.in.
-
-AUTOMAKE_OPTIONS = foreign
-ACLOCAL_AMFLAGS = -I . -I .. -I ../.. -I ../../config
-
-gdbdir = ${dir ${patsubst %/,%,${dir @srcdir@}}}gdb
-VPATH = $(gdbdir)
-bin_PROGRAMS = stub.exe
-stub_exe_SOURCES = wince-stub.c
-
-tooldir = $(exec_prefix)/$(host_alias)
-AM_CPPFLAGS = -I$(gdbdir)
-LDADD = @LDADD@
diff --git a/libgloss/wince/Makefile.inc b/libgloss/wince/Makefile.inc
new file mode 100644
index 000000000000..1c78894a55a4
--- /dev/null
+++ b/libgloss/wince/Makefile.inc
@@ -0,0 +1,8 @@
+## Process this file with automake to produce Makefile.in.
+
+gdbdir = ${dir ${patsubst %/,%,${dir @srcdir@}}}gdb
+VPATH += $(gdbdir)
+bin_PROGRAMS += %D%/stub.exe
+%C%_stub_exe_SOURCES = wince-stub.c
+%C%_stub_exe_CPPFLAGS = $(AM_CPPFLAGS) -I$(gdbdir)
+%C%_stub_exe_LDADD = -lwinsock $(WINCE_STUB_LIBS)
diff --git a/libgloss/wince/acinclude.m4 b/libgloss/wince/acinclude.m4
new file mode 100644
index 000000000000..047a66a3992a
--- /dev/null
+++ b/libgloss/wince/acinclude.m4
@@ -0,0 +1,5 @@
+WINCE_STUB_LIBS=
+case "${target}" in
+  *arm*-wince-pe) WINCE_STUB_LIBS='-lsslsock' ;;
+esac
+AC_SUBST(WINCE_STUB_LIBS)
diff --git a/libgloss/wince/configure.ac b/libgloss/wince/configure.ac
deleted file mode 100644
index d17b061ff467..000000000000
--- a/libgloss/wince/configure.ac
+++ /dev/null
@@ -1,32 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT(wince-stub, 1.0)
-AC_CANONICAL_SYSTEM
-AC_ARG_PROGRAM
-AM_INIT_AUTOMAKE
-AM_MAINTAINER_MODE
-
-cross_compiling=yes
-program_transform_name=s,^,@target_alias@-,;
-
-: ${CFLAGS='-O2'}
-LIB_AC_PROG_CC
-# CFLAGS="$CFLAGS -Xlinker --defsym -Xlinker _main=_WinMain"
-AC_CHECK_TOOL(LD, ld, ld)
-AC_SUBST(LD)
-AC_PROG_INSTALL
-case "${target}" in
-    *arm*-*-*)	LDADD='-lwinsock -lsslsock' ;;
-    *)		LDADD='-lwinsock'
-esac
-AC_SUBST(LDADD)
-LIB_AM_PROG_AS
-#
-# The following is sort of a kludge but we *know* that we need
-# an executable extension and, currently, the sh-pe-gcc compiler
-# doesn't play well with configure, so, set a "cache" entry.
-#
-: ${ac_cv_exeext='.exe'}
-AC_EXEEXT
-
-AC_OUTPUT([Makefile])
-- 
2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.