From owner-cvs-all Thu Apr 11 19:19:49 2002 Delivered-To: cvs-all@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 1EC4C37B41A; Thu, 11 Apr 2002 19:19:39 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id g3C2Jai12042; Thu, 11 Apr 2002 20:19:37 -0600 (MDT) (envelope-from imp@village.org) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id g3C2JYc47966; Thu, 11 Apr 2002 20:19:34 -0600 (MDT) (envelope-from imp@village.org) Date: Thu, 11 Apr 2002 20:19:30 -0600 (MDT) Message-Id: <20020411.201930.119969734.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 From: "M. Warner Losh" In-Reply-To: <20020411135740.A13856@dragon.nuxi.com> References: <20020411051528.8663638FD@overcee.wemm.org> <20020411093353.GA42484@sunbay.com> <20020411135740.A13856@dragon.nuxi.com> X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: <20020411135740.A13856@dragon.nuxi.com> "David O'Brien" 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