Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Apr 2002 20:19:30 -0600 (MDT)
From:      "M. Warner Losh" <imp@village.org>
To:        obrien@FreeBSD.org
Cc:        ru@FreeBSD.org, peter@wemm.org, marcel@xcllnt.net, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/gnu/usr.bin/gperf Makefile src/gnu/usr.bin/groff/src/devices/grodvi Makefile src/gnu/usr.bin/groff/src/devices/grohtml Makefile src/gnu/usr.bin/groff/src/devices/grolbp Makefile sr
Message-ID:  <20020411.201930.119969734.imp@village.org>
In-Reply-To: <20020411135740.A13856@dragon.nuxi.com>
References:  <20020411051528.8663638FD@overcee.wemm.org> <20020411093353.GA42484@sunbay.com> <20020411135740.A13856@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20020411135740.A13856@dragon.nuxi.com>
            "David O'Brien" <obrien@FreeBSD.org> writes:
: On Thu, Apr 11, 2002 at 12:33:53PM +0300, Ruslan Ermilov wrote:
: > +.if defined(PROG_CXX)
: > +PROG=	${PROG_CXX}
: > +DPADD+=	${LIBSTDCPLUSPLUS}
: > +LDADD+=	-lstdc++
: > +.endif
: 
: We really should not be doing this part -- we do not do it for libc.
: Making too many assumptions about how G++ expects the linking to be is
: bad.  Rather if PROG_GXX is set, 'g++' should be used for linking rather
: than 'gcc' [as Peter mentioned].  We really should just be letting g++ do
: its job.

+.if defined(PROG_CXX)
+PROG=	${PROG_CXX}
+.endif

Is almost right, but we have:

${PROG}: ${OBJS}
	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}

Redefining CC to be g++ isnt' right, because it uses CFLAGS rather
than CXXFLAGS.  In the current setup, it doesn't matter.

So we'd need

 ${PROG}: ${OBJS}
+.if defined(PROG_CXX)
+	${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}
+.else
	${CC} ${CFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDDESTDIR} ${LDADD}
+.endif

to be more correct, but we need that in at least two places in
bsd.prog.mk since we duplicate the code.  Oh, wait, the second one
isn't quite right either, since we need to also support PROG_CXX w/o
defining SRCS.

Warner

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020411.201930.119969734.imp>