@@ -284,11 +284,18 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
284
284
`--with-bz2=${ launchpadPath } /sourceware.org/bzip2/v1.0.8`
285
285
]
286
286
287
+ // Platform-specific dependency paths
288
+ const platformDependencyArgs = [ ]
289
+ if ( config . platform === 'darwin' ) {
290
+ platformDependencyArgs . push ( `--with-iconv=${ launchpadPath } /gnu.org/libiconv/v1.18.0` )
291
+ }
292
+
287
293
// Platform-specific arguments
288
294
if ( config . platform === 'darwin' ) {
289
295
return [
290
296
...baseArgs ,
291
297
...dependencyArgs ,
298
+ ...platformDependencyArgs ,
292
299
'--enable-opcache=shared' ,
293
300
'--with-libedit' ,
294
301
'--with-zip' ,
@@ -299,10 +306,11 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
299
306
return [
300
307
...baseArgs ,
301
308
...dependencyArgs ,
309
+ ...platformDependencyArgs ,
302
310
'--enable-opcache=shared' ,
303
311
'--with-readline' ,
304
312
'--without-zip' ,
305
- '--with -iconv' ,
313
+ '--without -iconv' ,
306
314
'--without-ldap-sasl'
307
315
]
308
316
}
@@ -852,6 +860,14 @@ async function buildPhp(config: BuildConfig): Promise<string> {
852
860
`${ launchpadRoot } /libzip.org/v1.11.4/include`
853
861
]
854
862
863
+ // Add iconv paths for macOS only (Linux uses system iconv)
864
+ if ( config . platform === 'darwin' ) {
865
+ libPaths . push ( `${ launchpadRoot } /gnu.org/libiconv/v1.18.0/lib` )
866
+ includePaths . push ( `${ launchpadRoot } /gnu.org/libiconv/v1.18.0/include` )
867
+ pkgConfigPaths . push ( `${ launchpadRoot } /gnu.org/libiconv/v1.18.0/lib/pkgconfig` )
868
+ buildEnv . PKG_CONFIG_PATH = pkgConfigPaths . join ( ':' )
869
+ }
870
+
855
871
buildEnv . LDFLAGS = libPaths . map ( path => `-L${ path } ` ) . join ( ' ' )
856
872
buildEnv . CPPFLAGS = includePaths . map ( path => `-I${ path } ` ) . join ( ' ' )
857
873
@@ -884,9 +900,7 @@ async function buildPhp(config: BuildConfig): Promise<string> {
884
900
buildEnv . LDFLAGS = buildEnv . LDFLAGS . replace ( / - L [ ^ \s ] * l i b s t d c x x [ ^ \s ] * / g, '' )
885
901
// Set preprocessor to avoid traditional-cpp issues
886
902
buildEnv . CPP = 'gcc -E'
887
- // Force use of system iconv to avoid Launchpad libiconv linking issues
888
- buildEnv . ICONV_CFLAGS = ''
889
- buildEnv . ICONV_LIBS = '-liconv'
903
+ // Disable iconv completely on Linux due to glibc errno check failure
890
904
}
891
905
892
906
log ( 'Running buildconf...' )
0 commit comments