* [PATCH] OS X: make configure work better out of the box with FSF GCC
@ 2011-02-27 5:05 Daniel Colascione
2011-02-28 19:56 ` Glenn Morris
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Colascione @ 2011-02-27 5:05 UTC (permalink / raw)
To: Emacs development discussions
[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]
I didn't include the corresponding configure changes; I figure I can let
whoever installs this patch regenerate the script.
== modified file 'configure.in'
--- configure.in 2011-02-27 04:33:43 +0000
+++ configure.in 2011-02-27 05:02:27 +0000
@@ -481,8 +481,21 @@
* ) unported=yes ;;
esac
opsys=darwin
- # Define CPP as follows to make autoconf work correctly.
- CPP="${CC-cc} -E -no-cpp-precomp"
+
+ # Define CPP as follows to make autoconf work correctly
+ # when using the system compiler.
+ case "$(which "${CC-cc}")" in
+ /usr/bin/* | /usr/lib/* )
+ CPP="${CC-cc} -E -no-cpp-precomp"
+ ;;
+ * )
+ # The below macro prevents the Carbon headers from defining
+ # nonstandard constructs not understood by FSF GCC.
+ CPPFLAGS="$CPPFLAGS -D__INTEL_COMPILER=1"
+ CPP="${CC-cc} -E -D__INTEL_COMPILER=1"
+ ;;
+ esac;
+
# Use fink packages if available.
if test -d /sw/include && test -d /sw/lib; then
GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
@@ -614,9 +627,7 @@
machine=intel386
case "${canonical}" in
*-cygwin ) opsys=cygwin ;;
- *-darwin* ) opsys=darwin
- CPP="${CC-cc} -E -no-cpp-precomp"
- ;;
+ *-darwin* ) opsys=darwin ;;
*-linux-gnu* ) opsys=gnu-linux ;;
*-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
*-sysv5uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OS X: make configure work better out of the box with FSF GCC
2011-02-27 5:05 [PATCH] OS X: make configure work better out of the box with FSF GCC Daniel Colascione
@ 2011-02-28 19:56 ` Glenn Morris
2011-02-28 21:04 ` Daniel Colascione
0 siblings, 1 reply; 5+ messages in thread
From: Glenn Morris @ 2011-02-28 19:56 UTC (permalink / raw)
To: Daniel Colascione; +Cc: Emacs development discussions
Daniel Colascione wrote:
> I didn't include the corresponding configure changes; I figure I can let
> whoever installs this patch regenerate the script.
Could you explain what problem this change is supposed to fix?
> + case "$(which "${CC-cc}")" in
> + /usr/bin/* | /usr/lib/* )
> + CPP="${CC-cc} -E -no-cpp-precomp"
> + ;;
> + * )
> + # The below macro prevents the Carbon headers from defining
> + # nonstandard constructs not understood by FSF GCC.
> + CPPFLAGS="$CPPFLAGS -D__INTEL_COMPILER=1"
> + CPP="${CC-cc} -E -D__INTEL_COMPILER=1"
"FSF GCC" seems tautological at best.
It seems fragile to test the location of the compiler. Why not test for
the actual compiler version?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OS X: make configure work better out of the box with FSF GCC
2011-02-28 19:56 ` Glenn Morris
@ 2011-02-28 21:04 ` Daniel Colascione
2011-02-28 21:12 ` Andreas Schwab
2011-02-28 22:15 ` Chad Brown
0 siblings, 2 replies; 5+ messages in thread
From: Daniel Colascione @ 2011-02-28 21:04 UTC (permalink / raw)
To: Emacs development discussions
On Mon, Feb 28, 2011 at 11:56 AM, Glenn Morris <rgm@gnu.org> wrote:
>
> Daniel Colascione wrote:
>
>> I didn't include the corresponding configure changes; I figure I can let
>> whoever installs this patch regenerate the script.
>
> Could you explain what problem this change is supposed to fix?
Various header files (right now, Carbon --- which, granted, isn't used
in the in-tree Emacs) presume that Apple-gcc specific features like
printf attributes for CFStrings work. With FSF gcc (i.e., gcc without
Apple-specific patches) these declarations break the build. Defining
__INTEL_COMPILER essentially tells the system to use only the set of
gcc extensions supported by icc, which is a subset of the extensions
supported by FSF GCC.
>
>> + case "$(which "${CC-cc}")" in
>> + /usr/bin/* | /usr/lib/* )
>> + CPP="${CC-cc} -E -no-cpp-precomp"
>> + ;;
>> + * )
>> + # The below macro prevents the Carbon headers from defining
>> + # nonstandard constructs not understood by FSF GCC.
>> + CPPFLAGS="$CPPFLAGS -D__INTEL_COMPILER=1"
>> + CPP="${CC-cc} -E -D__INTEL_COMPILER=1"
>
> "FSF GCC" seems tautological at best.
>
> It seems fragile to test the location of the compiler. Why not test for
> the actual compiler version?
>
Apple essentially forked gcc 4.2, and it still reports that version.
I don't know a good way to distinguish Apple-patched gcc 4.2 from
FSF-issue gcc 4.2, and seeing whether the compiler is installed in the
"system compiler" location seems like a robust-enough way to figure
this out. Another option would be to just do a test compilation, but
that takes time.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OS X: make configure work better out of the box with FSF GCC
2011-02-28 21:04 ` Daniel Colascione
@ 2011-02-28 21:12 ` Andreas Schwab
2011-02-28 22:15 ` Chad Brown
1 sibling, 0 replies; 5+ messages in thread
From: Andreas Schwab @ 2011-02-28 21:12 UTC (permalink / raw)
To: Daniel Colascione; +Cc: Emacs development discussions
Daniel Colascione <dan.colascione@gmail.com> writes:
> Another option would be to just do a test compilation, but that takes
> time.
But that is exactly the Right Thing.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OS X: make configure work better out of the box with FSF GCC
2011-02-28 21:04 ` Daniel Colascione
2011-02-28 21:12 ` Andreas Schwab
@ 2011-02-28 22:15 ` Chad Brown
1 sibling, 0 replies; 5+ messages in thread
From: Chad Brown @ 2011-02-28 22:15 UTC (permalink / raw)
To: Daniel Colascione; +Cc: Emacs development discussions
[-- Attachment #1: Type: text/plain, Size: 635 bytes --]
On Feb 28, 2011, at 1:04 PM, Daniel Colascione wrote:
>
> Apple essentially forked gcc 4.2, and it still reports that version.
> I don't know a good way to distinguish Apple-patched gcc 4.2 from
> FSF-issue gcc 4.2
; gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5659)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Presumably only the Apple-patched versions say ``Apple Inc. build #'', yes?
*Chad
(anyone else find the copyright year humorous?)
[-- Attachment #2: Type: text/html, Size: 1063 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-02-28 22:15 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-27 5:05 [PATCH] OS X: make configure work better out of the box with FSF GCC Daniel Colascione
2011-02-28 19:56 ` Glenn Morris
2011-02-28 21:04 ` Daniel Colascione
2011-02-28 21:12 ` Andreas Schwab
2011-02-28 22:15 ` Chad Brown
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.