Commit d65e2bab authored by doko@python.org's avatar doko@python.org

- Issue #17086: Backport the patches from the 3.3 branch to cross-build

  the package.
parent c5200b48
......@@ -37,6 +37,11 @@ if os.name == "nt" and "\\pcbuild\\amd64" in project_base[-14:].lower():
project_base = os.path.abspath(os.path.join(project_base, os.path.pardir,
os.path.pardir))
# set for cross builds
if "_PYTHON_PROJECT_BASE" in os.environ:
# this is the build directory, at least for posix
project_base = os.path.normpath(os.environ["_PYTHON_PROJECT_BASE"])
# python_build: (Boolean) if true, we're either building Python or
# building an extension with an un-installed Python, so we use
# different (hard-wired) directories.
......@@ -230,7 +235,7 @@ def get_config_h_filename():
def get_makefile_filename():
"""Return full pathname of installed Makefile from the Python build."""
if python_build:
return os.path.join(os.path.dirname(sys.executable), "Makefile")
return os.path.join(project_base, "Makefile")
lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
return os.path.join(lib_dir, "config", "Makefile")
......
......@@ -51,6 +51,10 @@ def get_platform ():
return 'win-ia64'
return sys.platform
# Set for cross builds explicitly
if "_PYTHON_HOST_PLATFORM" in os.environ:
return os.environ["_PYTHON_HOST_PLATFORM"]
if os.name != "posix" or not hasattr(os, 'uname'):
# XXX what about the architecture? NT is Intel or Alpha,
# Mac OS is M68k or PPC, etc.
......
#! /bin/sh
set -v
python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /usr/include/netinet/in.h
eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" /usr/include/netinet/in.h
......@@ -116,6 +116,10 @@ if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower():
if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower():
_PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))
# set for cross builds
if "_PYTHON_PROJECT_BASE" in os.environ:
# the build directory for posix builds
_PROJECT_BASE = os.path.normpath(os.path.abspath("."))
def is_python_build():
for fn in ("Setup.dist", "Setup.local"):
if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)):
......@@ -507,6 +511,10 @@ def get_platform():
return 'win-ia64'
return sys.platform
# Set for cross builds explicitly
if "_PYTHON_HOST_PLATFORM" in os.environ:
return os.environ["_PYTHON_HOST_PLATFORM"]
if os.name != "posix" or not hasattr(os, 'uname'):
# XXX what about the architecture? NT is Intel or Alpha,
# Mac OS is M68k or PPC, etc.
......
......@@ -29,6 +29,8 @@ srcdir= @srcdir@
VPATH= @srcdir@
abs_srcdir= @abs_srcdir@
abs_builddir= @abs_builddir@
build= @build@
host= @host@
CC= @CC@
CXX= @CXX@
......@@ -190,6 +192,10 @@ UNICODE_OBJS= @UNICODE_OBJS@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
HOST_GNU_TYPE= @host@
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
#PROFILE_TASK= $(srcdir)/Lib/test/regrtest.py
......@@ -222,6 +228,19 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
# Parser
PGEN= Parser/pgen$(EXE)
PSRCS= \
Parser/acceler.c \
Parser/grammar1.c \
Parser/listnode.c \
Parser/node.c \
Parser/parser.c \
Parser/parsetok.c \
Parser/bitset.c \
Parser/metagrammar.c \
Parser/firstsets.c \
Parser/grammar.c \
Parser/pgen.c
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
......@@ -237,6 +256,14 @@ POBJS= \
PARSER_OBJS= $(POBJS) Parser/myreadline.o Parser/tokenizer.o
PGSRCS= \
Objects/obmalloc.c \
Python/mysnprintf.c \
Python/pyctype.c \
Parser/tokenizer_pgen.c \
Parser/printgrammar.c \
Parser/pgenmain.c
PGOBJS= \
Objects/obmalloc.o \
Python/mysnprintf.o \
......@@ -249,7 +276,8 @@ PARSER_HEADERS= \
Parser/parser.h \
Parser/tokenizer.h
PGENOBJS= $(PGENMAIN) $(POBJS) $(PGOBJS)
PGENSRCS= $(PSRCS) $(PGSRCS)
PGENOBJS= $(POBJS) $(PGOBJS)
##########################################################################
# AST
......@@ -391,6 +419,7 @@ build_all_generate_profile:
$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
run_profile_task:
: # FIXME: can't run for a cross build
./$(BUILDPYTHON) $(PROFILE_TASK)
build_all_use_profile:
......@@ -409,7 +438,7 @@ $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY)
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
platform: $(BUILDPYTHON)
$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
# Build the shared modules
......@@ -422,7 +451,7 @@ sharedmods: $(BUILDPYTHON)
*) quiet="";; \
esac; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
./$(BUILDPYTHON) -E $(srcdir)/setup.py $$quiet build
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
# Build static library
# avoid long command lines, same as LIBRARY_OBJS
......@@ -551,12 +580,13 @@ Modules/python.o: $(srcdir)/Modules/python.c
$(MAINCC) -c $(PY_CFLAGS) -o $@ $(srcdir)/Modules/python.c
# Use a stamp file to prevent make -j invoking pgen twice
$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
@$(MKDIR_P) Include
$(MAKE) $(PGEN)
$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-touch Parser/pgen.stamp
$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
$(MAKE) $(GRAMMAR_H)
touch $(GRAMMAR_C)
$(PGEN): $(PGENOBJS)
$(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
......@@ -953,37 +983,43 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
./$(BUILDPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
mkdir $(srcdir)/Lib/$(PLATDIR)
cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen
export PATH; PATH="`pwd`:$$PATH"; \
export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \
export PYTHONPATH; PYTHONPATH="$(srcdir)/Lib:$(abs_builddir)/`cat pybuilddir.txt`"; \
export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \
export EXE; EXE="$(BUILDEXE)"; \
if [ -n "$(MULTIARCH)" ]; then export MULTIARCH; MULTIARCH=$(MULTIARCH); fi; \
export PYTHON_FOR_BUILD; \
if [ "$(build)" = "$(host)" ]; then \
PYTHON_FOR_BUILD="$(BUILDPYTHON)"; \
else \
PYTHON_FOR_BUILD="$(PYTHON_FOR_BUILD)"; \
fi; \
cd $(srcdir)/Lib/$(PLATDIR); $(RUNSHARED) ./regen
python-config: $(srcdir)/Misc/python-config.in
......@@ -1079,7 +1115,7 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
$(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
......@@ -1152,7 +1188,7 @@ frameworkinstallextras:
# This installs a few of the useful scripts in Tools/scripts
scriptsinstall:
SRCDIR=$(srcdir) $(RUNSHARED) \
./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
$(PYTHON_FOR_BUILD) $(srcdir)/Tools/scripts/setup.py install \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--root=$(DESTDIR)/
......@@ -1219,7 +1255,7 @@ profile-removal:
clobber: clean profile-removal
-rm -f $(BUILDPYTHON) $(PGEN) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
tags TAGS Parser/pgen.stamp \
tags TAGS \
config.cache config.log pyconfig.h Modules/config.c
-rm -rf build platform
-rm -rf $(PYTHONFRAMEWORKDIR)
......
......@@ -754,6 +754,9 @@ Tests
Build
-----
- Issue #17086: Backport the patches from the 3.3 branch to cross-build
the package.
- Issue #3754: fix typo in pthread AC_CACHE_VAL.
- Issue #17029: Let h2py search the multiarch system include directory.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,33 @@ AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/)
AC_CONFIG_SRCDIR([Include/object.h])
AC_CONFIG_HEADER(pyconfig.h)
AC_CANONICAL_HOST
AC_SUBST(build)
AC_SUBST(host)
if test "$cross_compiling" = yes; then
AC_MSG_CHECKING([for python interpreter for cross build])
if test -z "$PYTHON_FOR_BUILD"; then
for interp in python$PACKAGE_VERSION python2 python; do
which $interp >/dev/null 2>&1 || continue
if $interp -c 'import sys;sys.exit(not (sys.version_info@<:@:2@:>@ >= (2,7) and sys.version_info@<:@0@:>@ < 3))'; then
break
fi
interp=
done
if test x$interp = x; then
AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
fi
AC_MSG_RESULT($interp)
PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
fi
elif test "$cross_compiling" = maybe; then
AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
else
PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
fi
AC_SUBST(PYTHON_FOR_BUILD)
dnl Ensure that if prefix is specified, it does not end in a slash. If
dnl it does, we get path names containing '//' which is both ugly and
dnl can cause trouble.
......@@ -279,6 +306,25 @@ AC_SUBST(MACHDEP)
AC_MSG_CHECKING(MACHDEP)
if test -z "$MACHDEP"
then
# avoid using uname for cross builds
if test "$cross_compiling" = yes; then
# ac_sys_system and ac_sys_release are only used for setting
# `define_xopen_source' in the case statement below. For the
# current supported cross builds, this macro is not adjusted.
case "$host" in
*-*-linux*)
ac_sys_system=Linux
;;
*-*-cygwin*)
ac_sys_system=Cygwin
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
ac_sys_release=
else
ac_sys_system=`uname -s`
if test "$ac_sys_system" = "AIX" \
-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
......@@ -286,20 +332,44 @@ then
else
ac_sys_release=`uname -r`
fi
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
fi
ac_md_system=`echo $ac_sys_system |
tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
ac_md_release=`echo $ac_sys_release |
tr -d '[/ ]' | sed 's/^[[A-Z]]\.//' | sed 's/\..*//'`
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
case $MACHDEP in
linux*) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
atheos*) MACHDEP="atheos";;
irix646) MACHDEP="irix6";;
'') MACHDEP="unknown";;
esac
fi
AC_SUBST(_PYTHON_HOST_PLATFORM)
if test "$cross_compiling" = yes; then
case "$host" in
*-*-linux*)
case "$host_cpu" in
arm*)
_host_cpu=arm
;;
*)
_host_cpu=$host_cpu
esac
;;
*-*-cygwin*)
_host_cpu=
;;
*)
# for now, limit cross builds to known configurations
MACHDEP="unknown"
AC_MSG_ERROR([cross build not supported for $host])
esac
_PYTHON_HOST_PLATFORM="$MACHDEP${_host_cpu:+-$_host_cpu}"
fi
# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
......@@ -446,10 +516,6 @@ AC_SUBST(EXPORT_MACOSX_DEPLOYMENT_TARGET)
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=
EXPORT_MACOSX_DEPLOYMENT_TARGET='#'
AC_MSG_CHECKING(machine type as reported by uname -m)
ac_sys_machine=`uname -m`
AC_MSG_RESULT($ac_sys_machine)
# checks for alternative programs
# compiler flags are generated in two sets, BASECFLAGS and OPT. OPT is just
......@@ -578,8 +644,8 @@ preset_cxx="$CXX"
if test -z "$CXX"
then
case "$CC" in
gcc) AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
gcc) AC_PATH_TOOL(CXX, [g++], [g++], [notfound]) ;;
cc) AC_PATH_TOOL(CXX, [c++], [c++], [notfound]) ;;
esac
if test "$CXX" = "notfound"
then
......@@ -588,7 +654,7 @@ then
fi
if test -z "$CXX"
then
AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
if test "$CXX" = "notfound"
then
CXX=""
......@@ -764,22 +830,23 @@ AC_MSG_RESULT($enable_shared)
AC_MSG_CHECKING(for --enable-profiling)
AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]),
[ac_save_cc="$CC"
CC="$CC -pg"
AC_RUN_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
[ac_enable_profiling="yes"],
[ac_enable_profiling="no"],
[ac_enable_profiling="no"])
CC="$ac_save_cc"])
AC_MSG_RESULT($ac_enable_profiling)
case "$ac_enable_profiling" in
"yes")
BASECFLAGS="-pg $BASECFLAGS"
LDFLAGS="-pg $LDFLAGS"
;;
esac
AS_HELP_STRING([--enable-profiling], [enable C-level code profiling]))
if test "x$enable_profiling" = xyes; then
ac_save_cc="$CC"
CC="$(CC) -pg"
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
[],
[enable_profiling=no])
CC="$ac_save_cc"
else
enable_profiling=no
fi
AC_MSG_RESULT($enable_profiling)
if test "x$enable_profiling" = xyes; then
BASECFLAGS="-pg $BASECFLAGS"
LDFLAGS="-pg $LDFLAGS"
fi
AC_MSG_CHECKING(LDLIBRARY)
......@@ -868,11 +935,15 @@ else # shared is disabled
esac
fi
if test "$cross_compiling" = yes; then
RUNSHARED=
fi
AC_MSG_RESULT($LDLIBRARY)
AC_PROG_RANLIB
AC_SUBST(AR)
AC_CHECK_PROGS(AR, ar aal, ar)
AC_CHECK_TOOLS(AR, ar aal, ar)
# tweak ARFLAGS only if the user didn't set it on the command line
AC_SUBST(ARFLAGS)
......@@ -1046,7 +1117,7 @@ yes)
# if using gcc on alpha, use -mieee to get (near) full IEEE 754
# support. Without this, treatment of subnormals doesn't follow
# the standard.
case $ac_sys_machine in
case $host in
alpha*)
BASECFLAGS="$BASECFLAGS -mieee"
;;
......@@ -3216,7 +3287,12 @@ int main()
]]])],
[ac_cv_buggy_getaddrinfo=no],
[ac_cv_buggy_getaddrinfo=yes],
[ac_cv_buggy_getaddrinfo=yes]))
[
if test "${enable_ipv6+set}" = set; then
ac_cv_buggy_getaddrinfo="no -- configured with --(en|dis)able-ipv6"
else
ac_cv_buggy_getaddrinfo=yes
fi]))
fi
AC_MSG_RESULT($ac_cv_buggy_getaddrinfo)
......@@ -4246,26 +4322,31 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <curses.h>]], [[void *x=resizeterm
[AC_MSG_RESULT(no)]
)
AC_MSG_CHECKING(for /dev/ptmx)
AC_MSG_NOTICE([checking for device files])
if test -r /dev/ptmx
then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_DEV_PTMX, 1,
[Define if we have /dev/ptmx.])
else
AC_MSG_RESULT(no)
dnl NOTE: Inform user how to proceed with files when cross compiling.
if test "x$cross_compiling" = xyes; then
if test "${ac_cv_file__dev_ptmx+set}" != set; then
AC_MSG_CHECKING([for /dev/ptmx])
AC_MSG_RESULT([not set])
AC_MSG_ERROR([set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling])
fi
if test "${ac_cv_file__dev_ptc+set}" != set; then
AC_MSG_CHECKING([for /dev/ptc])
AC_MSG_RESULT([not set])
AC_MSG_ERROR([set ac_cv_file__dev_ptc to yes/no in your CONFIG_SITE file when cross compiling])
fi
fi
AC_MSG_CHECKING(for /dev/ptc)
if test -r /dev/ptc
then
AC_MSG_RESULT(yes)
AC_CHECK_FILE(/dev/ptmx, [], [])
if test "x$ac_cv_file__dev_ptmx" = xyes; then
AC_DEFINE(HAVE_DEV_PTMX, 1,
[Define to 1 if you have the /dev/ptmx device file.])
fi
AC_CHECK_FILE(/dev/ptc, [], [])
if test "x$ac_cv_file__dev_ptc" = xyes; then
AC_DEFINE(HAVE_DEV_PTC, 1,
[Define if we have /dev/ptc.])
else
AC_MSG_RESULT(no)
[Define to 1 if you have the /dev/ptc device file.])
fi
if test "$have_long_long" = yes
......@@ -4305,7 +4386,23 @@ then
]]])],
[ac_cv_have_long_long_format=yes],
[ac_cv_have_long_long_format=no],
[ac_cv_have_long_long_format=no])
[ac_cv_have_long_long_format="cross -- assuming no"
if test x$GCC = xyes; then
save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Werror -Wformat"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <stddef.h>
]], [[
char *buffer;
sprintf(buffer, "%lld", (long long)123);
sprintf(buffer, "%lld", (long long)-123);
sprintf(buffer, "%llu", (unsigned long long)123);
]])],
ac_cv_have_long_long_format=yes
)
CFLAGS=$save_CFLAGS
fi])
)
AC_MSG_RESULT($ac_cv_have_long_long_format)
fi
......
......@@ -161,10 +161,10 @@
/* Define to 1 if you have the device macros. */
#undef HAVE_DEVICE_MACROS
/* Define if we have /dev/ptc. */
/* Define to 1 if you have the /dev/ptc device file. */
#undef HAVE_DEV_PTC
/* Define if we have /dev/ptmx. */
/* Define to 1 if you have the /dev/ptmx device file. */
#undef HAVE_DEV_PTMX
/* Define to 1 if you have the <direct.h> header file. */
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment