aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2010-01-24 11:12:50 +1000
committerSteve Bennett <steveb@workware.net.au>2010-10-15 11:02:41 +1000
commit571fa65a6f3cf1c0a11d8c3b46440fe8457fa6fb (patch)
tree407ada47686556fb16198c99b3c61ea595bdb6bd /configure.ac
parent2d8564100c86466b71408b24a4c6932ec942e7c5 (diff)
downloadjimtcl-571fa65a6f3cf1c0a11d8c3b46440fe8457fa6fb.zip
jimtcl-571fa65a6f3cf1c0a11d8c3b46440fe8457fa6fb.tar.gz
jimtcl-571fa65a6f3cf1c0a11d8c3b46440fe8457fa6fb.tar.bz2
Build improvements, bug fixes and compiler warnings
Remove unimplemented 'after restart|expire' from eventloop Allow libjim to be build as a shared library On some platforms, regex.h needs stdlib.h first Use ualarm() only for times < 1 second Fix warnings found by clang static analyser *: printf/syslog %m isn't portable *: some variables set but never read *: some possible null pointer references (although mostly impossible) *: also minor fixes to jim unit tests Fix 'syslog -options <n>' Must null terminate readlink() result
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac27
1 files changed, 23 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f4eeb53..d3ca0bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,12 +4,21 @@
AC_PREREQ(2.57)
AC_INIT([jim], [0.60], [steveb@workware.net.au])
-AC_SUBST(TARGET_PLATFORM,$ac_cv_host)
-
# Checks for programs.
AC_PROG_CC
AC_PROG_MAKE_SET
+# Shared library support. Because we don't believe in automake!
+AC_CANONICAL_HOST
+case $host in
+*-*-darwin*)
+ AC_SUBST(SH_CFLAGS,-dynamic)
+ AC_SUBST(SH_LDFLAGS,"-dynamiclib -undefined suppress -flat_namespace");;
+*)
+ AC_SUBST(SH_CFLAGS,-fPIC)
+ AC_SUBST(SH_LDFLAGS,-shared);;
+esac
+
AC_ARG_ENABLE(fork,
[ --disable-fork Do not use fork (no exec, etc.)],
[
@@ -23,7 +32,7 @@ AC_SUBST(JIM_NOFORK,$JIM_NOFORK)
jim_extensions="package readdir glob array clock exec file posix regexp signal tcl6 aio bio eventloop syslog"
AC_ARG_WITH(jim-ext,
- [ --with-jim-ext Specify jim extensions to build (or all, which is the default)],
+ [ --with-jim-ext Specify jim extensions to build (or all, which is the default)],
[
if test "x$withval" != "xno" ; then
if test "x$withval" != "xall" ; then
@@ -39,9 +48,19 @@ for i in $jim_extensions; do
EXTRA_CFLAGS="$EXTRA_CFLAGS -Dwith_jim_ext_$i"
done
+JIM_LIBTYPE=static
+AC_ARG_WITH(jim-shared,
+ [ --with-jim-shared Build a shared library instead of a static library],
+ [
+ if test "x$withval" = "xyes" ; then
+ JIM_LIBTYPE=shared
+ fi
+ ]
+)
+AC_SUBST(JIM_LIBTYPE,$JIM_LIBTYPE)
+
AC_CHECK_FUNCS([ualarm],EXTRA_CFLAGS="$EXTRA_CFLAGS -DHAVE_UALARM")
-AC_SUBST(JIM_EXTENSIONS,$JIM_EXTENSIONS)
AC_SUBST(EXTRA_CFLAGS,$EXTRA_CFLAGS)
AC_SUBST(SRCDIR,`dirname $0`)