-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault_config.ini
159 lines (142 loc) · 16.8 KB
/
default_config.ini
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
BUILD_NAME=required #ie findutils, should be the official name as we sometimes use this value to look for default libs etc
BUILD_FOLDER_NAME=[BUILD_NAME] #the folder under the base folder it will be built in
#if the var name starts with ENV_ and the value is 'env' then the var is set to the value of the environment variable with the name of the variable name without the leading ENV_
#you can set the base folder directly if desired note the path should be in the form x:/path/to/folder as this path form works both under msys and windows
ENV_WLB_BASE_FOLDER=env
BASE_FOLDER=[ENV_WLB_BASE_FOLDER]
SRC_FOLDER=[BASE_FOLDER]/[BUILD_FOLDER_NAME]
BUILD_AUX_FOLDER=[SRC_FOLDER]/build-aux
BUILD_AUX_SCRIPTS_DEFAULT = ( "ar-lib" "compile" "ld-link" "wrapper_helper.sh" )
BUILD_AUX_SCRIPTS_ADDL = ()
INSTALL_FOLDER_NAME=final
PREFER_STATIC_LINKING=1 #note this is only effecting the library searching and may requireother defines, we will auto update the VCPKG triplet for static libs if VCPKG_TRIPLET is default, if you change this it is best to likely start fresh with a checkout as not all our changes are automatically undone for all packages
INSTALL_FOLDER=[SRC_FOLDER]/[INSTALL_FOLDER_NAME]
FORCE_BUILD_ID=x86_64-MSYS2-mingw32 #there is ming64 but not everything defaults to that triplet support
OUR_LIB_DEPS=() #what other libraries that we build do we depend on, automatically calls add_lib_pkg_config at end of start common with these as well
OUR_LIB_BINS_PATH=() #what libraries/apps that we depend on should we add the output bin folder to the start of our path, these will count as deps even thought we don't add to pkg config
VCPKG_DEPS=() #what vcpkg installed libs do we need, automatically calls add_vcpkg_pkg_config at end of startcommon with these as well
PKG_CONFIG_MANUAL_ADD=() # if the config script is not pkg-config aware we can simulate it by adding to the CFLAGS and LDFAGS directly, this can be any lib pkgconfig can find through our deps of VCPKG installs deps
#these only apply to ./configure for cmake configure see cmake section
CONFIG_CMD_DEFAULT=("--config-cache" "--prefix=[INSTALL_FOLDER]" "--build=[FORCE_BUILD_ID]") #default additional commands to configure only, not for cmake configure calls
CONFIG_CMD_ADDL=() #any additional options to pass to ./configure beyond what we will generate
CONFIG_CMD_ADDL_STATIC=( "--enable-static" "--disable-shared" ) #additional configure config flags but only if static builds
CONFIG_CMD_ADDL_SHARED=( "--enable-shared" "--disable-static" ) #additional configure config flags but only if shared builds
CONFIG_CMD_ADDL_DEBUG=() #additional config flags but only for debug builds
CONFIG_CMD_GNULIB_ADDL=("--enable-threads=windows" "--disable-silent-rules")
CONFIG_PKG_CONFIG_STATIC_FIX=1 #configure.ac has the updated PKG_CHECK_MODULES_STATIC for static modules but not everything uses it, only done when static builds enabled
CONFIG_FLEX_NO_UNISTD_FIX=1 #for flex we add the %option nounistd to the test to avoid its failure
#these apply to cmake too
CONFIG_ADDL_LIBS=() # -lSomeLib
CONFIG_DEFAULT_WINDOWS_LIBS=("-lBcrypt" "-lWs2_32" "-lShell32" "-luser32" "-lAdvapi32" "-lKernel32" "-lWinmm")
CONFIG_BYPASS_FILESYSTEM_LIST_FAIL=1
CONFIG_GETHOSTNAME_FIX=1
BUILD_DEBUG=0 #build as much as possible in MSVS debug mode compat
BUILD_MSVC_RUNTIME_INFO_ADD_TO_C_AND_LDFLAGS=0 #add debug/static runtime (/MT /MD etc to CFLAGS and LDFLAGS), if this is enabled the BUILD_DEBUG and PREFER_STATIC_LINKING are used to determine what exactly. For most this is not needed, may be helpful if using with debugger.
BUILD_MSVC_CL_DEBUG_OPTS=/ZI /Zf /FS #it will also add things like /DEBUG by default, ZI=generate PDB, FS=sync PDB generation for when doing make -j X, Zf=speed up the synced PDB generation, not even with /FS it will get access errors with concurrent building. Our make command also falls back to non-concurrent building as a backup.
BUILD_MSVC_CL_NDEBUG_OPTS=/Os #optimize for size
BUILD_MSVC_IGNORE_WARNINGS=() #ie 4700, 4711, will turn into /wd4700 ...
BUILD_MSVC_NO_DEFAULT_LIB=none #if set to "full" will ignore all libs not the one we want can be set to "debug" to just set it to the non debug or debug lib (depending on if debugging or not)
BUILD_WINDOWS_COMPILE_WRAPPERS=0 #if you can't use the GNU_LIB_BUILD_AUX wrappers as it is a windows program calling the compiler (cmake or name for example) you can enable this to still get logging, that is all the wrapper does before passing all args through
BUILD_ADDL_CFLAGS=()
BUILD_ADDL_LDFLAGS=()
BUILD_ADDL_CFLAGS_DEBUG=( "-DDEBUG" ) #non standard but several apps to use it by default
BUILD_ADDL_CFLAGS_STATIC=()
BUILD_MAKE_JOBS=8 #if set to > 1 make command is `make -jJOBS | make` this makes sure any errors are easy to find and not buried due to multi-job
BUILD_MAKE_CMD_DEFAULT="make"
BUILD_MAKE_CMD_ADDL=() # additional args to pass to make generally we shouldn't be passing things here
BUILD_MAKE_INSTALL_CMD_ADDL=() #any additional args to pass to make install
CONFIG_NO_TESTS=1
CONFIG_NO_PO=1
CONFIG_NO_DOCS=1
OUR_OS_FIXES_COMPILE=0 #compile our osfixes.c/h libs
OUR_OS_FIXES_APPLY_TO_DBG=0 #will force our osfixes.obj to be linked in useful for stopping the dbgassert popups at start/end, will enable OUR_OS_FIXES_COMPILE if not enabled
GIT_CLONE_BRANCH="" #force a specific branch
GIT_PRINT_LAST_COMMIT_ON_CLONE=0 #print the last commit message in the repo on clone
GIT_NO_RECURSE=0 #Don't recurse submodules by deafult
GIT_SUBMODULE_INITS=() #if no recursing should we init any submodules for you?
GIT_SETTINGS_DEFAULT=( "core.autocrlf false" "user.email [email protected]" "user.name YourNamee" "core.fileMode false" "core.eol lf" "diff.ignoreAllSpace true" "apply.ignoreWhitespace change" "apply.whitespace fix" )
GIT_SETTINGS_ADDL=() #
GIT_IGNORE_DEFAULT=("*.exe" "*.ilk" "*.obj" "*.log" "*.Plo" "*.pdb" "*.idb" "*.zip" "*.tmp" "*.o" ".deps" "*.a" "final" "proj_config.ini" "*~" "*confest*" "_configure" )
GIT_IGNORE_DONE_TEST_STR="proj_config.ini"
GIT_IGNORE_ADDL=()
GIT_PATCH_APPLY_DEFAULT_ARGS=("--whitespace=nowarn" "--ignore-space-change" "--ignore-whitespace")
GIT_STASH_STAGE_AROUND_PATCHES=1 # to make it easier to tell what code you have changed vs what code we patch/change with the build script we can try to stage all of the changes we make using git. This way any untracked changes are the changes you made. In general this works without error always on first builds. To re-apply patches though we have to do some stashing of changes in different ways to discard the old applied patch changes before applying them again. We try to stash user changes separately and backup everything to tmp files (see output for what tmp files for a specific run) so it should be hard to lose your changes. It is more likely a conflict of some sort will occur though so this can break. There are also a few scripts where we need to commit a fake commit to git to store some changes we made to get this to work. If you disable this then it will just apply patches without any staging, which may make it harder to see changes you made.
GIT_STASH_STAGE_DEBUG=0 #given the above is fragile this will output debug messages if it is breaking to help determine what went wrong
ADD_WIN_ARGV_LIB=0 #should windows expand wildcard command line args, often we may want this if any multi file command arges are taken but not for something like find -name "*.c" we don't want it on
GNU_LIBS_USED=1 #0 if this is not actually a gnu app, otherwise we throw an error if we cannot find the gnu dir
GNU_LIB_SOURCE_DIR=[BASE_FOLDER]/gnulib #if this folder exists we will set GNULIB_SRCDIR to it and it should be used for sources, this can be useful for using a set of local changes for a repo but won't speed up cloning
GNU_LIB_REFERENCE_SOURCE_DIR=[BASE_FOLDER]/gnulib.git # this uses the --reference feature of git to speed up clones. Note: --reference does not work for submodules by default so we have to simulate this with not doing a recursive clone, if gnulib exists as a sub folder we can then use git submodule update with --reference to work. This folder existing turns off recursive cloning for all repos and will manually do so. To generate the source gnulib.git folder do a bare clone like: `git clone --mirror https://git.savannah.gnu.org/git/gnulib.git`.
GNU_LIB_REFERENCE_MASTER_SHORTCUT=1 # This only does something if GNU_LIB_REFERENCE_SOURCE_DIR and GNU_LIBS_BRANCH are set. By default we sync to the branch of the parent repo specifying. In our next step after applying our patch though we normally call gnulib_switch_to_master_and_patch and switch to master. Setting this shortcut to true though doesn't use git submodule update. Instead after our non recursive clone we git rm the submodule, re-add the submodule using --reference (and on the master branch) then unstage it
GNU_LIBS_BRANCH=master #leave blank to use whatever version the app checks out, technically this can be set to a specific sha for a commit if no branch exists
GNU_LIBS_BUILD_AUX_ONLY_USED=1
#symlink gets us unistd and lstat, lstat gets us stat, stat gets us sys_stat and filename
GNU_LIBS_DEFAULT=( "sigpipe" "sigaction" "spawn-pipe" "strtok_r" "waitpid" "windows-stat-inodes" "windows-stat-timespec" "execute" "poll" "symlink" "symlinkat" "readlink" "readlinkat" "link" "fchmodat" "unlink" "unlinkat" "fsync" "open" )
GNU_LIBS_ADDL=()
GNU_LIBS_EXCLUDE= ()
GNU_LIBS_USE_GNULIB_TOOL_PY=1
GNU_LIBS_AUTORECONF_WRAPPER=1 #the wrapper allows us to inject anything needed mid bootstrap (so after autoconf before actual bootstrap call). Ensures our build-aux scripts installed, uses --symlink, and optionally disables --force, beware if you disable this you likely need to run `gnulib_ensure_buildaux_scripts_copied --forced` after bootstrapping. If libtool is used you will need to run libtool_fixes and autoreconf after bootstrapping to fix it, otherwise you will get hangs (potentially even during bootstrapping...)
GNU_LIBS_AUTORECONF_DISABLE_FORCE=0 #prevent --force being used
GNU_LIBS_LIBTOOL_FIXES=("build-aux/ltmain.sh" "m4/libtool.m4") # if these files exist we will run libtool_fixes on them post any autoreconf commands
GNU_LIBS_PATCHES_DEFAULT=( "NOOP_FOR_WINDOWS_CHOWN_CHMOD_GETUSER_GETGROUP" "GNULIB_TOOL_APPLY_PATCHES_BY_FILE" "FTS_MINOR_FIXES" "BUILD_AUX_HANDLE_DOT_A_LIBS" "FIX_SYSSTAT_TIMESPEC_DISABLE_BUG" "WIN_FSUSAGE_FIXES" "WINDOWS_SYMLINK_SUPPORT" "SPAWN_PIPE_FORK_FD_FIXES" "WINDOW_PATH_FIXES" "PHYSMEM_TEST_MAIN_RENAME" "WIN32_POLL_FIXES" "MSVC_PARAMETER_HANDLER_M4_MACRO_FIX" )
GNU_LIBS_PATCHES_ADDL=()
GNU_LIBS_BOOTSTRAP_CMD_DEFAULT=("--no-bootstrap-sync" "--no-git") #will automatically append gnulib-srcdir if GNULIB_SRCDIR is set or gnulib exists in project root, also does --skip-po if CONFIG_NO_PO set
GNU_LIBS_BOOTSTRAP_CMD_ADDL=()
GNU_LIBS_BOOTSTRAP_EXTRAS_ADD="" # for gnulib bootstrap confs that dont already have gnulib_tool_option_extras we will add this line to it
GNU_LIBS_ADD_TO_REPO=0 #Does a checkout of gnulib after checking out the main repo
PERL_DIR=[BASE_FOLDER]/perl #perl is mostly only needed for openssl, or if we need gcc's gas assembler (as.exe) easy way is to take it from perl bins
PERL_INSTALL=0 #install perl sometimes used to just get AS.exe from GAS
PERL_SET_AS=0 #if installing perl should be alias AS to GAS should be autopicked up by our compile script then
VCPKG_DIR=[BASE_FOLDER]/vcpkg
VCPKG_INSTALL_TARGET_BASEDIR=[BASE_FOLDER]/vc_pkgs
VCPKG_TRIPLET=x64-windows[STATIC_RELEASE_TRIPLET_AUTO]
VCPKG_BINARY_DIR=[VCPKG_DIR]/archive
VCPKG_BIN=[VCPKG_DIR]/vcpkg.exe
VCPKG_STRIP_TRIPLET=0 #can strip the triplet off vcpkg to make the install paths shorter but if you switch between debug/release static/not without removing this will fail off by default
LOG_DEBUG_WRAPPERS=1 #enable debug mode for build-aux wrappers, show input and output, essentially sets DEBUG_GNU_COMPILE_WRAPPER=1 DEBUG_GNU_LIB_WRAPPER=1
LOG_COLOR_HIGHLIGHT=1 #when using some of our command wrappers do minimal coloring of the output
LOG_ON_AT_INIT=1
LOG_OFF_AT_FINAL=1
LOG_IGNORE_CMDS_EXACT_DEFAULT= ( "LOGOFF" "trap - debug" "LOGON" "ourmain" "ex " "echo \"{*@Q}\" 1>&3" "\"\$@\"" )
LOG_IGNORE_CMDS_EXACT_ADDL=()
LOG_IGNORE_CMDS_REGEX_DEFAULT=( "IFS=' ' read" "^\\(\\(" )
LOG_IGNORE_CMDS_REGEX_ADDL=( )
LOG_FILE="[BASE_FOLDER]/[BUILD_FOLDER_NAME]-cmd.log"
LOG_MAKE_CMD_FILE="[BASE_FOLDER]/[BUILD_FOLDER_NAME]-make.log" #must call log_make to generate
LOG_CONFIG_ENV_FILE="[BASE_FOLDER]/[BUILD_FOLDER_NAME]-env.log"
LOG_CONFIGURE_FILE="[BASE_FOLDER]/[BUILD_FOLDER_NAME]-configure.log"
LOG_RAW_BUILD_FILE="[BASE_FOLDER]/[BUILD_FOLDER_NAME]-build.bat" #if used with the "log_raw_build" or "log_raw_build_full" all the actual commands output to cl.exe or lib.exe although need to add link.exe you can also use log_true_make_full to run all the commands up to true make and stop at that point
LOG_RAW_BUILD_FILE_POST_PROCESS=1 # This will call the dotnet bat_cleanup.csx script after generating the bat file. It fixes any msys only paths into windows compat paths, it will also try to extract out long repeating strings into bat variables. See the comments at the top of the file for more details., note not currently actually enabled.
LOG_EXPAND_VARS=0 #This is a safeish way to expand the variables in commands but it is pretty slow, also note expanding the command manually is not error proof, any bash vars declared local won't be avail, and if there is a global var with the same name it will appear instead. This is for the LOG_FILE file.
LOG_FILE_AUTOTAIL=0
LOG_COPY_LOGS_TO_INFODIR=0 #if we should copy the *-.log and bat files etc to the final/info dir. Off by default and only for debug builds
LOG_IGNORE_REPEAT_LINES=1
STACKTRACE_ON_FAIL=1
EXPAND_FAILED_CMD_ON_STACKTRACE=1 #Note expanding the command manually is not error proof, any bash vars declared local won't be avail, and if there is a global var with the same name it will appear instead.
PRINT_VARS_AT_START=0
CMAKE_STYLE="" #enabling this will automatically set some vars in start_common and for template generation use cmake over make
#VALUES: best,vs,unix-msys,ninja,ninja-msys,nmake,nmake-launchers,msys
#Best is current recommendation
# Visual studio (vs) almost always works perfectly but we can't really log commands as it uses msbuild, all these other attempts are to get logging to properly work
# unix-msys works well uses gnu wrappers hrm actually the file extensions for binaries are missing (no .exe) would need to manually rename anyhting in the bin folder, but otherwise works
# unix works pretty well as long as we use the windows wrappers, only issue is it needs the cmake *.rsp files
# msys works well compact commands but some of the build args are being doubled up
# nmake-launchers basically works BUT names are nonsense wouldn't work for source, could maybe use export compile but still deosnt help for link commands
# note only unix, unix-msys(minus renames),msys is fully tested right now (outside of vs) so some others may not automatically build correctly
CMAKE_BUILD_DIR=[SRC_FOLDER]/winbuild
CMAKE_SRC_DIR=.
CMAKE_MSYS_DIR=[BASE_FOLDER]/cmake_msys
CMAKE_MSYS_BIN=[CMAKE_MSYS_DIR]/usr/bin/cmake.exe
CMAKE_MSYS_VER=cmake-3.26.4-1-x86_64.pkg.tar.zst
CMAKE_BEST_STYLE="msys" #don't change this per project use CMAKE_STYLE instead this is only what cmake-style is set to if it is set to best
CMAKE_VS_VERSION="Visual Studio 17 2022"
CMAKE_CONFIG_CMD_DEFAULT=("--debug-output" "-S" "[CMAKE_SRC_DIR]" "-B" "[CMAKE_BUILD_DIR]" "-DINSTALL_MSVC_PDB:BOOL=[BUILD_DEBUG]" "-DBUILD_TEST:BOOL=0" "-DCMAKE_BUILD_TYPE:STRING=[CMAKE_BUILD_TYPE_AUTO]" "-DCMAKE_CONFIGURATION_TYPES:STRING=[CMAKE_BUILD_TARGET_AUTO]" ) #default additional commands to configure only, not for cmake configure calls
CMAKE_CONFIG_CMD_ADDL=() #any additional options to pass to ./configure beyond what we will generate
CMAKE_CONFIG_CMD_ADDL_STATIC=( "-DBUILD_STATIC:BOOL=1" "-DBUILD_SHARED:BOOL=0" "-DBUILD_SHARED_LIBS:BOOL=0" ) #additional configure config flags but only if static builds
CMAKE_CONFIG_CMD_ADDL_SHARED=( "-DBUILD_STATIC:BOOL=0" "-DBUILD_SHARED:BOOL=1" "-DBUILD_SHARED_LIBS:BOOL=1" ) #additional configure config flags but only if shared builds
CMAKE_CONFIG_CMD_ADDL_DEBUG=() #additional config flags but only for debug builds
# There are some auto vars they are customized based on other options (or influenced by them) while you can't really override (without editing helpers_ini.sh) them you can change the places they are used in this INI
# STATIC_RELEASE_TRIPLET_AUTO - # if you have STATIC_RELEASE_TRIPLET_ADD it will contain -static-release (or the combos there of) depending on the other PREFER_STATIC_LINKING / BUILD_DEBUG
# CMAKE_BUILD_TARGET_AUTO - # Release without debug and Debug with BUILD_DEBUG
# CMAKE_BUILD_TYPE_AUTO - # MinSizeRel for Release, Debug for debug
# Bundle support disabled for now, does not work properly for recursive clones
# BUNDLE_PATH=[BASE_FOLDER]/gnulib.bundle # if this file exists use it as a bootstrapping bundle when cloning, to create get a clean gnulib checkout and then run `git bundle create gnulib.bundle master`, technically you could bundle more than just gnulib