summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <ast@2e8.dk>2017-04-25 16:05:49 +0000
committerEmil Renner Berthing <esmil@mailme.dk>2017-04-26 14:42:45 +0200
commitaf19290586a8d2b8eefa70b2614317c05df21a88 (patch)
tree80c1f8e27951bc6e391d58298200354cb979696b
parent20c1456915699ea457930e6241736112f3df20b5 (diff)
downloadlem-af19290586a8d2b8eefa70b2614317c05df21a88.tar.gz
lem-af19290586a8d2b8eefa70b2614317c05df21a88.tar.xz
lem-af19290586a8d2b8eefa70b2614317c05df21a88.zip
configure.ac: add option for using shared libev
Signed-off-by: Asbjørn Sloth Tønnesen <ast@2e8.dk>
-rwxr-xr-xconfigure1195
-rw-r--r--configure.ac114
2 files changed, 695 insertions, 614 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,10 +3763,589 @@ if test "$ac_res" != no; then :
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 <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> 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 <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+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 <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # 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
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+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 <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> 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 <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+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 <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # 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 :
+
+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; }
+fi
+
+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 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
+ 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
+ ac_cv_path_GREP=$GREP
+fi
+
+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 <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+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 <string.h>
+
+_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 <stdlib.h>
+
+_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 <ctype.h>
+#include <stdlib.h>
+#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
+
+fi
+
+done
+
+
# Configure libev
-objects="bin/libev.o $objects"
-headers="ev-config.h ev.h $headers"
-CPPFLAGS_ADD="$CPPFLAGS_ADD -Ilibev"
+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
+ 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
+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 :
+
+else
+ ac_cv_search_ev_run=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $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"
+
+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
+
+else
+ $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h
+
+fi
+
+else
+ $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h
+
+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
+
+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
+
+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
+fi
+fi
+fi
+fi
+fi
# Configure Lua
case "x$with_lua" in #(
@@ -3766,8 +4354,8 @@ case "x$with_lua" in #(
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"
@@ -3807,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
@@ -3825,8 +4413,8 @@ fi
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"
@@ -3866,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
@@ -3884,8 +4472,8 @@ fi
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"
@@ -3925,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
@@ -3943,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
@@ -3958,12 +4546,12 @@ else
fi
fi
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; }
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"
@@ -4003,7 +4591,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
@@ -4021,7 +4609,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
@@ -4043,12 +4631,12 @@ $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 "$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 lua53" >&5
+$as_echo_n "checking for lua53... " >&6; }
if test -n "$Lua_CFLAGS"; then
pkg_cv_Lua_CFLAGS="$Lua_CFLAGS"
@@ -4088,7 +4676,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
@@ -4106,8 +4694,8 @@ fi
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"
@@ -4147,7 +4735,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
@@ -4165,7 +4753,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
@@ -4180,12 +4768,12 @@ else
fi
fi
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; }
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 +4813,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 +4831,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
@@ -4274,8 +4862,8 @@ fi ;; #(
*) :
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 \"$with_lua\"" >&5
+$as_echo_n "checking for \"$with_lua\"... " >&6; }
if test -n "$Lua_CFLAGS"; then
pkg_cv_Lua_CFLAGS="$Lua_CFLAGS"
@@ -4315,7 +4903,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
@@ -4331,11 +4919,11 @@ 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
+ 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 "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
- as_fn_error $? "\"pkg-config package '$with_lua' not found\"" "$LINENO" 5
+ 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
@@ -4488,525 +5076,6 @@ 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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # 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
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-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 <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> 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 <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-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 <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # 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 :
-
-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; }
-fi
-
-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 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
- 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
- ac_cv_path_GREP=$GREP
-fi
-
-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 <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-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 <string.h>
-
-_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 <stdlib.h>
-
-_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 <ctype.h>
-#include <stdlib.h>
-#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
-
-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
-
-else
- $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h
-
-fi
-
-else
- $as_echo "#define EV_USE_EVENTFD 0" >>confdefs.h
-
-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
-
-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
-
-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
-
-fi
-fi
-fi
-fi
-
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
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