[build] Add AC_SYS_LARGEFILE to check for large-file support

To use off64_t on 32-bit system
This commit is contained in:
Ming-Hung Tsai 2015-11-27 23:38:55 +08:00
parent e528fa1972
commit 3be4fe985f
2 changed files with 13 additions and 0 deletions

View File

@ -98,10 +98,12 @@ OBJECTS:=$(subst .cc,.o,$(SOURCE))
TOP_DIR:=@top_srcdir@ TOP_DIR:=@top_srcdir@
TOP_BUILDDIR:=@top_builddir@ TOP_BUILDDIR:=@top_builddir@
CFLAGS+=-g -Wall -O3 CFLAGS+=-g -Wall -O3
CFLAGS+=@LFS_FLAGS@
CXXFLAGS+=-g -Wall -fno-strict-aliasing CXXFLAGS+=-g -Wall -fno-strict-aliasing
CXXFLAGS+=@CXXOPTIMISE_FLAG@ CXXFLAGS+=@CXXOPTIMISE_FLAG@
CXXFLAGS+=@CXXDEBUG_FLAG@ CXXFLAGS+=@CXXDEBUG_FLAG@
CXXFLAGS+=@CXX_STRERROR_FLAG@ CXXFLAGS+=@CXX_STRERROR_FLAG@
CXXFLAGS+=@LFS_FLAGS@
INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning INCLUDES+=-I$(TOP_BUILDDIR) -I$(TOP_DIR) -I$(TOP_DIR)/thin-provisioning
LIBS:=-lstdc++ -laio -lexpat LIBS:=-lstdc++ -laio -lexpat
INSTALL:=@INSTALL@ INSTALL:=@INSTALL@

View File

@ -45,6 +45,16 @@ AC_DEFUN([AC_PROG_STRIP], [AC_CHECK_TOOL(STRIP, strip, :)])
AC_PROG_STRIP AC_PROG_STRIP
AC_ARG_VAR(STRIP, [Command for discarding symbols from object files]) AC_ARG_VAR(STRIP, [Command for discarding symbols from object files])
################################################################
dnl -- Check for large file support
AC_SYS_LARGEFILE
if test x$ac_cv_sys_file_offset_bits = x64; then
LFS_FLAGS+="-D_FILE_OFFSET_BITS=64"
fi
if test x$ac_cv_sys_large_files = x1; then
LFS_FLAGS+="-D_LARGE_FILES"
fi
################################################################ ################################################################
dnl -- Checks for functions. dnl -- Checks for functions.
AC_FUNC_STRERROR_R AC_FUNC_STRERROR_R
@ -147,6 +157,7 @@ VERSION_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
AC_SUBST(CXXDEBUG_FLAG) AC_SUBST(CXXDEBUG_FLAG)
AC_SUBST(CXXOPTIMISE_FLAG) AC_SUBST(CXXOPTIMISE_FLAG)
AC_SUBST(CXX_STRERROR_FLAG) AC_SUBST(CXX_STRERROR_FLAG)
AC_SUBST(LFS_FLAGS)
AC_SUBST(INSTALL) AC_SUBST(INSTALL)
AC_SUBST(prefix) AC_SUBST(prefix)
AC_SUBST(RELEASE_DATE) AC_SUBST(RELEASE_DATE)