[patch 04/10] Add mingw target libraries
Yann E. MORIN
yann.morin.1998@anciens.enib.fr
Sun May 30 18:18:00 GMT 2010
Remy, All,
On Thursday 27 May 2010 23:18:13 Remy Bohmer wrote:
> Add several development libraries to the build of the mingw cross-compiler
> to be used on target
I'm wondering if those should go into the companion libraries sub-menu...
> Libraries:
> PDCurses (port of the ncurses library)
This one seems like it is used to replace ncurses to build gdb.
I guess we should move ncurses to the companion libraries, it
would make it easier to handle ncurses vs. PDcurses...
And, by the way, PDcurses is not a *port* of ncurses. It is a
re-impementation. PDcurses is in the public domain, while ncurses
uses a MIT-like license.
> GnuRX (the regex library)
> DirectX
> OpenGL
Seriously, moving those to the "compamnion libraries" sub-menu
would be nice:
- it makes sense as they are not part of the 'core' toolchain
- one of them is actually used by a target component (gdb)
And would make me happy about not including non-system libs in crosstool-NG.
Let's support it when stand-alone, yes. But when acting as a backend (which
is now almost completely implemented), it will be the responsibility of the
upper-layer build system to install those libs.
> Signed-off-by: Bart vdr. Meulen <bartvdrmeulen@gmail.com>
> ---
> config/libc/mingw.in | 72 +++++++++++
> patches/PDCurses/3.4/mingw32_cross_compile.patch | 87 +++++++++++++
> patches/mingw-libgnurx/2.5.1/build-static-library.patch | 103 ++++++++++++++++
Patches should be indexed with a three-digit prefix, starting at 100:
patches/PDCurses/3.4/100-mingw32_cross_compile.patch
patches/mingw-libgnurx/2.5.1/100-d-static-library.patch
It makes it easy to ensure a strict ordering in all locales, should new
patches be later added.
> Index: crosstool-ng/config/libc/mingw.in
> ===================================================================
> --- crosstool-ng.orig/config/libc/mingw.in
> +++ crosstool-ng/config/libc/mingw.in
[--SNIP--]
> +config MINGW_PDCURSES
> + bool
> + prompt "Include PDCurses (NCurses library) development files"
> + default n
> +
> +choice
> + bool
> + prompt "PDCurses library version"
I gues we don't want to show the PDcurses version choice if the user does
not select PDcurses, above...
[--SNIP--]
> +config MINGW_GNURX
> + bool
> + prompt "Include GnuRX (regex library) development files"
> + default n
> +
> +choice
> + bool
> + prompt "GnuRX library version"
Ditto for GnuRX: not selected -> don't show version choice.
> Index: crosstool-ng/patches/PDCurses/3.4/mingw32_cross_compile.patch
> ===================================================================
> --- /dev/null
> +++ crosstool-ng/patches/PDCurses/3.4/mingw32_cross_compile.patch
> @@ -0,0 +1,87 @@
> +--- PDCurses-3.4.orig/win32/mingwin32.mak 2009-11-02 13:50:11.000000000 +0100
> ++++ PDCurses-3.4/win32/mingwin32.mak 2009-11-02 13:53:43.000000000 +0100
> +@@ -18,7 +18,7 @@
> +
> + PDCURSES_WIN_H = $(osdir)/pdcwin.h
> +
> +-CC = gcc
> ++CC = ${CROSS_COMPILE}gcc
> +
> + ifeq ($(DEBUG),Y)
> + CFLAGS = -g -Wall -DPDCDEBUG
> +@@ -30,8 +30,8 @@
> +
> + CFLAGS += -I$(PDCURSES_SRCDIR)
> +
> +-BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def
> +-WIDEDEF = $(PDCURSES_SRCDIR)\exp-wide.def
> ++BASEDEF = $(PDCURSES_SRCDIR)/exp-base.def
> ++WIDEDEF = $(PDCURSES_SRCDIR)/exp-wide.def
Altough I personally don't care, I think this will break if we use
crosstool-NG in a mingw32 environment, as mingw32 uses '\' as the
directory 'spliting' char. Or I'm wrong, and need to be educated! ;-)
> + DEFDEPS = $(BASEDEF)
> +
> +@@ -46,17 +46,17 @@
> +
> + DEFFILE = pdcurses.def
> +
> +-LINK = gcc
> ++LINK = ${CROSS_COMPILE}gcc
> +
> + ifeq ($(DLL),Y)
> + CFLAGS += -DPDC_DLL_BUILD
> +- LIBEXE = gcc $(DEFFILE)
> ++ LIBEXE = ${CROSS_COMPILE}gcc $(DEFFILE)
> + LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
> + LIBCURSES = pdcurses.dll
> + LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE)
> + CLEAN = $(LIBCURSES) *.a $(DEFFILE)
> + else
> +- LIBEXE = ar
> ++ LIBEXE = ${CROSS_COMPILE}ar
> + LIBFLAGS = rcv
> + LIBCURSES = pdcurses.a
> + LIBDEPS = $(LIBOBJS) $(PDCOBJS)
> +@@ -70,24 +70,24 @@
> + libs: $(LIBCURSES)
> +
> + clean:
> +- -del *.o
> +- -del *.exe
> +- -del $(CLEAN)
> ++ -rm *.o
> ++ -rm *.exe
> ++ -rm $(CLEAN)
Again, that would break on mingw32, right?
What about using smthg like:
ifeq ($(blabla),mingw32)
RM:=del
CAT:=type
CP:=copy
else
RM:=rm
CAT:=cat
CP:=cp
endif
clean:
-$(RM) blabla
and so on...
> + demos: $(DEMOS)
> +- strip *.exe
> ++ ${CROSS_COMPILE}strip *.exe
> +
> + $(DEFFILE): $(DEFDEPS)
> + echo LIBRARY pdcurses > $@
> + echo EXPORTS >> $@
> +- type $(BASEDEF) >> $@
> ++ cat $(BASEDEF) >> $@
Ditto?
Use:
$(CAT) blabla...
> + ifeq ($(WIDE),Y)
> +- type $(WIDEDEF) >> $@
> ++ cat $(WIDEDEF) >> $@
Ditto?
> + endif
> +
> + $(LIBCURSES) : $(LIBDEPS)
> + $(LIBEXE) $(LIBFLAGS) $@ $?
> +- -copy pdcurses.a panel.a
> ++ -cp pdcurses.a panel.a
Ditto?
Use:
$(CP) blabla...
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list