On Fri, Nov 09, 2012, Shao Miller wrote more as:> > Does anyone know of a clever, Linux-distribution-independent way to find out > where MinGW has its lib/ and include/ dirs? Right now, I've hard-coded the > path for Fedora 17 in the Makefiles. ># # pkg-config # CFLAGS=$(shell pkg-config --cflags uuid ) LIBS=$(shell pkg-config --libs uuid ) proofofconcept: echo PoC ${CFLAGS} ${LIBS} # last line of this Makefile
On Sat, Nov 10, 2012 at 01:04:11PM +0100, Geert Stappers wrote:> On Fri, Nov 09, 2012, Shao Miller wrote more as: > > > > Does anyone know of a clever, Linux-distribution-independent way to find out > > where MinGW has its lib/ and include/ dirs? Right now, I've hard-coded the > > path for Fedora 17 in the Makefiles. > > > > # > # pkg-config > # > CFLAGS=$(shell pkg-config --cflags uuid ) > LIBS=$(shell pkg-config --libs uuid ) > > proofofconcept: > echo PoC ${CFLAGS} ${LIBS} > > # last line of this MakefileMeanwhile I understood that `pkg-config` is not the answer to the above question. I have been working on a script that does compile on Debian and should still work on Fedora 17. I'll git-mail it Groeten Geert Stappers --> And is there a policy on top-posting vs. bottom-posting?Yes.
Shao Miller
2012-Nov-11 17:04 UTC
[syslinux] [PATCH] mdiskchk: files for `./configure && make`
On 11/10/2012 07:04, Geert Stappers wrote:> On Fri, Nov 09, 2012, Shao Miller wrote more as: >> >> Does anyone know of a clever, Linux-distribution-independent way to find out >> where MinGW has its lib/ and include/ dirs? Right now, I've hard-coded the >> path for Fedora 17 in the Makefiles. >> > > # > # pkg-config > # > CFLAGS=$(shell pkg-config --cflags uuid ) > LIBS=$(shell pkg-config --libs uuid ) > > proofofconcept: > echo PoC ${CFLAGS} ${LIBS} > > # last line of this MakefileOn 11/11/2012 09:49, Geert Stappers wrote:> > Meanwhile I understood that `pkg-config` > is not the answer to the above question. > > I have been working on a script that does compile on Debian > and should still work on Fedora 17. I'll git-mail itOn 11/11/2012 09:54, Geert Stappers wrote:> > > --- > win32/mdiskchk/Makefile | 22 +++++++++++++++++++++ > win32/mdiskchk/configure | 48 ++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 70 insertions(+) > create mode 100644 win32/mdiskchk/Makefile > create mode 100644 win32/mdiskchk/configure > > diff --git a/win32/mdiskchk/Makefile b/win32/mdiskchk/Makefile > new file mode 100644 > index 0000000..50388d3 > --- /dev/null > +++ b/win32/mdiskchk/Makefile > @@ -0,0 +1,22 @@ > +# > +# Makefile > +# > +# to reflect build order of the directories "sys/" and "exe/" > +# and to make the ./configure script less lonely in this directory > +# > + > +mdiskchk.exe: exe/mdiskchk.exe > + cp exe/mdiskchk.exe . > + > +exe/mdiskchk.exe: sys/pmem.o > + ( cd exe ; make ) > + > +sys/pmem.o: > + ( cd sys ; make ) > + > +clean: > + ( cd sys ; make clean ) > + ( cd exe ; make clean ) > + rm -f exe/mdiskchk.exe # that might be in git > + > +# l l > diff --git a/win32/mdiskchk/configure b/win32/mdiskchk/configure > new file mode 100644 > index 0000000..12210b8 > --- /dev/null > +++ b/win32/mdiskchk/configure > @@ -0,0 +1,48 @@ > +#!/bin/bash > +# > +# Handcrafted configure script > +# > +# It is a response to > +# > Does anyone know of a clever, Linux-distribution-independent way to find out > +# > where MinGW has its lib/ and include/ dirs? > +# > + > +function firstfounddirectory > +{ > + while read CHECKME COMMENT > + do > + if [ -d $CHECKME ] ; then > + echo $CHECKME > + return > + fi > + done > + echo '/sorry/directory/not/in/supplied/list' > +} > + > +WININC=$( firstfounddirectory << HERE > +/possible/directory/without/white/space optional: extra information > +/usr/i686-w64-mingw32/sys-root/mingw/include fedora17 RPM version > +/usr/i686-w64-mingw32/include debian mingw-w64-i686-dev 2.0.3-1 > +HERE > +) > + > +WINLIB=$( firstfounddirectory << HERE > +/usr/i686-w64-mingw32/sys-root/mingw/lib works for Sha0 > +/usr/i686-w64-mingw32/lib debian mingw-w64-i686-dev 2.0.3-1 > +HERE > +) > + > +# TODO: have a {exe,sys}/Makefile.in and generate {exe,sys}/Makefile > +# current workaround: modify the {exe,sys}/Makefile that is in SCM > + > +sed --in-place \ > + -e "s@^WININC.*:=.*@WININC := $WININC@" \ > + -e "s@^WINLIB.*:=.*@WINLIB := $WINLIB@" \ > + exe/Makefile > + > +sed --in-place \ > + -e "s@^WININC.*:=.*@WININC := $WININC@" \ > + -e "s@^WINLIB.*:=.*@WINLIB := $WINLIB@" \ > + sys/Makefile > + > +# l l > -- 1.7.10.4 >Thanks a lot for all of this, Geert! I will try this patch out. - Shao P. S. A "bottom-post," just for you.
On 11/10/2012 04:04 AM, Geert Stappers wrote:> On Fri, Nov 09, 2012, Shao Miller wrote more as: >> >> Does anyone know of a clever, Linux-distribution-independent way to find out >> where MinGW has its lib/ and include/ dirs? Right now, I've hard-coded the >> path for Fedora 17 in the Makefiles. >> > > # > # pkg-config > # > CFLAGS=$(shell pkg-config --cflags uuid ) > LIBS=$(shell pkg-config --libs uuid ) > > proofofconcept: > echo PoC ${CFLAGS} ${LIBS} > > # last line of this MakefileSlightly confused... what is this needed for? In most cases you shouldn't need this, and instead should let the MinGW gcc pick up the proper headers. Either way, if you know the appropriate name for gcc (as found by find-mingw32.sh and find-mingw64.sh) you can do: $(GCC) -print-search-dirs | sed -e 's/^libraries: =//p' -e d ... to get a colon-separated list of library directories. Unfortunately I don't know of a way to get the full include path. -hpa