Created
December 20, 2012 00:09
-
-
Save shimondoodkin/4341933 to your computer and use it in GitHub Desktop.
libxml2 xml2-config translated to .bat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
rem libxml2-2.7.8.win32.zip can be downloaded from ftp://xmlsoft.org/libxml2/win32/libxml2-2.7.8.win32.zip | |
setlocal ENABLEDELAYEDEXPANSION | |
rem http://batcheero.blogspot.co.il/2007/06/how-to-enabledelayedexpansion.html - windows xp | |
SET SELFDIR=%~dp0 | |
IF %SELFDIR:~-1%==\ SET SELFDIR=%SELFDIR:~0,-1% | |
set SELFDIR=%SELFDIR:\=/% | |
set prefix=%SELFDIR%/libxml2-2.7.8.win32 | |
set exec_prefix=%prefix% | |
set includedir=%prefix%/include | |
set libdir=%exec_prefix%/lib | |
IF "%1"=="" GOTO usage0 | |
rem whats the point of resettingthes flags... | |
rem set cflags=false | |
rem set libs=false | |
:loop | |
IF "%1"=="" Exit /B 0 | |
IF "%1"=="--version" ( | |
echo 2.4.12 | |
Exit /B 0 | |
) | |
IF "%1"=="--help" ( | |
GOTO usage0 | |
) | |
rem the code below does: if next arg is not any known argument nor empty then the next arg is prefix value otherwise print the prefix | |
IF "%1"=="--prefix" ( | |
IF "%2"=="" ( SHIFT | |
echo %prefix%) ELSE ( | |
IF "%2"=="--cflags" ( SHIFT | |
echo %prefix% ) ELSE ( | |
IF "%2"=="--libs" ( SHIFT | |
echo %prefix%) ELSE ( | |
IF "%2"=="--prefix" ( SHIFT | |
echo %prefix%) ELSE ( | |
SET /A prefix=%2 | |
set exec_prefix=!prefix! | |
set includedir=!prefix!/include | |
set libdir=!exec_prefix!/lib | |
SHIFT | |
SHIFT | |
) | |
) | |
) | |
) | |
) | |
IF "%1"=="--cflags" ( | |
echo -I!includedir!/libxml2/libxml -I!includedir!/libxml2 | |
SHIFT | |
) | |
IF "%1"=="--libs" ( | |
echo -L!libdir! -lxml2 -lz -liconv -lm -Wl,-s -lwsock32 -liberty -lMsup -lMstubs | |
SHIFT | |
) | |
GOTO :loop | |
Exit /B 1 | |
:usage0 | |
echo Usage: xml-config [OPTION] | |
echo _ | |
echo Known values for OPTION are: | |
echo _ | |
echo --prefix=DIR change libxml prefix [default $prefix] | |
echo --libs print library linking information | |
echo --cflags print pre-processor and compiler flags | |
echo --help display this help and exit | |
echo --version output version information | |
Exit /B 0 | |
:usage1 | |
echo Usage: xml-config [OPTION] | |
echo _ | |
echo Known values for OPTION are: | |
echo _ | |
echo --prefix=DIR change libxml prefix [default $prefix] | |
echo --libs print library linking information | |
echo --cflags print pre-processor and compiler flags | |
echo --help display this help and exit | |
echo --version output version information | |
Exit /B 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment