comparison configure @ 4991:97c45e3ad810

implement configure test for whether ndbm.h prototypes are broken -------------------- ChangeLog entries follow: -------------------- ChangeLog addition: 2010-02-06 Ben Wing <ben@xemacs.org> * configure: * configure.ac (AC_LANG): * configure.ac (TAB): Add AC_LANG(C++) defs in a way very similar to AC_LANG(C), inserting our own flags, compiler, etc. When using g++, if we found ndbm, check whether we can compile a file using g++ and ndbm.h, calling some DBM routines. Currently, this fails because the prototypes in ndbm.h are incomplete, omitting the arguments, which doesn't work with g++. When ndbm.h is bad, we don't include it and instead provide our own prototypes; otherwise, we define TRUST_NDBM_H_PROTOTYPES, which signals to use the ones in ndbm.h. src/ChangeLog addition: 2010-02-06 Ben Wing <ben@xemacs.org> * config.h.in: Add undef for TRUST_NDBM_H_PROTOTYPES. * database.c: * database.c (struct): Use TRUST_NDBM_H_PROTOTYPES to determine whether to include ndbm.h or to specify our own prototypes, in place of CYGWIN_HEADERS (or more generally, any random list of systems). * depend: Regenerate.
author Ben Wing <ben@xemacs.org>
date Sat, 06 Feb 2010 03:26:34 -0600
parents cbe181529c34
children 2ade80e8c640
comparison
equal deleted inserted replaced
4983:fbcf988fbb33 4991:97c45e3ad810
710 PROGNAME 710 PROGNAME
711 SUBDIR_MAKEFILES 711 SUBDIR_MAKEFILES
712 MAKE_SUBDIR 712 MAKE_SUBDIR
713 INSTALL_ARCH_DEP_SUBDIR 713 INSTALL_ARCH_DEP_SUBDIR
714 SRC_SUBDIR_DEPS 714 SRC_SUBDIR_DEPS
715 ac_ct_CXX
716 CXXFLAGS
717 CXX
715 have_esd_config 718 have_esd_config
716 ALLOCA 719 ALLOCA
717 canna_libs 720 canna_libs
718 lwlib_objs 721 lwlib_objs
719 postgresql_libs 722 postgresql_libs
1033 LIBS 1036 LIBS
1034 CPPFLAGS 1037 CPPFLAGS
1035 CPP 1038 CPP
1036 YACC 1039 YACC
1037 YFLAGS 1040 YFLAGS
1038 XMKMF' 1041 XMKMF
1042 CXX
1043 CXXFLAGS
1044 CCC'
1039 1045
1040 1046
1041 # Initialize some variables set by options. 1047 # Initialize some variables set by options.
1042 ac_init_help= 1048 ac_init_help=
1043 ac_init_version=false 1049 ac_init_version=false
2020 the first program found out of: `bison -y', `byacc', `yacc'. 2026 the first program found out of: `bison -y', `byacc', `yacc'.
2021 YFLAGS The list of arguments that will be passed by default to $YACC. 2027 YFLAGS The list of arguments that will be passed by default to $YACC.
2022 This script will default YFLAGS to the empty string to avoid a 2028 This script will default YFLAGS to the empty string to avoid a
2023 default value of `-d' given by some make applications. 2029 default value of `-d' given by some make applications.
2024 XMKMF Path to xmkmf, Makefile generator for X Window System 2030 XMKMF Path to xmkmf, Makefile generator for X Window System
2031 CXX C++ compiler command
2032 CXXFLAGS C++ compiler flags
2025 2033
2026 Use these variables to override the choices made by `configure' or to help 2034 Use these variables to override the choices made by `configure' or to help
2027 it to find libraries and programs with nonstandard names/locations. 2035 it to find libraries and programs with nonstandard names/locations.
2028 2036
2029 Report bugs to <xemacs-beta@xemacs.org>. 2037 Report bugs to <xemacs-beta@xemacs.org>.
2828 fi 2836 fi
2829 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} 2837 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2830 as_fn_set_status $ac_retval 2838 as_fn_set_status $ac_retval
2831 2839
2832 } # ac_fn_c_compute_int 2840 } # ac_fn_c_compute_int
2841
2842 # ac_fn_cxx_try_compile LINENO
2843 # ----------------------------
2844 # Try to compile conftest.$ac_ext, and return whether this succeeded.
2845 ac_fn_cxx_try_compile ()
2846 {
2847 as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2848 rm -f conftest.$ac_objext
2849 if { { ac_try="$ac_compile"
2850 case "(($ac_try" in
2851 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
2852 *) ac_try_echo=$ac_try;;
2853 esac
2854 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
2855 $as_echo "$ac_try_echo"; } >&5
2856 (eval "$ac_compile") 2>conftest.err
2857 ac_status=$?
2858 if test -s conftest.err; then
2859 grep -v '^ *+' conftest.err >conftest.er1
2860 cat conftest.er1 >&5
2861 mv -f conftest.er1 conftest.err
2862 fi
2863 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
2864 test $ac_status = 0; } && {
2865 test -z "$ac_cxx_werror_flag" ||
2866 test ! -s conftest.err
2867 } && test -s conftest.$ac_objext; then :
2868 ac_retval=0
2869 else
2870 $as_echo "$as_me: failed program was:" >&5
2871 sed 's/^/| /' conftest.$ac_ext >&5
2872
2873 ac_retval=1
2874 fi
2875 eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
2876 as_fn_set_status $ac_retval
2877
2878 } # ac_fn_cxx_try_compile
2833 cat >config.log <<_ACEOF 2879 cat >config.log <<_ACEOF
2834 This file contains any messages produced by compilers while 2880 This file contains any messages produced by compilers while
2835 running configure, to aid debugging if configure makes a mistake. 2881 running configure, to aid debugging if configure makes a mistake.
2836 2882
2837 It was created by XEmacs $as_me 21.5, which was 2883 It was created by XEmacs $as_me 21.5, which was
19749 #define NDBM_H_FILE "$ndbm_h_file" 19795 #define NDBM_H_FILE "$ndbm_h_file"
19750 _ACEOF 19796 _ACEOF
19751 19797
19752 $as_echo "#define HAVE_DBM 1" >>confdefs.h 19798 $as_echo "#define HAVE_DBM 1" >>confdefs.h
19753 19799
19800 if test "$XEMACS_CC_GPP" = "yes"; then
19801 { $as_echo "$as_me:${as_lineno-$LINENO}: result: " >&5
19802 $as_echo "" >&6; }
19803 ac_ext=c
19804 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
19805 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
19806 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
19807 ac_cpp='$CPP '"$xe_cppflags"
19808 ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
19809 ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
19810 ac_compiler_gnu=$ac_cv_c_compiler_gnu
19811
19812 ac_ext=c
19813 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
19814 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
19815 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
19816 ac_cpp='$CPP '"$xe_cppflags"
19817 ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
19818 ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
19819 ac_compiler_gnu=$ac_cv_c_compiler_gnu
19820 if test -z "$CXX"; then
19821 if test -n "$CCC"; then
19822 CXX=$CCC
19823 else
19824 if test -n "$ac_tool_prefix"; then
19825 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
19826 do
19827 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
19828 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
19829 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19830 $as_echo_n "checking for $ac_word... " >&6; }
19831 if test "${ac_cv_prog_CXX+set}" = set; then :
19832 $as_echo_n "(cached) " >&6
19833 else
19834 if test -n "$CXX"; then
19835 ac_cv_prog_CXX="$CXX" # Let the user override the test.
19836 else
19837 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19838 for as_dir in $PATH
19839 do
19840 IFS=$as_save_IFS
19841 test -z "$as_dir" && as_dir=.
19842 for ac_exec_ext in '' $ac_executable_extensions; do
19843 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
19844 ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
19845 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19846 break 2
19847 fi
19848 done
19849 done
19850 IFS=$as_save_IFS
19851
19852 fi
19853 fi
19854 CXX=$ac_cv_prog_CXX
19855 if test -n "$CXX"; then
19856 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
19857 $as_echo "$CXX" >&6; }
19858 else
19859 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19860 $as_echo "no" >&6; }
19861 fi
19862
19863
19864 test -n "$CXX" && break
19865 done
19866 fi
19867 if test -z "$CXX"; then
19868 ac_ct_CXX=$CXX
19869 for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
19870 do
19871 # Extract the first word of "$ac_prog", so it can be a program name with args.
19872 set dummy $ac_prog; ac_word=$2
19873 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19874 $as_echo_n "checking for $ac_word... " >&6; }
19875 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then :
19876 $as_echo_n "(cached) " >&6
19877 else
19878 if test -n "$ac_ct_CXX"; then
19879 ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
19880 else
19881 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19882 for as_dir in $PATH
19883 do
19884 IFS=$as_save_IFS
19885 test -z "$as_dir" && as_dir=.
19886 for ac_exec_ext in '' $ac_executable_extensions; do
19887 if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
19888 ac_cv_prog_ac_ct_CXX="$ac_prog"
19889 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19890 break 2
19891 fi
19892 done
19893 done
19894 IFS=$as_save_IFS
19895
19896 fi
19897 fi
19898 ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
19899 if test -n "$ac_ct_CXX"; then
19900 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
19901 $as_echo "$ac_ct_CXX" >&6; }
19902 else
19903 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19904 $as_echo "no" >&6; }
19905 fi
19906
19907
19908 test -n "$ac_ct_CXX" && break
19909 done
19910
19911 if test "x$ac_ct_CXX" = x; then
19912 CXX="g++"
19913 else
19914 case $cross_compiling:$ac_tool_warned in
19915 yes:)
19916 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
19917 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
19918 ac_tool_warned=yes ;;
19919 esac
19920 CXX=$ac_ct_CXX
19921 fi
19922 fi
19923
19924 fi
19925 fi
19926 # Provide some information about the compiler.
19927 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
19928 set X $ac_compile
19929 ac_compiler=$2
19930 for ac_option in --version -v -V -qversion; do
19931 { { ac_try="$ac_compiler $ac_option >&5"
19932 case "(($ac_try" in
19933 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
19934 *) ac_try_echo=$ac_try;;
19935 esac
19936 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
19937 $as_echo "$ac_try_echo"; } >&5
19938 (eval "$ac_compiler $ac_option >&5") 2>conftest.err
19939 ac_status=$?
19940 if test -s conftest.err; then
19941 sed '10a\
19942 ... rest of stderr output deleted ...
19943 10q' conftest.err >conftest.er1
19944 cat conftest.er1 >&5
19945 fi
19946 rm -f conftest.er1 conftest.err
19947 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
19948 test $ac_status = 0; }
19949 done
19950
19951 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
19952 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
19953 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then :
19954 $as_echo_n "(cached) " >&6
19955 else
19956 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19957 /* end confdefs.h. */
19958
19959 int
19960 main ()
19961 {
19962 #ifndef __GNUC__
19963 choke me
19964 #endif
19965
19966 ;
19967 return 0;
19968 }
19969 _ACEOF
19970 if ac_fn_cxx_try_compile "$LINENO"; then :
19971 ac_compiler_gnu=yes
19972 else
19973 ac_compiler_gnu=no
19974 fi
19975 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
19976 ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
19977
19978 fi
19979 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
19980 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
19981 if test $ac_compiler_gnu = yes; then
19982 GXX=yes
19983 else
19984 GXX=
19985 fi
19986 ac_test_CXXFLAGS=${CXXFLAGS+set}
19987 ac_save_CXXFLAGS=$CXXFLAGS
19988 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
19989 $as_echo_n "checking whether $CXX accepts -g... " >&6; }
19990 if test "${ac_cv_prog_cxx_g+set}" = set; then :
19991 $as_echo_n "(cached) " >&6
19992 else
19993 ac_save_cxx_werror_flag=$ac_cxx_werror_flag
19994 ac_cxx_werror_flag=yes
19995 ac_cv_prog_cxx_g=no
19996 CXXFLAGS="-g"
19997 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19998 /* end confdefs.h. */
19999
20000 int
20001 main ()
20002 {
20003
20004 ;
20005 return 0;
20006 }
20007 _ACEOF
20008 if ac_fn_cxx_try_compile "$LINENO"; then :
20009 ac_cv_prog_cxx_g=yes
20010 else
20011 CXXFLAGS=""
20012 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20013 /* end confdefs.h. */
20014
20015 int
20016 main ()
20017 {
20018
20019 ;
20020 return 0;
20021 }
20022 _ACEOF
20023 if ac_fn_cxx_try_compile "$LINENO"; then :
20024
20025 else
20026 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
20027 CXXFLAGS="-g"
20028 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20029 /* end confdefs.h. */
20030
20031 int
20032 main ()
20033 {
20034
20035 ;
20036 return 0;
20037 }
20038 _ACEOF
20039 if ac_fn_cxx_try_compile "$LINENO"; then :
20040 ac_cv_prog_cxx_g=yes
20041 fi
20042 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20043 fi
20044 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20045 fi
20046 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20047 ac_cxx_werror_flag=$ac_save_cxx_werror_flag
20048 fi
20049 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
20050 $as_echo "$ac_cv_prog_cxx_g" >&6; }
20051 if test "$ac_test_CXXFLAGS" = set; then
20052 CXXFLAGS=$ac_save_CXXFLAGS
20053 elif test $ac_cv_prog_cxx_g = yes; then
20054 if test "$GXX" = yes; then
20055 CXXFLAGS="-g -O2"
20056 else
20057 CXXFLAGS="-g"
20058 fi
20059 else
20060 if test "$GXX" = yes; then
20061 CXXFLAGS="-O2"
20062 else
20063 CXXFLAGS=
20064 fi
20065 fi
20066 ac_ext=c
20067 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
20068 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
20069 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
20070 ac_cpp='$CPP '"$xe_cppflags"
20071 ac_compile='$XEMACS_CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
20072 ac_link='$XEMACS_CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
20073 ac_compiler_gnu=$ac_cv_c_compiler_gnu
20074
20075
20076 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20077 /* end confdefs.h. */
20078 #include "$ndbm_h_file"
20079 int
20080 main ()
20081 {
20082 dbm_close((DBM *) 0);
20083 ;
20084 return 0;
20085 }
20086 _ACEOF
20087 if ac_fn_cxx_try_compile "$LINENO"; then :
20088 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ndbm.h is compatible with g++" >&5
20089 $as_echo_n "checking whether ndbm.h is compatible with g++... " >&6; }
20090 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
20091 $as_echo "yes" >&6; }
20092 $as_echo "#define TRUST_NDBM_H_PROTOTYPES 1" >>confdefs.h
20093
20094 else
20095 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ndbm.h is compatible with g++" >&5
20096 $as_echo_n "checking whether ndbm.h is compatible with g++... " >&6; }
20097 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20098 $as_echo "no" >&6; }
20099 fi
20100 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
20101 ac_ext=c
20102 xe_cppflags='$CPPFLAGS $c_switch_site $c_switch_machine $c_switch_system $c_switch_x_site $X_CFLAGS'
20103 xe_ldflags='$LDFLAGS $ld_switch_site $ld_switch_machine $ld_switch_system $ld_switch_x_site $ld_switch_run'
20104 xe_libs='$ld_call_shared $xe_check_libs $X_EXTRA_LIBS $libs_x $libs_gtk $X_PRE_LIBS $LIBS $libs_machine $libs_system $libs_standard'
20105 ac_cpp='$CPP '"$xe_cppflags"
20106 ac_compile='$CC -c $CFLAGS '"$xe_cppflags"' conftest.$ac_ext >&5'
20107 ac_link='$CC -o conftest$ac_exeext $CFLAGS '"$xe_cppflags $xe_ldflags"' conftest.$ac_ext '"$xe_libs"' >&5'
20108 ac_compiler_gnu=$ac_cv_c_compiler_gnu
20109
20110 else
20111 $as_echo "#define TRUST_NDBM_H_PROTOTYPES 1" >>confdefs.h
20112
20113 fi
19754 $as_unset ndbm_h_file 20114 $as_unset ndbm_h_file
19755 fi 20115 fi
19756 20116
19757 ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default" 20117 ac_fn_c_check_type "$LINENO" "u_int8_t" "ac_cv_type_u_int8_t" "$ac_includes_default"
19758 if test "x$ac_cv_type_u_int8_t" = x""yes; then : 20118 if test "x$ac_cv_type_u_int8_t" = x""yes; then :