From 7dfe39b7b535be129818f5cbd5a61adfa1f19f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E4=BD=93=E5=8D=8E?= Date: Sun, 18 Jan 2026 11:14:09 +0800 Subject: [PATCH 1/2] Refactor installation instructions and update paths 1. In a Linux environment, libraries are installed by default to /usr/local/lib64 2. Fix the inconsistency between /usr/local/include in the documentation and /usr/include in the scripts 3. Fixed the copy error in the include library --- dcompiler.dd | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dcompiler.dd b/dcompiler.dd index 753206ee59..34fdbe5d59 100644 --- a/dcompiler.dd +++ b/dcompiler.dd @@ -98,7 +98,7 @@ export PATH="$HOME/dmd/linux/bin64:$PATH" --- [Environment64] -DFLAGS=-I/usr/local/include/d/dmd -L-L/usr/local/lib -L--export-dynamic -fPIC +DFLAGS=-I/usr/local/include/d/dmd/druntime -I/usr/local/include/d/dmd/phobos -L-L/usr/local/lib64 -L--export-dynamic -fPIC --- ) @@ -106,22 +106,23 @@ DFLAGS=-I/usr/local/include/d/dmd -L-L/usr/local/lib -L--export-dynamic -fPIC $(LI Copy binaries to $(D /usr/local/bin): $(CONSOLE -sudo cp $(DMDDIR)/linux/bin64/{dmd,$(DUMPOBJ),$(OBJ2ASM),rdmd,ddemangle,dub,dustmite} /usr/local/bin +sudo cp $(DMDDIR)/linux/bin64/{dmd,rdmd,ddemangle,dub,dustmite} /usr/local/bin ) ) - $(LI Copy the library to $(D /usr/local/lib): + $(LI Copy the library to $(D /usr/local/lib64): $(CONSOLE -sudo cp $(DMDDIR)/linux/lib64/$(LIB) /usr/local/lib +sudo cp -P $(DMDDIR)/linux/lib64/* /usr/local/lib64/ ) ) - $(LI Copy the standard library and runtime sources to $(D /usr/include/d/dmd): + $(LI Copy the standard library and runtime sources to $(D /usr/local/include/d/dmd): $(CONSOLE -sudo mkdir -p /usr/include/d/dmd -sudo cp $(DMDDIR)/{phobos/std,phobos/etc,druntime/import} /usr/include/d/dmd +sudo mkdir -p /usr/local/include/d/dmd/{phobos,druntime} +sudo cp $(DMDDIR)/phobos/{std,etc} /usr/local/include/d/dmd/phobos/ +sudo cp $(DMDDIR)/druntime/import/* /usr/local/include/d/dmd/druntime/ ) ) @@ -144,7 +145,7 @@ sudo cp $(DMDDIR)/{phobos/std,phobos/etc,druntime/import} /usr/include/d/dmd --- [Environment64] -DFLAGS=-I/usr/local/include/d/dmd -L-L/usr/local/lib -L--export-dynamic -fPIC +DFLAGS=-I/usr/local/include/d/dmd/druntime -I/usr/local/include/d/dmd/phobos -L-L/usr/local/lib -L--export-dynamic -fPIC --- ) @@ -155,7 +156,7 @@ DFLAGS=-I/usr/local/include/d/dmd -L-L/usr/local/lib -L--export-dynamic -fPIC to $(D /usr/local/bin):) $(CONSOLE -sudo cp $(DMDDIR)/linux/bin64/{dmd,$(DUMPOBJ),$(OBJ2ASM),rdmd,ddemangle,dub,dustmite} /usr/local/bin +sudo cp $(DMDDIR)/linux/bin64/{dmd,rdmd,ddemangle,dub,dustmite} /usr/local/bin ) $(LI Copy the library to $(D /usr/lib): @@ -165,11 +166,12 @@ sudo cp $(DMDDIR)/freebsd/lib/$(LIB) /usr/lib ) ) - $(LI Copy the standard library and runtime sources to $(D /usr/include/d/dmd): + $(LI Copy the standard library and runtime sources to $(D /usr/local/include/d/dmd): $(CONSOLE -sudo mkdir -p /usr/include/d/dmd -sudo cp $(DMDDIR)/{phobos/std,phobos/etc,druntime/import} /usr/include/d/dmd +sudo mkdir -p /usr/local/include/d/dmd/{phobos,druntime} +sudo cp $(DMDDIR)/phobos/{std,etc} /usr/local/include/d/dmd/phobos/ +sudo cp $(DMDDIR)/druntime/import/* /usr/local/include/d/dmd/druntime/ ) ) )) @@ -235,8 +237,9 @@ sudo cp $(DMDDIR)/osx/lib/$(LIB) /usr/local/lib $(LI Copy the standard library and runtime sources to $(D /usr/local/include/d/dmd): $(CONSOLE -sudo mkdir -p /usr/include/d/dmd -sudo cp $(DMDDIR)/{phobos/std,phobos/etc,druntime/import} /usr/include/d/dmd +sudo mkdir -p /usr/local/include/d/dmd/{phobos,druntime} +sudo cp $(DMDDIR)/phobos/{std,etc} /usr/local/include/d/dmd/phobos/ +sudo cp $(DMDDIR)/druntime/import/* /usr/local/include/d/dmd/druntime/ ) ) From 1a40c75be943a04a93a3319cda339f362156e0d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E4=BD=93=E5=8D=8E?= Date: Sun, 18 Jan 2026 22:34:51 +0800 Subject: [PATCH 2/2] Restore the installation path of the DMD library to /usr/local/lib Considering adapting to a wider range of Linux distributions, I changed /usr/local/lib64 to /usr/local/lib. --- dcompiler.dd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dcompiler.dd b/dcompiler.dd index 34fdbe5d59..707b809bb7 100644 --- a/dcompiler.dd +++ b/dcompiler.dd @@ -98,7 +98,7 @@ export PATH="$HOME/dmd/linux/bin64:$PATH" --- [Environment64] -DFLAGS=-I/usr/local/include/d/dmd/druntime -I/usr/local/include/d/dmd/phobos -L-L/usr/local/lib64 -L--export-dynamic -fPIC +DFLAGS=-I/usr/local/include/d/dmd/druntime -I/usr/local/include/d/dmd/phobos -L-L/usr/local/lib -L--export-dynamic -fPIC --- ) @@ -110,10 +110,10 @@ sudo cp $(DMDDIR)/linux/bin64/{dmd,rdmd,ddemangle,dub,dustmite} /usr/local/bin ) ) - $(LI Copy the library to $(D /usr/local/lib64): + $(LI Copy the library to $(D /usr/local/lib): $(CONSOLE -sudo cp -P $(DMDDIR)/linux/lib64/* /usr/local/lib64/ +sudo cp -P $(DMDDIR)/linux/lib64/* /usr/local/lib/ ) )