summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorwangjiezhe2016-05-14 15:33:33 +0800
committerwangjiezhe2016-05-14 15:33:33 +0800
commit1d72cc90bdb4fd64aeb75afc706278a6504017f5 (patch)
treee6e3c0403ebc88f7bb1de191baeca943f76c09a6
parent42b236e2d158edba1555593ac305bf776c69911f (diff)
downloadaur-1d72cc90bdb4fd64aeb75afc706278a6504017f5.tar.gz
texmacs-svn 20160514.10334-1
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD17
-rw-r--r--fix-m4.patch568
3 files changed, 582 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b309510588f1..efa0554614ed 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,8 @@
# Generated by mksrcinfo v8
-# Sat May 7 03:46:14 UTC 2016
+# Sun May 8 04:25:53 UTC 2016
pkgbase = texmacs-svn
pkgdesc = Free scientific text editor, inspired by TeX and GNU Emacs. WYSIWYG editor and CAS-interface.
- pkgver = 20160507.10276
+ pkgver = 20160508.10280
pkgrel = 1
url = http://www.texmacs.org/
arch = i686
@@ -26,6 +26,7 @@ pkgbase = texmacs-svn
provides = texmacs
conflicts = texmacs
options = !emptydirs
+ options = !ccache
source = texmacs::svn://svn.savannah.gnu.org/texmacs/trunk/src
sha1sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 2b20f4bc9dcc..dc3d6f10a7d6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@
pkgname=texmacs-svn
_pkgname=texmacs
-pkgver=20160507.10276
+pkgver=20160514.10334
pkgrel=1
pkgdesc="Free scientific text editor, inspired by TeX and GNU Emacs. WYSIWYG editor and CAS-interface."
arch=('i686' 'x86_64')
@@ -19,9 +19,11 @@ optdepends=('transfig: convert images using fig2ps'
'imagemagick: convert images'
'aspell: spell checking')
makedepends=('ghostscript')
-source=("${_pkgname}::svn://svn.savannah.gnu.org/texmacs/trunk/src")
-sha1sums=('SKIP')
-options=('!emptydirs')
+source=("${_pkgname}::svn://svn.savannah.gnu.org/texmacs/trunk/src"
+ "fix-m4.patch")
+sha1sums=('SKIP'
+ '7157af255642d08a37b518957b10050bb4fc9672')
+options=('!emptydirs' '!ccache')
provides=('texmacs')
conflicts=('texmacs')
@@ -35,12 +37,16 @@ prepare() {
svn export "${srcdir}/${_pkgname}" "${srcdir}/${_pkgname}-build"
cd "${srcdir}/${_pkgname}-build"
+
+ patch -Np1 -i ../fix-m4.patch
+
sed -i 's/env python/env python2/' \
plugins/{mathematica/bin/realpath.py,python/bin/tm_python,sage/bin/tm_sage} \
TeXmacs/misc/inkscape_extension/texmacs_reedit.py
sed -i 's/"python"/"python2"/' plugins/python/progs/init-python.scm
sed -i '/^LDPATH/d' src/makefile.in
+ # sed -i 's/guile18-config/guile-config1.8/g' configure
sed -e 's/GUILE_BIN="$GUILE_LIB"/GUILE_BIN="$GUILE_LIB$GUILE_VERSION"/g' \
-e 's/guile18-config/guile-config1.8/g' \
-i misc/m4/guile.m4
@@ -51,7 +57,6 @@ prepare() {
sed -i '/update-mime-database/d' Makefile.in
sed -i '/gtk-update-icon-cache/d' Makefile.in
sed -i '\/icons\/gnome 2>\/dev\/null/d' Makefile.in
-
}
build() {
@@ -59,7 +64,7 @@ build() {
export QMAKE=qmake-qt4
export MOC=moc-qt4
export UIC=uic-qt4
- export LDFLAGS="$LDFLAGS -lz"
+ # export LDFLAGS="$LDFLAGS -lz"
./configure --prefix=/usr \
--mandir=/usr/share/man \
diff --git a/fix-m4.patch b/fix-m4.patch
new file mode 100644
index 000000000000..3d0569acbc44
--- /dev/null
+++ b/fix-m4.patch
@@ -0,0 +1,568 @@
+diff --git a/aclocal.m4 b/aclocal.m4
+index fd4119f..dbf33a6 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -31,48 +31,48 @@ AC_DEFUN([LC_SUBST],[
+
+ #remove leading and trailing
+ AC_DEFUN([LC_STRIP],[
+- @<:@@<:@ "$$1" =~ [$(echo "^@{:@.*[^[:space:]])[[:space:]]+$"]) @:>@@:>@ && $1=${BASH_REMATCH[[1]]}
+- @<:@@<:@ "$$1" =~ [$(echo "^[[:space:]]+([^[:space:]].*)$"]) @:>@@:>@ && $1=${BASH_REMATCH[[1]]}
++ @<:@@<:@ "$$1" =~ [$(echo "^@{:@.*[^[:space:]])[[:space:]]+$"]) @:>@@:>@ && $1=${BASH_REMATCH[[1]]}
++ @<:@@<:@ "$$1" =~ [$(echo "^[[:space:]]+([^[:space:]].*)$"]) @:>@@:>@ && $1=${BASH_REMATCH[[1]]}
+ # transform \\ in \
+- $1=${$1//\/\//\/}
++ $1=${$1//\/\//\/}
+ ])
+
+ # remove unwanted space in well know flags
+ AC_DEFUN([LC_NORMALIZE_FLAG], [
+ LC_STRIP([$1])
+- if @<:@@<:@ "$$1" =~ [$(echo "^-(l|L|D)[[:space:]]+([^[:space:]].*)$"]) @:>@@:>@
+- then $1=-${BASH_REMATCH[[1]]}${BASH_REMATCH[[2]]}
+- fi
++ if @<:@@<:@ "$$1" =~ [$(echo "^-(l|L|D)[[:space:]]+([^[:space:]].*)$"]) @:>@@:>@
++ then $1=-${BASH_REMATCH[[1]]}${BASH_REMATCH[[2]]}
++ fi
+ ])
+
+
+ # append flag ($1) to ($2)
+ # authorize some duplicate according to the pattern
+ AC_DEFUN([LC_APPEND_FLAG],[
+- if @<:@@<:@ "$1" =~ $(echo "^[[:space:]]*-Wl,.+") @:>@@:>@
+- then $2="$$2 $1"
+- else AX_APPEND_FLAG([$1],[$2])
+- fi
++ if @<:@@<:@ "$1" =~ $(echo "^[[:space:]]*-Wl,.+") @:>@@:>@
++ then $2="$$2 $1"
++ else AX_APPEND_FLAG([$1],[$2])
++ fi
+ ])
+
+ #############################################################################
+ # generic pop flag $2 from $1 line $3 line flag separator (right most element)
+ AC_DEFUN([_LC_POP_FLAG],[
+ LC_STRIP([$1])
+- $2=${$1@%:@@%:@*$3} # get flag
+- if test "$$2" = "$$1"
+- then $1=
+- else $2="$3$$2"; $1=${$1%$$2} # remove flag
+- fi
+- LC_NORMALIZE_FLAG([$2])
++ $2=${$1@%:@@%:@*$3} # get flag
++ if test "$$2" = "$$1"
++ then $1=
++ else $2="$3$$2"; $1=${$1%$$2} # remove flag
++ fi
++ LC_NORMALIZE_FLAG([$2])
+ ])
+
+ # generic get flag $2 from $1 line $3 line flag separator (left most element)
+ AC_DEFUN([_LC_GET_FLAG],[
+ LC_STRIP([$1])
+- $2=${$1%%$3*} # get flag
+- $1=${$1@%:@*$$2} # remove flag
+- LC_NORMALIZE_FLAG([$2])
++ $2=${$1%%$3*} # get flag
++ $1=${$1@%:@*$$2} # remove flag
++ LC_NORMALIZE_FLAG([$2])
+ ])
+
+ #get flag $2 from $1 line (GET:left most element POP:right most)
+@@ -89,10 +89,10 @@ AC_DEFUN([LC_POP_FLAG_LIBS],[_LC_POP_FLAG([$1],[$2],[ ])])
+ #############################################################################
+ # wrapping AC_?_IFELSE for erro smg
+ AC_DEFUN([LC_X_IFELSE],[
+- AC_MSG_CHECKING([$2] linking)
+- AC_$1_IFELSE([$3], [ AC_MSG_RESULT(yes) $4
+- ],[ AC_MSG_RESULT(no) $5
+- ])])
++ AC_MSG_CHECKING([$2] linking)
++ AC_$1_IFELSE([$3], [ AC_MSG_RESULT(yes) $4
++ ],[ AC_MSG_RESULT(no) $5
++ ])])
+ AC_DEFUN([LC_RUN_IFELSE],[LC_X_IFELSE([RUN],[$1],[$2],[$3],[$4])])
+ AC_DEFUN([LC_LINK_IFELSE],[LC_X_IFELSE([LINK],[$1],[$2],[$3],[$4])])
+ AC_DEFUN([LC_COMPILE_IFELSE],[LC_X_IFELSE([COMPILE],[$1],[$2],[$3],[$4])])
+@@ -105,12 +105,12 @@ AC_DEFUN([lc_lib_name],[m4_tolower($1)])
+ AC_DEFUN([LC_SET_TRIVIAL_FLAGS],[
+ if [[ "$2" ]]
+ then
+- LC_SCATTER_FLAGS([-I$2/include -L$2/lib -l[]lc_lib_name([$1])],[$1])
++ LC_SCATTER_FLAGS([-I$2/include -L$2/lib -l[]lc_lib_name([$1])],[$1])
+ else
+- LC_SCATTER_FLAGS([-l[]lc_lib_name([$1])],[$1])
++ LC_SCATTER_FLAGS([-l[]lc_lib_name([$1])],[$1])
+ fi
+ ])
+-
++
+
+ #############################################################################
+ # We use function here to avoid 'm4 local variable' conflict for embedded calls
+@@ -122,23 +122,23 @@ m4_define([f_lc_functions_list],[ f_lc_scatter_flags ])
+ # LC_APPEND_FLAG is used to avoid duplicate flag
+ # $1 anonymous list $2 destination
+ AC_DEFUN([LC_PREPEND_LIST],[
+- [$0]_list="$1"
++ [$0]_list="$1"
+ #pop the old list
+- while @<:@ "$$2" @:>@
++ while @<:@ "$$2" @:>@
+ do LC_POP_FLAG_LIBS([$2],[[$0]_flag])
+ LC_APPEND_FLAG([$[$0]_flag],[[$0]_nlist])
+- done
++ done
+ # append new list
+ while @<:@ "$[$0]_list" @:>@
+- do LC_POP_FLAG_LIBS([[$0]_list],[[$0]_flag])
++ do LC_POP_FLAG_LIBS([[$0]_list],[[$0]_flag])
+ LC_APPEND_FLAG([$[$0]_flag],[[$0]_nlist])
+- done
++ done
+ $2=
+ while @<:@ "$[$0]_nlist" @:>@
+- do LC_GET_FLAG_LIBS([[$0]_nlist],[[$0]_flag])
+- $2="$[$0]_flag $$2"
+- done
+- unset ${![$0]_*}
++ do LC_GET_FLAG_LIBS([[$0]_nlist],[[$0]_flag])
++ $2="$[$0]_flag $$2"
++ done
++ unset ${![$0]_*}
+ ])
+
+ #############################################################################
+@@ -146,13 +146,13 @@ AC_DEFUN([LC_PREPEND_LIST],[
+ # $1 list $2 destination
+ AC_DEFUN([LC_MERGE_FLAGS],[
+ [$0]_list="$1"
+- if @<:@@<:@ "$2" =~ $(echo "(^|_)LIBS") @:>@@:>@
+- then LC_PREPEND_LIST([$1],[$2])
+- else while @<:@ "$[$0]_list" @:>@
+- do LC_GET_FLAG([[$0]_list],[[$0]_flag])
++ if @<:@@<:@ "$2" =~ $(echo "(^|_)LIBS") @:>@@:>@
++ then LC_PREPEND_LIST([$1],[$2])
++ else while @<:@ "$[$0]_list" @:>@
++ do LC_GET_FLAG([[$0]_list],[[$0]_flag])
+ LC_APPEND_FLAG([$[$0]_flag],[$2])
+- done
+- fi
++ done
++ fi
+ unset ${![$0]_*}
+ ])
+
+@@ -165,8 +165,8 @@ m4_define([all_flags],[superseded_flags, merged_flags])
+
+ # generic transfert flag $1 within the superseded list $2 and the merged list $3
+ AC_DEFUN([_LC_TRANSFERT_FLAGS],
+- [m4_foreach([_tmp1], [$2], [ if @<:@ "$$1_[]_tmp1" @:>@; then _tmp1=$$1_[]_tmp1;fi;])]
+- [m4_foreach([_tmp1], [$3], [LC_MERGE_FLAGS([$$1_[]_tmp1], [_tmp1])])]
++ [m4_foreach([_tmp1], [$2], [ if @<:@ "$$1_[]_tmp1" @:>@; then _tmp1=$$1_[]_tmp1;fi;])]
++ [m4_foreach([_tmp1], [$3], [LC_MERGE_FLAGS([$$1_[]_tmp1], [_tmp1])])]
+ )
+
+ # set compile flags from the LIBRARY ($1) flags into standard flags
+@@ -199,23 +199,17 @@ AC_DEFUN([LC_COMBINE_FLAGS],[
+
+ # supersede the $2 empty flags by $1 flags
+ AC_DEFUN([LC_SET_EMPTY_FLAGS],[
+- m4_foreach([_tmp1], [all_flags], [$2_[]_tmp1=${$2_[]_tmp1:-${$1_[]_tmp1}};])])
++ m4_foreach([_tmp1], [all_flags], [$2_[]_tmp1=${$2_[]_tmp1:-${$1_[]_tmp1}};])])
+
+ # raw copy flags from $1 to $2
+ AC_DEFUN([LC_COPY_FLAGS],[
+- m4_foreach([_tmp1], [all_flags], [$2_[]_tmp1="${$1_[]_tmp1}";])])
++ m4_foreach([_tmp1], [all_flags], [$2_[]_tmp1="${$1_[]_tmp1}";])])
+
+ # Delete the LIBRARY ($1) flags
+ AC_DEFUN([LC_CLEAR_FLAGS],[
+ m4_ifblank([$1],[m4_define([_tmp2])],[m4_define([_tmp2],[_])])
+ m4_foreach([_tmp1], [all_flags],[unset $1[]_tmp2[]_tmp1;])])
+
+-# raw compare flags in $1 and $2
+- AC_DEFUN([LC_EQ_FLAGS],[@<:@ dnl
+- m4_foreach([_tmp1], [all_flags], ["${$2_[]_tmp1}" == "${$1_[]_tmp1}" -a ])dnl
+- : @:>@
+- ])
+-
+ #############################################################################
+ # build the lib name with a underscore if needed
+ m4_define([lc_libname],[m4_ifblank([$1],[$2],[$1_$2])])
+@@ -223,21 +217,21 @@ m4_define([lc_libname],[m4_ifblank([$1],[$2],[$1_$2])])
+ #
+ AC_DEFUN([LC_SCATTER_FLAGS],[
+ [$0]_list="$1"
+-
++
+ while test -n "$[$0]_list" ;
+- do
+- LC_GET_FLAG([[$0]_list], [[$0]_flag])
+- LC_STRIP([$0]_flag)
+- case "$[$0]_flag" in
+- -l*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[LIBS])]);;
+- -L*|-framework*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[LDFLAGS])]);;
+- -I*|-U*|-D*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[CPPFLAGS])]);;
++ do
++ LC_GET_FLAG([[$0]_list], [[$0]_flag])
++ LC_STRIP([$0]_flag)
++ case "$[$0]_flag" in
++ -l*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[LIBS])]);;
++ -L*|-framework*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[LDFLAGS])]);;
++ -I*|-U*|-D*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[CPPFLAGS])]);;
+ -F*@:}@ LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[CPPFLAGS])]) LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[LDFLAGS])]);;
+- -Wl,*@:}@ AC_MSG_WARN(Flag $[$0]_flag dropped for lib $2);;
+- -*@:}@
+- AX_CHECK_COMPILE_FLAG($[$0]_flag,[LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[CXXFLAGS])])],[AC_MSG_WARN(Flag $[$0]_flag dropped)],[],[]);;
+- *@:}@ AC_MSG_WARN(Flags $[$0]_flag NOT managed);;
+- esac
++ -Wl,*@:}@ AC_MSG_WARN(Flag $[$0]_flag dropped for lib $2);;
++ -*@:}@
++ AX_CHECK_COMPILE_FLAG($[$0]_flag,[LC_APPEND_FLAG([$[$0]_flag],[lc_libname([$2],[CXXFLAGS])])],[AC_MSG_WARN(Flag $[$0]_flag dropped)],[],[]);;
++ *@:}@ AC_MSG_WARN(Flags $[$0]_flag NOT managed);;
++ esac
+ done
+ unset ${![$0]_*}
+ ])
+@@ -246,9 +240,9 @@ AC_DEFUN([LC_SCATTER_FLAGS],[
+
+ # Dump flags
+ AC_DEFUN([_LC_DUMP_FLAGS], [
+- m4_foreach([_tmp1], [[CFLAGS], [CXXFLAGS], [CPPFLAGS], [LIBS], [LDFLAGS]],
+- [AC_MSG_NOTICE([$1[]_tmp1:$$1[]_tmp1])
+- ])
++ m4_foreach([_tmp1], [[CFLAGS], [CXXFLAGS], [CPPFLAGS], [LIBS], [LDFLAGS]],
++ [AC_MSG_NOTICE([$1[]_tmp1:$$1[]_tmp1])
++ ])
+ ])
+
+ AC_DEFUN([LC_DUMP_FLAGS], [m4_ifblank([$1],[_LC_DUMP_FLAGS],[_LC_DUMP_FLAGS([$1_])])])
+@@ -256,13 +250,12 @@ AC_DEFUN([LC_DUMP_FLAGS], [m4_ifblank([$1],[_LC_DUMP_FLAGS],[_LC_DUMP_FLAGS([$1_
+ # get arg value from a args list
+ # $1 args list $2 arg $3 arg value
+ AC_DEFUN([LC_GET_ARG_VALUE], [
+- if @<:@@<:@ "$$1" =~ $(echo "(^|[[[:space:]]]+)$2(=?|[[[:space:]]]*)(.*)$") @:>@@:>@
+- then $3=${BASH_REMATCH[[3]]%% -*}
+- $3=${$3%% } # strip tailing blanks
+- else unset $3
+- fi
++ if @<:@@<:@ $$1 =~ $(echo "(^|[[:space:]]+)$2(=?|[[:space:]]*)(.*)$") @:>@@:>@
++ then $3=${BASH_REMATCH[[3]]%% -*}
++ else unset $3
++ fi
+ ])
+-
++
+ # remove all occurrence of arg from a args list
+ # $1 args list to clean $2 arg to remove
+ AC_DEFUN([STRIP_ARG], [
+@@ -279,20 +272,20 @@ AC_DEFUN([STRIP_ARG], [
+ $1=$(echo $$1) # wipe extra blank if any
+ unset ${![$0]_*}
+ ])
+-
++
+ # remove multiple occurrences of arg from a args list
+ # $1 args list to clean $2 args to remove
+ AC_DEFUN([STRIP_ALL_ARGS], [
+- unset [$0]_list
+- for [$0]_arg in "$2"
+- do while @<:@@<:@ $$1 != $[$0]_list @:>@@:>@
+- do [$0]_list=$$1
+- STRIP_ARG([$1],[$[$0]_arg])
+- done
+- done
+- unset ${![$0]_*}
++ unset [$0]_list
++ for [$0]_arg in "$2"
++ do while @<:@@<:@ $$1 != $[$0]_list @:>@@:>@
++ do [$0]_list=$$1
++ STRIP_ARG([$1],[$[$0]_arg])
++ done
++ done
++ unset ${![$0]_*}
+ ])
+-
++
+
+
+
+diff --git a/misc/m4/dlopen.m4 b/misc/m4/dlopen.m4
+index 5eab086..cf74379 100644
+--- a/misc/m4/dlopen.m4
++++ b/misc/m4/dlopen.m4
+@@ -1,18 +1,31 @@
+-
+-#--------------------------------------------------------------------
+-# Checks for dlopen in standard or dl library
+-# we are looking in sequence for dlopen or dld_link or shl_load in
+-# standard libs or libdl or libdld
+-#--------------------------------------------------------------------
+-
+-m4_define([dyn_link_ok],[AC_DEFINE(TM_DYNAMIC_LINKING, [$1], [Dynamic linking function name])])
+-
+ AC_DEFUN([LC_DLOPEN],[
+- AC_SEARCH_LIBS(dlopen, libdl libdld, [dyn_link_ok(dlopen)],[
+- AC_SEARCH_LIBS(dld_link, libdl libdld, [dyn_link_ok(dld_link)],[
+- AC_SEARCH_LIBS(shl_load, libdl libdld, [dyn_link_ok(shl_load)],[
+- echo configure: warning: dynamic linking using dlopen will not work
+- ])
+- ])
+- ])
+-])
++ AC_CHECK_FUNC(dlopen)
++ if test "$ac_cv_func_dl" = "yes"; then
++ AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
++ else
++ AC_CHECK_LIB(dl,dlopen)
++ if test "$ac_cv_lib_dl_dlopen" = "yes"; then
++ AC_CHECK_FUNCS(dlopen)
++ CONFIG_BDL="-ldl"
++ AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
++ else
++ AC_CHECK_LIB(dld,dld_link)
++ if test "$ac_cv_lib_dld_dld_link" = "yes"; then
++ CONFIG_BDL="-ldl"
++ AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
++ else
++ AC_CHECK_FUNCS(shl_load)
++ if test "$ac_cv_func_shl_load" = "yes"; then
++ CONFIG_BDL="-ldl"
++ AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
++ else
++ AC_CHECK_FUNCS(dlopen)
++ if test "$ac_cv_func_dlopen" = "yes"; then
++ AC_DEFINE(DYNAMIC_LINKING, 1, [Dynamic linking works])
++ fi
++ fi
++ fi
++ fi
++ fi
++ AC_SUBST(CONFIG_BDL)
++])
+\ No newline at end of file
+diff --git a/misc/m4/iconv.m4 b/misc/m4/iconv.m4
+index 4d1f46e..2a4c78f 100644
+--- a/misc/m4/iconv.m4
++++ b/misc/m4/iconv.m4
+@@ -1,48 +1,67 @@
+-#--------------------------------------------------------------------
+-# Checks for iconv library
+-#--------------------------------------------------------------------
+-
+ AC_DEFUN([LC_ICONV],[
+-AC_ARG_WITH(iconv,
+-AS_HELP_STRING([--with-iconv@<:@=DIR@:>@], [where to find iconv []]),
+- [], [unset withval;])
++ AC_ARG_WITH(iconv,
++ AS_HELP_STRING([--with-iconv@<:@=DIR@:>@], [where to find iconv [system]]))
++
++ # Check for iconv
++ # Modified from GNOME's libxml2 configure.in
++ AC_LANG_SAVE
++ AC_LANG_C # compile C to avoid the 'const char**' problem
+
+-if [[[ "$withval" != no ]]]
+-then
+- i_failure=1
+-
+- [$0]_LIBPATHS="$LDFLAGS $withval -L/opt/local/lib -L/sw/lib"
+-
+- LC_GET_ARG_VALUE([$0]_LIBPATHS, [-L], [$0]_LIBPATH)
+- STRIP_ARG([[$0]_LIBPATHS], -L$[$0]_LIBPATH)
+-
+- while test -n "$[$0]_LIBPATH"
+- do
+- LC_CLEAR_FLAGS([ICONV]) # no external iconv definition allowed
+- LC_SET_TRIVIAL_FLAGS([ICONV],[${$0_LIBPATH]%/lib})
+- AX_SAVE_FLAGS
+- LC_SET_FLAGS([ICONV])
+- AC_CHECK_HEADER(iconv.h, [
+- LC_LINK_IFELSE([iconv], [AC_LANG_PROGRAM([[@%:@include <iconv.h>]],
+- [[iconv_open("",""); ]])
+- ], [
+- AX_RESTORE_FLAGS
+- LC_COMBINE_FLAGS([ICONV],[iconv])
++ SAVE_CPPFLAGS="$CPPFLAGS"
++ SAVE_LDFLAGS="$LDFLAGS"
++ SAVE_LIBS="$LIBS"
++ if test "$with_iconv" = "no" ; then
++ AC_MSG_RESULT([disabling iconv support])
++ else
++ if test -n "$ICONV_CFLAGS" -a -n "$ICONV_LDFLAGS"; then
++ CPPFLAGS="$ICONV_CFLAGS" # for AC_TRY_LINK
++ LDFLAGS="$ICONV_LDFLAGS"
++ fi
++ if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then
++ CPPFLAGS="-I$with_iconv/include" # for AC_TRY_LINK
++ LDFLAGS="-L$with_iconv/lib"
++ ICONV_CFLAGS="-I$with_iconv/include"
++ ICONV_LDFLAGS="-L$with_iconv/lib"
++ fi
++
++ AC_CHECK_HEADER(iconv.h,
++ AC_MSG_CHECKING(for iconv)
++ AC_TRY_LINK(
++ [
++ #include <stdlib.h>
++ #include <iconv.h>
++ ],[
++ iconv_t cd = iconv_open ("","");
++ iconv (cd, NULL, NULL, NULL, NULL);
++ ],[
++ AC_MSG_RESULT(yes)
++ AC_DEFINE(USE_ICONV, 1, [Use iconv library])
++ ],[
++ AC_MSG_RESULT(no)
++ AC_MSG_CHECKING(for iconv in -liconv)
++ # LDFLAGS="${ICONV_LDFLAGS}" # for AC_TRY_LINK
++ LIBS="-liconv" # for AC_TRY_LINK
++ AC_TRY_LINK(
++ [
++ #include <stdlib.h>
++ #include <iconv.h>
++ ],[
++ iconv_t cd = iconv_open ("","");
++ iconv (cd, NULL, NULL, NULL, NULL);
++ ],[
++ AC_MSG_RESULT(yes)
+ AC_DEFINE(USE_ICONV, 1, [Use iconv library])
+- unset i_failure
+- unset [$0]_LIBPATH
+- ], [
+- AC_MSG_ERROR([you may have several versions of iconv installed,
+- use with-iconv=iconv_base_path (i.e /usr/local) to specify one location])
+- ])],[
+- LC_GET_ARG_VALUE([$0]_LIBPATHS, [-L], [$0]_LIBPATH)
+- STRIP_ARG([[$0]_LIBPATHS], -L$[$0]_LIBPATH)
+- ])
+- done
+- if [[ $i_failure ]]
+- then AC_MSG_ERROR([absence of iconv may crash HTML import or prevent the build
+- but it is possible to run configure --with-iconv=no])
++ ICONV_LDFLAGS="${ICONV_LDFLAGS/-liconv} -liconv"
++ ],[
++ AC_MSG_RESULT(no)
++ AC_MSG_WARN([absence of iconv may crash HTML import])
++ ])]))
+ fi
+-fi
+-LC_SUBST([ICONV])
+-])
++
++ CPPFLAGS="$SAVE_CPPFLAGS"
++ LDFLAGS="$SAVE_LDFLAGS"
++ LIBS="$SAVE_LIBS"
++ AC_LANG_RESTORE # restore C++ language
++ AC_SUBST(ICONV_CFLAGS)
++ AC_SUBST(ICONV_LDFLAGS)
++])
+\ No newline at end of file
+diff --git a/src/System/config.h.cmake b/src/System/config.h.cmake
+index 44b9a4a..2b34c1d 100644
+--- a/src/System/config.h.cmake
++++ b/src/System/config.h.cmake
+@@ -7,7 +7,7 @@
+ #cmakedefine DOTS_OK 1
+
+ /* Dynamic linking works */
+-#cmakedefine TM_DYNAMIC_LINKING 1
++#cmakedefine DYNAMIC_LINKING 1
+
+ /* Enable experimental style rewriting code */
+ #cmakedefine EXPERIMENTAL 1
+diff --git a/src/System/config.in b/src/System/config.in
+index c501466..f20d0cc 100644
+--- a/src/System/config.in
++++ b/src/System/config.in
+@@ -6,6 +6,9 @@
+ /* Defined if ...-style argument passing works */
+ #undef DOTS_OK
+
++/* Dynamic linking works */
++#undef DYNAMIC_LINKING
++
+ /* Enable experimental style rewriting code */
+ #undef EXPERIMENTAL
+
+@@ -33,6 +36,9 @@
+ /* Guile library name */
+ #undef GUILE_NUM
+
++/* Define to 1 if you have the `dlopen' function. */
++#undef HAVE_DLOPEN
++
+ /* Define to 1 if the system has the type `FILE'. */
+ #undef HAVE_FILE
+
+@@ -45,12 +51,21 @@
+ /* Define to 1 if you have the <inttypes.h> header file. */
+ #undef HAVE_INTTYPES_H
+
++/* Define to 1 if you have the `dl' library (-ldl). */
++#undef HAVE_LIBDL
++
++/* Define to 1 if you have the `dld' library (-ldld). */
++#undef HAVE_LIBDLD
++
+ /* Define to 1 if you have the <memory.h> header file. */
+ #undef HAVE_MEMORY_H
+
+ /* Define to 1 if you have the <pty.h> header file. */
+ #undef HAVE_PTY_H
+
++/* Define to 1 if you have the `shl_load' function. */
++#undef HAVE_SHL_LOAD
++
+ /* Define to 1 if you have the <stdint.h> header file. */
+ #undef HAVE_STDINT_H
+
+@@ -132,9 +147,6 @@
+ /* Define to 1 if you have the ANSI C header files. */
+ #undef STDC_HEADERS
+
+-/* Dynamic linking function name */
+-#undef TM_DYNAMIC_LINKING
+-
+ /* Use axel library */
+ #undef USE_AXEL
+
+diff --git a/src/makefile.in b/src/makefile.in
+index 8a2a476..bb23a01 100644
+--- a/src/makefile.in
++++ b/src/makefile.in
+@@ -41,7 +41,7 @@ CXXCAIRO = @CAIRO_CXX@
+ CXXIMLIB2 = @IMLIB2_CFLAGS@
+ CXXSQLITE3 = @SQLITE3_CXX@
+ CXXFREETYPE = @FREETYPE_CFLAGS@
+-CXXICONV = @ICONV_CXX@
++CXXICONV = @ICONV_CFLAGS@
+ CXXGUILE = @GUILE_CFLAGS@
+ CXXSPARKLE = @SPARKLE_CXX@
+ CXXPDF = @PDF_CFLAGS@
+@@ -53,12 +53,14 @@ LDRT = @CONFIG_LDRT@
+ LDSTATIC = @CONFIG_BSTATIC@
+ LDSHARED = @CONFIG_BSHARED@
+ LDPATH = @CONFIG_BPATH@
++LDDL = @CONFIG_BDL@
+ LDX11 = @X11_LDFLAGS@
+ LDCOCOA = @COCOA_LDFLAGS@
+ LDQT = @QT_LIBS@
+ LDGUI = $(LD@CONFIG_GUI@)
+ LDIMLIB2 = @IMLIB2_LDFLAGS@
+ LDFREETYPE = @FREETYPE_LDFLAGS@
++LDICONV = @ICONV_LDFLAGS@
+ #LDGUILE = @GUILE_LDFLAGS@
+
+ AR = ar
+@@ -421,7 +423,7 @@ TEXMACS_objects := $(strip $(call uses,system kernel data graphics\
+
+ link_options:=-L$(tmsrc)/lib $(LDRT) -lm $(LDPATH) $(LDGUI) $(LDICONV) \
+ $(LDAXEL) $(LDCAIRO) $(LDIMLIB2) $(LDSQLITE3) $(LDFREETYPE) \
+- $(LDSPARKLE)
++ $(LDDL) $(LDSPARKLE)
+
+ $(tmsrc)/bin/texmacs.bin: Objects/texmacs-$(link).bin
+ $(CP) $^ $@