From af19290586a8d2b8eefa70b2614317c05df21a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Tue, 25 Apr 2017 16:05:49 +0000 Subject: configure.ac: add option for using shared libev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Asbjørn Sloth Tønnesen --- configure | 1937 ++++++++++++++++++++++++++++++---------------------------- configure.ac | 114 ++-- 2 files changed, 1066 insertions(+), 985 deletions(-) diff --git a/configure b/configure index 162ee6b..8772288 100755 --- a/configure +++ b/configure @@ -623,11 +623,11 @@ ac_includes_default="\ ac_subst_vars='LTLIBOBJS LIBOBJS +Lua_LIBS +Lua_CFLAGS EGREP GREP CPP -Lua_LIBS -Lua_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG @@ -703,6 +703,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +with_ev with_lua with_lmoddir with_cmoddir @@ -719,9 +720,9 @@ CPPFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR +CPP Lua_CFLAGS -Lua_LIBS -CPP' +Lua_LIBS' # Initialize some variables set by options. @@ -1335,6 +1336,7 @@ if test -n "$ac_init_help"; then Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-ev check or builtin [default=check] --with-lua check, builtin or pkg-config name [default=check] --with-lmoddir Lua module installation directory --with-cmoddir Lua C module installation directory @@ -1354,9 +1356,9 @@ Some influential environment variables: directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path + CPP C preprocessor Lua_CFLAGS C compiler flags for Lua, overriding pkg-config Lua_LIBS linker flags for Lua, overriding pkg-config - CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. @@ -2149,8 +2151,6 @@ 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 -ac_config_headers="$ac_config_headers libev/ev-config.h:ev-config.h.in" - headers='lem.h lem-parsers.h' @@ -2166,6 +2166,15 @@ if test "x$CFLAGS" = 'x'; then : fi +# Check whether --with-ev was given. +if test "${with_ev+set}" = set; then : + withval=$with_ev; +else + with_ev=check +fi + + + # Check whether --with-lua was given. if test "${with_lua+set}" = set; then : withval=$with_lua; @@ -3754,312 +3763,610 @@ if test "$ac_res" != no; then : fi -# Configure libev -objects="bin/libev.o $objects" -headers="ev-config.h ev.h $headers" -CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilibev" - -# Configure Lua -case "x$with_lua" in #( - xbuiltin) : - ;; #( - xcheck) : - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +# Checks for header files. +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 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -if test -n "$Lua_CFLAGS"; then - pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua5.3") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua5.3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else - pkg_failed=yes -fi - else - pkg_failed=untried + # Broken: fails on valid input. +continue fi -if test -n "$Lua_LIBS"; then - pkg_cv_Lua_LIBS="$Lua_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua5.3") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua5.3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - pkg_failed=yes -fi - else - pkg_failed=untried + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + done + ac_cv_prog_CPP=$CPP -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +fi + CPP=$ac_cv_prog_CPP else - _pkg_short_errors_supported=no + ac_cv_prog_CPP=$CPP fi - if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.3" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.3" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 - - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : -if test -n "$Lua_CFLAGS"; then - pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua53" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else - pkg_failed=yes -fi - else - pkg_failed=untried + # Broken: fails on valid input. +continue fi -if test -n "$Lua_LIBS"; then - pkg_cv_Lua_LIBS="$Lua_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua53" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue else - pkg_failed=yes -fi - else - pkg_failed=untried + # Passes both tests. +ac_preproc_ok=: +break fi +rm -f conftest.err conftest.i conftest.$ac_ext +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi - if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua53" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua53" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 +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 -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } -if test -n "$Lua_CFLAGS"; then - pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$Lua_LIBS"; then - pkg_cv_Lua_LIBS="$Lua_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi else - pkg_failed=yes + ac_cv_path_GREP=$GREP fi - else - pkg_failed=untried + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $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 : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi +done +for ac_header in sys/eventfd.h sys/epoll.h sys/event.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +fi -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes +done + + +# Configure libev +case "x$with_ev" in #( + xbuiltin) : + ;; #( + xcheck) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ev_run" >&5 +$as_echo_n "checking for library containing ev_run... " >&6; } +if ${ac_cv_search_ev_run+:} false; then : + $as_echo_n "(cached) " >&6 else - _pkg_short_errors_supported=no + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ev_run (); +int +main () +{ +return ev_run (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ev; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_ev_run=$ac_res fi - if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_ev_run+:} false; then : + break +fi +done +if ${ac_cv_search_ev_run+:} false; then : - with_lua=builtin -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_lua=builtin -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : - with_lua=lua else - with_lua=builtin + ac_cv_search_ev_run=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ev_run" >&5 +$as_echo "$ac_cv_search_ev_run" >&6; } +ac_res=$ac_cv_search_ev_run +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +else + with_ev=builtin +fi + ;; #( + *) : + as_fn_error $? "--with-ev must be check or builtin, not '$with_ev'" "$LINENO" 5 ;; +esac + +if test "x$with_ev" = 'xbuiltin'; then : + ac_config_headers="$ac_config_headers libev/ev-config.h:ev-config.h.in" + + objects="bin/libev.o $objects" + headers="ev-config.h ev.h $headers" + CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilibev" + + if test "x$ac_cv_header_sys_eventfd_h" = 'xyes'; then : + ac_fn_c_check_func "$LINENO" "eventfd" "ac_cv_func_eventfd" +if test "x$ac_cv_func_eventfd" = xyes; then : + $as_echo "#define EV_USE_EVENTFD 1" >>confdefs.h -if test -n "$Lua_CFLAGS"; then - pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else - pkg_failed=yes + $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h + fi - else - pkg_failed=untried + +else + $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h + fi -if test -n "$Lua_LIBS"; then - pkg_cv_Lua_LIBS="$Lua_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes + + ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" +if test "x$ac_cv_func_nanosleep" = xyes; then : + $as_echo "#define EV_USE_NANOSLEEP 1" >>confdefs.h + else - pkg_failed=yes + $as_echo "#define EV_USE_NANOSLEEP 0" >>confdefs.h + fi - else - pkg_failed=untried + + + for ac_func in poll select epoll_ctl kqueue +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" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi +done + if test "x$ac_cv_func_epoll_ctl" = 'xyes'; then : + $as_echo "#define EV_USE_SELECT 0" >>confdefs.h -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + $as_echo "#define EV_USE_POLL 0" >>confdefs.h + + $as_echo "#define EV_USE_EPOLL 1" >>confdefs.h + + $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 + if test "x$ac_cv_func_kqueue" = 'xyes'; then : + $as_echo "#define EV_USE_SELECT 0" >>confdefs.h + + $as_echo "#define EV_USE_POLL 0" >>confdefs.h + + $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h + + $as_echo "#define EV_USE_KQUEUE 1" >>confdefs.h - with_lua=builtin -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_lua=builtin else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : - with_lua=lua + if test "x$ac_cv_func_select" = 'xyes'; then : + $as_echo "#define EV_USE_SELECT 1" >>confdefs.h + + $as_echo "#define EV_USE_POLL 0" >>confdefs.h + + $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h + + $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h + else - with_lua=builtin + if test "x$ac_cv_func_poll" = 'xyes'; then : + $as_echo "#define EV_USE_SELECT 0" >>confdefs.h + + $as_echo "#define EV_USE_POLL 1" >>confdefs.h + + $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h + + $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h + +else + as_fn_error $? "neither poll or select found" "$LINENO" 5 fi fi -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_lua=lua53 fi -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +fi +fi + +# Configure Lua +case "x$with_lua" in #( + xbuiltin) : + ;; #( + xcheck) : pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua5.3" >&5 +$as_echo_n "checking for lua5.3... " >&6; } if test -n "$Lua_CFLAGS"; then pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua5.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua53" 2>/dev/null` + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua5.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -4071,12 +4378,12 @@ if test -n "$Lua_LIBS"; then pkg_cv_Lua_LIBS="$Lua_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua5.3") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua53" 2>/dev/null` + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua5.3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -4088,7 +4395,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -4097,28 +4404,28 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua53" 2>&1` + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.3" 2>&1` else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua53" 2>&1` + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.3" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$Lua_PKG_ERRORS" >&5 pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua53" >&5 +$as_echo_n "checking for lua53... " >&6; } if test -n "$Lua_CFLAGS"; then pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua53" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -4130,12 +4437,12 @@ if test -n "$Lua_LIBS"; then pkg_cv_Lua_LIBS="$Lua_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 - ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua53" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -4147,7 +4454,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -4156,36 +4463,17 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 - - with_lua=builtin -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - with_lua=builtin -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : - with_lua=lua -else - with_lua=builtin -fi -fi -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua53" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua53" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 + pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua" >&5 +$as_echo_n "checking for lua... " >&6; } if test -n "$Lua_CFLAGS"; then pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" @@ -4225,7 +4513,7 @@ fi if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then @@ -4243,7 +4531,7 @@ fi with_lua=builtin elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } with_lua=builtin else @@ -4257,36 +4545,24 @@ else with_lua=builtin fi fi -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_lua=lua53 -fi -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - with_lua=lua5.3 -fi ;; #( - *) : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Lua" >&5 -$as_echo_n "checking for Lua... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua" >&5 +$as_echo_n "checking for lua... " >&6; } if test -n "$Lua_CFLAGS"; then pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$with_lua\"\""; } >&5 - ($PKG_CONFIG --exists --print-errors ""$with_lua"") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags ""$with_lua"" 2>/dev/null` + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -4298,713 +4574,506 @@ if test -n "$Lua_LIBS"; then pkg_cv_Lua_LIBS="$Lua_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$with_lua\"\""; } >&5 - ($PKG_CONFIG --exists --print-errors ""$with_lua"") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs ""$with_lua"" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""$with_lua"" 2>&1` - else - Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""$with_lua"" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$Lua_PKG_ERRORS" >&5 - - as_fn_error $? "\"pkg-config package '$with_lua' not found\"" "$LINENO" 5 -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "\"pkg-config package '$with_lua' not found\"" "$LINENO" 5 -else - Lua_CFLAGS=$pkg_cv_Lua_CFLAGS - Lua_LIBS=$pkg_cv_Lua_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi ;; -esac - -if test "x$with_lua" = 'xbuiltin'; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sin" >&5 -$as_echo_n "checking for library containing sin... " >&6; } -if ${ac_cv_search_sin+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char sin (); -int -main () -{ -return sin (); - ; - return 0; -} -_ACEOF -for ac_lib in '' m; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_sin=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_sin+:} false; then : - break -fi -done -if ${ac_cv_search_sin+:} false; then : - -else - ac_cv_search_sin=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sin" >&5 -$as_echo "$ac_cv_search_sin" >&6; } -ac_res=$ac_cv_search_sin -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_dlopen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_dlopen+:} false; then : - break -fi -done -if ${ac_cv_search_dlopen+:} false; then : - -else - ac_cv_search_dlopen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 -$as_echo "$ac_cv_search_dlopen" >&6; } -ac_res=$ac_cv_search_dlopen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - objects="bin/lua.o $objects" - headers="luaconf.h lua.h lauxlib.h $headers" - CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilua" - Lua_CFLAGS='' - Lua_LIBS='' - ac_cv_func_luaL_traceback=yes - if test "x$lmoddir" = 'x'; then : - lmoddir="\${datarootdir}/lua/$builtin_lua_version" -fi - if test "x$cmoddir" = 'x'; then : - cmoddir="\${libdir}/lua/$builtin_lua_version" -fi -fi - -CPPFLAGS_ADD="$CPPFLAGS_ADD $Lua_CFLAGS" -LIBS="$Lua_LIBS $LIBS" -if test "x$lmoddir" = 'x'; then : - lmoddir="`$PKG_CONFIG --variable=INSTALL_LMOD $with_lua`" -fi -if test "x$cmoddir" = 'x'; then : - cmoddir="`$PKG_CONFIG --variable=INSTALL_CMOD $with_lua`" -fi - -if test "x$lmoddir" = 'x'; then : - as_fn_error $? "unable to deduce Lua module directory, please use --with-lmoddir=path" "$LINENO" 5 -fi -if test "x$cmoddir" = 'x'; then : - as_fn_error $? "unable to deduce Lua C module directory, please use --with-cmoddir=path" "$LINENO" 5 -fi - -# Checks for header files. -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 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - # Broken: fails on valid input. -continue + pkg_failed=yes +fi + else + pkg_failed=untried fi -rm -f conftest.err conftest.i conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - # Passes both tests. -ac_preproc_ok=: -break + _pkg_short_errors_supported=no fi -rm -f conftest.err conftest.i conftest.$ac_ext + if test $_pkg_short_errors_supported = yes; then + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break + with_lua=builtin +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_lua=builtin +else + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : + with_lua=lua +else + with_lua=builtin fi - - done - ac_cv_prog_CPP=$CPP - fi - CPP=$ac_cv_prog_CPP else - ac_cv_prog_CPP=$CPP + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_lua=lua53 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua53" >&5 +$as_echo_n "checking for lua53... " >&6; } +if test -n "$Lua_CFLAGS"; then + pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua53" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - # Broken: fails on valid input. -continue + pkg_failed=yes fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue + else + pkg_failed=untried +fi +if test -n "$Lua_LIBS"; then + pkg_cv_Lua_LIBS="$Lua_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua53") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua53" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - # Passes both tests. -ac_preproc_ok=: -break + pkg_failed=yes +fi + else + pkg_failed=untried fi -rm -f conftest.err conftest.i conftest.$ac_ext -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua53" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua53" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 -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 +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua" >&5 +$as_echo_n "checking for lua... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$Lua_CFLAGS"; then + pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$Lua_LIBS"; then + pkg_cv_Lua_LIBS="$Lua_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - ac_cv_path_GREP=$GREP + _pkg_short_errors_supported=no fi + if test $_pkg_short_errors_supported = yes; then + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 + with_lua=builtin +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_lua=builtin +else + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : + with_lua=lua +else + with_lua=builtin fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" +fi +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua" >&5 +$as_echo_n "checking for lua... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 +if test -n "$Lua_CFLAGS"; then + pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$Lua_LIBS"; then + pkg_cv_Lua_LIBS="$Lua_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 + ($PKG_CONFIG --exists --print-errors "lua") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_cv_path_EGREP=$EGREP + pkg_failed=yes fi - - fi + else + pkg_failed=untried fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" -{ $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 : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -int -main () -{ +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes else - ac_cv_header_stdc=no + _pkg_short_errors_supported=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $_pkg_short_errors_supported = yes; then + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + with_lua=builtin +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + with_lua=builtin +else + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + if test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'; then : + with_lua=lua +else + with_lua=builtin +fi +fi +else + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_lua=lua53 +fi +else + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + with_lua=lua5.3 +fi ;; #( + *) : -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"$with_lua\"" >&5 +$as_echo_n "checking for \"$with_lua\"... " >&6; } +if test -n "$Lua_CFLAGS"; then + pkg_cv_Lua_CFLAGS="$Lua_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$with_lua\"\""; } >&5 + ($PKG_CONFIG --exists --print-errors ""$with_lua"") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_CFLAGS=`$PKG_CONFIG --cflags ""$with_lua"" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - ac_cv_header_stdc=no + pkg_failed=yes fi -rm -f conftest* - + else + pkg_failed=untried +fi +if test -n "$Lua_LIBS"; then + pkg_cv_Lua_LIBS="$Lua_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"\$with_lua\"\""; } >&5 + ($PKG_CONFIG --exists --print-errors ""$with_lua"") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_Lua_LIBS=`$PKG_CONFIG --libs ""$with_lua"" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried fi -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + Lua_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs ""$with_lua"" 2>&1` + else + Lua_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs ""$with_lua"" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$Lua_PKG_ERRORS" >&5 + + as_fn_error $? "pkg-config package '$with_lua' not found" "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "pkg-config package '$with_lua' not found" "$LINENO" 5 else - ac_cv_header_stdc=no -fi -rm -f conftest* + Lua_CFLAGS=$pkg_cv_Lua_CFLAGS + Lua_LIBS=$pkg_cv_Lua_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } -fi +fi ;; +esac -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : +if test "x$with_lua" = 'xbuiltin'; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sin" >&5 +$as_echo_n "checking for library containing sin... " >&6; } +if ${ac_cv_search_sin+:} false; then : + $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sin (); int main () { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; +return sin (); + ; return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no +for ac_lib in '' m; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sin=$ac_res fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sin+:} false; then : + break fi +done +if ${ac_cv_search_sin+:} false; then : +else + ac_cv_search_sin=no fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sin" >&5 +$as_echo "$ac_cv_search_sin" >&6; } +ac_res=$ac_cv_search_sin +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi -done - + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 +$as_echo_n "checking for library containing dlopen... " >&6; } +if ${ac_cv_search_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -for ac_header in stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} _ACEOF - +for ac_lib in '' dl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_dlopen=$ac_res fi - -done - -for ac_header in sys/eventfd.h sys/epoll.h sys/event.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_dlopen+:} false; then : + break fi - done - - -if test "x$ac_cv_header_sys_eventfd_h" = 'xyes'; then : - ac_fn_c_check_func "$LINENO" "eventfd" "ac_cv_func_eventfd" -if test "x$ac_cv_func_eventfd" = xyes; then : - $as_echo "#define EV_USE_EVENTFD 1" >>confdefs.h +if ${ac_cv_search_dlopen+:} false; then : else - $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h - + ac_cv_search_dlopen=no fi - -else - $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi - -ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" -if test "x$ac_cv_func_nanosleep" = xyes; then : - $as_echo "#define EV_USE_NANOSLEEP 1" >>confdefs.h - -else - $as_echo "#define EV_USE_NANOSLEEP 0" >>confdefs.h +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5 +$as_echo "$ac_cv_search_dlopen" >&6; } +ac_res=$ac_cv_search_dlopen +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi - -for ac_func in poll select epoll_ctl kqueue -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" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - + objects="bin/lua.o $objects" + headers="luaconf.h lua.h lauxlib.h $headers" + CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilua" + Lua_CFLAGS='' + Lua_LIBS='' + ac_cv_func_luaL_traceback=yes + if test "x$lmoddir" = 'x'; then : + lmoddir="\${datarootdir}/lua/$builtin_lua_version" +fi + if test "x$cmoddir" = 'x'; then : + cmoddir="\${libdir}/lua/$builtin_lua_version" +fi fi -done - - -if test "x$ac_cv_func_epoll_ctl" = 'xyes'; then : - - $as_echo "#define EV_USE_SELECT 0" >>confdefs.h - - $as_echo "#define EV_USE_POLL 0" >>confdefs.h - - $as_echo "#define EV_USE_EPOLL 1" >>confdefs.h - - $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h - - -else - if test "x$ac_cv_func_kqueue" = 'xyes'; then : - - $as_echo "#define EV_USE_SELECT 0" >>confdefs.h - - $as_echo "#define EV_USE_POLL 0" >>confdefs.h - - $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h - - $as_echo "#define EV_USE_KQUEUE 1" >>confdefs.h - - -else - if test "x$ac_cv_func_select" = 'xyes'; then : - - $as_echo "#define EV_USE_SELECT 1" >>confdefs.h - - $as_echo "#define EV_USE_POLL 0" >>confdefs.h - - $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h - - $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h - - -else - if test "x$ac_cv_func_poll" = 'xyes'; then : - - $as_echo "#define EV_USE_SELECT 0" >>confdefs.h - - $as_echo "#define EV_USE_POLL 1" >>confdefs.h - - $as_echo "#define EV_USE_EPOLL 0" >>confdefs.h - - $as_echo "#define EV_USE_KQUEUE 0" >>confdefs.h - - -else - - as_fn_error $? "neither poll or select found" "$LINENO" 5 +CPPFLAGS_ADD="$CPPFLAGS_ADD $Lua_CFLAGS" +LIBS="$Lua_LIBS $LIBS" +if test "x$lmoddir" = 'x'; then : + lmoddir="`$PKG_CONFIG --variable=INSTALL_LMOD $with_lua`" fi +if test "x$cmoddir" = 'x'; then : + cmoddir="`$PKG_CONFIG --variable=INSTALL_CMOD $with_lua`" fi + +if test "x$lmoddir" = 'x'; then : + as_fn_error $? "unable to deduce Lua module directory, please use --with-lmoddir=path" "$LINENO" 5 fi +if test "x$cmoddir" = 'x'; then : + as_fn_error $? "unable to deduce Lua C module directory, please use --with-cmoddir=path" "$LINENO" 5 fi ac_config_files="$ac_config_files Makefile" diff --git a/configure.ac b/configure.ac index 29aeadd..690def8 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,6 @@ AC_INIT([[lem]], [[0.3]], [[esmil@mailme.dk]]) builtin_lua_version='5.3' AC_LANG(C) -AC_CONFIG_HEADERS([libev/ev-config.h:ev-config.h.in]) AC_SUBST([headers], ['lem.h lem-parsers.h']) AC_SUBST([objects], ['bin/lem.o']) @@ -12,6 +11,12 @@ AC_SUBST([SHARED], ['-shared']) AS_IF([test "x$CFLAGS" = 'x'], CFLAGS='-O2 -g -Wall -Wextra') +AC_ARG_WITH([ev], + [AS_HELP_STRING([--with-ev], + [check or builtin @<:@default=check@:>@])], + [], + [with_ev=check]) + AC_ARG_WITH([lua], [AS_HELP_STRING([--with-lua], [check, builtin or pkg-config name @<:@default=check@:>@])], @@ -50,10 +55,57 @@ AS_CASE(["x$target_os"], # Check for pthread library AC_SEARCH_LIBS([pthread_create], [pthread]) +# Checks for header files. +AC_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h]) +AC_CHECK_HEADERS([sys/eventfd.h sys/epoll.h sys/event.h]) + # Configure libev -objects="bin/libev.o $objects" -headers="ev-config.h ev.h $headers" -CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilibev" +AS_CASE(["x$with_ev"], + [xbuiltin], + [], + [xcheck], + [AC_SEARCH_LIBS([ev_run], [ev], [], [with_ev=builtin])], + [AC_MSG_ERROR([--with-ev must be check or builtin, not '$with_ev'])]) + +AS_IF([test "x$with_ev" = 'xbuiltin'], + [AC_CONFIG_HEADERS([libev/ev-config.h:ev-config.h.in])] + [objects="bin/libev.o $objects"] + [headers="ev-config.h ev.h $headers"] + [CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilibev"] + + [AS_IF([test "x$ac_cv_header_sys_eventfd_h" = 'xyes'], + [AC_CHECK_FUNC([eventfd], + [AC_DEFINE([EV_USE_EVENTFD], 1)], + [AC_DEFINE([EV_USE_EVENTFD], 0)])], + [AC_DEFINE([EV_USE_EVENTFD], 0)])] + + [AC_CHECK_FUNC([nanosleep], + [AC_DEFINE([EV_USE_NANOSLEEP], 1)], + [AC_DEFINE([EV_USE_NANOSLEEP], 0)])] + + [AC_CHECK_FUNCS([poll select epoll_ctl kqueue])] + + [AS_IF([test "x$ac_cv_func_epoll_ctl" = 'xyes'], + [AC_DEFINE([EV_USE_SELECT], 0)] + [AC_DEFINE([EV_USE_POLL], 0)] + [AC_DEFINE([EV_USE_EPOLL], 1)] + [AC_DEFINE([EV_USE_KQUEUE], 0)], + [AS_IF([test "x$ac_cv_func_kqueue" = 'xyes'], + [AC_DEFINE([EV_USE_SELECT], 0)] + [AC_DEFINE([EV_USE_POLL], 0)] + [AC_DEFINE([EV_USE_EPOLL], 0)] + [AC_DEFINE([EV_USE_KQUEUE], 1)], + [AS_IF([test "x$ac_cv_func_select" = 'xyes'], + [AC_DEFINE([EV_USE_SELECT], 1)] + [AC_DEFINE([EV_USE_POLL], 0)] + [AC_DEFINE([EV_USE_EPOLL], 0)] + [AC_DEFINE([EV_USE_KQUEUE], 0)], + [AS_IF([test "x$ac_cv_func_poll" = 'xyes'], + [AC_DEFINE([EV_USE_SELECT], 0)] + [AC_DEFINE([EV_USE_POLL], 1)] + [AC_DEFINE([EV_USE_EPOLL], 0)] + [AC_DEFINE([EV_USE_KQUEUE], 0)], + [AC_MSG_ERROR([neither poll or select found])])])])])]) # Configure Lua AS_CASE(["x$with_lua"], @@ -61,14 +113,14 @@ AS_CASE(["x$with_lua"], [], [xcheck], [PKG_CHECK_MODULES([Lua], [lua5.3], [with_lua=lua5.3], - [PKG_CHECK_MODULES([Lua], [lua53], [with_lua=lua53], - [PKG_CHECK_MODULES([Lua], [lua], - [AS_IF([test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'], - [with_lua=lua], - [with_lua=builtin])], - [with_lua=builtin])])])], + [PKG_CHECK_MODULES([Lua], [lua53], [with_lua=lua53], + [PKG_CHECK_MODULES([Lua], [lua], + [AS_IF([test "x$($PKG_CONFIG --variable=V lua)" = 'x5.3'], + [with_lua=lua], + [with_lua=builtin])], + [with_lua=builtin])])])], [PKG_CHECK_MODULES([Lua], ["$with_lua"], [], - [AC_MSG_ERROR(["pkg-config package '$with_lua' not found"])])]) + [AC_MSG_ERROR([pkg-config package '$with_lua' not found])])]) AS_IF([test "x$with_lua" = 'xbuiltin'], [AC_SEARCH_LIBS([sin], [m])] @@ -92,45 +144,5 @@ AS_IF([test "x$lmoddir" = 'x'], AS_IF([test "x$cmoddir" = 'x'], [AC_MSG_ERROR([unable to deduce Lua C module directory, please use --with-cmoddir=path])]) -# Checks for header files. -AC_CHECK_HEADERS([stddef.h stdlib.h string.h unistd.h sys/time.h time.h pthread.h]) -AC_CHECK_HEADERS([sys/eventfd.h sys/epoll.h sys/event.h]) - -AS_IF([test "x$ac_cv_header_sys_eventfd_h" = 'xyes'], - [AC_CHECK_FUNC([eventfd], - [AC_DEFINE([EV_USE_EVENTFD], 1)], - [AC_DEFINE([EV_USE_EVENTFD], 0)])], - [AC_DEFINE([EV_USE_EVENTFD], 0)]) - -AC_CHECK_FUNC([nanosleep], - [AC_DEFINE([EV_USE_NANOSLEEP], 1)], - [AC_DEFINE([EV_USE_NANOSLEEP], 0)]) - -AC_CHECK_FUNCS([poll select epoll_ctl kqueue]) - -AS_IF([test "x$ac_cv_func_epoll_ctl" = 'xyes'], [ - AC_DEFINE([EV_USE_SELECT], 0) - AC_DEFINE([EV_USE_POLL], 0) - AC_DEFINE([EV_USE_EPOLL], 1) - AC_DEFINE([EV_USE_KQUEUE], 0) -], [AS_IF([test "x$ac_cv_func_kqueue" = 'xyes'], [ - AC_DEFINE([EV_USE_SELECT], 0) - AC_DEFINE([EV_USE_POLL], 0) - AC_DEFINE([EV_USE_EPOLL], 0) - AC_DEFINE([EV_USE_KQUEUE], 1) -], [AS_IF([test "x$ac_cv_func_select" = 'xyes'], [ - AC_DEFINE([EV_USE_SELECT], 1) - AC_DEFINE([EV_USE_POLL], 0) - AC_DEFINE([EV_USE_EPOLL], 0) - AC_DEFINE([EV_USE_KQUEUE], 0) -], [AS_IF([test "x$ac_cv_func_poll" = 'xyes'], [ - AC_DEFINE([EV_USE_SELECT], 0) - AC_DEFINE([EV_USE_POLL], 1) - AC_DEFINE([EV_USE_EPOLL], 0) - AC_DEFINE([EV_USE_KQUEUE], 0) -], [ - AC_MSG_ERROR([neither poll or select found]) -])])])]) - AC_CONFIG_FILES([Makefile]) AC_OUTPUT -- cgit v1.2.1