aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshige <shige@FreeBSD.org>2001-05-10 01:49:11 +0800
committershige <shige@FreeBSD.org>2001-05-10 01:49:11 +0800
commite24466960af5e456db989e450712084b406c1c89 (patch)
tree83e913ae1d5b1e67fd407b2057f0b35cd7570445
parent924606ec6266c146e9fcc02648b7c8ce6250e1a6 (diff)
downloadfreebsd-ports-gnome-e24466960af5e456db989e450712084b406c1c89.tar.gz
freebsd-ports-gnome-e24466960af5e456db989e450712084b406c1c89.tar.zst
freebsd-ports-gnome-e24466960af5e456db989e450712084b406c1c89.zip
New port: emacs-20.7 + mule-4.1 patch (+ dynamic-loading patch + xim-fix patch).
-rw-r--r--editors/emacs20-mule-devel/Makefile120
-rw-r--r--editors/emacs20-mule-devel/distinfo4
-rw-r--r--editors/emacs20-mule-devel/files/patch-ai17
-rw-r--r--editors/emacs20-mule-devel/files/patch-aj31
-rw-r--r--editors/emacs20-mule-devel/files/patch-ca14
-rw-r--r--editors/emacs20-mule-devel/files/patch-cb40
-rw-r--r--editors/emacs20-mule-devel/files/patch-cc66
-rw-r--r--editors/emacs20-mule-devel/files/patch-cd20
-rw-r--r--editors/emacs20-mule-devel/files/patch-cg161
-rw-r--r--editors/emacs20-mule-devel/files/site-init.el.tmpl10
-rw-r--r--editors/emacs20-mule-devel/pkg-comment1
-rw-r--r--editors/emacs20-mule-devel/pkg-descr24
-rw-r--r--editors/emacs20-mule-devel/pkg-message14
-rw-r--r--editors/emacs20-mule-devel/pkg-plist25
-rw-r--r--editors/emacs20-mule-devel/scripts/configure14
15 files changed, 561 insertions, 0 deletions
diff --git a/editors/emacs20-mule-devel/Makefile b/editors/emacs20-mule-devel/Makefile
new file mode 100644
index 000000000000..81c91e299dbd
--- /dev/null
+++ b/editors/emacs20-mule-devel/Makefile
@@ -0,0 +1,120 @@
+# New ports collection makefile for: GNU emacs with mule 4.1 patch
+# Date created: 25 April 2001
+# Whom: shige
+#
+# $FreeBSD$
+#
+
+PORTNAME= emacs-${MULE}
+PORTVERSION= ${EMACS_VER}.${MULE_VER}
+CATEGORIES= editors ipv6
+MASTER_SITES= http://www.ainet.or.jp/~inoue/software/emacs-xim/ \
+ ${MASTER_SITE_GNU}
+MASTER_SITE_SUBDIR= emacs
+DISTNAME= emacs-${EMACS_VER}
+DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \
+ ${XIM_PATCH}${EXTRACT_SUFX}
+
+PATCH_SITES= http://www.teu.ac.jp/nsit/~yatagawa/comp/emacs/ \
+ ftp://ftp.m17n.org/pub/mule/dynamic-loading/ \
+ http://www.etl.go.jp/~tomo/comp/emacsen/
+PATCHFILES= emacs-${EMACS_VER}-mule-${MULE_VER}.patch \
+ emacs-20.4-dl3.diff.gz
+PATCH_DIST_STRIP= -p1
+
+MAINTAINER= shige@FreeBSD.org
+
+BUILD_DEPENDS= emacs-${EMACS_VER}:${PORTSDIR}/editors/emacs20
+RUN_DEPENDS= emacs-${EMACS_VER}:${PORTSDIR}/editors/emacs20
+
+WRKSRC= ${WRKDIR}/emacs-${EMACS_VER}
+
+USE_AUTOCONF= yes
+USE_GMAKE= yes
+MAKE_ENV= INSTALL_SCRIPT="${INSTALL_SCRIPT}"
+EMACS_VER= 20.7
+CONFIGURE_TARGET= ${MACHINE_ARCH}--freebsd
+.if !defined(WITHOUT_X11)
+CONFIGURE_ARGS= --with-x-toolkit --with-pop
+USE_XLIB= yes
+.else
+CONFIGURE_ARGS= --with-x=no --with-pop
+.endif
+
+# for Mule patch
+MULE= mule
+MULE_MAJOR_VER= 4
+MULE_VER= 4.1
+MULE_PATCHED_ELS= international/ccl.el international/mule-cmds.el \
+ international/mule-conf.el international/mule.el \
+ international/titdic-cnv.el
+MULE_ELS= loaddefs.el loadup.el ${MULE_PATCHED_ELS}
+
+# for XIM extension
+XIM_PATCH= emacs20-xim-20000713
+.if defined(WITHOUT_XIM) && (${WITHOUT_XIM} == "yes")
+MAKE_FLAGS= MYCPPFLAG="-DX_I18N_INHIBITED"
+.endif
+
+DOC_FILE= DOC-MULE-${EMACS_VER}.1
+
+PLIST_SUB= EMACS_VER=${EMACS_VER} EMACS_ARCH=${CONFIGURE_TARGET} \
+ DOC_FILE=${DOC_FILE} \
+ MULE=${MULE} MULE_MAJOR_VER=${MULE_MAJOR_VER}
+
+SCRIPTS_ENV= SED=${SED} MV=${MV} \
+ DOC_FILE=${DOC_FILE}
+
+.if defined(WITH_XPG4)
+.if ${OSVERSION} >= 220000 && ${OSVERSION} < 400020 || \
+ ${OSVERSION} >= 500000 && ${OSVERSION} < 500005
+CONFIGURE_ARGS+= --with-xpg4
+.endif
+.endif
+
+pre-patch:
+ @(cd ${WRKSRC} ; \
+ ${PATCH} ${PATCH_ARGS} -p1 < ../${XIM_PATCH}/${XIM_PATCH}.diff ;\
+ )
+
+pre-build:
+ @${RM} -rf ${WRKSRC}/info/*
+ @${LN} -sf DOC ${WRKSRC}/etc/${DOC_FILE}
+ @(cd ${WRKSRC}/lisp ; \
+ ${PREFIX}/bin/emacs-${EMACS_VER} -batch -q -f \
+ batch-byte-compile ${MULE_PATCHED_ELS} ; \
+ )
+
+do-install:
+# Install ${MULE} binary.
+ @${INSTALL} -c -s -m 555 -o root -g wheel ${WRKSRC}/src/emacs ${PREFIX}/bin/${MULE}-${EMACS_VER}
+# Install ${MULE} own data file.
+ @${INSTALL_DATA} ${WRKSRC}/etc/DOC ${PREFIX}/share/emacs/${EMACS_VER}/etc/${DOC_FILE}
+# Making directories for ${MULE}.
+ @for i in ${EMACS_VER}/lisp/international ${EMACS_VER}/leim ${EMACS_VER}/site-lisp site-lisp ; do \
+ ${MKDIR} ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/$${i} ; \
+ done
+# Install elisp files for ${MULE}.
+ @for i in ${MULE_ELS}; do \
+ ${INSTALL_DATA} ${WRKSRC}/lisp/$${i} \
+ ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/${EMACS_VER}/lisp/$${i} ; \
+ done
+ @for i in ${MULE_PATCHED_ELS} ; do \
+ ${INSTALL_DATA} ${WRKSRC}/lisp/$${i}c \
+ ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/${EMACS_VER}/lisp/$${i}c ; \
+ done
+# Install subdirs.el files for ${MULE}.
+ @${INSTALL_DATA} ${WRKSRC}/lisp/subdirs.el \
+ ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/${EMACS_VER}/lisp/subdirs.el
+ @for i in site-lisp/subdirs.el ${EMACS_VER}/site-lisp/subdirs.el ; do \
+ if [ ! -f ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/$${i} ]; then \
+ (${ECHO} "(if (fboundp 'normal-top-level-add-subdirs-to-load-path)"; \
+ ${ECHO} " (normal-top-level-add-subdirs-to-load-path))") \
+ > ${PREFIX}/share/${MULE}${MULE_MAJOR_VER}/$${i} ; \
+ fi ; \
+ done
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/editors/emacs20-mule-devel/distinfo b/editors/emacs20-mule-devel/distinfo
new file mode 100644
index 000000000000..75be10da24a1
--- /dev/null
+++ b/editors/emacs20-mule-devel/distinfo
@@ -0,0 +1,4 @@
+MD5 (emacs-20.7.tar.gz) = c732cf5e668d4ac67d9418ecb103ecf5
+MD5 (emacs20-xim-20000713.tar.gz) = 3fec03adb19038afe25345b12962ec0f
+MD5 (emacs-20.4-dl3.diff.gz) = c7d5891607236066cd1a7f187d6100bc
+MD5 (emacs-20.7-mule-4.1.patch) = 7bff7878f92dab08db3b519012018d12
diff --git a/editors/emacs20-mule-devel/files/patch-ai b/editors/emacs20-mule-devel/files/patch-ai
new file mode 100644
index 000000000000..c506c8761586
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-ai
@@ -0,0 +1,17 @@
+--- src/unexelf.c.orig Mon May 15 17:14:02 2000
++++ src/unexelf.c Sat Jul 1 18:17:15 2000
+@@ -506,6 +506,14 @@
+ # include <link.h> /* get ElfW etc */
+ #endif
+
++#ifdef __FreeBSD__
++# ifdef __STDC__
++# define ElfW(type) Elf_##type
++# else
++# define ElfW(type) Elf_/**/type
++# endif
++#endif
++
+ #ifndef ElfW
+ # ifdef __STDC__
+ # define ElfBitsW(bits, type) Elf##bits##_##type
diff --git a/editors/emacs20-mule-devel/files/patch-aj b/editors/emacs20-mule-devel/files/patch-aj
new file mode 100644
index 000000000000..35bcc5c36e08
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-aj
@@ -0,0 +1,31 @@
+--- src/m/alpha.h.orig Wed Oct 29 16:47:37 1997
++++ src/m/alpha.h Sun Jan 3 20:05:49 1999
+@@ -239,7 +239,7 @@
+
+ #ifndef NOT_C_CODE
+ /* We need these because pointers are larger than the default ints. */
+-#if !defined(__NetBSD__) && !defined(__OpenBSD__)
++#if !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
+ #include <alloca.h>
+ #else
+ #include <stdlib.h>
+@@ -308,7 +308,8 @@
+ termio and struct termios are mutually incompatible. */
+ #define NO_TERMIO
+
+-#if defined (LINUX) || defined (__NetBSD__) || defined (__OpenBSD__)
++#if defined (LINUX) || \
++ defined(__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
+ # define TEXT_END ({ extern int _etext; &_etext; })
+ # ifndef __ELF__
+ # define COFF
+@@ -316,7 +317,8 @@
+ # endif /* notdef __ELF__ */
+ #endif
+
+-#if (defined (__NetBSD__) || defined (__OpenBSD__)) && defined (__ELF__)
++#if (defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)) \
++ && defined (__ELF__)
+ #define HAVE_TEXT_START
+ #endif
+
diff --git a/editors/emacs20-mule-devel/files/patch-ca b/editors/emacs20-mule-devel/files/patch-ca
new file mode 100644
index 000000000000..329193d7e25d
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-ca
@@ -0,0 +1,14 @@
+--- src/Makefile.in.orig Sun Jul 2 12:44:43 2000
++++ src/Makefile.in Sun Jul 2 12:44:44 2000
+@@ -418,7 +418,11 @@
+ libexecdir=${exec_prefix}/libexec
+ archlibdir=${libexecdir}/emacs/${version}/${configuration}
+ #ifdef __FreeBSD__
++#ifdef __ELF__
++#define LINKER $(CC) -nostdlib -Wl,-export-dynamic -Wl,-R${archlibdir}
++#else /* not __ELF__ */
+ #define LINKER $(CC) -nostdlib -Wl,-R${archlibdir}
++#endif /* __ELF__ */
+ #else
+ #define LINKER $(CC) -nostdlib -rdynamic -Wl,-rpath,${archlibdir}
+ #endif
diff --git a/editors/emacs20-mule-devel/files/patch-cb b/editors/emacs20-mule-devel/files/patch-cb
new file mode 100644
index 000000000000..a31533eabc90
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-cb
@@ -0,0 +1,40 @@
+--- src/s/freebsd.h.orig Tue May 2 21:29:10 2000
++++ src/s/freebsd.h Sat Jul 1 20:17:45 2000
+@@ -41,8 +41,18 @@
+
+ #define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_p - (FILE)->_bf._base)
+
++/* Use XPG4 Library for FreeBSD */
++#define LIBS_XPG
++#if (__FreeBSD_version >= 220000 && __FreeBSD_version < 400020) \
++ || (__FreeBSD_version >= 500000 && __FreeBSD_version < 500005)
++#ifdef USE_XPG
++#undef LIBS_XPG
++#define LIBS_XPG -lxpg4
++#endif
++#endif
++
+ #define LIBS_DEBUG
+-#define LIBS_SYSTEM -lutil
++#define LIBS_SYSTEM -lutil LIBS_XPG
+ #if __FreeBSD_version < 400000
+ #define LIBS_TERMCAP -ltermcap
+ #endif
+@@ -56,9 +66,16 @@
+ #ifdef __ELF__
+
+ #define LD_SWITCH_SYSTEM
++
++#ifdef __alpha__
++#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crtbegin.o
++#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o
++#else
+ #define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
+-#define UNEXEC unexelf.o
+ #define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o
++#endif
++
++#define UNEXEC unexelf.o
+ #undef LIB_GCC
+ #define LIB_GCC
+
diff --git a/editors/emacs20-mule-devel/files/patch-cc b/editors/emacs20-mule-devel/files/patch-cc
new file mode 100644
index 000000000000..06b6e1189300
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-cc
@@ -0,0 +1,66 @@
+--- configure.in.orig Tue Jun 6 00:42:49 2000
++++ configure.in Thu May 10 02:00:34 2001
+@@ -26,10 +26,16 @@
+ AC_INIT(src/lisp.h)
+ AC_CONFIG_HEADER(src/config.h:src/config.in)
+
+-lispdir='${datadir}/emacs/${version}/lisp'
+-locallisppath='${datadir}/emacs/${version}/site-lisp:'\
+-'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
+-lisppath='${locallisppath}:${lispdir}'
++lispdir='${datadir}/mule4/${version}/lisp'
++locallisppath='${datadir}/mule4/${version}/site-lisp:'\
++'${datadir}/mule4/site-lisp:'\
++'${datadir}/emacs/${version}/site-lisp:'\
++'${datadir}/emacs/site-lisp:'\
++'${datadir}/mule4/${version}/leim:'\
++'${datadir}/mule4/${version}/lisp:'\
++'${datadir}/emacs/${version}/leim:'\
++'${datadir}/emacs/${version}/lisp'
++lisppath='${locallisppath}'
+ etcdir='${datadir}/emacs/${version}/etc'
+ archlibdir='${libexecdir}/emacs/${version}/${configuration}'
+ docdir='${datadir}/emacs/${version}/etc'
+@@ -42,6 +48,9 @@
+ AC_ARG_WITH(hesiod,
+ [ --with-hesiod support Hesiod to get the POP server host],
+ [AC_DEFINE(HESIOD)])
++AC_ARG_WITH(xpg4,
++[ --with-xpg4 support XPG4 library on FreeBSD system],
++[AC_DEFINE(USE_XPG)])
+ dnl This should be the last --with option, because --with-x is
+ dnl added later on when we find the path of X, and it's best to
+ dnl keep them together visually.
+@@ -147,6 +156,15 @@
+ machine='' opsys='' unported=no
+ case "${canonical}" in
+
++ ## FreeBSD ports
++ *-*-freebsd* )
++ opsys=freebsd
++ case "${canonical}" in
++ alpha*-*-freebsd*) machine=alpha ;;
++ i[3456]86-*-freebsd*) machine=intel386 ;;
++ esac
++ ;;
++
+ ## NetBSD ports
+ *-*-netbsd* )
+ opsys=netbsd
+@@ -958,7 +976,6 @@
+ ;;
+ *-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
+ *-386bsd* ) opsys=386bsd ;;
+- *-freebsd* ) opsys=freebsd ;;
+ *-nextstep* ) opsys=nextstep ;;
+ ## Otherwise, we'll fall through to the generic opsys code at the bottom.
+ esac
+@@ -1639,7 +1656,7 @@
+ rename closedir mkdir rmdir sysinfo \
+ random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
+ strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
+-utimes setrlimit setpgid getcwd shutdown strftime)
++utimes setrlimit setpgid getcwd shutdown strftime getaddrinfo)
+
+ # UNIX98 PTYs.
+ AC_CHECK_FUNCS(grantpt)
diff --git a/editors/emacs20-mule-devel/files/patch-cd b/editors/emacs20-mule-devel/files/patch-cd
new file mode 100644
index 000000000000..bd0d3fe516a2
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-cd
@@ -0,0 +1,20 @@
+--- src/config.in.orig Mon Jun 26 19:06:49 2000
++++ src/config.in Mon Jun 26 19:07:38 2000
+@@ -118,6 +118,9 @@
+ /* Define to support using a Hesiod database to find the POP server. */
+ #undef HESIOD
+
++/* Define to support using a XPG4 library on FreeBSD system. */
++#undef USE_XPG
++
+ /* Some things figured out by the configure script, grouped as they are in
+ configure.in. */
+ #ifndef _ALL_SOURCE /* suppress warning if this is pre-defined */
+@@ -236,6 +239,7 @@
+ #undef HAVE_STRFTIME
+ #undef HAVE_GRANTPT
+ #undef HAVE_GETPT
++#undef HAVE_GETADDRINFO
+
+ #undef LOCALTIME_CACHE
+ #undef HAVE_INET_SOCKETS
diff --git a/editors/emacs20-mule-devel/files/patch-cg b/editors/emacs20-mule-devel/files/patch-cg
new file mode 100644
index 000000000000..ad2a70850899
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/patch-cg
@@ -0,0 +1,161 @@
+--- src/process.c.orig Wed May 24 04:10:16 2000
++++ src/process.c Mon Sep 4 14:15:19 2000
+@@ -1,7 +1,18 @@
++/*
++ * Locally hacked process.c to add ipv6 support. -wsr
++ *
++ * The configure.in file should define "HAVE_GETADDRINFO" if it is found
++ * in libc.
++ *
++ */
++
+ /* Asynchronous subprocess control for GNU Emacs.
+ Copyright (C) 1985, 86, 87, 88, 93, 94, 95, 96, 1998
+ Free Software Foundation, Inc.
+
++ ipv6 changes are
++ Copyright (C) 1999 Wolfgang S. Rupprecht
++
+ This file is part of GNU Emacs.
+
+ GNU Emacs is free software; you can redistribute it and/or modify
+@@ -1810,15 +1821,21 @@
+ {
+ Lisp_Object proc;
+ register int i;
++#ifdef HAVE_GETADDRINFO
++ struct addrinfo hints, *res, *lres;
++ int ret = 0;
++ int xerrno = 0;
++ char *portstring, portbuf [128];
++#else /* HAVE_GETADDRINFO */
+ struct sockaddr_in address;
+ struct servent *svc_info;
+ struct hostent *host_info_ptr, host_info;
+ char *(addr_list[2]);
+ IN_ADDR numeric_addr;
+- int s, outch, inch;
+- char errstring[80];
+- int port;
+ struct hostent host_info_fixed;
++ int port;
++#endif /* HAVE_GETADDRINFO */
++ int s = -1, outch, inch;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+ int retry = 0;
+ int count = specpdl_ptr - specpdl;
+@@ -1831,6 +1848,22 @@
+ GCPRO4 (name, buffer, host, service);
+ CHECK_STRING (name, 0);
+ CHECK_STRING (host, 0);
++
++#ifdef HAVE_GETADDRINFO
++ /*
++ * caution: service can either be a string or int.
++ * Convert to a C string for later use by getaddrinfo.
++ */
++ if (INTEGERP (service)) {
++ snprintf (portbuf, sizeof (portbuf), "%d", XINT (service));
++ portstring = portbuf;
++ }
++ else
++ {
++ CHECK_STRING (service, 0);
++ portstring = XSTRING (service)->data;
++ }
++#else /* HAVE_GETADDRINFO */
+ if (INTEGERP (service))
+ port = htons ((unsigned short) XINT (service));
+ else
+@@ -1841,6 +1874,7 @@
+ error ("Unknown service \"%s\"", XSTRING (service)->data);
+ port = svc_info->s_port;
+ }
++#endif /* HAVE_GETADDRINFO */
+
+ /* Slow down polling to every ten seconds.
+ Some kernels have a bug which causes retrying connect to fail
+@@ -1850,6 +1884,75 @@
+ #endif
+
+ #ifndef TERM
++#ifdef HAVE_GETADDRINFO /* We have a modern OS. -wsr */
++ immediate_quit = 1;
++ QUIT;
++ memset(&hints, 0, sizeof(hints));
++ hints.ai_flags = 0;
++ hints.ai_family = AF_UNSPEC;
++ hints.ai_socktype = SOCK_STREAM;
++ hints.ai_protocol = 0;
++ ret = getaddrinfo(XSTRING (host)->data, portstring, &hints, &res);
++ if (ret)
++ error("%s/%s %s", XSTRING (host)->data, portstring, gai_strerror(ret));
++ immediate_quit = 0;
++
++ for (lres = res; lres ; lres = lres->ai_next)
++ {
++ s = socket(lres->ai_family, lres->ai_socktype, lres->ai_protocol);
++ if (s < 0)
++ {
++ xerrno = errno;
++ continue;
++ }
++
++ /* Kernel bugs (on Ultrix at least) cause lossage (not just EINTR)
++ when connect is interrupted. So let's not let it get interrupted.
++ Note we do not turn off polling, because polling is only used
++ when not interrupt_input, and thus not normally used on the systems
++ which have this bug. On systems which use polling, there's no way
++ to quit if polling is turned off. */
++ if (interrupt_input)
++ unrequest_sigio ();
++
++ loop:
++ immediate_quit = 1;
++ QUIT;
++
++ if (connect(s, lres->ai_addr, lres->ai_addrlen) == 0 ||
++ errno == EISCONN)
++ break;
++
++ xerrno = errno;
++ immediate_quit = 0;
++
++ if (errno == EINTR)
++ goto loop;
++ if (errno == EADDRINUSE && retry < 20)
++ {
++ /* A delay here is needed on some FreeBSD systems,
++ and it is harmless, since this retrying takes time anyway
++ and should be infrequent. */
++ Fsleep_for (make_number (1), Qnil);
++ retry++;
++ goto loop;
++ }
++
++ close(s);
++ s = -1;
++ }
++
++ freeaddrinfo(res);
++ if (s < 0)
++ {
++ if (interrupt_input)
++ request_sigio ();
++
++ errno = xerrno;
++ report_file_error ("connection failed",
++ Fcons (host, Fcons (name, Qnil)));
++ }
++#else /* HAVE_GETADDRINFO */
+ while (1)
+ {
+ #ifdef TRY_AGAIN
+@@ -1940,6 +2043,7 @@
+ report_file_error ("connection failed",
+ Fcons (host, Fcons (name, Qnil)));
+ }
++#endif /* HAVE_GETADDRINFO */
+
+ immediate_quit = 0;
+
diff --git a/editors/emacs20-mule-devel/files/site-init.el.tmpl b/editors/emacs20-mule-devel/files/site-init.el.tmpl
new file mode 100644
index 000000000000..e3549027dc02
--- /dev/null
+++ b/editors/emacs20-mule-devel/files/site-init.el.tmpl
@@ -0,0 +1,10 @@
+;;; site-init.el -- site-dependent initialization file
+
+;;
+;; Init file for FreeBSD port: emacs20-mule-devel
+;;
+
+; change a default file name of the internal DOC-string.
+(Snarf-documentation "%%DOC_FILE%%")
+
+;;; site-init.el ends here
diff --git a/editors/emacs20-mule-devel/pkg-comment b/editors/emacs20-mule-devel/pkg-comment
new file mode 100644
index 000000000000..5550c8c2287f
--- /dev/null
+++ b/editors/emacs20-mule-devel/pkg-comment
@@ -0,0 +1 @@
+GNU editing macros with dl module function and mule 4.1(binary only)
diff --git a/editors/emacs20-mule-devel/pkg-descr b/editors/emacs20-mule-devel/pkg-descr
new file mode 100644
index 000000000000..58f6c92b24fa
--- /dev/null
+++ b/editors/emacs20-mule-devel/pkg-descr
@@ -0,0 +1,24 @@
+GNU Emacs is a self-documenting, customizable, extensible real-time
+display editor (emacs binary only).
+
+This package's emacs has a dynamic loading module function
+and mule 4.1 new features.
+
+Emacs binary is:
+ ${PREFIX}/bin/mule-20.7
+Dynamic loading patch:
+ ftp://ftp.m17n.org/mule/dynamic-loading/emacs-20.4-dl3.diff.gz
+
+NOTE: This binary is not linked with libxpg4 shared library by default.
+If your LANG environment variable has a value but "C", the following
+warning message may be displayed:
+
+ Warning: locale not supported by C library, locale unchanged
+
+If you complain about this message, type `make install WITH_XPG4=yes'
+at the "${PORTSDIR}/editors/emacs20-mule-devel" directory to re-make
+this package.
+
+WWW: http://www.m17n.org/mule/dynamic-loading/
+
+--- Ported by shige@FreeBSD.ORG
diff --git a/editors/emacs20-mule-devel/pkg-message b/editors/emacs20-mule-devel/pkg-message
new file mode 100644
index 000000000000..c3c5240d92b9
--- /dev/null
+++ b/editors/emacs20-mule-devel/pkg-message
@@ -0,0 +1,14 @@
+****************************************************************************
+ NOTE: Warning message about locale.
+
+ This binary is not linked with libxpg4 shared library by default.
+ If your LANG environment variable has a value but "C", the following
+ warning message may be displayed:
+
+ Warning: locale not supported by C library, locale unchanged
+
+ If you complain about this message, type `make install WITH_XPG4=yes'
+ at the "${PORTSDIR}/editors/emacs20-mule-devel" directory to re-make
+ this package.
+
+****************************************************************************
diff --git a/editors/emacs20-mule-devel/pkg-plist b/editors/emacs20-mule-devel/pkg-plist
new file mode 100644
index 000000000000..e08eb634cb0e
--- /dev/null
+++ b/editors/emacs20-mule-devel/pkg-plist
@@ -0,0 +1,25 @@
+bin/%%MULE%%-%%EMACS_VER%%
+share/emacs/%%EMACS_VER%%/etc/%%DOC_FILE%%
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/loaddefs.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/loadup.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/ccl.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/ccl.elc
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule-cmds.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule-cmds.elc
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule-conf.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule-conf.elc
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/mule.elc
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/titdic-cnv.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international/titdic-cnv.elc
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/subdirs.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/site-lisp/subdirs.el
+share/%%MULE%%%%MULE_MAJOR_VER%%/site-lisp/subdirs.el
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/leim
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp/international
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/lisp
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/site-lisp
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%/site-lisp
+@dirrm share/%%MULE%%%%MULE_MAJOR_VER%%
+@exec /bin/mkdir -p %D/share/%%MULE%%%%MULE_MAJOR_VER%%/%%EMACS_VER%%/leim || true
diff --git a/editors/emacs20-mule-devel/scripts/configure b/editors/emacs20-mule-devel/scripts/configure
new file mode 100644
index 000000000000..64cca9b95398
--- /dev/null
+++ b/editors/emacs20-mule-devel/scripts/configure
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+for f in site-init.el; do
+ ${SED} -e "s,%%DOC_FILE%%,${DOC_FILE},g" \
+ < ${FILESDIR}/${f}.tmpl > ${WRKSRC}/lisp/${f}
+done
+
+cd ${WRKSRC}
+
+if [ -f /usr/lib/aout/crt0.o -a ! -f /usr/lib/crt0.o ]; then
+ ${SED} -e "s|/usr/lib/crt0\.o|/usr/lib/aout/crt0.o|g" \
+ src/s/freebsd.h > src/s/freebsd.h.new || exit
+ ${MV} -f src/s/freebsd.h.new src/s/freebsd.h
+fi