DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.72k stars 384 forks source link

Errors building for iOS on mac #701

Open tigrenok00 opened 1 year ago

tigrenok00 commented 1 year ago

Hi, I'm trying to build the latest version code as arm64 ios library (to use when compiling tesseract for the same purpose) on M2 mac. I'm getting this error: ../../prog/xtractprotos.c:198:15: error: 'system' is unavailable: not available on iOS`

Also, there are many warnings like these: "ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS" Are all these libs should be prebuilt for iOS as well, or is okay to leave like this? I want to get a static library and not dynamic...

This is my script:

!/bin/bash

OPT_FLAGS="-O3 -g3" MAKE_JOBS=16

dobuild() { make clean export CC CC=$(xcrun --find --sdk "${SDK}" gcc) export CXX CXX=$(xcrun --find --sdk "${SDK}" g++) export CPP CPP=$(xcrun --find --sdk "${SDK}" cpp) export CFLAGS CFLAGS="${HOST_FLAGS} ${OPT_FLAGS}" export CXXFLAGS CXXFLAGS="${HOST_FLAGS} ${OPT_FLAGS}" export LDFLAGS LDFLAGS="${HOST_FLAGS}" ../configure --host="${CHOST}" --prefix="${PREFIX}" --enable-static --without-curl --disable-shared make -j"${MAKE_JOBS}" make install }

SDK="iphoneos" ARCH_FLAGS="-arch arm64" HOST_FLAGS="${ARCH_FLAGS} -miphoneos-version-min=8.0 -isysroot $(xcrun --sdk ${SDK} --show-sdk-path)" CHOST="arm-apple-darwin" PREFIX="${HOME}/git_projects/leptonica/output/DEVICE_ARM" dobuild

And this is the full output and the error: checking build system type... aarch64-apple-darwin22.3.0 checking host system type... arm-apple-darwin checking how to print strings... printf checking for arm-apple-darwin-gcc... /Applications/Xcode.app/Contents/Developer/usr/bin/gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... yes checking for suffix of object files... o checking whether the compiler supports GNU C... yes checking whether /Applications/Xcode.app/Contents/Developer/usr/bin/gcc accepts -g... yes checking for /Applications/Xcode.app/Contents/Developer/usr/bin/gcc option to enable C11 features... none needed checking whether /Applications/Xcode.app/Contents/Developer/usr/bin/gcc understands -c and -o together... rm: conftest.dSYM: is a directory yes checking for a sed that does not truncate output... /usr/bin/sed checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -E checking for fgrep... /usr/bin/grep -F checking for ld used by /Applications/Xcode.app/Contents/Developer/usr/bin/gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no checking for BSD- or MS-compatible name lister (nm)... no checking for arm-apple-darwin-dumpbin... no checking for arm-apple-darwin-link... no checking for dumpbin... no checking for link... link -dump configure: WARNING: using cross tools not prefixed with host triplet checking the name lister (nm) interface... rm: conftest.dSYM: is a directory BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 786432 checking how to convert aarch64-apple-darwin22.3.0 file names to arm-apple-darwin format... func_convert_file_noop checking how to convert aarch64-apple-darwin22.3.0 file names to toolchain format... func_convert_file_noop checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r checking for arm-apple-darwin-file... no checking for file... file checking for arm-apple-darwin-objdump... no checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for arm-apple-darwin-dlltool... no checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for arm-apple-darwin-ar... no checking for ar... ar checking for archiver @FILE support... rm: conftest.dSYM: is a directory no checking for arm-apple-darwin-strip... no checking for strip... strip checking for arm-apple-darwin-ranlib... no checking for ranlib... ranlib checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking command to parse nm output from /Applications/Xcode.app/Contents/Developer/usr/bin/gcc object... rm: conftest.dSYM: is a directory ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for arm-apple-darwin-mt... no checking for mt... no checking if : is a manifest tool... no checking for arm-apple-darwin-dsymutil... no checking for dsymutil... dsymutil checking for arm-apple-darwin-nmedit... no checking for nmedit... nmedit checking for arm-apple-darwin-lipo... no checking for lipo... lipo checking for arm-apple-darwin-otool... no checking for otool... otool checking for arm-apple-darwin-otool64... no checking for otool64... no checking for -single_module linker flag... yes checking for -exported_symbols_list linker flag... yes checking for -force_load linker flag... yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for strings.h... yes checking for sys/stat.h... yes checking for sys/types.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if /Applications/Xcode.app/Contents/Developer/usr/bin/gcc supports -fno-rtti -fno-exceptions... yes checking for /Applications/Xcode.app/Contents/Developer/usr/bin/gcc option to produce PIC... -fno-common -DPIC checking if /Applications/Xcode.app/Contents/Developer/usr/bin/gcc PIC flag -fno-common -DPIC works... yes checking if /Applications/Xcode.app/Contents/Developer/usr/bin/gcc static flag -static works... no checking if /Applications/Xcode.app/Contents/Developer/usr/bin/gcc supports -c -o file.o... yes checking if /Applications/Xcode.app/Contents/Developer/usr/bin/gcc supports -c -o file.o... (cached) yes checking whether the /Applications/Xcode.app/Contents/Developer/usr/bin/gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... darwin dyld checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for arm-apple-darwin-strip... strip checking for a race-free mkdir -p... ../config/install-sh -c -d checking whether make sets $(MAKE)... yes checking whether make supports the include directive... yes (GNU style) checking whether make supports nested variables... yes checking dependency style of /Applications/Xcode.app/Contents/Developer/usr/bin/gcc... gcc3 checking for gawk... (cached) awk checking for arm-apple-darwin-gcc... (cached) /Applications/Xcode.app/Contents/Developer/usr/bin/gcc checking whether the compiler supports GNU C... (cached) yes checking whether /Applications/Xcode.app/Contents/Developer/usr/bin/gcc accepts -g... (cached) yes checking for /Applications/Xcode.app/Contents/Developer/usr/bin/gcc option to enable C11 features... (cached) none needed checking whether /Applications/Xcode.app/Contents/Developer/usr/bin/gcc understands -c and -o together... (cached) yes checking how to run the C preprocessor... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cpp checking whether ln -s works... yes checking whether make sets $(MAKE)... (cached) yes checking for arm-apple-darwin-pkg-config... no checking for pkg-config... /opt/homebrew/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for zlib... yes checking for libpng... yes checking for libjpeg... yes checking for DGifOpenFileHandle in -lgif... no checking for gif_lib.h... no checking for libtiff-4... yes checking for libwebp... yes checking for libwebpmux >= 0.5.0... yes checking for libopenjp2 >= 2.0.0... yes checking whether to enable debugging... checking whether make supports nested variables... (cached) yes checking for size_t... yes checking whether byte ordering is bigendian... no checking whether compiler supports -Wl,--as-needed... no checking for fmemopen... yes checking for fstatat... yes checking for dirfd... yes checking Major version... 1 checking Minor version... 84 checking Point version... 0 checking whether ln -s works... yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/endianness.h config.status: creating src/Makefile config.status: creating prog/Makefile config.status: creating lept.pc config.status: creating cmake/templates/LeptonicaConfig.cmake config.status: creating cmake/templates/LeptonicaConfig-version.cmake config.status: creating config_auto.h config.status: config_auto.h is unchanged config.status: executing libtool commands config.status: executing depfiles commands configure: WARNING: unrecognized options: --without-curl /Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive Making all in src CC adaptmap.lo CC affinecompose.lo CC affine.lo CC arrayaccess.lo CC bilateral.lo CC baseline.lo CC bilinear.lo CC bbuffer.lo CC binarize.lo CC bardecode.lo CC binexpand.lo CC binreduce.lo CC bmpio.lo CC blend.lo CC bmf.lo CC bmpiostub.lo ../../src/bmpio.c:168:37: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] compression = convertOnBigEnd32(bmpih->biCompression); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:181:47: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] ihbytes = convertOnBigEnd32((l_uint32 )(bmpih)); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:182:31: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] width = convertOnBigEnd32(bmpih->biWidth); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:183:32: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] height = convertOnBigEnd32(bmpih->biHeight); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:184:31: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] depth = convertOnBigEnd16(bmpih->biBitCount); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:185:36: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] imagebytes = convertOnBigEnd32(bmpih->biSizeImage); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:186:30: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] xres = convertOnBigEnd32(bmpih->biXPelsPerMeter); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:187:30: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] yres = convertOnBigEnd32(bmpih->biYPelsPerMeter); ^~~~~ ../../src/bmpio.c:146:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:602:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biSize = convertOnBigEnd32(BMP_IHBYTES); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:603:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biWidth = convertOnBigEnd32(w); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:604:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biHeight = convertOnBigEnd32(h); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:605:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biPlanes = convertOnBigEnd16(1); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:606:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biBitCount = convertOnBigEnd16(fdepth); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:607:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biSizeImage = convertOnBigEnd32(fimagebytes); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:608:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biXPelsPerMeter = convertOnBigEnd32(xres); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:609:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biYPelsPerMeter = convertOnBigEnd32(yres); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:610:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biClrUsed = convertOnBigEnd32(ncolors); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

../../src/bmpio.c:611:5: warning: taking address of packed member 'bmpih' of class or structure 'BMP_HEADER' may result in an unaligned pointer value [-Waddress-of-packed-member] bmpih->biClrImportant = convertOnBigEnd32(ncolors); ^~~~~ ../../src/bmpio.c:474:17: note: expanded from macro 'bmpih'

define bmpih (&bmph->bmpih)

            ^~~~~~~~~~~

CC bootnumgen1.lo CC bootnumgen2.lo CC bootnumgen3.lo CC bootnumgen4.lo CC boxbasic.lo CC boxfunc1.lo 18 warnings generated. CC boxfunc2.lo CC boxfunc3.lo CC boxfunc4.lo CC boxfunc5.lo CC bytearray.lo CC ccbord.lo CC ccthin.lo ../../src/boxbasic.c:1952:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/boxbasic.c:1952:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/boxbasic.c:2233:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/boxbasic.c:2233:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC checkerboard.lo CC classapp.lo CC colorcontent.lo CC colorfill.lo CC coloring.lo CC colormap.lo CC colormorph.lo CC colorquant1.lo CC colorquant2.lo CC colorseg.lo CC colorspace.lo ../../src/colormap.c:1945:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/colormap.c:1945:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC conncomp.lo CC convertfiles.lo CC compare.lo CC convolve.lo CC correlscore.lo CC dewarp1.lo CC dewarp2.lo 2 warnings generated. CC dewarp3.lo CC dewarp4.lo ../../src/dewarp1.c:1383:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/dewarp1.c:1383:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/dewarp1.c:1654:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/dewarp1.c:1654:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC dnabasic.lo CC dnafunc1.lo 2 warnings generated. CC dnahash.lo CC dwacomblow.2.lo CC dwacomb.2.lo CC edge.lo ../../src/dnabasic.c:1151:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/dnabasic.c:1151:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/dnabasic.c:1785:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/dnabasic.c:1785:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC encoding.lo CC enhance.lo CC fhmtauto.lo CC fhmtgen.1.lo 2 warnings generated. CC fhmtgenlow.1.lo CC finditalic.lo CC flipdetect.lo 1 warning generated. CC fmorphauto.lo CC fmorphgen.1.lo CC fmorphgenlow.1.lo CC fpix1.lo CC fpix2.lo CC gifio.lo CC gifiostub.lo CC gplot.lo CC graphics.lo CC graymorph.lo CC grayquant.lo ../../src/fpix1.c:1555:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/fpix1.c:1555:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/fpix1.c:1844:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/fpix1.c:1844:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC hashmap.lo CC heap.lo CC jbclass.lo CC jp2kheader.lo CC jp2kheaderstub.lo CC jp2kio.lo 2 warnings generated. CC jp2kiostub.lo CC jpegio.lo CC kernel.lo CC jpegiostub.lo CC leptwin.lo CC list.lo CC libversions.lo ../../src/jp2kio.c:858:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/jp2kio.c:858:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC map.lo ../../src/jpegio.c:1131:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/jpegio.c:1131:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC maze.lo 1 warning generated. CC morphdwa.lo CC morph.lo CC morphapp.lo 1 warning generated. CC numabasic.lo CC morphseq.lo CC numafunc2.lo CC pageseg.lo CC numafunc1.lo CC paintcmap.lo CC partify.lo CC parseprotos.lo CC partition.lo ../../src/numabasic.c:1269:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/numabasic.c:1269:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/numabasic.c:1942:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/numabasic.c:1942:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC pdfio2stub.lo CC pdfio1.lo CC pdfio2.lo CC pdfio1stub.lo CC pix2.lo CC pix1.lo CC pix3.lo 2 warnings generated. CC pix5.lo CC pix4.lo CC pixabasic.lo CC pixacc.lo CC pixafunc1.lo CC pixafunc2.lo ../../src/pixabasic.c:2742:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/pixabasic.c:2742:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/pixabasic.c:3112:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/pixabasic.c:3112:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC pixalloc.lo CC pixcomp.lo CC pixarith.lo CC pixconv.lo CC pixlabel.lo ../../src/pixcomp.c:1866:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/pixcomp.c:1866:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC pixtiling.lo 1 warning generated. CC pngio.lo CC pngiostub.lo CC pnmio.lo CC projective.lo CC pnmiostub.lo 2 warnings generated. CC psio1.lo CC psio1stub.lo CC psio2.lo ../../src/pnmio.c:1235:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/pnmio.c:1235:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/pnmio.c:1291:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/pnmio.c:1291:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC psio2stub.lo CC ptabasic.lo CC ptafunc1.lo CC ptafunc2.lo CC ptra.lo CC queue.lo CC quadtree.lo CC rank.lo 2 warnings generated. CC rbtree.lo ../../src/ptabasic.c:872:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/ptabasic.c:872:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/ptabasic.c:1490:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/ptabasic.c:1490:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC readbarcode.lo CC readfile.lo CC recogdid.lo CC recogident.lo CC recogbasic.lo CC regutils.lo CC recogtrain.lo 2 warnings generated. CC rop.lo CC roplow.lo ../../src/recogbasic.c:1052:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/recogbasic.c:1052:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ CC rotate.lo 1 warning generated. CC rotateam.lo CC rotateorth.lo CC rotateshear.lo CC runlength.lo CC sarray1.lo CC sarray2.lo CC scale1.lo CC scale2.lo CC seedfill.lo CC sel1.lo CC sel2.lo ../../src/sarray1.c:1596:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE *open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0)); ^ ../../src/sarray1.c:1596:15: note: enclose 'open_memstream' in a __builtin_available check to silence this warning if ((fp = open_memstream((char )pdata, psize)) == NULL) ^~~~~~ ../../src/scale2.c:257:28: warning: floating-point comparison is always false; constant cannot be represented exactly in type 'float' [-Wliteral-range] } else if (scalefactor == 0.16667) {


  CC       selgen.lo
  CC       shear.lo
  CC       skew.lo
  CC       spixio.lo
  CC       stack.lo
  CC       stringcode.lo
  CC       strokes.lo
  CC       sudoku.lo
  CC       textops.lo
1 warning generated.
  CC       tiffio.lo
  CC       tiffiostub.lo
  CC       utils1.lo
  CC       warper.lo
  CC       utils2.lo
  CC       watershed.lo
  CC       webpio.lo
../../src/utils2.c:1951:15: warning: 'fmemopen' is only available on iOS 11.0 or newer [-Wunguarded-availability-new]
    if ((fp = fmemopen((void *)data, size, "rb")) == NULL)
              ^~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:366:7: note: 'fmemopen' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0
FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
      ^
../../src/utils2.c:1951:15: note: enclose 'fmemopen' in a __builtin_available check to silence this warning
    if ((fp = fmemopen((void *)data, size, "rb")) == NULL)
              ^~~~~~~~
  CC       webpiostub.lo
  CC       webpanimio.lo
  CC       webpanimiostub.lo
  CC       writefile.lo
  CC       zlibmem.lo
  CC       zlibmemstub.lo
1 warning generated.
1 warning generated.
  CCLD     libleptonica.la
Making all in prog
  CC       convertfilestops.o
  CC       convertformat.o
  CC       convertsegfilestops.o
  CC       converttops.o
  CC       converttopdf.o
  CC       convertfilestopdf.o
  CC       convertsegfilestopdf.o
  CC       fileinfo.o
  CC       xtractprotos.o
  CC       imagetops.o
  CC       adaptmap_reg.o
  CC       adaptnorm_reg.o
  CC       affine_reg.o
  CC       alphaops_reg.o
  CC       alphaxform_reg.o
  CC       baseline_reg.o
../../prog/xtractprotos.c:198:15: error: 'system' is unavailable: not available on iOS
        ret = system(buf);  /* cpp */
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdlib.h:184:6: note: 'system' has been explicitly marked unavailable here
int      system(const char *) __DARWIN_ALIAS_C(system);
         ^
1 error generated.
make[2]: *** [xtractprotos.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Making install in src
 ../../config/install-sh -c -d '/Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib'
 /bin/sh ../libtool   --mode=install /usr/bin/install -c   libleptonica.la '/Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib'
libtool: install: /usr/bin/install -c .libs/libleptonica.lai /Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib/libleptonica.la
libtool: install: /usr/bin/install -c .libs/libleptonica.a /Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib/libleptonica.a
libtool: install: chmod 644 /Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib/libleptonica.a
libtool: install: ranlib /Users/maria/git_projects/leptonica/output/DEVICE_ARM/lib/libleptonica.a
 ../../config/install-sh -c -d '/Users/maria/git_projects/leptonica/output/DEVICE_ARM/include/leptonica'
 /usr/bin/install -c -m 644 ../../src/allheaders.h ../../src/alltypes.h ../../src/array.h ../../src/array_internal.h ../../src/arrayaccess.h ../../src/bbuffer.h ../../src/bilateral.h ../../src/bmf.h ../../src/bmfdata.h ../../src/bmp.h ../../src/ccbord.h ../../src/ccbord_internal.h ../../src/colorfill.h ../../src/dewarp.h endianness.h ../../src/environ.h ../../src/gplot.h ../../src/hashmap.h ../../src/heap.h ../../src/imageio.h ../../src/jbclass.h ../../src/leptwin.h ../../src/list.h ../../src/morph.h ../../src/pix.h ../../src/pix_internal.h ../../src/ptra.h ../../src/queue.h ../../src/rbtree.h ../../src/readbarcode.h ../../src/recog.h ../../src/regutils.h ../../src/stack.h ../../src/stringcode.h ../../src/sudoku.h ../../src/watershed.h '/Users/maria/git_projects/leptonica/output/DEVICE_ARM/include/leptonica'
Making install in prog
  CCLD     convertfilestopdf
ld: warning: ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOSld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS

ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
  CCLD     convertfilestops
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
  CCLD     convertformat
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
  CCLD     convertsegfilestopdf
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
  CCLD     convertsegfilestops
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: ld: warning: ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
  CCLD     converttopdf
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
  CCLD     converttops
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
  CCLD     fileinfo
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOSld: warning: ld: warning: ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOSbuilding for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOS

ld: warning: 
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOS
  CCLD     imagetops
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/opt/libpng/lib/libpng16.dylib) built for macOSld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebp.dylib) built for macOSld: warning: 
building for iOS, but linking in dylib file (/opt/homebrew/Cellar/libtiff/4.5.1/lib/libtiff.dylib) built for macOS

ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/jpeg-turbo/2.1.5.1/lib/libjpeg.dylib) built for macOS
ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOSld: warning: ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/openjpeg/2.5.0_1/lib/libopenjp2.dylib) built for macOS

building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libsharpyuv.dylib) built for macOS
  CC       xtractprotos.o
../../prog/xtractprotos.c:198:15: error: 'system' is unavailable: not available on iOS
        ret = system(buf);  /* cpp */
              ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdlib.h:184:6: note: 'system' has been explicitly marked unavailable here
int      system(const char *) __DARWIN_ALIAS_C(system);
         ^
1 error generated.
make[1]: *** [xtractprotos.o] Error 1
make: *** [install-recursive] Error 1
DanBloomberg commented 1 year ago

To be clear, I am not an expert in buildilng on iOS. I've never done it.

You are getting this message: ../../src/boxbasic.c:2233:15: warning: 'open_memstream' is only available on iOS 11.0 or newer [-Wunguarded-availability-new] if ((fp = open_memstream((char *)pdata, psize)) == NULL) ^~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:367:7: note: 'open_memstream' has been marked as being introduced in iOS 11.0 here, but the deployment target is iOS 8.0.0 FILE open_memstream(char *__bufp, size_t sizep) API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));

If you look in environ.h, HAVE_FMEMOPEN is defined to be 1 for iOS => 11.0, whereas yours apparently is 8.0. So it shouldn't be defined and those functions -- open_memstream() and fmemopen() -- should not be exposed.

DanBloomberg commented 1 year ago

Also, at the end note that the repeated ld warnings are like this:

   ld: warning: building for iOS, but linking in dylib file (/opt/homebrew/Cellar/webp/1.3.0_1/lib/libwebpmux.dylib) built for macOS
tigrenok00 commented 1 year ago

Hi, I changed to -miphoneos-version-min=11.0 and now not getting the error about open_memstream, but this still shown:

../../prog/xtractprotos.c:198:15: error: 'system' is unavailable: not available on iOS ret = system(buf); / cpp / ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdlib.h:184:6: note: 'system' has been explicitly marked unavailable here int system(const char *) __DARWIN_ALIAS_C(system);

stweil commented 1 year ago

The files in prog are for testing and code examples, so you can simply ignore those errors. The library build is not affected by them. Ideally the code which does not work for iOS should be protected by a conditional compilation. Or the build rules could skip the prog build for iOS completely. If you want, you can create a fix and contribute it as a pull request.

tigrenok00 commented 1 year ago

Thank you! I got it working. Here is the script I used in the end if it helps anyone:


OPT_FLAGS="-O3 -g3"
MAKE_JOBS=16

dobuild() {
    make distclean

    export CC
    CC=$(xcrun --find --sdk "${SDK}" gcc)
    export CXX
    CXX=$(xcrun --find --sdk "${SDK}" g++)
    export CFLAGS
    CFLAGS="${HOST_FLAGS} ${OPT_FLAGS}"
    export CXXFLAGS
    CXXFLAGS="${HOST_FLAGS} ${OPT_FLAGS}"
    export LDFLAGS
    LDFLAGS="${HOST_FLAGS}"

    ../configure --host="${CHOST}" --prefix="${PREFIX}" --enable-static --disable-programs --without-libwebpmux --without-zlib --without-libpng --without-jpeg --without-libopenjpeg --without-libwebp --without-giflib --without-libtiff

    make -j"${MAKE_JOBS}"
    make install
}

SDK="iphoneos"
ARCH_FLAGS="-arch arm64"
HOST_FLAGS="${ARCH_FLAGS} -miphoneos-version-min=11.0 -isysroot $(xcrun --sdk ${SDK} --show-sdk-path)"
CHOST="aarch64-apple-darwin"
PREFIX="${HOME}/git_projects/leptonica/output/DEVICE_ARM"
dobuild