-
Notifications
You must be signed in to change notification settings - Fork 541
Expand file tree
/
Copy pathconfigure.bat
More file actions
115 lines (108 loc) · 3.89 KB
/
Copy pathconfigure.bat
File metadata and controls
115 lines (108 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
@if "%ECHOON%" == "" (@echo off) else (@echo %ECHOON%)&:: set ECHOON=on if you want to debug this script
@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@:: THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY ::
@:: Read the zproject/README.md for information about making permanent changes. ::
@::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@setlocal
:- configure.bat creates platform.h and configures the build process
:- You MUST run this before building via msbuild or VisualStudio.
IF %1.==--help. (
ECHO Syntax: configure [ switch ]
ECHO --help show this help
ECHO --enable-drafts from zip package, enables DRAFT API
ECHO --disable-drafts from git repository, disables DRAFT API
ECHO --without-zmakecert do not build zmakecert.exe
ECHO --without-zoscdump do not build zoscdump.exe
ECHO --without-zsp do not build zsp.exe
ECHO --without-test_randof do not build test_randof.exe
ECHO --without-czmq_selftest do not build czmq_selftest.exe
GOTO :eof
)
ECHO Configuring CZMQ...
:- make sure our directory is builds\msvc no matter where user is when executing it from
@pushd %~dp0%
ECHO // Generated by configure.bat> platform.h
ECHO. >> platform.h
ECHO #ifndef __PLATFORM_H_INCLUDED__>> platform.h
ECHO #define __PLATFORM_H_INCLUDED__>> platform.h
ECHO. >> platform.h
ECHO #define CZMQ_HAVE_WINDOWS 1>> platform.h
:- Check for dependencies
IF EXIST "..\..\..\libzmq" (
ECHO Building with libzmq
ECHO #define HAVE_LIBZMQ 1>> platform.h
) ELSE (
ECHO Building without libzmq
ECHO CZMQ cannot build without libzmq
ECHO Please clone https://github.com/zeromq/libzmq.git, and then configure ^& build
ECHO TODO: resolve this problem automatically.
GOTO error
)
IF EXIST "..\..\..\uuid" (
ECHO Building with uuid
ECHO #define HAVE_UUID 1>> platform.h
) ELSE (
ECHO Building without uuid
ECHO #undef HAVE_UUID>> platform.h
)
IF EXIST "..\..\..\systemd" (
ECHO Building with systemd
ECHO #define HAVE_SYSTEMD 1>> platform.h
) ELSE (
ECHO Building without systemd
ECHO #undef HAVE_SYSTEMD>> platform.h
)
IF EXIST "..\..\..\lz4" (
ECHO Building with lz4
ECHO #define HAVE_LZ4 1>> platform.h
) ELSE (
ECHO Building without lz4
ECHO #undef HAVE_LZ4>> platform.h
)
IF EXIST "..\..\..\libcurl" (
ECHO Building with libcurl
ECHO #define HAVE_LIBCURL 1>> platform.h
) ELSE (
ECHO Building without libcurl
ECHO #undef HAVE_LIBCURL>> platform.h
)
IF EXIST "..\..\..\nss" (
ECHO Building with nss
ECHO #define HAVE_NSS 1>> platform.h
) ELSE (
ECHO Building without nss
ECHO #undef HAVE_NSS>> platform.h
)
IF EXIST "..\..\..\libmicrohttpd" (
ECHO Building with libmicrohttpd
ECHO #define HAVE_LIBMICROHTTPD 1>> platform.h
) ELSE (
ECHO Building without libmicrohttpd
ECHO #undef HAVE_LIBMICROHTTPD>> platform.h
)
:- Check if we want to build the draft API
if "%1" == "--enable-drafts" goto :with_draft
if "%1" == "--disable-drafts" goto :no_draft
IF NOT EXIST "..\..\.git" GOTO no_draft
:with_draft
ECHO Building with draft API (stable + legacy + draft API)
ECHO // Provide draft classes and methods>>platform.h
ECHO #define CZMQ_BUILD_DRAFT_API 1>>platform.h
GOTO end_draft
:no_draft
ECHO Building without draft API (stable + legacy API)
ECHO #undef CZMQ_BUILD_DRAFT_API 1>>platform.h
:end_draft
ECHO. >> platform.h
ECHO #endif>> platform.h
goto :done
:done
popd
@endlocal
:: this is how you code a return in a windows batch script... "goto :eof"
:: you see after a "call :label", %0 == ":label" inside :label, until "goto :eof" happens.
@if "%0:~1,1" == ":" @goto :eof
@exit /b 0
:error
call :done
@exit /b 1