diff options
Diffstat (limited to 'packages/iconvenc')
-rw-r--r-- | packages/iconvenc/Makefile | 23 | ||||
-rw-r--r-- | packages/iconvenc/examples/Makefile | 27 | ||||
-rw-r--r-- | packages/iconvenc/src/iconvert.inc | 11 |
3 files changed, 55 insertions, 6 deletions
diff --git a/packages/iconvenc/Makefile b/packages/iconvenc/Makefile index 151b6074e4..8720c627ef 100644 --- a/packages/iconvenc/Makefile +++ b/packages/iconvenc/Makefile @@ -2,7 +2,7 @@ # Don't edit, this file is generated by FPCMake Version 2.0.0 # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded m68k-sinclairql powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm32-embedded wasm32-wasi sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos z80-amstradcpc +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded m68k-sinclairql powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-freebsd aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm32-embedded wasm32-wasi sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos z80-amstradcpc BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos win16 atari @@ -1816,6 +1816,14 @@ REQUIRE_PACKAGES_HASH=1 REQUIRE_PACKAGES_LIBTAR=1 REQUIRE_PACKAGES_FPMKUNIT=1 endif +ifeq ($(FULL_TARGET),aarch64-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +endif ifeq ($(FULL_TARGET),aarch64-darwin) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_PASZLIB=1 @@ -2291,6 +2299,19 @@ override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR) override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX) endif endif +ifdef SYSROOTPATH +override FPCOPT+=-XR$(SYSROOTPATH) +else +ifeq ($(OS_TARGET),$(OS_SOURCE)) +ifneq ($(findstring $(OS_TARGET),darwin),) +ifneq ($(findstring $(CPU_TARGET),aarch64),) +ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),) +override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk +endif +endif +endif +endif +endif ifdef CREATESHARED override FPCOPT+=-Cg endif diff --git a/packages/iconvenc/examples/Makefile b/packages/iconvenc/examples/Makefile index a1e3bdb121..0fe3006d54 100644 --- a/packages/iconvenc/examples/Makefile +++ b/packages/iconvenc/examples/Makefile @@ -2,7 +2,7 @@ # Don't edit, this file is generated by FPCMake Version 2.0.0 # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded m68k-sinclairql powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm32-embedded wasm32-wasi sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos z80-amstradcpc +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim i386-android i386-aros m68k-linux m68k-netbsd m68k-amiga m68k-atari m68k-palmos m68k-macosclassic m68k-embedded m68k-sinclairql powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macosclassic powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-haiku x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded x86_64-iphonesim x86_64-android x86_64-aros x86_64-dragonfly arm-linux arm-netbsd arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian arm-android arm-aros arm-freertos arm-ios powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux mipsel-embedded mipsel-android mips64el-linux jvm-java jvm-android i8086-embedded i8086-msdos i8086-win16 aarch64-linux aarch64-freebsd aarch64-darwin aarch64-win64 aarch64-android aarch64-ios wasm32-embedded wasm32-wasi sparc64-linux riscv32-linux riscv32-embedded riscv64-linux riscv64-embedded xtensa-linux xtensa-embedded xtensa-freertos z80-embedded z80-zxspectrum z80-msxdos z80-amstradcpc BSDs = freebsd netbsd openbsd darwin dragonfly UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom msdos win16 atari @@ -608,6 +608,9 @@ endif ifeq ($(FULL_TARGET),aarch64-linux) override TARGET_PROGRAMS+=iconvtest endif +ifeq ($(FULL_TARGET),aarch64-freebsd) +override TARGET_PROGRAMS+=iconvtest +endif ifeq ($(FULL_TARGET),aarch64-darwin) override TARGET_PROGRAMS+=iconvtest endif @@ -2208,6 +2211,15 @@ REQUIRE_PACKAGES_LIBTAR=1 REQUIRE_PACKAGES_FPMKUNIT=1 REQUIRE_PACKAGES_ICONVENC=1 endif +ifeq ($(FULL_TARGET),aarch64-freebsd) +REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_PASZLIB=1 +REQUIRE_PACKAGES_FCL-PROCESS=1 +REQUIRE_PACKAGES_HASH=1 +REQUIRE_PACKAGES_LIBTAR=1 +REQUIRE_PACKAGES_FPMKUNIT=1 +REQUIRE_PACKAGES_ICONVENC=1 +endif ifeq ($(FULL_TARGET),aarch64-darwin) REQUIRE_PACKAGES_RTL=1 REQUIRE_PACKAGES_PASZLIB=1 @@ -2739,6 +2751,19 @@ override COMPILER_UNITTARGETDIR=$(COMPILER_TARGETDIR) override UNITTARGETDIRPREFIX=$(TARGETDIRPREFIX) endif endif +ifdef SYSROOTPATH +override FPCOPT+=-XR$(SYSROOTPATH) +else +ifeq ($(OS_TARGET),$(OS_SOURCE)) +ifneq ($(findstring $(OS_TARGET),darwin),) +ifneq ($(findstring $(CPU_TARGET),aarch64),) +ifneq ($(wildcard /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk),) +override FPCOPT+=-XR/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk +endif +endif +endif +endif +endif ifdef CREATESHARED override FPCOPT+=-Cg endif diff --git a/packages/iconvenc/src/iconvert.inc b/packages/iconvenc/src/iconvert.inc index d4428a8cf6..61ced52f6c 100644 --- a/packages/iconvenc/src/iconvert.inc +++ b/packages/iconvenc/src/iconvert.inc @@ -14,7 +14,7 @@ var iconvres: size_t; begin H := iconv_open(PChar(ToEncoding), PChar(FromEncoding)); - if not assigned(H) then + if h=Iconv_t(-1) then begin Res := S; exit(-1); @@ -48,7 +48,8 @@ begin Dst:=PChar(Res)+Offset; OutLen:=Length(Res)-Offset; end; - iconvres:=iconv(H, nil, nil, @Dst, @Outlen); + InLen=0; + iconvres:=iconv(H, nil, @InLen, @Dst, @Outlen); if iconvres = size_t(-1) then begin res:=s; @@ -91,7 +92,8 @@ begin SetLength(Res, Length(Res)+InLen*2+5); // 5 is minimally one utf-8 char Dst:=PChar(Res)+Offset; OutLen:=Length(Res)-Offset; - iconv(H, nil, nil, @Dst, @Outlen); + InLen:=0; + iconv(H, nil, @InLen, @Dst, @Outlen); end; {$endif} // trim output buffer @@ -101,7 +103,8 @@ begin SetLength(Res, Length(Res)+InLen*2+5); // 5 is minimally one utf-8 char Dst:=PChar(Res)+Offset; OutLen:=Length(Res)-Offset; - iconvres:=iconv(H, nil, nil, @Dst, @Outlen); + InLen:=0; + iconvres:=iconv(H, nil, @InLen, @Dst, @Outlen); setlength(Res,Length(Res) - Outlen); iconv_close(H); end; |