Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit899f49c

Browse files
committed
Use special gcc -W flags only if we are using gcc, not if we are using
the Intel compiler.Jeremy Drake
1 parent1b4504c commit899f49c

File tree

2 files changed

+75
-13
lines changed

2 files changed

+75
-13
lines changed

‎configure

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,12 +2713,65 @@ else
27132713
fi
27142714
fi
27152715

2716+
# The Intel compiler on Linux supports most gcc options, but not
2717+
# all of them, so only add these options if we are really using
2718+
# gcc
2719+
27162720
if test "$GCC" = yes; then
2717-
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
27182721

2719-
# Some versions of GCC support some additional useful warning flags.
2720-
# Check whether they are supported, and add them to CFLAGS if so.
2721-
echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
2722+
cat >conftest.$ac_ext <<_ACEOF
2723+
/* confdefs.h. */
2724+
_ACEOF
2725+
cat confdefs.h >>conftest.$ac_ext
2726+
cat >>conftest.$ac_ext <<_ACEOF
2727+
/* end confdefs.h. */
2728+
2729+
int
2730+
main ()
2731+
{
2732+
#ifndef __INTEL_COMPILER
2733+
choke me
2734+
#endif
2735+
;
2736+
return 0;
2737+
}
2738+
_ACEOF
2739+
rm -f conftest.$ac_objext
2740+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2741+
(eval $ac_compile) 2>conftest.er1
2742+
ac_status=$?
2743+
grep -v '^ *+' conftest.er1 >conftest.err
2744+
rm -f conftest.er1
2745+
cat conftest.err >&5
2746+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2747+
(exit $ac_status); } &&
2748+
{ ac_try='test -z "$ac_c_werror_flag"
2749+
|| test ! -s conftest.err'
2750+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2751+
(eval $ac_try) 2>&5
2752+
ac_status=$?
2753+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2754+
(exit $ac_status); }; } &&
2755+
{ ac_try='test -s conftest.$ac_objext'
2756+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2757+
(eval $ac_try) 2>&5
2758+
ac_status=$?
2759+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
2760+
(exit $ac_status); }; }; then
2761+
ICC=yes
2762+
else
2763+
echo "$as_me: failed program was:" >&5
2764+
sed 's/^/| /' conftest.$ac_ext >&5
2765+
2766+
ICC=no
2767+
fi
2768+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
2769+
if test "$ICC" = no; then
2770+
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
2771+
2772+
# Some versions of GCC support some additional useful warning flags.
2773+
# Check whether they are supported, and add them to CFLAGS if so.
2774+
echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5
27222775
echo $ECHO_N "checking if $CC supports -Wdeclaration-after-statement... $ECHO_C" >&6
27232776
pgac_save_CFLAGS=$CFLAGS
27242777
CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement"
@@ -2771,7 +2824,7 @@ echo "${ECHO_T}no" >&6
27712824
fi
27722825
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
27732826

2774-
echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
2827+
echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5
27752828
echo $ECHO_N "checking if $CC supports -Wendif-labels... $ECHO_C" >&6
27762829
pgac_save_CFLAGS=$CFLAGS
27772830
CFLAGS="$pgac_save_CFLAGS -Wendif-labels"
@@ -2824,6 +2877,7 @@ echo "${ECHO_T}no" >&6
28242877
fi
28252878
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
28262879

2880+
fi
28272881

28282882
# Disable strict-aliasing rules; needed for gcc 3.3+
28292883
echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5
@@ -2897,7 +2951,6 @@ fi
28972951
# Check if the compiler still works with the template settings
28982952
echo "$as_me:$LINENO: checking whether the C compiler still works" >&5
28992953
echo $ECHO_N "checking whether the C compiler still works... $ECHO_C" >&6
2900-
29012954
cat >conftest.$ac_ext <<_ACEOF
29022955
/* confdefs.h. */
29032956
_ACEOF

‎configure.in

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.457 2006/04/19 16:32:08 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.458 2006/04/21 23:11:58 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -248,13 +248,22 @@ else
248248
fi
249249
fi
250250

251-
if test "$GCC" = yes; then
252-
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
251+
# The Intel compiler on Linux supports most gcc options, but not
252+
# all of them, so only add these options if we are really using
253+
# gcc
253254

254-
# Some versions of GCC support some additional useful warning flags.
255-
# Check whether they are supported, and add them to CFLAGS if so.
256-
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
257-
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
255+
if test "$GCC" = yes; then
256+
AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER
257+
choke me
258+
@%:@endif], [ICC=[yes]], [ICC=[no]])
259+
if test "$ICC" = no; then
260+
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
261+
262+
# Some versions of GCC support some additional useful warning flags.
263+
# Check whether they are supported, and add them to CFLAGS if so.
264+
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
265+
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
266+
fi
258267

259268
# Disable strict-aliasing rules; needed for gcc 3.3+
260269
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp