Cairo exports and more (was Re: [cairo] Re: Munging header files for export (and other) attributes)

Tor Lillqvist tml at iki.fi
Thu Sep 8 02:38:12 PDT 2005


Hans Breuer writes:
 > For Gtk+, Dia, The GIMP and some other projects the msvc build relies on
 > configuration *by hand*. You basically need one master makefile-include-file
 > which defines FOO_CFLAGS and FOO_LIBS matching your installation.

It would be great BTW to finally rework the glib/build/win32/make.msc
and module.defs stuff. At least for software that provides pkg.config
.pc files, one should use pkg-config to produce the required makefile
snippets for nmake. And the current setup is geared against having the
*sources* for dependent packages "installed" (at least the comments
say so), and including headers and linking to import libraries from
the source (build) directories.

(Even though I use gcc myself, occasionally I do find myself thinking
"hmm, maybe I should build this or that with MSVC so that I could run
it usefully under boundschecker". But having to manually edit the
make.msc files etc is not that interesting.)

Doesn't the current way for instance make it very hard to use
alternative versions of glib, for instance? If pkg-config was used
instead of hardcoded paths (to source directories), just by setting
PKG_CONFIG_PATH one could switch between what "installed" versions of
some package's headers and import libraries one builds against.

Something like the below would presumably be useful, a .bat file
called runpkfconfig.bat: (If you are a sensitive Unix guy, please stop
reading NOW.)

@rem ================
@echo off
verify other 2>nul
setlocal enableextensions
if errorlevel 1 echo No extensions >&2 && exit 1

:loop
if "%1"=="" goto :eof
set pkg=%1
shift
set varbl=%1
shift
for /f "usebackq" %%i in (`pkg-config  --msvc-syntax --cflags %pkg%`) do echo %varbl%_CFLAGS = %%i
for /f "usebackq" %%i in (`pkg-config  --msvc-syntax --libs %pkg%`) do echo %varbl%_LIBS = %%i
echo #
goto loop
@rem ================

\begin{rant}
Yes, MSFT, since Win2k, has backquote functionality in their shell!
It only took, eh, 20 years? No, they didn't implement it as generally
as Unix shells (surprised?). By some unfathomable rationale it is
possible to use backquotes only in the FOR command, and even then you
need to specify a special "usebackq" flag... Surely this proves the
old saying that "those who don't understand Unix are condemned to
reinvent it, badly".
\end{rant}

The makefile.msc files would then make sure the above is run and then
invoke a sub-nmake that would include the file generated by the
above. Or something like that.

--tml



More information about the cairo mailing list