aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-09-10 15:25:45 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:52 +1000
commit9a438e624ea8771f790eb0e45bb65f7091681daf (patch)
treec6a2bd416a63aebdbb058010c68157bd096b4430
parent7226f89f4865c2c8db2f51a28b0a98379092936a (diff)
downloadjimtcl-9a438e624ea8771f790eb0e45bb65f7091681daf.zip
jimtcl-9a438e624ea8771f790eb0e45bb65f7091681daf.tar.gz
jimtcl-9a438e624ea8771f790eb0e45bb65f7091681daf.tar.bz2
autoconf improvements
Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--autoconf.h.in18
-rwxr-xr-xconfigure77
-rwxr-xr-xconfigure.ac7
-rw-r--r--jim-posix.c2
-rw-r--r--jim.h8
5 files changed, 88 insertions, 24 deletions
diff --git a/autoconf.h.in b/autoconf.h.in
index b07dcdd..25edf2b 100644
--- a/autoconf.h.in
+++ b/autoconf.h.in
@@ -3,6 +3,9 @@
/* Define to 1 if you have the `backtrace' function. */
#undef HAVE_BACKTRACE
+/* Have the dlopen function */
+#undef HAVE_DLOPEN
+
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
@@ -27,6 +30,12 @@
/* Define to 1 if you have the `realpath' function. */
#undef HAVE_REALPATH
+/* Define to 1 if you have the `regcomp' function. */
+#undef HAVE_REGCOMP
+
+/* Define to 1 if you have the `sigaction' function. */
+#undef HAVE_SIGACTION
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -45,6 +54,12 @@
/* Define to 1 if you have the `sysinfo' function. */
#undef HAVE_SYSINFO
+/* Define to 1 if you have the `sys_siglist' function. */
+#undef HAVE_SYS_SIGLIST
+
+/* Define to 1 if you have the `sys_signame' function. */
+#undef HAVE_SYS_SIGNAME
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
@@ -60,6 +75,9 @@
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
+/* Define to 1 if you have the `waitpid' function. */
+#undef HAVE_WAITPID
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
diff --git a/configure b/configure
index 768b9ce..e2e1153 100755
--- a/configure
+++ b/configure
@@ -613,7 +613,6 @@ build
EGREP
GREP
CPP
-HAVE_LONG_LONG
SET_MAKE
OBJEXT
EXEEXT
@@ -665,6 +664,7 @@ ac_user_opts='
enable_option_checking
enable_fork
enable_math
+enable_ipv6
with_jim_ext
with_jim_shared
'
@@ -1293,6 +1293,7 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-fork do not use fork (no exec, etc.)
--enable-math include support for math functions
+ --enable-ipv6 include ipv6 support in the aio extension
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3289,7 +3290,6 @@ cat >>confdefs.h <<_ACEOF
#define HAVE_LONG_LONG 1
_ACEOF
-HAVE_LONG_LONG="#define HAVE_LONG_LONG"
fi
@@ -3423,6 +3423,16 @@ if test "${enable_math+set}" = set; then :
fi
+# Check whether --enable-ipv6 was given.
+if test "${enable_ipv6+set}" = set; then :
+ enableval=$enable_ipv6;
+ if test "x$enableval" = "xyes" ; then
+ EXTRA_CFLAGS="$EXTRA_CFLAGS -DJIM_IPV6"
+ fi
+
+
+fi
+
jim_extensions="stdlib load package readdir glob array clock exec file posix regexp signal tclcompat aio bio eventloop syslog"
@@ -3487,19 +3497,31 @@ _ACEOF
fi
done
+for ac_func in regcomp waitpid sigaction sys_signame sys_siglist
+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"
+eval as_val=\$$as_ac_var
+ if test "x$as_val" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
EXTRA_CFLAGS=$EXTRA_CFLAGS
SRCDIR=`dirname $0`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
+$as_echo_n "checking for library containing dlopen... " >&6; }
+if test "${ac_cv_search_dlopen+set}" = set; then :
$as_echo_n "(cached) " >&6
else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
+ ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -3518,19 +3540,40 @@ return dlopen ();
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
+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 conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+ conftest$ac_exeext
+ if test "${ac_cv_search_dlopen+set}" = set; then :
+ break
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then :
- LIBDL=-ldl
+done
+if test "${ac_cv_search_dlopen+set}" = set; 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"
+ LIBDL=${ac_cv_search_dlopen%none required}
+
+
+$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
+
fi
diff --git a/configure.ac b/configure.ac
index 84f726c..ff7738a 100755
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ AC_PROG_CC
AC_PROG_MAKE_SET
# Checks for types
-AC_CHECK_TYPES(long long,AC_SUBST(HAVE_LONG_LONG,["#define HAVE_LONG_LONG"]))
+AC_CHECK_TYPES(long long)
# Shared library support. Because we don't believe in automake!
AC_CANONICAL_HOST
@@ -84,7 +84,10 @@ AC_CHECK_FUNCS([regcomp waitpid sigaction sys_signame sys_siglist])
AC_SUBST(EXTRA_CFLAGS,$EXTRA_CFLAGS)
AC_SUBST(SRCDIR,`dirname $0`)
-AC_CHECK_LIB(dl, dlopen,AC_SUBST(LIBDL,-ldl))
+AC_SEARCH_LIBS(dlopen, dl,
+ AC_SUBST(LIBDL,${ac_cv_search_dlopen%none required})
+ AC_DEFINE([HAVE_DLOPEN],[1],[Have the dlopen function])
+)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff --git a/jim-posix.c b/jim-posix.c
index 1013121..7fedf66 100644
--- a/jim-posix.c
+++ b/jim-posix.c
@@ -37,7 +37,7 @@ static void Jim_PosixSetError(Jim_Interp *interp)
Jim_SetResultString(interp, strerror(errno), -1);
}
-#ifdef HAVE_FORK
+#if defined(HAVE_FORK) && !defined(HAVE_NO_FORK)
static int Jim_PosixForkCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
pid_t pid;
diff --git a/jim.h b/jim.h
index 1c0c7a1..7db83d1 100644
--- a/jim.h
+++ b/jim.h
@@ -89,14 +89,14 @@ extern "C" {
#define JIM_ANSIC
#endif
-#if !defined(JIM_ANSIC) && !defined(NOMMU)
-#define JIM_DYNLIB /* Dynamic library support */
-#endif
-
#ifndef HAVE_NO_AUTOCONF
#include <autoconf.h>
#endif
+#if defined(HAVE_DLOPEN)
+#define JIM_DYNLIB /* Dynamic library support */
+#endif
+
/* -----------------------------------------------------------------------------
* Compiler specific fixes.
* ---------------------------------------------------------------------------*/