Skip to content

Commit 20cd273

Browse files
committed
chore: wip
1 parent 2353992 commit 20cd273

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

scripts/build-php.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
281281
`--with-sodium=${launchpadPath}/libsodium.org/v1.0.18`,
282282
`--with-xsl=${launchpadPath}/gnome.org/libxslt/v1.1.43`,
283283
`--with-zlib=${launchpadPath}/zlib.net/v1.3.1`,
284-
`--with-bz2=${launchpadPath}/sourceware.org/bzip2/v1.0.8`,
285-
`--with-iconv=${launchpadPath}/gnu.org/libiconv/v1.18.0`
284+
`--with-bz2=${launchpadPath}/sourceware.org/bzip2/v1.0.8`
286285
]
287286

288287
// Platform-specific arguments
@@ -303,6 +302,7 @@ function generateConfigureArgs(config: BuildConfig, installPrefix: string): stri
303302
'--enable-opcache=shared',
304303
'--with-readline',
305304
'--without-zip',
305+
'--with-iconv',
306306
'--without-ldap-sasl'
307307
]
308308
}
@@ -799,7 +799,6 @@ async function buildPhp(config: BuildConfig): Promise<string> {
799799

800800
// Set up targeted PKG_CONFIG_PATH for essential libraries
801801
const pkgConfigPaths = [
802-
`${launchpadRoot}/gnu.org/libiconv/v1.18.0/lib/pkgconfig`,
803802
`${launchpadRoot}/sourceware.org/bzip2/v1.0.8/lib/pkgconfig`,
804803
`${launchpadRoot}/zlib.net/v1.3.1/lib/pkgconfig`,
805804
`${launchpadRoot}/curl.se/v8.15.0/lib/pkgconfig`,
@@ -820,7 +819,6 @@ async function buildPhp(config: BuildConfig): Promise<string> {
820819

821820
// Set up targeted library and include paths
822821
const libPaths = [
823-
`${launchpadRoot}/gnu.org/libiconv/v1.18.0/lib`,
824822
`${launchpadRoot}/sourceware.org/bzip2/v1.0.8/lib`,
825823
`${launchpadRoot}/zlib.net/v1.3.1/lib`,
826824
`${launchpadRoot}/curl.se/v8.15.0/lib`,
@@ -838,7 +836,6 @@ async function buildPhp(config: BuildConfig): Promise<string> {
838836
]
839837

840838
const includePaths = [
841-
`${launchpadRoot}/gnu.org/libiconv/v1.18.0/include`,
842839
`${launchpadRoot}/sourceware.org/bzip2/v1.0.8/include`,
843840
`${launchpadRoot}/zlib.net/v1.3.1/include`,
844841
`${launchpadRoot}/curl.se/v8.15.0/include`,
@@ -883,8 +880,13 @@ async function buildPhp(config: BuildConfig): Promise<string> {
883880
buildEnv.CXX = 'g++'
884881
buildEnv.CFLAGS = (buildEnv.CFLAGS || '') + ' -O2 -fPIC'
885882
buildEnv.CXXFLAGS = (buildEnv.CXXFLAGS || '') + ' -O2 -fPIC'
883+
// Use system libstdc++ and iconv instead of Launchpad's to avoid linking issues
884+
buildEnv.LDFLAGS = buildEnv.LDFLAGS.replace(/-L[^\s]*libstdcxx[^\s]*/g, '')
886885
// Set preprocessor to avoid traditional-cpp issues
887886
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'
888890
}
889891

890892
log('Running buildconf...')

0 commit comments

Comments
 (0)