comparison configure.ac @ 4932:8b63e21b0436

fix compile issues with gcc 4 -------------------- ChangeLog entries follow: -------------------- ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * aclocal.m4 (XE_SHLIB_STUFF): Use -export-all-symbols instead of -export-dynamic on PE targets (Cygwin and MinGW). * configure.ac (XE_EXPAND_VARIABLE): * configure.ac (TAB): Create variable XEMACS_CC_GPP to check whether we're running g++. Don't just check for an executable called `g++' -- it might be called g++-4 or whatever. Instead, check for either named `g++*' or claiming to be g++ when called with --version. Rewrite code do use the variable. Add -fno-strict-aliasing to optimization flags when GCC and optimized, and in all cases with g++, since under these circumstances strict aliasing is otherwise assumed, and XEmacs can't easily be made to respect its restrictions. * configure: Regenerate. lib-src/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * fakemail.c (args_size): * fakemail.c (parse_header): * ootags.c (C_entries): Fix warnings about possible use of uninitialized vars. lwlib/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * xlwgauge.c (GaugeResize): * xlwgauge.c (GaugeSize): Fix warnings about possible use of uninitialized vars. modules/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * postgresql/postgresql.c (CHECK_LIVE_CONNECTION): * postgresql/postgresql.c (print_pgconn): * postgresql/postgresql.c (Fpq_connectdb): * postgresql/postgresql.c (Fpq_connect_start): * postgresql/postgresql.c (Fpq_exec): * postgresql/postgresql.c (Fpq_get_result): Fix g++ 4.3 complaints about implicit conversions of string literals (const char *) to char *. src/ChangeLog addition: 2010-01-24 Ben Wing <ben@xemacs.org> * chartab.c (decode_char_table_range): * extents.c (extent_fragment_update): * objects-msw.c (initialize_font_instance): * process.c (Fgetenv): * redisplay-output.c (get_next_display_block): Fix warnings about possible use of uninitialized vars. * compiler.h: * compiler.h (REGISTER): * event-stream.c (is_scrollbar_event): * window.c (window_scrollbar_width): * window.c (window_scrollbar_height): * window.c (window_left_window_gutter_width): * window.c (window_right_window_gutter_width): Add USED_IF_SCROLLBARS. Use it to fix warnings about unused vars when --with-scrollbars=no. * config.h.in: Change comment to explain better why DECLARE_INLINE_HEADER is needed. * dialog-msw.c: * emacs.c (SHEBANG_EXE_PROGNAME_LENGTH): * emacs.c (main_1): * event-msw.c (struct mswin_message_debug): * event-msw.c (debug_output_mswin_message): * font-mgr.c: * font-mgr.c (Ffc_config_filename): * glyphs-msw.c (struct): * glyphs-msw.c (bitmap_table): * glyphs-x.c (update_widget_face): * intl-win32.c (struct lang_to_string): * intl-win32.c (lang_to_string_table): * nas.c: * objects-xlike-inc.c: * objects-xlike-inc.c (xft_find_charset_font): * syswindows.h: * win32.c (mswindows_output_last_error): Fix g++ 4.3 complaints about implicit conversions of string literals (const char *) to char *. * lisp.h: G++ 4.3 needs #include <limits> to avoid errors about min/max. * lisp.h (disabled_assert_with_message): Use disabled_assert* whenever asserts are disabled. Rewrite disabled_assert* to avoid complaints about unused vars by pretending to use the vars but casting them to (void). Remove code that defined assert() weirdly if DEBUG_XEMACS but not USE_ASSERTIONS -- configure sets USE_ASSERTIONS automatically when DEBUG_XEMACS, and if the user has forced it off, then so be it. * lisp.h (SYMBOL_KEYWORD): Put some of the combined `extern Lisp_Object's back under the file they are declared in. Cosmetic fix. * number.h: Remove `extern Lisp_Object' decls that duplicate lisp.h, since they have different C vs. C++ linkage.
author Ben Wing <ben@xemacs.org>
date Sun, 24 Jan 2010 22:04:58 -0600
parents bde90bc762f2
children 349f01075eb7
comparison
equal deleted inserted replaced
4931:8a08cf0b7583 4932:8b63e21b0436
1589 1589
1590 dnl We don't do AC_PROG_CC for XEMACS_CC; if we can't trust these people.... 1590 dnl We don't do AC_PROG_CC for XEMACS_CC; if we can't trust these people....
1591 test -n "$with_xemacs_compiler" && XEMACS_CC="$with_xemacs_compiler" 1591 test -n "$with_xemacs_compiler" && XEMACS_CC="$with_xemacs_compiler"
1592 : ${XEMACS_CC:="$CC"} 1592 : ${XEMACS_CC:="$CC"}
1593 1593
1594 dnl Are we using g++?
1595
1596 AC_MSG_CHECKING(whether we are using g++)
1597
1598 dnl Is it named g++*?
1599 XEMACS_CC_GPP=no
1600 case "$XEMACS_CC" in
1601 *g++* ) XEMACS_CC_GPP=yes ;;
1602 esac
1603
1604 dnl If it's known to be in the GCC family, does it claim to be g++? We don't
1605 dnl run this test unless we know it's GCC-like, because not all compilers
1606 dnl accept --version.
1607 dnl
1608 dnl It's not clear we need both tests, but it doesn't hurt. g++ might not
1609 dnl have always output "g++" as the first thing in its version string, and
1610 dnl might not always in the future.
1611 if test "$XEMACS_CC_GPP" = "no" -a "$GCC" = "yes"; then
1612 case "`$XEMACS_CC --version`" in
1613 g++* ) XEMACS_CC_GPP=yes ;;
1614 esac
1615 fi
1616
1617 AC_MSG_RESULT($XEMACS_CC_GPP)
1618
1594 dnl Figure out what C preprocessor to use. 1619 dnl Figure out what C preprocessor to use.
1595 1620
1596 dnl On Sun systems, people sometimes set up the variable CPP 1621 dnl On Sun systems, people sometimes set up the variable CPP
1597 dnl with a value that is a directory, not an executable at all. 1622 dnl with a value that is a directory, not an executable at all.
1598 dnl Detect that case, and ignore that value. 1623 dnl Detect that case, and ignore that value.
1875 dnl as CC or the following flag calculations are bogus. 1900 dnl as CC or the following flag calculations are bogus.
1876 dnl No error/abort; detection is too fragile. 1901 dnl No error/abort; detection is too fragile.
1877 1902
1878 xemacs_cc_cc_mismatch=no 1903 xemacs_cc_cc_mismatch=no
1879 if test "$CC" != "$XEMACS_CC"; then 1904 if test "$CC" != "$XEMACS_CC"; then
1880 case "$XEMACS_CC" in 1905 if test "$XEMACS_CC_GPP" = "yes" -a "$GCC" != "yes"; then
1881 *g++* ) 1906 AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong])
1882 if test "$GCC" != "yes"; then 1907 xemacs_cc_cc_mismatch=yes
1883 AC_MSG_WARN([CC and g++ are mismatched; XE_CFLAGS may be wrong]) 1908 fi
1884 xemacs_cc_cc_mismatch=yes 1909 if test -n "$GCC" -a "$XEMACS_CC_GPP" != "yes" ; then
1885 fi 1910 AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
1886 ;; 1911 xemacs_cc_cc_mismatch=yes
1887 esac
1888 if test -n "$GCC"; then
1889 case $XEMACS_CC in
1890 *g++* )
1891 # it's as expected, do nothing
1892 ;;
1893 * )
1894 AC_MSG_WARN([gcc and XEMACS_CC are mismatched; XE_CFLAGS may be wrong])
1895 xemacs_cc_cc_mismatch=yes
1896 ;;
1897 esac
1898 fi 1912 fi
1899 dnl #### Add other detectable mismatches here. 1913 dnl #### Add other detectable mismatches here.
1900 fi 1914 fi
1901 1915
1902 dnl Calculate optimization flags. These will be off by default in beta 1916 dnl Calculate optimization flags. These will be off by default in beta
1917 with_optimization=no 1931 with_optimization=no
1918 fi 1932 fi
1919 fi 1933 fi
1920 1934
1921 AC_MSG_CHECKING([for preferred optimization flags]) 1935 AC_MSG_CHECKING([for preferred optimization flags])
1922 if test "$with_optimization" = "yes" ; then 1936 if test "$cflags_optimization_specified" = "no"; then
1923 if test "$cflags_optimization_specified" = "no"; then 1937 if test "$with_optimization" = "yes" ; then
1924 dnl Following values of cflags_optimization are known to work well. 1938 dnl Following values of cflags_optimization are known to work well.
1925 dnl Should we take debugging options into consideration? 1939 dnl Should we take debugging options into consideration?
1926 if test "$GCC" = "yes"; then 1940 if test "$GCC" = "yes"; then
1927 with_cflags_optimization="-O3" 1941 dnl If you want to remove the -fno-strict-aliasing, then you will have
1942 dnl to rewrite all cases of "type-punning" expressions like
1943 dnl (* (foo *) (&bar)), which occur all over XEmacs, by making `bar' a
1944 dnl union (use an anonymous union if you're willing to put in an ifdef
1945 dnl for anon-union support, falling back to the type-punned expression.
1946 with_cflags_optimization="-O3 -fno-strict-aliasing"
1928 elif test "$__SUNPRO_C" = "yes"; then 1947 elif test "$__SUNPRO_C" = "yes"; then
1929 case "$opsys" in 1948 case "$opsys" in
1930 sol2 ) with_cflags_optimization="-xO4" ;; 1949 sol2 ) with_cflags_optimization="-xO4" ;;
1931 esac 1950 esac
1932 elif test "$__DECC" = "yes"; then 1951 elif test "$__DECC" = "yes"; then
1938 with_cflags_optimization="-O3 -Ob2" 1957 with_cflags_optimization="-O3 -Ob2"
1939 dnl ### Add optimal cflags_optimization support for other compilers HERE! 1958 dnl ### Add optimal cflags_optimization support for other compilers HERE!
1940 else 1959 else
1941 with_cflags_optimization="-O" ;dnl The only POSIX-approved flag 1960 with_cflags_optimization="-O" ;dnl The only POSIX-approved flag
1942 fi 1961 fi
1943 fi 1962 elif test "$XEMACS_CC_GPP" = "yes" ; then
1944 else 1963 dnl Fuck me! g++ v4 turns on strict aliasing by default, even without
1945 with_cflags_optimization= 1964 dnl optimization. See comment above about why we can't have strict
1965 dnl aliasing currently in XEmacs.
1966 with_cflags_optimization="-fno-strict-aliasing"
1967 fi
1946 fi 1968 fi
1947 1969
1948 AC_MSG_RESULT([${with_cflags_optimization}]) 1970 AC_MSG_RESULT([${with_cflags_optimization}])
1949 1971
1950 AC_MSG_CHECKING([for preferred debugging flags]) 1972 AC_MSG_CHECKING([for preferred debugging flags])
2003 dnl complaints about parameters with the same names as global functions. 2025 dnl complaints about parameters with the same names as global functions.
2004 dnl There is no -Wmissing-declarations under g++. 2026 dnl There is no -Wmissing-declarations under g++.
2005 dnl But gcc warns about -Weffc++ in C compiles. 2027 dnl But gcc warns about -Weffc++ in C compiles.
2006 dnl With g++, there is no effective way to use -Wunused-parameter without 2028 dnl With g++, there is no effective way to use -Wunused-parameter without
2007 dnl some very ugly code changes. 2029 dnl some very ugly code changes.
2008 if test "$with_xemacs_compiler" = "g++"; then 2030 if test "$XEMACS_CC_GPP" = "yes"; then
2009 xe_cflags_warning="$with_cflags_warning -Weffc++" 2031 xe_cflags_warning="$with_cflags_warning -Weffc++"
2010 elif test "$__GCC" -ge 3; then 2032 elif test "$__GCC" -ge 3; then
2011 xe_cflags_warning="$with_cflags_warning -Wunused-parameter" 2033 xe_cflags_warning="$with_cflags_warning -Wunused-parameter"
2012 if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then 2034 if test "$__GCC" -gt 3 || test "$__GCC_MINOR" -ge 4; then
2013 with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement" 2035 with_cflags_warning="$with_cflags_warning -Wdeclaration-after-statement"
3310 dnl Autodetect dll support 3332 dnl Autodetect dll support
3311 3333
3312 dnl If g++ is used, we have to explicitly link modules with -lstdc++ on Cygwin 3334 dnl If g++ is used, we have to explicitly link modules with -lstdc++ on Cygwin
3313 dnl to avoid undefined symbol errors. This will never hurt, so just do it on 3335 dnl to avoid undefined symbol errors. This will never hurt, so just do it on
3314 dnl all platforms in case others have the same brain damage. 3336 dnl all platforms in case others have the same brain damage.
3315 if test "$with_xemacs_compiler" = "g++"; then 3337 if test "$XEMACS_CC_GPP" = "yes"; then
3316 LIBSTDCPP=-lstdc++ 3338 LIBSTDCPP=-lstdc++
3317 else 3339 else
3318 LIBSTDCPP= 3340 LIBSTDCPP=
3319 fi 3341 fi
3320 AC_SUBST(LIBSTDCPP) 3342 AC_SUBST(LIBSTDCPP)
5488 5510
5489 if test "$with_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC) 5511 if test "$with_system_malloc" = "yes"; then AC_DEFINE(USE_SYSTEM_MALLOC)
5490 elif test "$with_debug_malloc" = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC) 5512 elif test "$with_debug_malloc" = "yes"; then AC_DEFINE(USE_DEBUG_MALLOC)
5491 AC_DEFINE(USE_SYSTEM_MALLOC) 5513 AC_DEFINE(USE_SYSTEM_MALLOC)
5492 fi 5514 fi
5493 test "$GCC" = "yes" && AC_DEFINE(USE_GCC) 5515 test "$GCC" = "yes" && AC_DEFINE(USE_GCC)
5494 test "$with_xemacs_compiler" = "g++" && AC_DEFINE(USE_GPLUSPLUS) 5516 test "$XEMACS_CC_GPP" = "yes" && AC_DEFINE(USE_GPLUSPLUS)
5495 test "$with_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET) 5517 test "$with_external_widget" = "yes" && AC_DEFINE(EXTERNAL_WIDGET)
5496 test "$with_kkcc" = "yes" && AC_DEFINE(USE_KKCC) 5518 test "$with_kkcc" = "yes" && AC_DEFINE(USE_KKCC)
5497 test "$with_newgc" = "yes" && AC_DEFINE(NEW_GC) 5519 test "$with_newgc" = "yes" && AC_DEFINE(NEW_GC)
5498 test "$have_vdb_posix" = "yes" && AC_DEFINE(VDB_POSIX) 5520 test "$have_vdb_posix" = "yes" && AC_DEFINE(VDB_POSIX)
5499 test "$have_vdb_fake" = "yes" && AC_DEFINE(VDB_FAKE) 5521 test "$have_vdb_fake" = "yes" && AC_DEFINE(VDB_FAKE)
5500 test "$with_quick_build" = "yes" && AC_DEFINE(QUICK_BUILD) 5522 test "$with_quick_build" = "yes" && AC_DEFINE(QUICK_BUILD)
5501 test "$with_purify" = "yes" && AC_DEFINE(PURIFY) 5523 test "$with_purify" = "yes" && AC_DEFINE(PURIFY)
5502 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY) 5524 test "$with_quantify" = "yes" && AC_DEFINE(QUANTIFY)
5503 test "$with_valgrind" = "yes" && AC_DEFINE(USE_VALGRIND) 5525 test "$with_valgrind" = "yes" && AC_DEFINE(USE_VALGRIND)
5504 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP) 5526 test "$with_pop" = "yes" && AC_DEFINE(MAIL_USE_POP)
5505 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS) 5527 test "$with_kerberos" = "yes" && AC_DEFINE(KERBEROS)
5506 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD) 5528 test "$with_hesiod" = "yes" && AC_DEFINE(HESIOD)
5507 test "$with_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE) 5529 test "$with_union_type" = "yes" && AC_DEFINE(USE_UNION_TYPE)
5508 test "$with_pdump" = "yes" && AC_DEFINE(PDUMP) 5530 test "$with_pdump" = "yes" && AC_DEFINE(PDUMP)
5509 test "$with_dump_in_exec" = "yes" && AC_DEFINE(DUMP_IN_EXEC) 5531 test "$with_dump_in_exec" = "yes" && AC_DEFINE(DUMP_IN_EXEC)
5510 test "$with_ipv6_cname" = "yes" && AC_DEFINE(IPV6_CANONICALIZE) 5532 test "$with_ipv6_cname" = "yes" && AC_DEFINE(IPV6_CANONICALIZE)
5511 5533
5512 5534
5513 5535
5514 dnl ------------------------------------------------------------------------- 5536 dnl -------------------------------------------------------------------------
5515 dnl ------------------------------- 5537 dnl -------------------------------