Bug 81825 - SRPMS: LINK.c & COMPILE.c is used for C++ files in Makefile
SRPMS: LINK.c & COMPILE.c is used for C++ files in Makefile
Product: Red Hat Linux
Classification: Retired
Component: stardict (Show other bugs)
i386 Linux
medium Severity low
: ---
: ---
Assigned To: Leon Ho
Depends On:
  Show dependency treegraph
Reported: 2003-01-14 06:36 EST by Sysoltsev Slawa
Modified: 2007-04-18 12:49 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-02-03 15:55:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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 06:40 EST, Sysoltsev Slawa
no flags Details
Patch which fix Makefile to use C++ compilers (396 bytes, patch)
2003-01-14 06:42 EST, Sysoltsev Slawa
no flags Details | Diff

  None (edit)
Description Sysoltsev Slawa 2003-01-14 06:36:18 EST
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 06:40:22 EST
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 06:42:46 EST
Created attachment 89347 [details]
Patch which fix Makefile to use C++ compilers
Comment 3 Leon Ho 2005-02-03 15:55:17 EST
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.