diff --git a/hawk/Makefile.in b/hawk/Makefile.in index 33cffa54..e892cb5d 100644 --- a/hawk/Makefile.in +++ b/hawk/Makefile.in @@ -170,8 +170,8 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \ $(top_srcdir)/ac/config.sub $(top_srcdir)/ac/install-sh \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \ $(top_srcdir)/pkgs/hawk.spec.in ac/ar-lib ac/compile \ - ac/config.guess ac/config.sub ac/depcomp ac/install-sh \ - ac/ltmain.sh ac/missing + ac/config.guess ac/config.sub ac/install-sh ac/ltmain.sh \ + ac/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -354,6 +354,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/bin/Makefile.in b/hawk/bin/Makefile.in index bf28774e..0158c293 100644 --- a/hawk/bin/Makefile.in +++ b/hawk/bin/Makefile.in @@ -323,6 +323,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/configure b/hawk/configure index 14e93367..9156c6d7 100755 --- a/hawk/configure +++ b/hawk/configure @@ -783,6 +783,7 @@ infodir docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -883,6 +884,7 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1135,6 +1137,15 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1272,7 +1283,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1425,6 +1436,7 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -5746,6 +5758,8 @@ fi +if test "${HAVE_CXX}" = "yes" +then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if c++ supports namespace std" >&5 @@ -5794,8 +5808,7 @@ $as_echo "#define HAVE_CXX_NAMESPACE_STD /**/" >>confdefs.h fi - - ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6477,6 +6490,7 @@ $as_echo "#define HAVE_CXX11 1" >>confdefs.h fi +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 @@ -18066,7 +18080,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18112,7 +18126,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18136,7 +18150,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18181,7 +18195,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18205,7 +18219,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18693,6 +18707,45 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "${HAVE_CXX}" = "yes" +then + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +void* operator new (unsigned int) { return (void*)0; } +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAWK_PREFER_UNSIGNED_INT_FOR_OPERATOR_NEW 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : diff --git a/hawk/configure.ac b/hawk/configure.ac index cec964c8..a6abd9c1 100644 --- a/hawk/configure.ac +++ b/hawk/configure.ac @@ -26,11 +26,13 @@ AC_PROG_CXX dnl check if the C++ compiler exists in PATH AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no) -dnl check if the C++ compiler supports namespace -AX_CXX_NAMESPACE_STD - -dnl HAVE_CXX11 -AX_CXX_COMPILE_STDCXX(11, , optional) +if test "${HAVE_CXX}" = "yes" +then + dnl check if the C++ compiler supports namespace + AX_CXX_NAMESPACE_STD + dnl HAVE_CXX11 + AX_CXX_COMPILE_STDCXX(11, , optional) +fi dnl determine some key programs AC_PROG_INSTALL @@ -222,10 +224,22 @@ AC_MSG_CHECKING([labels as values]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [], [[void* jp[] = { &&jpt1, &&jpt2, &&jpt3 }; goto *jp[1]; jpt1: 1; jpt2: 2; jpt3: 3; ]])], [AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_LABELS_AS_VALUES, 1, [labels as values])], + AC_DEFINE([HAVE_LABELS_AS_VALUES], [1], [labels as values])], [AC_MSG_RESULT(no)] ) +if test "${HAVE_CXX}" = "yes" +then + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( [[void* operator new (unsigned int) { return (void*)0; }]], [[ ]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([HAWK_PREFER_UNSIGNED_INT_FOR_OPERATOR_NEW], [1], [prefer unsigned int for the first parameter of operator new])], + [AC_MSG_RESULT(no)] + ) + AC_LANG_POP([C++]) +fi + dnl check header files. AC_HEADER_STDC AC_CHECK_HEADERS([stddef.h wchar.h wctype.h errno.h signal.h fcntl.h dirent.h]) diff --git a/hawk/lib/Makefile.in b/hawk/lib/Makefile.in index 03896d18..973c5c74 100644 --- a/hawk/lib/Makefile.in +++ b/hawk/lib/Makefile.in @@ -548,6 +548,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/lib/hawk-cfg.h.in b/hawk/lib/hawk-cfg.h.in index 02eb803e..f758d7ba 100644 --- a/hawk/lib/hawk-cfg.h.in +++ b/hawk/lib/hawk-cfg.h.in @@ -756,6 +756,9 @@ /* Prefix wide-character literals with L */ #undef HAWK_PREFER_PREFIX_L +/* prefer unsigned int for the first parameter of operator new */ +#undef HAWK_PREFER_UNSIGNED_INT_FOR_OPERATOR_NEW + /* Define if pthread_cond_t is signed */ #undef HAWK_PTHREAD_MUTEX_T_IS_SIGNED diff --git a/hawk/lib/hawk-cmn.h b/hawk/lib/hawk-cmn.h index 5a0ec375..ffbd224c 100644 --- a/hawk/lib/hawk-cmn.h +++ b/hawk/lib/hawk-cmn.h @@ -210,7 +210,16 @@ /* hawk_int32_t */ -#if defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_INT == 4) +#if defined(HAWK_SIZEOF_LONG) && (HAWK_SIZEOF_LONG == 4) && !defined(HAWK_PREFER_UNSIGNED_INT_FOR_OPERATOR_NEW) + /* in case c++ compiler defines the first parameter of the operator new() to unsigned int */ + /* in addition, if c++ is disabled, long is preferred by default */ +# define HAWK_HAVE_UINT32_T +# define HAWK_HAVE_INT32_T +# define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF_LONG) +# define HAWK_SIZEOF_INT32_T (HAWK_SIZEOF_LONG) + typedef unsigned long int hawk_uint32_t; + typedef signed long int hawk_int32_t; +#elif defined(HAWK_SIZEOF_INT) && (HAWK_SIZEOF_INT == 4) # define HAWK_HAVE_UINT32_T # define HAWK_HAVE_INT32_T # define HAWK_SIZEOF_UINT32_T (HAWK_SIZEOF_INT) diff --git a/hawk/mod/Makefile.in b/hawk/mod/Makefile.in index f93d534b..a1674f67 100644 --- a/hawk/mod/Makefile.in +++ b/hawk/mod/Makefile.in @@ -379,6 +379,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/samples/Makefile.in b/hawk/samples/Makefile.in index b7bed9c0..74c791be 100644 --- a/hawk/samples/Makefile.in +++ b/hawk/samples/Makefile.in @@ -351,6 +351,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/t/Makefile.in b/hawk/t/Makefile.in index ca95a7aa..4005f0c6 100644 --- a/hawk/t/Makefile.in +++ b/hawk/t/Makefile.in @@ -538,6 +538,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ diff --git a/hawk/tools/Makefile.in b/hawk/tools/Makefile.in index c3599c72..6e3e8386 100644 --- a/hawk/tools/Makefile.in +++ b/hawk/tools/Makefile.in @@ -329,6 +329,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@