mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
build: support multi os/arch conf for libiconv
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
19
Makefile
19
Makefile
@@ -112,7 +112,7 @@ install-netsurf: _install-netsurf
|
|||||||
install-netsurf: OPTCFLAGS := -DNDEBUG
|
install-netsurf: OPTCFLAGS := -DNDEBUG
|
||||||
|
|
||||||
BC_NS := $(BC)vendor/netsurf
|
BC_NS := $(BC)vendor/netsurf
|
||||||
ICONV := $(BC)vendor/libiconv
|
ICONV := $(BC)vendor/libiconv/out/$(OS)-$(ARCH)
|
||||||
# TODO: add Linux iconv path (I guess it depends on the distro)
|
# TODO: add Linux iconv path (I guess it depends on the distro)
|
||||||
# TODO: this way of linking libiconv is not ideal. We should have a more generic way
|
# TODO: this way of linking libiconv is not ideal. We should have a more generic way
|
||||||
# and stick to a specif version. Maybe build from source. Anyway not now.
|
# and stick to a specif version. Maybe build from source. Anyway not now.
|
||||||
@@ -169,16 +169,23 @@ test-netsurf:
|
|||||||
cd vendor/netsurf/libdom && \
|
cd vendor/netsurf/libdom && \
|
||||||
BUILDDIR=$(BC_NS)/build/libdom make test
|
BUILDDIR=$(BC_NS)/build/libdom make test
|
||||||
|
|
||||||
install-libiconv:
|
download-libiconv:
|
||||||
ifeq ("$(wildcard vendor/libiconv/lib/libiconv.a)","")
|
ifeq ("$(wildcard vendor/libiconv/libiconv-1.17)","")
|
||||||
@mkdir -p vendor/libiconv
|
@mkdir -p vendor/libiconv
|
||||||
@cd vendor/libiconv && \
|
@cd vendor/libiconv && \
|
||||||
curl https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz | tar -xvzf -
|
curl https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz | tar -xvzf -
|
||||||
@cd vendor/libiconv/libiconv-1.17 && \
|
|
||||||
./configure --prefix=$(BC)vendor/libiconv --enable-static && \
|
|
||||||
make && make install
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
install-libiconv: download-libiconv clean-libiconv
|
||||||
|
@cd vendor/libiconv/libiconv-1.17 && \
|
||||||
|
./configure --prefix=$(ICONV) --enable-static && \
|
||||||
|
make && make install
|
||||||
|
|
||||||
|
clean-libiconv:
|
||||||
|
@cd vendor/libiconv/libiconv-1.17 && \
|
||||||
|
make clean > /dev/null && cd .. && \
|
||||||
|
rm -Rf lib && rm -Rf share && rm -Rf bin && rm -Rf include
|
||||||
|
|
||||||
install-zig-js-runtime-dev:
|
install-zig-js-runtime-dev:
|
||||||
@cd vendor/zig-js-runtime && \
|
@cd vendor/zig-js-runtime && \
|
||||||
make install-dev
|
make install-dev
|
||||||
|
|||||||
18
build.zig
18
build.zig
@@ -170,9 +170,23 @@ fn moduleNetSurf(b: *std.Build, target: std.Build.ResolvedTarget) !*std.Build.Mo
|
|||||||
.root_source_file = b.path("src/netsurf/netsurf.zig"),
|
.root_source_file = b.path("src/netsurf/netsurf.zig"),
|
||||||
.target = target,
|
.target = target,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const os = target.result.os.tag;
|
||||||
|
const arch = target.result.cpu.arch;
|
||||||
|
|
||||||
// iconv
|
// iconv
|
||||||
mod.addObjectFile(b.path("vendor/libiconv/lib/libiconv.a"));
|
const libiconv_lib_path = try std.fmt.allocPrint(
|
||||||
mod.addIncludePath(b.path("vendor/libiconv/include"));
|
mod.owner.allocator,
|
||||||
|
"vendor/libiconv/out/{s}-{s}/lib/libiconv.a",
|
||||||
|
.{ @tagName(os), @tagName(arch) },
|
||||||
|
);
|
||||||
|
const libiconv_include_path = try std.fmt.allocPrint(
|
||||||
|
mod.owner.allocator,
|
||||||
|
"vendor/libiconv/out/{s}-{s}/lib/libiconv.a",
|
||||||
|
.{ @tagName(os), @tagName(arch) },
|
||||||
|
);
|
||||||
|
mod.addObjectFile(b.path(libiconv_lib_path));
|
||||||
|
mod.addIncludePath(b.path(libiconv_include_path));
|
||||||
|
|
||||||
// mimalloc
|
// mimalloc
|
||||||
mod.addImport("mimalloc", (try moduleMimalloc(b, target)));
|
mod.addImport("mimalloc", (try moduleMimalloc(b, target)));
|
||||||
|
|||||||
Reference in New Issue
Block a user