Skip to content

Commit

Permalink
macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
Smjert committed Dec 18, 2023
1 parent e042cea commit 88e07e8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
42 changes: 22 additions & 20 deletions libraries/cmake/source/zlib/README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
# zlib library build notes

Check that the generated `zconf.h` and the compilation enables the defines that we are hardcoding in the CMakeLists.txt.
Check that the defines we are hardcoding in the CMakeLists.txt corresponds to the ones that are enabled during compilation.
Also verify that if there are preprocessors `#if/#ifdef` checks in `zconf.h` that are modified to `#if 1`,
the respective define checked is also present among the defines we are hardcoding.

## Linux

### Linux x86_64
For instance if
```
#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
```

Generated with the following commands:
becomes
```
#if 1 /* was set to #if 1 by ./configure */
# define Z_HAVE_UNISTD_H
#endif
```

```bash
export TOOLCHAIN=/usr/local/osquery-toolchain
export PATH="${TOOLCHAIN}/usr/bin:${PATH}"
export CFLAGS="--sysroot ${TOOLCHAIN}"
export CXXFLAGS="${CFLAGS}"
export CPPFLAGS="${CFLAGS}"
export CC=clang
Add `HAVE_UNISTD_H` in the hardcoded defines.

./configure --static --64
make
```
## Linux

### Linux AArch64
### Linux x86_64/AArch64

Generated with the following commands:

```bash
export TOOLCHAIN=/usr/local/osquery-toolchain
export PATH="/usr/local/osquery-toolchain/usr/bin:${PATH}"
export CFLAGS="--sysroot /usr/local/osquery-toolchain"
export PATH="${TOOLCHAIN}/usr/bin:${PATH}"
export CFLAGS="--sysroot ${TOOLCHAIN}"
export CXXFLAGS="${CFLAGS}"
export CPPFLAGS="${CFLAGS}"
export CC=clang
Expand All @@ -43,14 +45,14 @@ Generated with the following commands:
### macOS ARM (M1, M2, etc.)

```sh
CFLAGS="-isysroot /Applications/Xcode_13.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -target arm64-apple-macos10.15" ./configure --static --64
CFLAGS="-isysroot /Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target arm64-apple-macos10.15" ./configure --static --64
make
```

### macOS x86-64

```sh
CFLAGS="-isysroot /Applications/Xcode_13.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk -target x86_64-apple-macos10.14"
CFLAGS="-isysroot /Applications/Xcode_15.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk -target x86_64-apple-macos10.15"
./configure --static --64
make
```
2 changes: 1 addition & 1 deletion libraries/cmake/source/zlib/src
Submodule src updated 90 files
+1 −1 .github/workflows/cmake.yml
+1 −1 .github/workflows/configure.yml
+2 −2 CMakeLists.txt
+19 −1 ChangeLog
+1 −1 FAQ
+8 −2 Makefile.in
+9 −10 README
+5 −27 adler32.c
+5 −16 compress.c
+16 −10 configure
+2 −2 contrib/ada/readme.txt
+2 −2 contrib/ada/test.adb
+1 −1 contrib/ada/zlib-streams.ads
+1 −1 contrib/ada/zlib.adb
+1 −1 contrib/ada/zlib.ads
+1 −1 contrib/delphi/ZLib.pas
+1 −1 contrib/dotzlib/DotZLib/ChecksumImpl.cs
+2 −2 contrib/dotzlib/DotZLib/CodecBase.cs
+3 −3 contrib/dotzlib/DotZLib/GZipStream.cs
+1 −1 contrib/dotzlib/DotZLib/UnitTests.cs
+1 −1 contrib/dotzlib/readme.txt
+6 −18 contrib/infback9/infback9.c
+8 −8 contrib/infback9/infback9.h
+6 −11 contrib/infback9/inftree9.c
+3 −3 contrib/infback9/inftree9.h
+1 −1 contrib/minizip/MiniZip64_Changes.txt
+1 −1 contrib/minizip/configure.ac
+4 −8 contrib/minizip/crypt.h
+18 −44 contrib/minizip/ioapi.c
+18 −18 contrib/minizip/ioapi.h
+19 −46 contrib/minizip/iowin32.c
+4 −4 contrib/minizip/iowin32.h
+22 −48 contrib/minizip/miniunz.c
+24 −36 contrib/minizip/minizip.c
+1 −7 contrib/minizip/mztools.c
+185 −330 contrib/minizip/unzip.c
+68 −68 contrib/minizip/unzip.h
+129 −186 contrib/minizip/zip.c
+148 −151 contrib/minizip/zip.h
+1 −1 contrib/pascal/zlibpas.pas
+1 −1 contrib/testzlib/testzlib.c
+28 −35 contrib/untgz/untgz.c
+1 −1 contrib/vstudio/readme.txt
+4 −4 contrib/vstudio/vc10/zlib.rc
+1 −1 contrib/vstudio/vc10/zlibvc.def
+4 −4 contrib/vstudio/vc11/zlib.rc
+1 −1 contrib/vstudio/vc11/zlibvc.def
+4 −4 contrib/vstudio/vc12/zlib.rc
+1 −1 contrib/vstudio/vc12/zlibvc.def
+4 −4 contrib/vstudio/vc14/zlib.rc
+1 −1 contrib/vstudio/vc14/zlibvc.def
+4 −4 contrib/vstudio/vc9/zlib.rc
+1 −1 contrib/vstudio/vc9/zlibvc.def
+86 −162 crc32.c
+233 −336 deflate.c
+8 −8 deflate.h
+1 −1 examples/fitblk.c
+15 −11 examples/zlib_how.html
+396 −342 examples/zran.c
+40 −29 examples/zran.h
+1 −3 gzclose.c
+11 −12 gzguts.h
+22 −79 gzlib.c
+20 −68 gzread.c
+19 −65 gzwrite.c
+7 −23 infback.c
+1 −4 inffast.c
+1 −1 inffast.h
+30 −99 inflate.c
+6 −11 inftrees.c
+3 −3 inftrees.h
+1 −1 os400/README400
+4 −4 os400/zlib.inc
+5 −5 qnx/package.qpg
+23 −80 test/example.c
+3 −2 test/infcover.c
+50 −122 test/minigzip.c
+2 −2 treebuild.xml
+224 −302 trees.c
+4 −12 uncompr.c
+2 −2 win32/README-WIN32.txt
+6 −2 zconf.h
+6 −2 zconf.h.cmakein
+6 −2 zconf.h.in
+3 −3 zlib.3
+ zlib.3.pdf
+191 −188 zlib.h
+0 −152 zlib2ansi
+16 −44 zutil.c
+10 −10 zutil.h

0 comments on commit 88e07e8

Please sign in to comment.