Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jan 1999 13:01:56 +0900 (KST)
From:      junker@jazz.snu.ac.kr
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   ports/9451: port fix: korean/hanemacs
Message-ID:  <199901120401.NAA05614@punky.snu.ac.kr>

next in thread | raw e-mail | index | archive | help

>Number:         9451
>Category:       ports
>Synopsis:       port fix: korean/hanemacs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 11 20:10:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     CHOI Junho
>Release:        FreeBSD 2.2.8-STABLE i386
>Organization:
NARAE, CS Dept., Seoul National Univ., ROK
>Environment:

FreeBSD punky.snu.ac.kr 2.2.8-STABLE FreeBSD 2.2.8-STABLE #0: Mon Dec 14 12:08:34 KST 1998     pwd@punky.snu.ac.kr:/allegro/2.2-src/sys/compile/PUNKY  i386

FreeBSD samba.snu.ac.kr 3.0-CURRENT FreeBSD 3.0-CURRENT #4: Thu Dec  3 10:00:45 KST 1998     pwd@samba.snu.ac.kr:/usr/src/sys/compile/SAMBA  i386

>Description:

ELF building fix. Many part of fix from editors/emacs.

>How-To-Repeat:

Build korean/hanemacs in a ELF system.

>Fix:
	
Apply the following diffs:

diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/Makefile ./Makefile
--- /usr/ports/korean/hanemacs/Makefile	Sat Nov 21 14:20:37 1998
+++ ./Makefile	Tue Jan 12 12:33:04 1999
@@ -14,12 +14,11 @@
 
 MAINTAINER=	junker@jazz.snu.ac.kr
 
-BROKEN_ELF=	yes
-
 WRKSRC=		${WRKDIR}/hanemacs-19.34
 GNU_CONFIGURE=	yes
 USE_GMAKE=	yes
-CONFIGURE_ARGS=	i386--freebsd --with-x-toolkit --prefix=${PREFIX}
+CONFIGURE_ARGS=	i386--freebsd --with-x-toolkit \
+		--sharedstatedir=/var/run
 STRIP=
 MAN1=		emacs.1 etags.1 ctags.1
 
@@ -42,5 +41,10 @@
 .for info in emacs vip viper forms gnus mh-e cl sc dired-x ediff ccmode message
 	install-info ${PREFIX}/info/${info} ${PREFIX}/info/dir
 .endfor
+# install emacs.sh into ${PREFIX}/etc/rc.d
+	${MKDIR} /var/run/emacs/lock
+	chmod 1777 /var/run/emacs/lock
+	@${MKDIR} ${PREFIX}/etc/rc.d
+	@${INSTALL_SCRIPT} ${FILESDIR}/emacs.sh ${PREFIX}/etc/rc.d
 
 .include <bsd.port.mk>
diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/files/emacs.sh ./files/emacs.sh
--- /usr/ports/korean/hanemacs/files/emacs.sh	Thu Jan  1 09:00:00 1970
+++ ./files/emacs.sh	Tue Jan 12 12:05:20 1999
@@ -0,0 +1,10 @@
+#!/bin/sh
+if [ -d /var/run/emacs/lock ]
+then
+    rm -f /var/run/emacs/lock/*
+else
+    mkdir -p /var/run/emacs/lock
+fi
+chmod 1777 /var/run/emacs/lock
+exit 0
+
diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/patches/patch-ac ./patches/patch-ac
--- /usr/ports/korean/hanemacs/patches/patch-ac	Mon May 18 07:25:59 1998
+++ ./patches/patch-ac	Tue Jan 12 12:01:04 1999
@@ -1,33 +1,69 @@
---- src/s/freebsd.h.orig	Sun Jun  9 13:14:32 1996
-+++ src/s/freebsd.h	Wed Dec  3 17:36:40 1997
-@@ -33,9 +33,16 @@
+--- orig/s/freebsd.h	Mon Jun 10 05:14:32 1996
++++ src/s/freebsd.h	Tue Sep 29 11:35:32 1998
+@@ -1,5 +1,15 @@
+ /* s/ file for freebsd system.  */
  
- #define LIBS_DEBUG
- #define LIBS_SYSTEM -lutil
--#define LIBS_TERMCAP -ltermcap
- #define LIB_GCC -lgcc
- 
-+#ifdef HAVE_LIBNCURSES
-+#define TERMINFO
-+#define LIBS_TERMCAP -lncurses
++/* Get the correct __FreeBSD_version, even if this is before that was
++   defined. */
++#ifndef __FreeBSD__
++#define __FreeBSD_version 199401
++#elif __FreeBSD__ == 1
++#define __FreeBSD_version 199405
 +#else
-+#define LIBS_TERMCAP -ltermcap
++#include <osreldate.h>
 +#endif
 +
-+
+ /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
+    Earlier versions do not have shared libraries, so inhibit them.
+    You can inhibit them on newer systems if you wish
+@@ -34,7 +44,6 @@
+ #define LIBS_DEBUG
+ #define LIBS_SYSTEM -lutil
+ #define LIBS_TERMCAP -ltermcap
+-#define LIB_GCC -lgcc
+ 
  #define SYSV_SYSTEM_DIR
  
- /* freebsd has POSIX-style pgrp behavior. */
-@@ -46,7 +53,7 @@
+@@ -42,12 +51,28 @@
+ #undef BSD_PGRPS
+ #define GETPGRP_NO_ARG
+ 
++#ifdef __ELF__
++
++#define LD_SWITCH_SYSTEM
++#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
++#undef LIB_GCC
++#define LIB_GCC
++
++#else /* not __ELF__ */
++
+ #ifndef NO_SHARED_LIBS
  #define LD_SWITCH_SYSTEM -e start -dc -dp
  #define HAVE_TEXT_START		/* No need to define `start_of_text'. */
++#if __FreeBSD_version >= 300002
++#define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
++#else /* __FreeBSD_version < 300002 */
  #define START_FILES pre-crt0.o /usr/lib/crt0.o
 -#define UNEXEC unexsunos4.o
++#endif /* __FreeBSD_version < 300002 */
 +#define UNEXEC unexfreebsd.o
  #define RUN_TIME_REMAP
++#define LIB_GCC -lgcc
  
  #ifndef N_TRELOFF
-@@ -80,6 +87,8 @@
+ #define N_PAGSIZ(x) __LDPGSZ
+@@ -63,6 +88,8 @@
+ #endif /* __FreeBSD__ */
+ #endif /* NO_SHARED_LIBS */
+ 
++#endif /* not __ELF__ */
++
+ #define HAVE_WAIT_HEADER
+ #define HAVE_GETLOADAVG
+ /*#define HAVE_GETPAGESIZE  /* configure now puts this in config.h */
+@@ -80,6 +107,8 @@
  #define BSD 199103
  #elif __FreeBSD__ == 2
  #define BSD 199306
diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/patches/patch-af ./patches/patch-af
--- /usr/ports/korean/hanemacs/patches/patch-af	Thu Jan  1 09:00:00 1970
+++ ./patches/patch-af	Tue Jan 12 12:02:02 1999
@@ -0,0 +1,22 @@
+--- src/unexelf.c.orig	Fri Oct  2 12:55:43 1998
++++ src/unexelf.c	Fri Oct  2 13:02:05 1998
+@@ -678,7 +678,8 @@
+   if (n < 0)
+     fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0);
+ 
+-  NEW_PROGRAM_H (n).p_filesz += new_data2_size;
++/*  NEW_PROGRAM_H (n).p_filesz += new_data2_size; */
++  NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr; /* From emacs 20.3 */
+   NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
+ 
+ #if 0 /* Maybe allow section after data2 - does this ever happen? */
+@@ -845,7 +846,9 @@
+ 
+       for (; symp < symendp; symp ++)
+ 	if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0
+-	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0)
++	    || strcmp ((char *) (symnames + symp->st_name), "end") == 0
++	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0
++	    || strcmp ((char *) (symnames + symp->st_name), "edata") == 0)
+ 	  memcpy (&symp->st_value, &new_bss_addr, sizeof (new_bss_addr));
+     }
diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/pkg/PLIST ./pkg/PLIST
--- /usr/ports/korean/hanemacs/pkg/PLIST	Wed Sep  2 19:55:26 1998
+++ ./pkg/PLIST	Tue Jan 12 12:47:30 1999
@@ -8,6 +8,8 @@
 bin/emacsclient
 @exec if [ ! -d %d/share/hanemacs/site-lisp ]; then mkdir -p %D/share/hanemacs/site-lisp; fi
 @exec if [ ! -d %d/share/hanemacs/19.34/site-lisp ]; then mkdir -p %D/share/hanemacs/19.34/site-lisp; fi
+@exec mkdir -p /var/run/emacs/lock ; chmod 1777 /var/run/emacs/lock
+etc/rc.d/emacs.sh
 @comment these two can fail if other ports are installed, no need to
 @comment scare user in that case
 @unexec %D/share/hanemacs/site-lisp 2>/dev/null || true
@@ -134,6 +136,7 @@
 share/hanemacs/19.34/etc/DEBUG
 share/hanemacs/19.34/etc/DISTRIB
 share/hanemacs/19.34/etc/DOC-19.34.1
+share/hanemacs/19.34/etc/DOC-19.34.2
 share/hanemacs/19.34/etc/FAQ
 share/hanemacs/19.34/etc/FTP
 share/hanemacs/19.34/etc/GNU
diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/u ./u
--- /usr/ports/korean/hanemacs/u	Thu Jan  1 09:00:00 1970
+++ ./u	Tue Jan 12 12:58:56 1999
@@ -0,0 +1,178 @@
+diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/Makefile ./Makefile
+--- /usr/ports/korean/hanemacs/Makefile	Sat Nov 21 14:20:37 1998
++++ ./Makefile	Tue Jan 12 12:33:04 1999
+@@ -14,12 +14,11 @@
+ 
+ MAINTAINER=	junker@jazz.snu.ac.kr
+ 
+-BROKEN_ELF=	yes
+-
+ WRKSRC=		${WRKDIR}/hanemacs-19.34
+ GNU_CONFIGURE=	yes
+ USE_GMAKE=	yes
+-CONFIGURE_ARGS=	i386--freebsd --with-x-toolkit --prefix=${PREFIX}
++CONFIGURE_ARGS=	i386--freebsd --with-x-toolkit \
++		--sharedstatedir=/var/run
+ STRIP=
+ MAN1=		emacs.1 etags.1 ctags.1
+ 
+@@ -42,5 +41,10 @@
+ .for info in emacs vip viper forms gnus mh-e cl sc dired-x ediff ccmode message
+ 	install-info ${PREFIX}/info/${info} ${PREFIX}/info/dir
+ .endfor
++# install emacs.sh into ${PREFIX}/etc/rc.d
++	${MKDIR} /var/run/emacs/lock
++	chmod 1777 /var/run/emacs/lock
++	@${MKDIR} ${PREFIX}/etc/rc.d
++	@${INSTALL_SCRIPT} ${FILESDIR}/emacs.sh ${PREFIX}/etc/rc.d
+ 
+ .include <bsd.port.mk>
+diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/files/emacs.sh ./files/emacs.sh
+--- /usr/ports/korean/hanemacs/files/emacs.sh	Thu Jan  1 09:00:00 1970
++++ ./files/emacs.sh	Tue Jan 12 12:05:20 1999
+@@ -0,0 +1,10 @@
++#!/bin/sh
++if [ -d /var/run/emacs/lock ]
++then
++    rm -f /var/run/emacs/lock/*
++else
++    mkdir -p /var/run/emacs/lock
++fi
++chmod 1777 /var/run/emacs/lock
++exit 0
++
+diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/patches/patch-ac ./patches/patch-ac
+--- /usr/ports/korean/hanemacs/patches/patch-ac	Mon May 18 07:25:59 1998
++++ ./patches/patch-ac	Tue Jan 12 12:01:04 1999
+@@ -1,33 +1,69 @@
+---- src/s/freebsd.h.orig	Sun Jun  9 13:14:32 1996
+-+++ src/s/freebsd.h	Wed Dec  3 17:36:40 1997
+-@@ -33,9 +33,16 @@
++--- orig/s/freebsd.h	Mon Jun 10 05:14:32 1996
+++++ src/s/freebsd.h	Tue Sep 29 11:35:32 1998
++@@ -1,5 +1,15 @@
++ /* s/ file for freebsd system.  */
+  
+- #define LIBS_DEBUG
+- #define LIBS_SYSTEM -lutil
+--#define LIBS_TERMCAP -ltermcap
+- #define LIB_GCC -lgcc
+- 
+-+#ifdef HAVE_LIBNCURSES
+-+#define TERMINFO
+-+#define LIBS_TERMCAP -lncurses
+++/* Get the correct __FreeBSD_version, even if this is before that was
+++   defined. */
+++#ifndef __FreeBSD__
+++#define __FreeBSD_version 199401
+++#elif __FreeBSD__ == 1
+++#define __FreeBSD_version 199405
+ +#else
+-+#define LIBS_TERMCAP -ltermcap
+++#include <osreldate.h>
+ +#endif
+ +
+-+
++ /* '__FreeBSD__' is defined by the preprocessor on FreeBSD-1.1 and up.
++    Earlier versions do not have shared libraries, so inhibit them.
++    You can inhibit them on newer systems if you wish
++@@ -34,7 +44,6 @@
++ #define LIBS_DEBUG
++ #define LIBS_SYSTEM -lutil
++ #define LIBS_TERMCAP -ltermcap
++-#define LIB_GCC -lgcc
++ 
+  #define SYSV_SYSTEM_DIR
+  
+- /* freebsd has POSIX-style pgrp behavior. */
+-@@ -46,7 +53,7 @@
++@@ -42,12 +51,28 @@
++ #undef BSD_PGRPS
++ #define GETPGRP_NO_ARG
++ 
+++#ifdef __ELF__
+++
+++#define LD_SWITCH_SYSTEM
+++#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
+++#undef LIB_GCC
+++#define LIB_GCC
+++
+++#else /* not __ELF__ */
+++
++ #ifndef NO_SHARED_LIBS
+  #define LD_SWITCH_SYSTEM -e start -dc -dp
+  #define HAVE_TEXT_START		/* No need to define `start_of_text'. */
+++#if __FreeBSD_version >= 300002
+++#define START_FILES pre-crt0.o /usr/lib/aout/crt0.o
+++#else /* __FreeBSD_version < 300002 */
+  #define START_FILES pre-crt0.o /usr/lib/crt0.o
+ -#define UNEXEC unexsunos4.o
+++#endif /* __FreeBSD_version < 300002 */
+ +#define UNEXEC unexfreebsd.o
+  #define RUN_TIME_REMAP
+++#define LIB_GCC -lgcc
+  
+  #ifndef N_TRELOFF
+-@@ -80,6 +87,8 @@
++ #define N_PAGSIZ(x) __LDPGSZ
++@@ -63,6 +88,8 @@
++ #endif /* __FreeBSD__ */
++ #endif /* NO_SHARED_LIBS */
++ 
+++#endif /* not __ELF__ */
+++
++ #define HAVE_WAIT_HEADER
++ #define HAVE_GETLOADAVG
++ /*#define HAVE_GETPAGESIZE  /* configure now puts this in config.h */
++@@ -80,6 +107,8 @@
+  #define BSD 199103
+  #elif __FreeBSD__ == 2
+  #define BSD 199306
+diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/patches/patch-af ./patches/patch-af
+--- /usr/ports/korean/hanemacs/patches/patch-af	Thu Jan  1 09:00:00 1970
++++ ./patches/patch-af	Tue Jan 12 12:02:02 1999
+@@ -0,0 +1,22 @@
++--- src/unexelf.c.orig	Fri Oct  2 12:55:43 1998
+++++ src/unexelf.c	Fri Oct  2 13:02:05 1998
++@@ -678,7 +678,8 @@
++   if (n < 0)
++     fatal ("Couldn't find segment next to .bss in %s\n", old_name, 0);
++ 
++-  NEW_PROGRAM_H (n).p_filesz += new_data2_size;
+++/*  NEW_PROGRAM_H (n).p_filesz += new_data2_size; */
+++  NEW_PROGRAM_H (n).p_filesz = new_bss_addr - NEW_PROGRAM_H (n).p_vaddr; /* From emacs 20.3 */
++   NEW_PROGRAM_H (n).p_memsz = NEW_PROGRAM_H (n).p_filesz;
++ 
++ #if 0 /* Maybe allow section after data2 - does this ever happen? */
++@@ -845,7 +846,9 @@
++ 
++       for (; symp < symendp; symp ++)
++ 	if (strcmp ((char *) (symnames + symp->st_name), "_end") == 0
++-	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0)
+++	    || strcmp ((char *) (symnames + symp->st_name), "end") == 0
+++	    || strcmp ((char *) (symnames + symp->st_name), "_edata") == 0
+++	    || strcmp ((char *) (symnames + symp->st_name), "edata") == 0)
++ 	  memcpy (&symp->st_value, &new_bss_addr, sizeof (new_bss_addr));
++     }
+diff -uNr -x work -x README.html /usr/ports/korean/hanemacs/pkg/PLIST ./pkg/PLIST
+--- /usr/ports/korean/hanemacs/pkg/PLIST	Wed Sep  2 19:55:26 1998
++++ ./pkg/PLIST	Tue Jan 12 12:47:30 1999
+@@ -8,6 +8,8 @@
+ bin/emacsclient
+ @exec if [ ! -d %d/share/hanemacs/site-lisp ]; then mkdir -p %D/share/hanemacs/site-lisp; fi
+ @exec if [ ! -d %d/share/hanemacs/19.34/site-lisp ]; then mkdir -p %D/share/hanemacs/19.34/site-lisp; fi
++@exec mkdir -p /var/run/emacs/lock ; chmod 1777 /var/run/emacs/lock
++etc/rc.d/emacs.sh
+ @comment these two can fail if other ports are installed, no need to
+ @comment scare user in that case
+ @unexec %D/share/hanemacs/site-lisp 2>/dev/null || true
+@@ -134,6 +136,7 @@
+ share/hanemacs/19.34/etc/DEBUG
+ share/hanemacs/19.34/etc/DISTRIB
+ share/hanemacs/19.34/etc/DOC-19.34.1
++share/hanemacs/19.34/etc/DOC-19.34.2
+ share/hanemacs/19.34/etc/FAQ
+ share/hanemacs/19.34/etc/FTP
+ share/hanemacs/19.34/etc/GNU
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901120401.NAA05614>