unixsys: check for system() in configure

Don't let a non-available system() function (happens e.g. on iOS)
prevent us from compiling ECL.
This commit is contained in:
Marius Gerbershagen 2019-10-31 19:15:54 +01:00 committed by Daniel Kochmański
parent 8a0b9cf8b9
commit a2319d3150
6 changed files with 17 additions and 20 deletions

View file

@ -113,19 +113,7 @@
/* #undef HAVE_SYS_WAIT_H */
/* size of long long */
#define ECL_LONG_LONG_BITS 64
/*
* we do not manage to get proper signal handling of floating point
* arithmetics in the Alpha chips.
*/
#if defined(__alpha__)
# ifdef HAVE_FENV_H
# undef HAVE_FENV_H
# endif
# ifdef HAVE_FEENABLEEXCEPT
# undef HAVE_FEENABLEEXCEPT
# endif
#endif
#define HAVE_SYSTEM
/* what characters are used to mark beginning of new line */
#define ECL_NEWLINE_IS_CRLF 1

View file

@ -39,9 +39,14 @@
cl_object
si_system(cl_object cmd_string)
{
cl_object cmd = si_copy_to_simple_base_string(cmd_string);
int code = system((const char *)(cmd->base_string.self));
return ecl_make_fixnum(code);
#if !defined(HAVE_SYSTEM)
FElibc_error("si_system not implemented",1);
@(return ECL_NIL);
#else
cl_object cmd = si_copy_to_simple_base_string(cmd_string);
int code = system((const char *)(cmd->base_string.self));
@(return ecl_make_fixnum(code));
#endif
}
cl_object

4
src/configure vendored
View file

@ -9444,7 +9444,7 @@ done
for ac_func in nanosleep alarm times select setenv putenv \
lstat mkstemp sigprocmask isatty tzset \
gettimeofday getrusage
gettimeofday getrusage system
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -9469,7 +9469,7 @@ fi
for ac_func in expf powf logf sqrtf cosf sinf tanf sinhf coshf tanhf \
floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl \
floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl \
copysign
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`

View file

@ -737,14 +737,14 @@ dnl !!! end autoscan
AC_CHECK_FUNCS( [nanosleep alarm times select setenv putenv] \
[lstat mkstemp sigprocmask isatty tzset] \
[gettimeofday getrusage] )
[gettimeofday getrusage system] )
AC_CHECK_DECL([feenableexcept],
[AC_DEFINE(HAVE_FEENABLEEXCEPT,[],[feenableexcept is available])],
[AC_MSG_WARN(feenableexcept not declared: disabling floating point exceptions)],
[#include <fenv.h>])
AC_CHECK_FUNCS( [expf powf logf sqrtf cosf sinf tanf sinhf coshf tanhf] \
[floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl] \
[floorf ceilf fabsf frexpf ldexpf log1p log1pf log1pl] \
[copysign] )
AC_CHECK_FUNCS( [sched_yield uname fseeko dladdr backtrace backtrace_symbols] )

View file

@ -519,6 +519,9 @@
/* Define to 1 if you have the `strtol' function. */
#undef HAVE_STRTOL
/* Define to 1 if you have the `system' function. */
#undef HAVE_SYSTEM
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_DIR_H

View file

@ -149,6 +149,7 @@
#undef HAVE_BACKTRACE
#undef HAVE_BACKTRACE_SYMBOLS
#undef HAVE_SCHED_H
#undef HAVE_SYSTEM
/* what characters are used to mark beginning of new line */
#undef ECL_NEWLINE_IS_CRLF