Added autoconf test for off64_t and related calls.
This commit is contained in:
parent
43eabc727c
commit
0634cba224
4 changed files with 94 additions and 46 deletions
124
configure
vendored
124
configure
vendored
|
|
@ -614,6 +614,8 @@ PKG_CONFIG_LIBDIR
|
|||
PKG_CONFIG_PATH
|
||||
PKG_CONFIG
|
||||
SDL2_FRAMEWORK
|
||||
HAS_OFF64T_FALSE
|
||||
HAS_OFF64T_TRUE
|
||||
USE_ALSA_FALSE
|
||||
USE_ALSA_TRUE
|
||||
USE_NETWORKING_FALSE
|
||||
|
|
@ -1571,48 +1573,6 @@ fi
|
|||
|
||||
} # ac_fn_cxx_try_compile
|
||||
|
||||
# ac_fn_c_try_run LINENO
|
||||
# ----------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
|
||||
# that executables *can* be run.
|
||||
ac_fn_c_try_run ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
if { { ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo"; } >&5
|
||||
(eval "$ac_link") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
|
||||
{ { case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo"; } >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }; then :
|
||||
ac_retval=0
|
||||
else
|
||||
$as_echo "$as_me: program exited with status $ac_status" >&5
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_retval=$ac_status
|
||||
fi
|
||||
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_try_run
|
||||
|
||||
# ac_fn_c_try_link LINENO
|
||||
# -----------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded.
|
||||
|
|
@ -1658,6 +1618,48 @@ fi
|
|||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_try_link
|
||||
|
||||
# ac_fn_c_try_run LINENO
|
||||
# ----------------------
|
||||
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
|
||||
# that executables *can* be run.
|
||||
ac_fn_c_try_run ()
|
||||
{
|
||||
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
|
||||
if { { ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo"; } >&5
|
||||
(eval "$ac_link") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
|
||||
{ { case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo"; } >&5
|
||||
(eval "$ac_try") 2>&5
|
||||
ac_status=$?
|
||||
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
|
||||
test $ac_status = 0; }; }; then :
|
||||
ac_retval=0
|
||||
else
|
||||
$as_echo "$as_me: program exited with status $ac_status" >&5
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_retval=$ac_status
|
||||
fi
|
||||
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
|
||||
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
|
||||
as_fn_set_status $ac_retval
|
||||
|
||||
} # ac_fn_c_try_run
|
||||
cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
|
@ -4201,6 +4203,30 @@ else
|
|||
fi
|
||||
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for off64_t" >&5
|
||||
$as_echo_n "checking for off64_t... " >&6; }
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
off64_t n=0;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
has_lfs="yes"
|
||||
else
|
||||
has_lfs="no"
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $has_lfs" >&5
|
||||
$as_echo "$has_lfs" >&6; }
|
||||
|
||||
#AC_MSG_CHECKING([for libz])
|
||||
#AX_CHECK_ZLIB
|
||||
|
||||
|
|
@ -4229,6 +4255,15 @@ else
|
|||
fi
|
||||
|
||||
|
||||
if test "$has_lfs" = "yes"; then
|
||||
HAS_OFF64T_TRUE=
|
||||
HAS_OFF64T_FALSE='#'
|
||||
else
|
||||
HAS_OFF64T_TRUE='#'
|
||||
HAS_OFF64T_FALSE=
|
||||
fi
|
||||
|
||||
|
||||
SDL_VERSION=2.0.1
|
||||
|
||||
|
||||
|
|
@ -4351,7 +4386,6 @@ $as_echo "no" >&6; }
|
|||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --with-sdl-prefix was given.
|
||||
if test "${with_sdl_prefix+set}" = set; then :
|
||||
withval=$with_sdl_prefix; sdl_prefix="$withval"
|
||||
|
|
@ -5571,6 +5605,10 @@ if test -z "${USE_ALSA_TRUE}" && test -z "${USE_ALSA_FALSE}"; then
|
|||
as_fn_error $? "conditional \"USE_ALSA\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${HAS_OFF64T_TRUE}" && test -z "${HAS_OFF64T_FALSE}"; then
|
||||
as_fn_error $? "conditional \"HAS_OFF64T\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
fi
|
||||
if test -z "${OS_LINUX_TRUE}" && test -z "${OS_LINUX_FALSE}"; then
|
||||
as_fn_error $? "conditional \"OS_LINUX\" was never defined.
|
||||
Usually this means the macro was only invoked conditionally." "$LINENO" 5
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ esac
|
|||
AM_CONDITIONAL(CPU_I386, test "$CPU" = "i386")
|
||||
AM_CONDITIONAL(CPU_X86_64, test "$CPU" = "x86_64")
|
||||
|
||||
AC_MSG_CHECKING([for off64_t])
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],[[off64_t n=0;]])],[has_lfs="yes"],[has_lfs="no"])
|
||||
AC_MSG_RESULT($has_lfs)
|
||||
|
||||
#AC_MSG_CHECKING([for libz])
|
||||
#AX_CHECK_ZLIB
|
||||
|
||||
|
|
@ -67,6 +71,8 @@ AM_CONDITIONAL(USE_WX, test "$enable_wx" = "yes")
|
|||
AM_CONDITIONAL(USE_NETWORKING, test "$enable_networking" = "yes")
|
||||
AM_CONDITIONAL(USE_ALSA, test "$enable_alsa" = "yes")
|
||||
|
||||
AM_CONDITIONAL(HAS_OFF64T, test "$has_lfs" = "yes")
|
||||
|
||||
SDL_VERSION=2.0.1
|
||||
AM_PATH_SDL2($SDL_VERSION,
|
||||
:,
|
||||
|
|
|
|||
|
|
@ -77,4 +77,8 @@ endif
|
|||
|
||||
if OS_LINUX
|
||||
pcem_SOURCES += cdrom-ioctl-linux.c
|
||||
endif
|
||||
|
||||
if !HAS_OFF64T
|
||||
pcem_CFLAGS += -Doff64_t=off_t -Dfopen64=fopen -Dfseeko64=fseek -Dftello64=ftell
|
||||
endif
|
||||
|
|
@ -106,6 +106,7 @@ bin_PROGRAMS = pcem$(EXEEXT)
|
|||
@OS_MACOSX_TRUE@am__append_12 = -DPCEM_RENDER_WITH_TIMER -DPCEM_RENDER_TIMER_LOOP
|
||||
@OS_MACOSX_TRUE@am__append_13 = -DPCEM_RENDER_WITH_TIMER -DPCEM_RENDER_TIMER_LOOP
|
||||
@OS_LINUX_TRUE@am__append_14 = cdrom-ioctl-linux.c
|
||||
@HAS_OFF64T_FALSE@am__append_15 = -Doff64_t=off_t -Dfopen64=fopen -Dfseeko64=fseek -Dftello64=ftell
|
||||
subdir = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
|
|
@ -543,9 +544,8 @@ pcem_SOURCES = 386.c 386_dynarec.c 386_dynarec_ops.c 808x.c \
|
|||
$(am__append_3) $(am__append_4) $(am__append_6) \
|
||||
$(am__append_9) $(am__append_11) $(am__append_14)
|
||||
pcem_CFLAGS = $(shell wx-config --cxxflags) $(shell sdl2-config \
|
||||
--cflags) -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello \
|
||||
-Doff64_t=off_t $(am__append_5) $(am__append_7) \
|
||||
$(am__append_12)
|
||||
--cflags) $(am__append_5) $(am__append_7) $(am__append_12) \
|
||||
$(am__append_15)
|
||||
pcem_CXXFLAGS = $(shell wx-config --cxxflags) $(shell sdl2-config \
|
||||
--cflags) $(am__append_8) $(am__append_13)
|
||||
pcem_LDADD = @LIBS@ $(am__append_1) $(am__append_10)
|
||||
|
|
|
|||
Loading…
Reference in a new issue