我正在尝试编译库以在 OS X 10.8 及更高版本上使用。当我构建示例libpng
库时,我正在使用此脚本并且它可以工作(生成的库与 OS X 10.8 和更高版本兼容)
export MACOSX_DEPLOYMENT_TARGET=10.8
./configure --disable-dependency-tracking --enable-shared
make check
它有效。
但问题就在这里。我无法让它适用于任何使用meson
构建系统的东西。例如pango
:
mkdir build
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
export MACOSX_DEPLOYMENT_TARGET=10.8
meson -Dintrospection=true -Duse_fontconfig=true --default-library=shared --buildtype=release . build
cd build
ninja
它失败ninja
并出现错误:
[70/128] Generating Pango-1.0.gir with a custom command
FAILED: pango/Pango-1.0.gir
/usr/local/Cellar/gobject-introspection/1.64.1_2/bin/g-ir-scanner --no-libtool --namespace=Pango --nsversion=1.0 --warn-all --output pango/Pango-1.0.gir --c-include=pango/pango.h --quiet -I/Users/USER/pango-1.45.3/pango -I/Users/USER/pango-1.45.3/build/pango -I./. -I../. -I./pango/. -I../pango/. --filelist=/Users/USER/pango-1.45.3/build/pango/libpango-1.0.0.dylib.p/Pango_1.0_gir_filelist --include=HarfBuzz-0.0 --include=GObject-2.0 --include=cairo-1.0 --symbol-prefix=pango --identifier-prefix=Pango --pkg-export=pango --cflags-begin -D_POSIX_C_SOURCE=200809L -D_POSIX_THREAD_SAFE_FUNCTIONS -D_GNU_SOURCE -I./. -I../. -I./pango/. -I../pango/. -I/usr/local/Cellar/glib/2.64.4/include/glib-2.0 -I/usr/local/Cellar/glib/2.64.4/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.44/include -I/usr/local/Cellar/libffi/3.3/include -I/usr/local/Cellar/glib/2.64.4/include -I/usr/local/Cellar/fribidi/1.0.10/include/fribidi -I/usr/local/Cellar/harfbuzz/2.6.8/include/harfbuzz -I/usr/local/opt/freetype/include/freetype2 -I/usr/local/Cellar/graphite2/1.3.14/include -I/usr/local/Cellar/fontconfig/2.13.1/include -I/usr/local/Cellar/cairo/1.16.0_3/include/cairo -I/usr/local/Cellar/pixman/0.40.0/include/pixman-1 -I/usr/local/Cellar/libpng/1.6.37/include/libpng16 -I/usr/local/Cellar/gobject-introspection/1.64.1_2/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/local/Cellar/gobject-introspection/1.64.1_2/share/gir-1.0 --library pango-1.0 -L/Users/USER/pango-1.45.3/build/pango -L/usr/local/Cellar/fribidi/1.0.10/lib -L/usr/local/Cellar/harfbuzz/2.6.8/lib -L/usr/local/opt/freetype/lib -L/usr/local/Cellar/cairo/1.16.0_3/lib --extra-library=m -L/usr/local/Cellar/glib/2.64.4/lib -L/usr/local/opt/gettext/lib --extra-library=glib-2.0 --extra-library=intl --extra-library=gobject-2.0 --extra-library=gio-2.0 -L/usr/local/Cellar/fribidi/1.0.10/lib --extra-library=fribidi -L/usr/local/Cellar/harfbuzz/2.6.8/lib --extra-library=harfbuzz -L/usr/local/Cellar/fontconfig/2.13.1/lib -L/usr/local/opt/freetype/lib --extra-library=fontconfig --extra-library=freetype -L/usr/local/Cellar/cairo/1.16.0_3/lib --extra-library=cairo -L/usr/local/Cellar/gobject-introspection/1.64.1_2/lib --extra-library=girepository-1.0 --sources-top-dirs /Users/USER/pango-1.45.3/subprojects/ --sources-top-dirs /Users/USER/pango-1.45.3/build/subprojects/
Traceback (most recent call last):
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/bin/g-ir-scanner", line 104, in <module>
sys.exit(scanner_main(sys.argv))
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/lib/gobject-introspection/giscanner/scannermain.py", line 590, in scanner_main
ss, filenames = create_source_scanner(options, args)
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/lib/gobject-introspection/giscanner/scannermain.py", line 463, in create_source_scanner
ss.parse_files(filenames)
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/lib/gobject-introspection/giscanner/sourcescanner.py", line 262, in parse_files
self._parse(headers)
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/lib/gobject-introspection/giscanner/sourcescanner.py", line 308, in _parse
cc.preprocess(tmp_name_cpp,
File "/usr/local/Cellar/gobject-introspection/1.64.1_2/lib/gobject-introspection/giscanner/ccompiler.py", line 272, in preprocess
self.compiler.preprocess(source=source,
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/unixccompiler.py", line 107, in preprocess
self.spawn(pp_args)
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/ccompiler.py", line 910, in spawn
spawn(cmd, dry_run=self.dry_run)
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/spawn.py", line 36, in spawn
_spawn_posix(cmd, search_path, dry_run=dry_run)
File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/spawn.py", line 111, in _spawn_posix
raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.8" but "11.0" during configure
[75/128] Generating symbol file pango/libpango-1.0.0.dylib.p/libpango-1.0.0.dylib.symbols
ninja: build stopped: subcommand failed.
如何MACOSX_DEPLOYMENT_TARGET
在配置期间指定?