Date: Wed, 15 Aug 2001 18:04:09 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Patrick Mitran" Message-Id: <8582-Wed15Aug2001180409+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp AT delorie DOT com In-reply-to: (pmitran AT tsp DOT ece DOT mcgill DOT ca) Subject: Re: Makefiles with DJGPP References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > From: "Patrick Mitran" > Newsgroups: comp.os.msdos.djgpp > > LDLIBS = -lm -lstdcxx > > in my makefile. In DJGPP, this links fine, no problem. In linux, I would > need > the second library to be -lstdc++ instead. How can I make the makefile > detect the build environment and choose the right library? Test inside the Makefile for the DJDIR variable being defined: ifeq ($(DJDIR),) LIBSTDCXX = -lstdc++ else LIBSTDCXX = -lstdcxx endif then use $(LIBSTDCXX) instead of the literal -lstdcxx. Of course, if someone sets the environment variable DJDIR on GNU/Linux, you are toast; but why would they?