dmd/druntime/phobos makefile horror

Christian Manning cmanning999 at gmail.com
Fri Dec 30 03:47:16 PST 2011


On Friday, 30 December 2011 at 00:34:13 UTC, Trass3r wrote:
>> The reason is druntime doesn't build separate libs like phobos 
>> does.
>
> A quick and dirty patch would be:
>
> diff --git a/posix.mak b/posix.mak
> index 5fd7fee..9ed2004 100644
> --- a/posix.mak
> +++ b/posix.mak
> @@ -32,9 +32,9 @@ UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d 
> -Isrc -Iimport -property
>
> CFLAGS=-m$(MODEL) -O
>
> -OBJDIR=obj
> +OBJDIR=obj/$(MODEL)
> DRUNTIME_BASE=druntime
> -DRUNTIME=lib/lib$(DRUNTIME_BASE).a
> +DRUNTIME=lib/$(MODEL)/lib$(DRUNTIME_BASE).a
>
> DOCFMT=

I've been using a similar patch for a while, originally from 
https://bugs.gentoo.org/show_bug.cgi?id=355527 but less of those 
changes are needed now so it's been stripped down a lot. Would be 
nice to have this upstream so a proper multilib d toolchain can 
be built out of the box

--- a/src/druntime/posix.mak	2011-06-25 01:39:28.000000000 +0100
+++ b/src/druntime/posix.mak	2011-07-13 16:27:21.307999841 +0100
@@ -25,16 +25,16 @@
DOCDIR=doc
IMPDIR=import

-MODEL=32
+MODEL?=32

DFLAGS=-m$(MODEL) -O -release -inline -nofloat -w -d -Isrc 
-Iimport -property
UDFLAGS=-m$(MODEL) -O -release -nofloat -w -d -Isrc -Iimport 
-property

CFLAGS=-m$(MODEL) -O

-OBJDIR=obj
+OBJDIR=obj$(MODEL)
DRUNTIME_BASE=druntime
-DRUNTIME=lib/lib$(DRUNTIME_BASE).a
+DRUNTIME=lib$(MODEL)/lib$(DRUNTIME_BASE).a

DOCFMT=

--- a/src/phobos/posix.mak	2011-07-10 21:19:30.000000000 +0100
+++ b/src/phobos/posix.mak	2011-07-13 16:27:11.585999804 +0100
@@ -75,7 +75,7 @@

# Set DRUNTIME name and full path
ifeq (,$(findstring win,$(OS)))
-	DRUNTIME = $(DRUNTIME_PATH)/lib/libdruntime.a
+	DRUNTIME = $(DRUNTIME_PATH)/lib$(MODEL)/libdruntime.a
else
	DRUNTIME = $(DRUNTIME_PATH)/lib/druntime.lib
endif



More information about the Digitalmars-d mailing list