[syslinux] [PATCH] mdiskchk: files for `./configure && make`
Shao Miller
sha0.miller at gmail.com
Sun Nov 11 09:04:28 PST 2012
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 Makefile
On 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 it
On 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.
More information about the Syslinux
mailing list