NSPR's configure script should check the C++ compiler only when --enable-cplus is specified

RESOLVED FIXED in 4.7.1

Status

P2
minor
RESOLVED FIXED
13 years ago
11 years ago

People

(Reporter: wtc, Assigned: christophe.ravel.bugs)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

13 years ago
NSPR's configure script performs several checks on
the C++ compiler.  I believe these checks come from
the following code in mozilla/nsprpub/configure.in:

    AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
    unset ac_cv_prog_CXX
    AC_PROG_CXX

Since NSPR doesn't need a C++ compiler by default, we
should only perform the C++ compiler checks when the
--enable-cplus configure option is specified.
QA Contact: wtchang → nspr
(Assignee)

Comment 1

11 years ago
Created attachment 306064 [details] [diff] [review]
Disable check for C++ compiler unless --enable-cplus

Configure and make tested on Solaris SPARC, Windows 32 bit and AIX 5.3 ppc.
Assignee: wtc → christophe.ravel.bugs
Status: NEW → ASSIGNED
Attachment #306064 - Flags: review?(wtc)
(Assignee)

Updated

11 years ago
Priority: -- → P2
Target Milestone: --- → 4.7.1
(Reporter)

Comment 2

11 years ago
Comment on attachment 306064 [details] [diff] [review]
Disable check for C++ compiler unless --enable-cplus

>@@ -455,11 +463,13 @@ if test "$target" != "$host"; then
>     AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
>     AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
>     AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
> 
> else
>-    AC_PROG_CXX
>+    if test -n "$USE_CPLUS"; then
>+        AC_PROG_CXX
>+    fi
>     if test "$CXX" = "cl" -a -z "$CC"; then
>         CC=$CXX
>     else        
>         AC_PROG_CC
>     fi

I think it's safer to rewrite the code to check CC before CXX, and
then apply the USE_CPLUS test, like this:

    AC_PROG_CC
    if test -n "$USE_CPLUS"; then
        if test "$CC" = "cl" -a -z "$CXX"; then
            CXX=$CC
        else        
            AC_PROG_CXX
        fi
    fi

All the other changes look good.  Thanks!
Attachment #306064 - Flags: review?(wtc) → review-
(Assignee)

Comment 3

11 years ago
Created attachment 307362 [details] [diff] [review]
Implements Wan-Teh's comments

Tested again on Solaris SPARC, AIX 5.3 ppc and Windows.
Attachment #306064 - Attachment is obsolete: true
Attachment #307362 - Flags: review?(wtc)
(Reporter)

Comment 4

11 years ago
Comment on attachment 307362 [details] [diff] [review]
Implements Wan-Teh's comments

r=wtc.

cls, if you have time, I'd appreciate if you could take a quick look at
this patch.  If you're busy, don't worry about it.
Attachment #307362 - Flags: review?(wtc) → review+
(Assignee)

Comment 5

11 years ago
Committed on NSPR trunk.

Checking in configure.in;
/cvsroot/mozilla/nsprpub/configure.in,v  <--  configure.in
new revision: 1.231; previous revision: 1.230
done
Checking in configure;
/cvsroot/mozilla/nsprpub/configure,v  <--  configure
new revision: 1.227; previous revision: 1.226
done
Status: ASSIGNED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.