mkid diffs for SysV3.2

Admin root at segpc.UUCP
Fri Dec 14 15:57:34 AEST 1990


I am really glad that we've been given a new version of mkid!  Anyway, following
are diffs for compiling mkid under Esix SVR3.2/386.  They ought probably to
suffice for most SysV-ish machines.  Note that you also will want to remove
the mkdep-generated header header dependencies in Makefile.
	-scott garfinkle
diff -c mkid/Makefile new_mkid/Makefile
*** mkid/Makefile	Thu Dec 13 22:15:55 1990
--- new_mkid/Makefile	Thu Dec 13 23:49:42 1990
***************
*** 32,39 ****
  #   it, set `RANLIB' to something harmless like `@:', or `echo'
  # --------------------------------------------------------------------
  
! DEFS	=	-Dvoid=int -DREGEX -DTERMIO	# typical System-V defs
! # DEFS	=	-DREGEX -DNDIR -DTERMIO	# typical System-V defs
  # DEFS	=	-Dvoid=int -DRINDEX -DRE_EXEC -DNDIR	# typical V7 defs
  # DEFS	=	-Dvoid=int -DRINDEX -DRE_EXEC -DERRLINEBUF	# BSD defs
  
--- 32,39 ----
  #   it, set `RANLIB' to something harmless like `@:', or `echo'
  # --------------------------------------------------------------------
  
! # DEFS	=	-Dvoid=int -DREGEX -DTERMIO	# typical System-V defs
! DEFS	=	-DMAXPATHLEN=1024 -DREGEX -DNDIR -DTERMIO -DGETCWD
  # DEFS	=	-Dvoid=int -DRINDEX -DRE_EXEC -DNDIR	# typical V7 defs
  # DEFS	=	-Dvoid=int -DRINDEX -DRE_EXEC -DERRLINEBUF	# BSD defs
  
***************
*** 53,73 ****
  
  # CCFLG	=	-g -DDEBUG 	# debugging
  # CCFLG	=	-p	# profiling
! CCFLG	=	-O3 -g	# production
  
  # LDFLG	=	-g	# debugging
  # LDFLG	=	-p	# profiling
  LDFLG	=	# production
  
- CC	=	hc
- 
  # --------------------------------------------------------------------
  
! SHELL =		/bin/ksh
  TARGETS =	libid.a $(PROGS)
  PROGS =		mkid lid idx fid iid $(LIDLINKS)
! DESTINATION_DIR = /usr/local
! MANDIR =        /usr/catman/local_man/man1
  
  LIDLINKS = 	gid aid eid pid
  CFLAGS =	$(CCFLG) -I. $(DEFS)
--- 53,72 ----
  
  # CCFLG	=	-g -DDEBUG 	# debugging
  # CCFLG	=	-p	# profiling
! CCFLG	=	-O	# production
  
  # LDFLG	=	-g	# debugging
  # LDFLG	=	-p	# profiling
  LDFLG	=	# production
  
  # --------------------------------------------------------------------
  
! SHELL =		/bin/csh
  TARGETS =	libid.a $(PROGS)
  PROGS =		mkid lid idx fid iid $(LIDLINKS)
! DESTINATION_DIR = /usr/local/bin
! LIB_DIR = /usr/local/lib
! MANDIR =        /usr/local/man/man1
  
  LIDLINKS = 	gid aid eid pid
  CFLAGS =	$(CCFLG) -I. $(DEFS)
***************
*** 76,82 ****
  OFILES =	init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
  		bitops.o basename.o gets0.o getsFF.o paths.o opensrc.o \
  		stoi.o uerror.o document.o bitcount.o wmatch.o bitsvec.o \
! 		tty.o bzero.o scan-text.o cannoname.o kshgetwd.o unsymlink.o
  
  # --------------------------------------------------------------------
  
--- 75,81 ----
  OFILES =	init.o getscan.o scan-c.o scan-asm.o bsearch.o hash.o \
  		bitops.o basename.o gets0.o getsFF.o paths.o opensrc.o \
  		stoi.o uerror.o document.o bitcount.o wmatch.o bitsvec.o \
! 		tty.o scan-text.o cannoname.o kshgetwd.o #unsymlink.o bzero.o
  
  # --------------------------------------------------------------------
  
***************
*** 101,115 ****
  iid:		iid.o iidfun.o
  		$(CC) -o iid iid.o iidfun.o $(LDFLG) $(LIBS)
  
! iid.c:		iid.y
! 		rm -f iid.c
! 		yacc iid.y
! 		mv y.tab.c iid.c
! 
! iidfun.o:	iidfun.c iiddef.h
  
! iid.o:		iid.c iiddef.h
! 		$(CC) $(CFLAGS) -DDEF -c iid.c
  
  $(LIDLINKS): lid
  		-/bin/rm -f $@
--- 100,108 ----
  iid:		iid.o iidfun.o
  		$(CC) -o iid iid.o iidfun.o $(LDFLG) $(LIBS)
  
! iidfun.o:	iiddef.h
  
! iid.o:		iiddef.h
  
  $(LIDLINKS): lid
  		-/bin/rm -f $@
***************
*** 139,152 ****
  		-mv $(DESTINATION_DIR)/eid $(DESTINATION_DIR)/OLDeid
  		-mv $(DESTINATION_DIR)/pid $(DESTINATION_DIR)/OLDpid
  		-mv $(DESTINATION_DIR)/iid $(DESTINATION_DIR)/OLDiid
! 		-rm -f $(DESTINATION_DIR)/iid.help
  		cp mkid $(DESTINATION_DIR)/mkid
  		cp lid $(DESTINATION_DIR)/lid
  		cp idx $(DESTINATION_DIR)/idx
  		cp fid $(DESTINATION_DIR)/fid
  		cp iid $(DESTINATION_DIR)/iid
! 		cp iid.help $(DESTINATION_DIR)/iid.help
! 		chmod 444 $(DESTINATION_DIR)/iid.help
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/gid
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/aid
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/eid
--- 132,145 ----
  		-mv $(DESTINATION_DIR)/eid $(DESTINATION_DIR)/OLDeid
  		-mv $(DESTINATION_DIR)/pid $(DESTINATION_DIR)/OLDpid
  		-mv $(DESTINATION_DIR)/iid $(DESTINATION_DIR)/OLDiid
! 		-rm -f $(LIB_DIR)/iid.help
  		cp mkid $(DESTINATION_DIR)/mkid
  		cp lid $(DESTINATION_DIR)/lid
  		cp idx $(DESTINATION_DIR)/idx
  		cp fid $(DESTINATION_DIR)/fid
  		cp iid $(DESTINATION_DIR)/iid
! 		cp iid.help $(LIB_DIR)/iid.help
! 		chmod 444 $(LIB_DIR)/iid.help
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/gid
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/aid
  		ln $(DESTINATION_DIR)/lid $(DESTINATION_DIR)/eid
diff -c mkid/iid.y new_mkid/iid.y
*** mkid/iid.y	Thu Dec 13 22:16:02 1990
--- new_mkid/iid.y	Thu Dec 13 23:40:39 1990
***************
*** 3,9 ****
   * The main program, scanner, and parser are defined here.
   * The utility functions invoked from here are in iidfun.c
   */
! 
  #include "iiddef.h"
  
  %}
--- 3,9 ----
   * The main program, scanner, and parser are defined here.
   * The utility functions invoked from here are in iidfun.c
   */
! #define DEF
  #include "iiddef.h"
  
  %}
diff -c mkid/iiddef.h new_mkid/iiddef.h
*** mkid/iiddef.h	Thu Dec 13 22:15:56 1990
--- new_mkid/iiddef.h	Thu Dec 13 23:40:33 1990
***************
*** 24,30 ****
  #define HASH_SIZE 947                  /* size of hash table for file names */
  
  #ifndef HELPFILE
! #define HELPFILE "/usr/local/iid.help" /* The help file location */
  #endif
  
  #define INIT_FILES 8000                /* start with bits for this many */
--- 24,30 ----
  #define HASH_SIZE 947                  /* size of hash table for file names */
  
  #ifndef HELPFILE
! #define HELPFILE "/usr/local/lib/iid.help" /* The help file location */
  #endif
  
  #define INIT_FILES 8000                /* start with bits for this many */
***************
*** 38,44 ****
  #define MIN(a,b) (((a)>(b))?(b):(a))
  
  #ifndef PAGER
! #define PAGER "pg"
  #endif
  
  #define PROMPT "iid> "
--- 38,44 ----
  #define MIN(a,b) (((a)>(b))?(b):(a))
  
  #ifndef PAGER
! #define PAGER "more"
  #endif
  
  #define PROMPT "iid> "
diff -c mkid/kshgetwd.c new_mkid/kshgetwd.c
*** mkid/kshgetwd.c	Thu Dec 13 22:15:40 1990
--- new_mkid/kshgetwd.c	Thu Dec 13 22:40:05 1990
***************
*** 7,12 ****
--- 7,20 ----
  extern char * unsymlink();
  extern char * getwd();
  
+ #ifndef S_IFLNK
+ # define unsymlink(x) (x)
+ #endif
+ 
+ #ifdef GETCWD
+ #define getwd(x) getcwd(x,MAXPATHLEN)
+ #endif
+ 
  /* kshgetwd is a routine that acts just like getwd, but is optimized
   * for ksh users, taking advantage of the fact that ksh maintains
   * an environment variable named PWD holding path name of the
diff -c mkid/unsymlink.c new_mkid/unsymlink.c
*** mkid/unsymlink.c	Thu Dec 13 22:15:43 1990
--- new_mkid/unsymlink.c	Thu Dec 13 22:31:33 1990
***************
*** 52,57 ****
--- 52,58 ----
           /* we have a complete component name in partname, check it out */
           *d = '\0' ;
           if (lstat(partname, &statb) != 0) return(NULL) ;
+ #ifdef S_IFLNK
           if ((statb.st_mode & S_IFMT) == S_IFLNK) {
              /* This much of name is a symbolic link, do a readlink
               * and tack the bits and pieces together
***************
*** 70,76 ****
                 *d++ = *s++ ;
              }
              lastcomp = d ;
!          } else {
              /* Not a symlink, just keep scanning to next component */
              if (*s == '\0') break ;
              *d++ = *s++ ;
--- 71,79 ----
                 *d++ = *s++ ;
              }
              lastcomp = d ;
!          } else
! #endif /* S_IFLNK */
! 		 {
              /* Not a symlink, just keep scanning to next component */
              if (*s == '\0') break ;
              *d++ = *s++ ;



More information about the Alt.sources mailing list