Closed Bug 635948 Opened 13 years ago Closed 13 years ago

Check for valid compiler/Mac OS X SDK combination works by chance

Categories

(Firefox Build System :: General, defect)

All
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glandium, Assigned: glandium)

References

Details

(Whiteboard: fixed-in-bs)

Attachments

(1 file)

The current check for valid compiler/Mac OS X SDK combination works by mere luck: the problem is here:
  AC_TRY_COMPILE([#include <new>
                 int main() { return 0; }],
    result=yes,
    result=no)

AC_TRY_COMPILE takes 4 arguments: a preamble, a main body, a script to run when succeeded, a script to run when failed. Here, the main body ends up being "result=yes", and the AC_TRY_COMPILE fails because the resulting .c file contains two main() functions. But there's nothing to run in case of failure due to only 3 arguments being present. The check that triggers an error later, fortunately, fails for $result = "no"... which is not the case.

So all in all, configure doesn't fail, but that's by chance, and the check wouldn't pick a real error.
Attachment #514231 - Flags: review?(ted.mielczarek)
Assignee: nobody → mh+mozilla
Comment on attachment 514231 [details] [diff] [review]
Fix AC_TRY_COMPILE call for valid compiler/Mac OS X SDK combination check

Wow, that's truly awful. I'm guessing there was meant to be separate sets of brackets around the #include <new> and the main body there (not that that would work either).
Attachment #514231 - Flags: review?(ted.mielczarek) → review+
http://hg.mozilla.org/mozilla-central/rev/bbb42f5bef5a
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Blocks: 644324
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: