accelerator/third_party/Configure
sappho 1d60f3746a
overhaul -> overhaul (#21)
* overhaul the repository

add protobuf

change repo url

try to restore github python syntax highlighter

move breakpad into third_party, update packagescript

* AMBuildifying

remove unnecessary files

Move the git patching into ambuild

move lss to a patch

Add windows compilation support

remove breakpad.bat

move postlink libs

* Overhaul CI (#4)

* Dockerbuild (#5)

* make cwd_cmd spew stdout and stderr

* add proper docker build support

* Overhaul ci (#6)

* Setup CI

* fix checkout

* fix yaml syntax

* no fail fast

* setup CI cache

* Fix pip install

* remove pip git

* update actions, ditch node 16

* small syntax cleanups

* more CI changes

* github doc lied

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* final push for perfect dockerbuilds in every scenario that i have been able to find

* rename cicd->dockerbuild

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>

* Add readme, remode duplicate -fPIC

update names of dockerbuild folder in sh files

* cleanup dockerfile (#7)

* Update 0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch

* Statically link libz, libgcc & libstdc++

* fix submodule path

* Review change + comment patch

---------

Co-authored-by: Kenzzer <kenzzer@users.noreply.github.com>
Co-authored-by: Benoist <14257866+Kenzzer@users.noreply.github.com>
2024-10-10 21:59:28 -04:00

104 lines
2.9 KiB
Python

# vim: set ts=2 sw=2 tw=99 noet ft=python:
import os, sys
builder.SetBuildFolder('third_party/config')
for compiler in Accelerator.targets:
output = """
/* define if the compiler supports basic C++17 syntax */
#define HAVE_CXX17 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
"""
if compiler.target.platform == "linux":
output += """
/* Define to 1 if you have the <a.out.h> header file. */
#define HAVE_A_OUT_H 1
/* Define to 1 if you have the `getcontext' function. */
#define HAVE_GETCONTEXT 1
/* Define to 1 if you have the `getrandom' function. */
#define HAVE_GETRANDOM 1
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/random.h> header file. */
#define HAVE_SYS_RANDOM_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `memfd_create' function. */
#define HAVE_MEMFD_CREATE 1
"""
if '-lrustc_demangle' in compiler.postlink:
output += """
/* Define to 1 if you have the `rustc_demangle' library (-lrustc_demangle). */
#define HAVE_LIBRUSTC_DEMANGLE 1
/* Define to 1 if you have the <rustc_demangle.h> header file. */
#define HAVE_RUSTC_DEMANGLE_H 1
"""
if '-pthread' in compiler.postlink:
output += """
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1
"""
if '-lzstd' in compiler.postlink:
output += """
/* Define to 1 if you have the `zstd' library (-lzstd). */
#define HAVE_LIBZSTD 1
"""
output += """
/* Name of package */
#define PACKAGE "breakpad"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "google-breakpad-dev@googlegroups.com"
/* Define to the full name of this package. */
#define PACKAGE_NAME "breakpad"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "breakpad 0.1"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "breakpad"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.1"
/* Version number of package */
#define VERSION "0.1"
"""
Accelerator.breakpad_config[compiler.target.arch] = [builder.AddOutputFile(os.path.join(compiler.target.arch, 'config.h'), output.encode())]