Bug 81825 - SRPMS: LINK.c & COMPILE.c is used for C++ files in Makefile
Summary: SRPMS: LINK.c & COMPILE.c is used for C++ files in Makefile
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: stardict
Version: 8.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Leon Ho
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-01-14 11:36 UTC by Sysoltsev Slawa
Modified: 2007-04-18 16:49 UTC (History)
0 users

Clone Of:
Last Closed: 2005-02-03 20:55:17 UTC

Attachments (Terms of Use)
Dump done by `CC=gcc rpmbuild -bb --define "_topdir `pwd`/.." --define "_tmpdir `pwd`/../tmp" ` (5.12 KB, text/plain)
2003-01-14 11:40 UTC, Sysoltsev Slawa
no flags Details
Patch which fix Makefile to use C++ compilers (396 bytes, patch)
2003-01-14 11:42 UTC, Sysoltsev Slawa
no flags Details | Diff

Description Sysoltsev Slawa 2003-01-14 11:36:18 UTC
Description of problem:
Traditionally environment variable CC contains C compiler name while CXX 
contains C++ compiler name. For example I have CC=gcc, CXX=g++. If you try to 
build stardict with these environment settings you will get a lot of undefined 
reference during build because stardict's Makefile will use $CC=gcc as C++ 
compiler therefore libstdc++ won't be linked. Error happens because Makefile uses 
COMPILE.c and LINK.c macroses which are for plain C compilation. It softens by 
declaration CC=g++ in begin of makefile, but as make is called with -e option 
(environment variables precedence over variables from makefiles) environment's 
CC=gcc prevail, that's why gcc is used to build stardict.
To be correct you should use at least LINK.cpp macro instead of LINK.c (as gcc 
do C++ compilation for .cc files). I'll attach the patch with these changes, please 
take a look at it.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. install SRPM
2. from SPECS directory:
CC=gcc rpmbuild -bb --define "_topdir `pwd`/.." --define "_tmpdir `pwd`/../tmp" 
Actual results:
Compilation errors

Expected results:
Succesfully built package

Additional info:

Comment 1 Sysoltsev Slawa 2003-01-14 11:40:22 UTC
Created attachment 89346 [details]
Dump done by `CC=gcc rpmbuild -bb --define "_topdir `pwd`/.." --define "_tmpdir `pwd`/../tmp" `

Comment 2 Sysoltsev Slawa 2003-01-14 11:42:46 UTC
Created attachment 89347 [details]
Patch which fix Makefile to use C++ compilers

Comment 3 Leon Ho 2005-02-03 20:55:17 UTC
Updated to latest 2.4.4. Should be fine now

Note You need to log in before you can comment on or make changes to this bug.