Branch: Tag:

2006-06-28

2006-06-28 21:23:35 by Martin Stjernholm <mast@lysator.liu.se>

Added --enable-dll and basic support for linking dlls (a fresh rntcl is
required if enabled).

Rev: src/acconfig.h:1.149
Rev: src/configure.in:1.962
Rev: src/make_variables.in:1.25
Rev: src/modules/dynamic_module_makefile.in:1.118

1: - AC_REVISION("$Id: configure.in,v 1.961 2006/06/28 21:15:53 mast Exp $") + AC_REVISION("$Id: configure.in,v 1.962 2006/06/28 21:23:35 mast Exp $")   AC_INIT(interpret.c)   AC_CONFIG_HEADER(machine.h)   
1246:   MY_AC_ARG_WITH(static_linking, MY_DESCR([--with-static-linking],    [link statically, if possible]),    [with_static_linking=yes]) + AC_ARG_ENABLE(dll, MY_DESCR([--enable-dll], +  [link dynamic modules to DLLs on NT]), +  [], [enable_dll=no])   AC_ARG_WITH(bundles,    MY_DESCR([--without-bundles],    [do not enable bundled libraries]),
2100:    # Windows NT    DO_IF_OS(Windows_NT,    [ -  # FIXME: The test below probably doesn't work. -  if echo "x$CC" | grep "rntecl" >/dev/null 2>&1; then +  case "x$CC" in +  *rntecl*)    # Some options used by ecl (Intel's IA64 compiler).       # We want threads, and link libc statically.
2120:    # (Only if optimizations are turned off with -Od).    AC_SYS_COMPILER_FLAG(-GZ,GZ,WARN)    fi -  else :; fi +  ;;    -  if test x$with_dynamic_modules = xno ; then :; else +  *rntcl*) +  # If --with-rtldebug then compile for and link with the debug +  # runtime lib. If --enable-dll then compile for and link with +  # the dynamic crt to make all modules share the same crt +  # instance. +  if test x$with_rtldebug = xyes; then +  if test x$enable_dll = xyes; then +  CFLAGS="$CFLAGS -MDd" +  else +  CFLAGS="$CFLAGS -MTd" +  fi +  else +  if test x$enable_dll = xyes; then +  CFLAGS="$CFLAGS -MD" +  else +  CFLAGS="$CFLAGS -MT" +  fi +  fi +  ;; +  esac +  +  if test x$enable_dll = xyes; then +  pike_cv_sys_dynamic_loading=yes +  elif test x$with_dynamic_modules = xno ; then :; else    PIKE_MSG_NOTE([Enabling dynamic modules for Win32.])   # EXTRA_MODULE_REQUIREMENTS="${EXTRA_MODULE_REQUIREMENTS} import_functions.h"    DLOPEN_O="dlopen.o"
2225:    # MinGW system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.961 2006/06/28 21:15:53 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.962 2006/06/28 21:23:35 mast Exp $.   # MinGW-version. Do NOT edit.   posix_name="`cat`"   posix_prefix="/"
2263:    # Native POSIX system.    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.961 2006/06/28 21:15:53 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.962 2006/06/28 21:23:35 mast Exp $.   # POSIX-version. Do NOT edit.   cat   EOF
2272:    # rntcl-style    cat <<\EOF   #!/bin/sh - # Automatically generated by $Id: configure.in,v 1.961 2006/06/28 21:15:53 mast Exp $. + # Automatically generated by $Id: configure.in,v 1.962 2006/06/28 21:23:35 mast Exp $.   # RNTCL-version. Do NOT edit.   sed -e "$PIKE_PATH_TRANSLATE"   EOF
6990:   # Set info about shared libraries.   AC_SUBST(SO)   AC_SUBST(LDSHARED) + AC_SUBST(LDSHARED_MODULE_REQS)   AC_SUBST(CCSHARED)   AC_SUBST(LINKFORSHARED)   
7087:    fi    ;;    Windows_NT*|NT*) +  if test x$enable_dll = xno; then    LDSHARED="pntld" -  +  else +  # It's important that we use $(CC) unexpanded here so that any +  # -MD/-MDd flags also gets passed to the linker. +  LDSHARED='$(CC) -shared' +  LDSHARED_MODULE_ARGS="-l`pwd`/pike" +  LDSHARED_MODULE_REQS="`pwd`/pike.lib" +  fi    ;;    *) LDSHARED="ld";;    esac
7216:    SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;    # What about UNIX_SV?    UnixWare*|OpenUNIX*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; -  Windows_NT*|NT*) LINKFORSHARED="-rdynamic";; +  Windows_NT*|NT*) +  test x$enable_dll != xyes && LINKFORSHARED="-rdynamic";;       FreeBSD*)    AC_TRY_RUN([int main(){exit(
7616:      BASE_CFLAGS=$CFLAGS   BASE_CPPFLAGS=$CPPFLAGS + MOD_LDSHARED="$LDSHARED $LDSHARED_MODULE_ARGS"      # Put LIBS into the LDFLAGS that the modules will use. This is   # necessary to keep compatibility with module configure scripts. Some