pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/43363: update emulators/simh V3.8-1, with fixes for build on Linux



>Number:         43363
>Category:       pkg
>Synopsis:       update emulators/simh V3.8-1, with fixes for build on Linux
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed May 26 11:30:00 +0000 2010
>Originator:     Izumi Tsutsui
>Release:        NetBSD 5.99.22
>Organization:
>Environment:
System: NetBSD i386 / CentOS 5.4 i386
Architecture: i386
Machine: i386
>Description:
(1) simh V3.8-1 was out on 08-Feb-2009:
http://simh.trailing-edge.com/changes38.html

(2) simh pkgsrc build on CentOS fails:
---
===> Building for simh-3.8.0
gcc -std=c99 -O2 -U__STRICT_ANSI__ -g -lm  -I . PDP1/pdp1_lp.c \
 PDP1/pdp1_cpu.c PDP1/pdp1_stddev.c  PDP1/pdp1_sys.c PDP1/pdp1_dt.c \
 PDP1/pdp1_drm.c  PDP1/pdp1_clk.c PDP1/pdp1_dcs.c scp.c sim_console.c \
 sim_fio.c sim_timer.c sim_sock.c  sim_tmxr.c sim_ether.c sim_tape.c \ 
 -I PDP1 -o BIN/pdp1 -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib
/tmp/ccx23K8b.o: In function `sim_os_ms_sleep_init':
/usr/pkgsrc/emulators/simh/work/sim_timer.c:303: \
 undefined reference to `clock_getres'
collect2: ld returned 1 exit status
*** Error code 1
---
This is because patch-aa against makefile only handles NetBSD definitions.
(Linux needs -lrt for clock_getres())

>How-To-Repeat:
See above.

>Fix:
A dumb patch attached.

 * update DISTNAME, PKGNAME, and distinfo for V3.8-1
 * add MAKEFLAGS in pkgsrc Makefile to handle OSTYPE in dist makefile
 * revise patch-aa to handle non-NetBSD OSes in makefile
   (Darwin and Solaris are untested)
 * update patch-ac for upstream cosmetics
 * rewrite patch-ad to get proper inline defs,
   though upstream seems to disable SIM_INLINE macro
 * remove INSTALL_DATA_DIR per pkglint


Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/simh/Makefile,v
retrieving revision 1.29
diff -u -r1.29 Makefile
--- Makefile    25 Aug 2009 11:57:45 -0000      1.29
+++ Makefile    25 May 2010 16:32:24 -0000
@@ -1,8 +1,8 @@
 # $NetBSD: Makefile,v 1.29 2009/08/25 11:57:45 wiz Exp $
 #
 
-DISTNAME=      simhv38-0
-PKGNAME=       simh-3.8.0
+DISTNAME=      simhv38-1
+PKGNAME=       simh-3.8.1
 CATEGORIES=    emulators
 MASTER_SITES=  http://simh.trailing-edge.com/sources/
 EXTRACT_SUFX=  .zip
@@ -27,6 +27,7 @@
 INSTALLATION_DIRS=     bin share/simh share/doc/simh
 
 MAKE_FILE=             makefile
+MAKEFLAGS+=            OSTYPE=${OPSYS} USE_NETWORK=YES
 
 post-extract:
        ${MKDIR} ${WRKSRC}/BIN
@@ -37,9 +38,7 @@
                ${INSTALL_PROGRAM} $$BIN ${DESTDIR}${PREFIX}/bin/simh-$$BIN; \
                fi ;                                                    \
        done)
-       ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/simh
        ${INSTALL_DATA} ${WRKSRC}/VAX/ka655x.bin ${DESTDIR}${PREFIX}/share/simh
-       ${INSTALL_DATA_DIR} ${DESTDIR}${PREFIX}/share/doc/simh
        (cd ${WRKSRC} && for TXT in *.txt */*.txt; do                   \
                ${INSTALL_DATA} $$TXT ${DESTDIR}${PREFIX}/share/doc/simh;       
        \
        done)
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/simh/distinfo,v
retrieving revision 1.14
diff -u -r1.14 distinfo
--- distinfo    20 Nov 2008 21:30:05 -0000      1.14
+++ distinfo    25 May 2010 16:32:24 -0000
@@ -1,9 +1,9 @@
 $NetBSD: distinfo,v 1.14 2008/11/20 21:30:05 chuck Exp $
 
-SHA1 (simhv38-0.zip) = e1afbebede7dc4b2e0f7b13fca3ee6aa8d34f9c1
-RMD160 (simhv38-0.zip) = f1986d45f9b17a905957d1dca4eaa70098a7cae6
-Size (simhv38-0.zip) = 2775593 bytes
-SHA1 (patch-aa) = 427aa8eca1f1ac17f9279708e666d066b24dde7e
+SHA1 (simhv38-1.zip) = 5eac2f8e50be11600727983e05072690a7066702
+RMD160 (simhv38-1.zip) = f085c52ec92425f84f65b3f3605cb7aba8be7b32
+Size (simhv38-1.zip) = 2954982 bytes
+SHA1 (patch-aa) = 22b9c6f39606a6e7e2ce395c509938d7018b624b
 SHA1 (patch-ab) = 85b36e3d92a2bfbd886dbb2e08a0af967edeb0bd
-SHA1 (patch-ac) = 78ecdc9abe248eb8c9a1dc3c297a4a7e5eb812d6
-SHA1 (patch-ad) = 4ab9108d50bc89b41aea3efdf58cc95089137937
+SHA1 (patch-ac) = 16673f3bb5c42cdfd0497cd1f0657cbbe3bbecdb
+SHA1 (patch-ad) = ec0ed59793f4c84553e3156b9c241c8e00c2be13
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/simh/patches/patch-aa,v
retrieving revision 1.8
diff -u -r1.8 patch-aa
--- patches/patch-aa    1 Nov 2008 05:15:42 -0000       1.8
+++ patches/patch-aa    25 May 2010 16:32:24 -0000
@@ -1,14 +1,13 @@
-$NetBSD: patch-aa,v 1.8 2008/11/01 05:15:42 obache Exp $
+$NetBSD$
 
---- makefile.orig      2008-06-06 06:00:46.000000000 +0000
+--- makefile.orig      2008-11-19 12:53:48.000000000 +0000
 +++ makefile
-@@ -1,32 +1,36 @@
+@@ -1,32 +1,24 @@
  #
  # CC Command
  #
 -ifeq ($(WIN32),)
-+#ifeq ($(WIN32),)
-   #Unix Environments
+-  #Unix Environments
 -  ifneq (,$(findstring solaris,$(OSTYPE)))
 -    OS_CCDEFS = -lm -lsocket -lnsl -lrt -lpthread -D_GNU_SOURCE
 -  else
@@ -33,38 +32,28 @@
 -    NETWORK_OPT = -DUSE_NETWORK -lwpcap -lpacket
 -  endif
 -endif
-+#  ifneq (,$(findstring solaris,$(OSTYPE)))
-+#    OS_CCDEFS = -lm -lsocket -lnsl -lrt -lpthread -D_GNU_SOURCE
-+#  else
-+#    ifneq (,$(findstring darwin,$(OSTYPE)))
-+#      OS_CCDEFS = -D_GNU_SOURCE
-+#    else
-+#      OS_CCDEFS = -lrt -lm -D_GNU_SOURCE
-+#    endif
-+#  endif
-+#  CC = gcc -std=c99 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
-+CC ?= gcc
-+CC := ${CC} -std=c99 -O2 -U__STRICT_ANSI__ -g -lm $(OS_CCDEFS) -I .
-+#
-+#  ifeq ($(USE_NETWORK),)
-+#  else
-+#    NETWORK_OPT = -DUSE_NETWORK -isystem /usr/local/include 
/usr/local/lib/libpcap.a
-+     NETWORK_OPT = -DUSE_NETWORK -lpcap
-+#  endif
-+#else
-+#  #Win32 Environments
-+#  LDFLAGS = -lm -lwsock32 -lwinmm
-+#  CC = gcc -std=c99 -U__STRICT_ANSI__ -O2 -I.
-+#  EXE = .exe
-+#  ifeq ($(USE_NETWORK),)
-+#  else
-+#    NETWORK_OPT = -DUSE_NETWORK -lwpcap -lpacket
-+#  endif
-+#endif
++.if ${OSTYPE} == "SunOS"
++OS_CCDEFS = -lm -lsocket -lnsl -lrt -lpthread -D_GNU_SOURCE
++.elif ${OSTYPE} == "Darwin"
++OS_CCDEFS = -D_GNU_SOURCE
++.elif ${OSTYPE} == "Linux"
++OS_CCDEFS = -lrt -lm -D_GNU_SOURCE
++.elif ${OSTYPE} == "NetBSD"
++OS_CCDEFS = -lm -D_GNU_SOURCE
++.else
++OS_CCDEFS = -lm -D_GNU_SOURCE
++.endif
++
++CC ?= gcc -std=c99
++CC := ${CC} -O2 -U__STRICT_ANSI__ -g $(OS_CCDEFS) -I .
++
++.if ${USE_NETWORK} != "no"
++NETWORK_OPT= -DUSE_NETWORK -lpcap
++.endif
  
  #
  # Common Libraries
-@@ -259,11 +263,11 @@ ALL = pdp1 pdp4 pdp7 pdp8 pdp9 pdp15 pdp
+@@ -262,11 +254,11 @@
  all : ${ALL}
  
  clean :
Index: patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/simh/patches/patch-ac,v
retrieving revision 1.5
diff -u -r1.5 patch-ac
--- patches/patch-ac    1 Nov 2008 05:15:42 -0000       1.5
+++ patches/patch-ac    25 May 2010 16:32:24 -0000
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.5 2008/11/01 05:15:42 obache Exp $
+$NetBSD$
 
---- sim_console.c.orig 2006-10-01 14:26:58.000000000 +0200
+--- sim_console.c.orig 2008-11-20 04:50:44.000000000 +0000
 +++ sim_console.c
-@@ -391,7 +391,7 @@ for (i = 0; i < sec; i++) {             
+@@ -429,7 +429,7 @@
      if (tmxr_poll_conn (&sim_con_tmxr) >= 0) {          /* poll connect */
          sim_con_ldsc.rcve = 1;                          /* rcv enabled */
          if (i) {                                        /* if delayed */
@@ -11,9 +11,9 @@
              fflush (stdout);
              }
          return SCPE_OK;                                 /* ready to proceed */
-@@ -399,7 +399,7 @@ for (i = 0; i < sec; i++) {             
-     c = sim_os_poll_kbd ();                             /* check for stop 
char */
-     if ((c == SCPE_STOP) || stop_cpu) return SCPE_STOP;
+@@ -438,7 +438,7 @@
+     if ((c == SCPE_STOP) || stop_cpu)
+         return SCPE_STOP;
      if ((i % 10) == 0) {                                /* Status every 10 
sec */
 -        printf ("Waiting for console Telnet connection\n");
 +        printf ("Waiting for console Telnet connection\r\n");
Index: patches/patch-ad
===================================================================
RCS file: /cvsroot/pkgsrc/emulators/simh/patches/patch-ad,v
retrieving revision 1.1
diff -u -r1.1 patch-ad
--- patches/patch-ad    20 Nov 2008 21:30:05 -0000      1.1
+++ patches/patch-ad    25 May 2010 16:32:24 -0000
@@ -1,11 +1,12 @@
-$NetBSD: patch-ad,v 1.1 2008/11/20 21:30:05 chuck Exp $
+$NetBSD$
 
---- sim_defs.h.orig    2008-11-20 15:36:35.000000000 -0500
-+++ sim_defs.h 2008-11-20 15:40:40.000000000 -0500
-@@ -164,7 +164,20 @@
- /* Inlining */
+--- sim_defs.h.orig    2008-11-14 00:11:02.000000000 +0000
++++ sim_defs.h
+@@ -164,7 +164,24 @@
  
- #if defined (__GNUC__)                                  /* GCC */
+ /* Stubs for inlining */
+ 
++#if defined (__GNUC__)                                        /* GCC */
 +
 +#if defined(__APPLE_CC__) && (__APPLE_CC__ > 5400) && \
 +      (__APPLE_CC__ < 5488) && (__STDC_VERSION__ >= 199901L) && \
@@ -17,9 +18,12 @@
 +#ifdef __GNUC_STDC_INLINE__
 +#define SIM_INLINE extern inline
 +#else
- #define SIM_INLINE inline
++#define SIM_INLINE inline
 +#endif
 +
- #elif defined (_MSC_VER)                                /* Microsoft C 
Compilers */
- #define SIM_INLINE __inline
- #else                                                   /* default */
++#else /* !GCC */
+ #define SIM_INLINE
++#endif
+ 
+ /* System independent definitions */
+ 

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index