OSDN Git Service

use the autoconf/automake
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Thu, 30 Sep 1999 14:41:30 +0000 (14:41 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Thu, 30 Sep 1999 14:41:30 +0000 (14:41 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@7 6a8cc165-1e22-0410-a132-eb4e3f353aba

32 files changed:
IFNAMES [new file with mode: 0644]
Makefile.am [new file with mode: 0644]
Makefile.in.org [moved from Makefile with 72% similarity]
README.autoconf [new file with mode: 0644]
config.h.in [new file with mode: 0644]
configure.in [new file with mode: 0644]
man/Makefile [deleted file]
man/Makefile.am [new file with mode: 0644]
src/Makefile.am [new file with mode: 0644]
src/Makefile.in.org [moved from src/Makefile with 98% similarity]
src/append.c
src/crcio.c
src/dhuf.c
src/extract.c
src/header.c
src/huf.c
src/larc.c
src/lha.h
src/lha_macro.h
src/lhadd.c
src/lharc.c
src/lhdir.c
src/lhdir.h
src/lhext.c
src/lhlist.c
src/makefile.dj [deleted file]
src/maketbl.c
src/maketree.c
src/patmatch.c
src/shuf.c
src/slide.c
src/util.c

diff --git a/IFNAMES b/IFNAMES
new file mode 100644 (file)
index 0000000..c329fe8
--- /dev/null
+++ b/IFNAMES
@@ -0,0 +1,61 @@
+# -*- text -*-
+# this file was generated by `ifnames' utility.
+
+AIX lha.h lha_macro.h slide.c
+ARCHIVENAME_EXTENTION lha_macro.h
+BACKUPNAME_EXTENTION lha_macro.h
+CHAR_BIT lha_macro.h
+DEBUG slide.c
+DIRBLKSIZ lhdir.h
+DIRSIZ lhdir.c
+# EUC crcio.c lha.h lharc.c            --enable-text-conv
+EXTEND_TOWNSOS lhlist.c
+# FTIME header.c                       replace with HAVE_FTIME
+# GETTIMEOFDAY header.c                        replace with HAVE_GETTIMEOFDAY
+# SYSV_SYSTEM_DIR lha_macro.h          replace with HAVE_DIRENT_H
+# HAVE_TM_ZONE header.c                        replace with HAVE_TM_GMTOFF
+LHA_MAIN_SRC lha.h lha_macro.h
+# LONG_MAX lha_macro.h
+# LONG_MIN lha_macro.h
+MKDIRPATH util.c
+# MKTIME header.c                      replace with HAVE_MKTIME
+MSDOS lha_macro.h
+# MULTIBYTE_CHAR header.c lha_macro.h util.c   --enable-multibyte-filename
+# NEED_INCREMENTAL_INDICATOR append.c crcio.c lha.h    --enable-indicator
+NEWSOS huf.c                           use HAVE_STDLIB_H ???
+# NOBSTRING lha_macro.h util.c         use memset(), memcpy()
+NODIRECTORY lha_macro.h lharc.c
+# NOFTRUNCATE lhadd.c util.c           replace with !HAVE_FTRUNCATE
+# NOINDEX lha_macro.h                  use strchr(), strrchr()
+# NOMEMSET util.c                      replace with !HAVE_MEMSET
+# NOMKDIR util.c                       replace with !HAVE_MKDIR
+NONSYSTEM_DIR_LIBRARY lha_macro.h      no use (???)
+# NOSTRDUP util.c                      replace with !HAVE_STRDUP
+NOT_COMPATIBLE_MODE header.c lhext.c
+NOT_USED header.c
+NOVOID lha_macro.h
+# NO_INODE lharc.c                     replace with !HAVE_ST_INO (???)
+# HAVE_NO_LCHOWN lhext.c               replace with !HAVE_LCHOWN
+NULL lha_macro.h
+OSK header.c
+O_RDONLY lhdir.c
+RMDIRPATH util.c
+SEEK_SET lha_macro.h
+SHRT_MAX lha_macro.h
+SHRT_MIN lha_macro.h
+# SUPPORT_LH6 lharc.c                  use configure --enable-lh6
+S_IFLNK header.c lha_macro.h lhadd.c lharc.c lhext.c
+# TIMELOCAL header.c                   replace with HAVE_TIMELOCAL
+TIMEZONE_HOOK header.c
+# TMP_FILENAME_TEMPLATE lha_macro.h lhadd.c lharc.c    --with-tmp-file
+# SYSTIME_HAS_NO_TM lha_macro.h                replace with TM_IN_SYS_TIME
+# TZSET header.c                       replace with HAVE_TZSET
+UCHAR_MAX lha_macro.h
+UINT_MAX maketree.c
+ULONG_MAX lha_macro.h
+# USESTRCASECMP lha_macro.h util.c     replace with HAVE_STRCASECMP
+USE_PROF lharc.c
+# USHRT_MAX lha_macro.h
+# _MINIX header.c lha_macro.h util.c   use AC_MINIX in configure.in
+__STDC__ huf.c lha.h lha_macro.h slide.c util.c
+sony_news huf.c
diff --git a/Makefile.am b/Makefile.am
new file mode 100644 (file)
index 0000000..eb50768
--- /dev/null
@@ -0,0 +1,7 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = CHANGES.euc MACHINES.euc MACHINES2.euc PROBLEMS.euc README.euc \
+       change-114e.txt change-114f.txt config.eng config.jpn.euc \
+       header.doc.euc IFNAMES
+SUBDIRS= man src
similarity index 72%
rename from Makefile
rename to Makefile.in.org
index ce0d4b0..2bff6d8 100644 (file)
--- a/Makefile
 #      SWITCHES macro definitions ... see config.eng or config.jpn.
 #-----------------------------------------------------------------------
 
-SHELL=/bin/sh
-MAKE = make
+top_srcdir=@top_srcdir@
+srcdir=@srcdir@
+SHELL=@SHELL@
+@SET_MAKE@
 
-#CC                    = cc
-CC                     = gcc
-SWITCHES       = -DNEED_INCREMENTAL_INDICATOR \
- -DTMP_FILENAME_TEMPLATE="\"/tmp/lhXXXXXX\""
+CC                     = @CC@
+SWITCHES       = @DEF_KCODE@ @DEFS@ -I$(top_srcdir)/..
+OPTIMIZE       = 
 
-#MACHINE     = -DSYSTIME_HAS_NO_TM -DFTIME -DEUC
-#MACHINE     = -DSYSTIME_HAS_NO_TM -DEUC -DHAVE_TM_ZONE -DSYSV_SYSTEM_DIR
-MACHINE     = -DSYSTIME_HAS_NO_TM -DEUC -DSYSV_SYSTEM_DIR -DMKTIME
+prefix = @prefix@
+exec_prefix = @exec_prefix@
 
-#OPTIMIZE      = -O2 -fstrength-reduce -fomit-frame-pointer
-OPTIMIZE       = -O2 -DSUPPORT_LH6
-
-BINDIR = /usr/local/bin
-MANDIR = /usr/local/man
+BINDIR = @bindir@
+MANDIR = @mandir@
 MANSECT = n
 
-INSTALL = install
-INSTALLBIN = -s -m 755
-INSTALLMAN = -m 644
+INSTALL = @INSTALL@
+INSTALLBIN = @INSTALL_PROGRAM@
+INSTALLMAN = @INSTALL_DATA@
 
 SUBDIRS = src man
 
-O              = .o
+O              = .@OBJEXT@
 
 # missing library objects.
 #      memset$(O) lhdir$(O)
diff --git a/README.autoconf b/README.autoconf
new file mode 100644 (file)
index 0000000..34d80e7
--- /dev/null
@@ -0,0 +1,42 @@
+# -*- Mode: text ; Coding: euc-japan -*-
+
+autoconfiguration for LHa for UNIX version 1.14f
+                                       Thu, Sep 30 1999 by Koji Arai
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤ÏLHa for UNIX version 1.14f ¤òautoconf¡¢automake²½
+¤·¤¿¤È¤­¤Î¥á¥â¤Ç¤¹¡£
+
+¡¦¥Þ¥¯¥í¤ÎÃÖ¤­´¹¤¨
+
+  ¥ª¥ê¥¸¥Ê¥ë¤Îlha-1.14f ¤Ç»È¤ï¤ì¤Æ¤¤¤¿¥Þ¥¯¥í¤Ïautoconfɸ½à¤Î¥Þ¥¯¥í̾¤Ë
+  ÃÖ¤­´¹¤¨¤é¤ì¤Þ¤·¤¿¡£(IFNAMES¥Õ¥¡¥¤¥ë¤Ë¾ÜºÙ¤¬½ñ¤«¤ì¤Æ¤¤¤Þ¤¹)
+
+  IFNAMES¥Õ¥¡¥¤¥ë¤Ï¡¢
+     ¥Þ¥¯¥í̾ ÄêµÁ¤Î¤¢¤ë¥Õ¥¡¥¤¥ë...  ¥³¥á¥ó¥È
+  ¤È¤¤¤¦¹½À®¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ïautoconf¤È°ì½ï¤ËÇÛÉÛ¤µ¤ì¤ë
+  ifnames¥³¥Þ¥ó¥É¤ÇÀ¸À®¤·¤Þ¤·¤¿¡£
+  IFNAMES¥Õ¥¡¥¤¥ë¤Î# ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¹Ô¤Ï³ºÅö¤Î¥Þ¥¯¥í¤¬ÃÖ¤­´¹¤¨¤é¤ì¤¿¤ê¡¢
+  configure ¥³¥Þ¥ó¥É¤Î¥³¥Þ¥ó¥É¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤³¤È¤ò
+  ¼¨¤·¤Þ¤¹¡£¤½¤Î¤Þ¤Þ¤Î¹Ô¤Ïautoconf¤ÇȽÃǤ¹¤ëɬÍפ¬¤Ê¤¤¤«¤Þ¤¿¤Ï»ä¤¬È½ÃÇ
+  ¤Ç¤­¤Ê¤¤¤¿¤á¡¢¤½¤Î¤Þ¤ÞÊüÃÖ¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
+
+¡¦GPL
+  automake ¤Ï¡¢--foreign ÉÕ¤­¤Ç½èÍý¤·¤Þ¤·¤¿¡£¤¤¤¯¤Ä¤«¤ÎGNU¥æ¡¼¥Æ¥£¥ê¥Æ¥£
+  (config.guess, config.sub, install-sh, missing, mkinstalldirs)¤¬´Þ¤Þ
+  ¤ì¤Æ¤¤¤ë¤¿¤á¡¢GPL2¤¬µ­½Ò¤µ¤ì¤¿¥Õ¥¡¥¤¥ëCOPYING¤òƱº­¤·¤Þ¤·¤¿¤¬¡¢
+  Lha for UNIX¼«ÂΤÏGPL¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
+
+¡¦-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼¥«¥¤¥ÖºîÀ®
+
+  lha 1.14f ¤Ç¤Ï¡¢SUPPORT_LH6¤ÎÄêµÁ¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¡¢-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼
+  ¥«¥¤¥Ö¤òºîÀ®¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿¡£¤³¤Î¤³¤È¤ÏÊ̤˹½¤ï¤Ê¤¤¤Î¤Ç¤¹¤¬
+  SUPPORT_LH6¤òÄêµÁ¤¹¤ë¤È¥Ç¥Õ¥©¥ë¥È¤Ç-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼¥«¥¤¥ÖºîÀ®¤ò¶¯
+  À©¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¤½¤³¤Ç¡¢¤â¤¦¾¯¤·½ÀÆð¤ËlhaÍøÍѼԤ¬¤³¤ì¤é¤òÁªÂò¤Ç
+  ¤­¤ë¤è¤¦SUPPORT_LH6¤ÎµóÆ°¤ò¥Ç¥Õ¥©¥ë¥È¤ÇºîÀ®¤¹¤ë¥¢¡¼¥«¥¤¥Ö¥á¥½¥Ã¥É¤Î
+  Êѹ¹¤Ë¤·¡¢¤³¤Î¥Þ¥¯¥íÄêµÁ(configure¤Ç¤Ï--enable-lh6¥Õ¥é¥°)¤Î¤¢¤ë¤Ê¤·
+  ¤Ë¤è¤é¤º¡¢o6¥ª¥×¥·¥ç¥ó¤Ç- lh6-¥¢¡¼¥«¥¤¥Ö¤òºîÀ®¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
+
+  ¤Þ¤¿¡¢configure¤Î¥Ç¥Õ¥©¥ë¥È¤ÏSUPPORT_LH6¤òÄêµÁ¤·¤Þ¤»¤ó¡£½¾¤Ã¤Æ¡¢¥Ç¥Õ¥©
+  ¥ë¥È¤ÇºîÀ®¤µ¤ì¤ë¥¢¡¼¥«¥¤¥Ö¤Î¥á¥½¥Ã¥É¤Ï-lh5-¤Ç¤¹¡£(¾å¤Ç½Ò¤Ù¤¿Ä̤ꡢ
+  lha¤Î o6 ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê¤¤¤Ä¤Ç¤â-lh6-¤ÇºîÀ®¤Ç¤­¡¢configure¥ª¥×¥·¥ç
+  ¥ó¤Ë¤è¤ê¥Ç¥Õ¥©¥ë¥È¤ÎµóÆ°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹)
diff --git a/config.h.in b/config.h.in
new file mode 100644 (file)
index 0000000..3484078
--- /dev/null
@@ -0,0 +1,124 @@
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* Define if your struct tm has tm_zone.  */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have tm_zone but do have the external array
+   tzname.  */
+#undef HAVE_TZNAME
+
+/* Define if utime(file, NULL) sets file's timestamp to the present.  */
+#undef HAVE_UTIME_NULL
+
+/* Define if on MINIX.  */
+#undef _MINIX
+
+/* Define if the system does not provide POSIX.1 features except
+   with this defined.  */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work.  */
+#undef _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void).  */
+#undef RETSIGTYPE
+
+/* Define if you have the ANSI C header files.  */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>.  */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm.  */
+#undef TM_IN_SYS_TIME
+
+/* Define if you have the ftime function.  */
+#undef HAVE_FTIME
+
+/* Define if you have the ftruncate function.  */
+#undef HAVE_FTRUNCATE
+
+/* Define if you have the gettimeofday function.  */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the lchown function.  */
+#undef HAVE_LCHOWN
+
+/* Define if you have the memcpy function.  */
+#undef HAVE_MEMCPY
+
+/* Define if you have the memset function.  */
+#undef HAVE_MEMSET
+
+/* Define if you have the mkdir function.  */
+#undef HAVE_MKDIR
+
+/* Define if you have the mktime function.  */
+#undef HAVE_MKTIME
+
+/* Define if you have the rmdir function.  */
+#undef HAVE_RMDIR
+
+/* Define if you have the strcasecmp function.  */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function.  */
+#undef HAVE_STRCHR
+
+/* Define if you have the strdup function.  */
+#undef HAVE_STRDUP
+
+/* Define if you have the timelocal function.  */
+#undef HAVE_TIMELOCAL
+
+/* Define if you have the tzset function.  */
+#undef HAVE_TZSET
+
+/* Define if you have the <dirent.h> header file.  */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file.  */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <limits.h> header file.  */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <ndir.h> header file.  */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <sys/dir.h> header file.  */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/file.h> header file.  */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/ndir.h> header file.  */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/time.h> header file.  */
+#undef HAVE_SYS_TIME_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* Define if your struct tm has tm_gmtoff */
+#undef HAVE_TM_GMTOFF
+
+/* Define if your struct stat has st_ino */
+#undef HAVE_ST_INO
+
+/* Define if you want to use the -lh6- method, default */
+#undef SUPPORT_LH6
+
+/* temporary file template */
+#undef TMP_FILENAME_TEMPLATE
+
+/* Define you want to use the incremental indicator */
+#undef NEED_INCREMENTAL_INDICATOR
+
+/* Define you want to use multibyte filename */
+#undef MULTIBYTE_CHAR
+
diff --git a/configure.in b/configure.in
new file mode 100644 (file)
index 0000000..396bcdd
--- /dev/null
@@ -0,0 +1,126 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/lha.h)
+AM_INIT_AUTOMAKE(lha, 1.14f)
+AM_CONFIG_HEADER(config.h)
+
+AC_CANONICAL_HOST
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_GCC_TRADITIONAL
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+dnl on MINIX, define _MINIX and _POSIX_SOURCE
+AC_MINIX
+
+AC_EXEEXT
+AC_OBJEXT
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/time.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
+
+AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
+[AC_TRY_COMPILE([
+#if TM_IN_SYS_TIME
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+  ], [struct tm t; t.tm_gmtoff;],
+  ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
+])
+
+if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
+  AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
+fi
+
+AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/stat.h>
+  ], [struct stat s; s.st_ino;],
+  ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
+])
+
+if test "x$ac_cv_struct_st_ino" = xyes; then
+  AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
+fi
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+AC_FUNC_UTIME_NULL
+AC_CHECK_FUNCS(strchr memcpy)
+AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday)
+AC_CHECK_FUNCS(mkdir rmdir strdup memset ftruncate lchown)
+AC_CHECK_FUNCS(strcasecmp)
+
+AC_SUBST(LIBOBJS)
+if test $ac_header_dirent = no; then
+  LIBOBJS="$LIBOBJS lhdir.o"
+fi
+
+dnl support kanji code conversion
+AC_SUBST(DEF_KCODE)
+AC_ARG_ENABLE(text_conv,
+  [  --enable-text-conv      support text code convert from/to EUC [default=yes]],
+  , enable_text_conv=yes)
+
+if test $enable_text_conv = yes; then
+  DEF_KCODE=-DEUC
+fi
+
+dnl whether use the -lh6- method
+AC_ARG_ENABLE(lh6,
+  [  --enable-lh6            create the -lh6- archive default [default=no]],
+  , enable_lh6=no)
+
+if test "x$enable_lh6" = "xyes"; then
+  AC_DEFINE(SUPPORT_LH6, 1, [Define if you want to use the -lh6- method, default])
+fi
+
+dnl decide path names
+AC_MSG_CHECKING(template of the temporary file is )
+AC_ARG_WITH(tmp_file,
+  [  --with-tmp-file=TEMPLATE temporary file template [default=/tmp/lhXXXXXX]],
+  [case $withval in
+   yes|no) AC_MSG_ERROR(you should have specified path name);;
+   esac],
+  with_tmp_file=/tmp/lhXXXXXX)
+
+AC_MSG_RESULT($with_tmp_file)
+AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
+  [temporary file template])
+
+dnl incremental indicator
+AC_ARG_ENABLE(indicator,
+  [  --enable-indicator      need incremental indicator [default=yes]],
+  ,
+  # default
+  enable_indicator=yes)
+
+if test "x$enable_indicator" = xyes; then
+  AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
+fi
+
+dnl support multibyte filename
+AC_ARG_ENABLE(multibyte-char,
+  [  --enable-multibyte-char support multibyte(sjis) filename [default=yes]],
+  ,
+  # default
+  enable_multibyte_char=yes)
+
+if test "x$enable_multibyte_char" = xyes; then
+  AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
+fi
+
+AC_OUTPUT([Makefile src/Makefile man/Makefile])
diff --git a/man/Makefile b/man/Makefile
deleted file mode 100644 (file)
index dc3e0d5..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################
-# Makefile for LHa man directory
-################################################################
-
-NROFF = nroff
-#NROFF = jman
-
-all:   lha.man
-
-lha.man: lha.n
-       $(NROFF) -man lha.n > lha.man
-
-install:
-       $(INSTALL) $(INSTALLMAN) lha.n $(MANDIR)/man$(MANSECT)/lha.$(MANSECT)
-
-clean:
-       rm -f *~
-
-moreclean:
-       rm -f lha.man core *~ *.orig
diff --git a/man/Makefile.am b/man/Makefile.am
new file mode 100644 (file)
index 0000000..8ebf88c
--- /dev/null
@@ -0,0 +1,6 @@
+## Process this file with automake to produce Makefile.in
+man_MANS = lha.n
+EXTRA_DIST = $(man_MANS) lha.man
+
+#lha.man: lha.n
+#      $(NROFF) -man lha.n > lha.man
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644 (file)
index 0000000..5a61364
--- /dev/null
@@ -0,0 +1,8 @@
+## Process this file with automake to produce Makefile.in
+bin_PROGRAMS = lha
+lha_SOURCES = append.c crcio.c dhuf.c extract.c header.c huf.c larc.c lha.h \
+       lha_macro.h lhadd.c lharc.c lhext.c lhlist.c \
+       maketbl.c maketree.c patmatch.c shuf.c slide.c util.c
+lha_LDADD = @LIBOBJS@
+EXTRA_DIST = lhdir.c lhdir.h
+AM_CPPFLAGS=$(DEF_KCODE)
similarity index 98%
rename from src/Makefile
rename to src/Makefile.in.org
index 66c038e..fe38f42 100644 (file)
@@ -48,5 +48,6 @@ clean:
 moreclean:
        rm -f core *.o lha.tar lha.tar.Z *~ \#* *.orig
 
-install:
+install: lha
+       strip lha
        $(INSTALL) $(INSTALLBIN) lha $(BINDIR)/lha
index c30526e..cd1dd44 100644 (file)
@@ -130,3 +130,6 @@ finish_indicator(name, msg)
 #endif
        fflush(stdout);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 6f28aa7..4c38dda 100644 (file)
@@ -356,3 +356,6 @@ calc_header_crc(p, n)               /* Thanks T.Okamoto */
                UPDATE_CRC(*p++);
        return crc;
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index bde60e3..8865b96 100644 (file)
@@ -342,3 +342,6 @@ encode_end_dyn( /* void */ )
 {
        putcode(7, 0);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index ff0fdd8..f760d96 100644 (file)
@@ -59,3 +59,6 @@ decode_lzhuf(infp, outfp, original_size, packed_size, name, method)
 
        return crc;
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index ae80731..7797739 100644 (file)
@@ -81,7 +81,36 @@ msdos_to_unix_filename(name, len)
 {
        register int    i;
 
+#define HANKAKU_KATAKANA_P(c)\
+       (0xa0 < (unsigned char)(c) && (unsigned char)(c) < 0xe0)
+
 #ifdef MULTIBYTE_CHAR
+#ifdef SUPPORT_X0201
+       for (i = 0; i < len; i++) {
+               /* modified by Koji Arai */
+               if (HANKAKU_KATAKANA_P(name[i])) {
+                       int j;
+                       for (j = len; j >= i; j--) {
+                               name[j+1] = name[j]; /* no check over */
+                       }
+                       name[i] = 0x8e;
+                       i++;
+                       len++;
+               } else
+               if (MULTIBYTE_FIRST_P(name[i]) &&
+                   MULTIBYTE_SECOND_P(name[i + 1])) {
+                       int c1, c2;
+                       c1 = name[i]; c2 = name[i+1];
+                       sjis2euc(&c1, &c2);
+                       name[i] = c1; name[i+1] = c2;
+                       i++;
+               }
+               else if (name[i] == '\\')
+                       name[i] = '/';
+               else if (isupper(name[i]))
+                       name[i] = tolower(name[i]);
+       }
+#else
        for (i = 0; i < len; i++) {
                if (MULTIBYTE_FIRST_P(name[i]) &&
                    MULTIBYTE_SECOND_P(name[i + 1]))
@@ -91,6 +120,7 @@ msdos_to_unix_filename(name, len)
                else if (isupper(name[i]))
                        name[i] = tolower(name[i]);
        }
+#endif /* SUPPORT_X0201 */
 #else
        for (i = 0; i < len; i++) {
                if (name[i] == '\\')
@@ -111,6 +141,28 @@ generic_to_unix_filename(name, len)
        boolean         lower_case_used = FALSE;
 
 #ifdef MULTIBYTE_CHAR
+#ifdef SUPPORT_X0201
+       for (i = 0; i < len; i++) {
+               /* modified by Koji Arai */
+               if (HANKAKU_KATAKANA_P(name[i])) {
+                       int j;
+                       for (j = len; j >= i; j--) {
+                               name[j+1] = name[j]; /* no check over */
+                       }
+                       name[i] = 0x8e;
+                       i++;
+                       len++;
+               } else
+
+               if (MULTIBYTE_FIRST_P(name[i]) &&
+                   MULTIBYTE_SECOND_P(name[i + 1]))
+                       i++;
+               else if (islower(name[i])) {
+                       lower_case_used = TRUE;
+                       break;
+               }
+       }
+#else
        for (i = 0; i < len; i++) {
                if (MULTIBYTE_FIRST_P(name[i]) &&
                    MULTIBYTE_SECOND_P(name[i + 1]))
@@ -120,6 +172,7 @@ generic_to_unix_filename(name, len)
                        break;
                }
        }
+#endif /* SUPPORT_X0201 */
        for (i = 0; i < len; i++) {
                if (MULTIBYTE_FIRST_P(name[i]) &&
                    MULTIBYTE_SECOND_P(name[i + 1]))
@@ -152,12 +205,45 @@ macos_to_unix_filename(name, len)
 {
        register int    i;
 
+/* modified by Koji Arai */
+#ifdef SUPPORT_X0201
+       for (i = 0; i < len; i ++) {
+               /* modified by Koji Arai */
+               if (HANKAKU_KATAKANA_P(name[i])) {
+                       int j;
+                       for (j = len; j >= i; j--) {
+                               name[j+1] = name[j]; /* no check over */
+                       }
+                       name[i] = 0x8e;
+                       i++;
+                       len++;
+               } else
+
+               if (MULTIBYTE_FIRST_P (name[i]) &&
+                       MULTIBYTE_SECOND_P (name[i+1])) {
+                       int c1, c2;
+                       c1 = name[i]; c2 = name[i+1];
+                       sjis2euc(&c1, &c2);
+                       name[i] = c1; name[i+1] = c2;
+                       i ++;
+               }
+               else if (name[i] == ':')
+                       name[i] = '/';
+               else if (name[i] == '/')
+                       name[i] = ':';
+/*
+               else if (isupper (name[i]))
+                       name[i] = tolower (name[i]);
+*/
+       }
+#else
        for (i = 0; i < len; i++) {
                if (name[i] == ':')
                        name[i] = '/';
                else if (name[i] == '/')
                        name[i] = ':';
        }
+#endif /* SUPPORT_X0201 */
 }
 
 /* ------------------------------------------------------------------------ */
@@ -194,35 +280,35 @@ unix_to_generic_filename(name, len)
  */
 
 /* choose one */
-#if defined(MKTIME)
-#ifdef TIMELOCAL
-#undef TIMELOCAL
+#if defined(HAVE_MKTIME)
+#ifdef HAVE_TIMELOCAL
+#undef HAVE_TIMELOCAL
 #endif
-#endif                         /* defined(MKTIME) */
+#endif                         /* defined(HAVE_MKTIME) */
 
-#if defined(MKTIME) || defined(TIMELOCAL)
-#ifdef TZSET
-#undef TZSET
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL)
+#ifdef HAVE_TZSET
+#undef HAVE_TZSET
 #endif
-#endif                         /* defined(MKTIME) || defined(TIMELOCAL) */
+#endif                         /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
 
-#if defined(MKTIME) || defined(TIMELOCAL) || defined(TZSET)
-#ifdef FTIME
-#undef FTIME
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) || defined(HAVE_TZSET)
+#ifdef HAVE_FTIME
+#undef HAVE_FTIME
 #endif
 #endif
 
-#if defined(MKTIME) || defined(TIMELOCAL) || defined(TZSET) || defined(FTIME)
-#ifdef GETTIMEOFDAY
-#undef GETTIMEOFDAY
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) || defined(HAVE_TZSET) || defined(HAVE_FTIME)
+#ifdef HAVE_GETTIMEOFDAY
+#undef HAVE_GETTIMEOFDAY
 #endif
 #else
-#ifndef GETTIMEOFDAY
-#define GETTIMEOFDAY           /* use gettimeofday() */
+#ifndef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY              /* use gettimeofday() */
 #endif
 #endif
 
-#ifdef FTIME
+#ifdef HAVE_FTIME
 #include <sys/timeb.h>
 #endif
 
@@ -235,15 +321,15 @@ TIMEZONE_HOOK
 /* Which do you like better, `TIMEZONE_HOOK' or `TIMEZONE_HOOK;' ? */
 #endif
 
-#if defined(TZSET) && defined(_MINIX)
+#if defined(HAVE_TZSET) && defined(_MINIX)
 extern long     timezone;              /* not defined in time.h */
 #endif
 
 /* ------------------------------------------------------------------------ */
-#if defined(FTIME) || defined(GETTIMEOFDAY) || defined(TZSET)
+#if defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY) || defined(HAVE_TZSET)
 static long
 gettz()
-#ifdef TZSET
+#ifdef HAVE_TZSET
 {
        tzset();
        return timezone;
@@ -251,7 +337,7 @@ gettz()
 #endif
 
 /* ------------------------------------------------------------------------ */
-#if !defined(TZSET) && defined(FTIME)
+#if !defined(HAVE_TZSET) && defined(HAVE_FTIME)
 {
        struct timeb    buf;
 
@@ -261,14 +347,14 @@ gettz()
 #endif
 
 /* ------------------------------------------------------------------------ */
-#if !defined(TZSET) && !defined(FTIME) /* maybe defined(GETTIMEOFDAY) */
+#if !defined(HAVE_TZSET) && !defined(HAVE_FTIME)       /* maybe defined(HAVE_GETTIMEOFDAY) */
 {
-#ifdef HAVE_TM_ZONE
+#ifdef HAVE_TM_GMTOFF
         time_t tt;
 
         time(&tt);
         return -localtime(&tt)->tm_gmtoff;
-#else /* HAVE_TM_ZONE */
+#else /* HAVE_TM_GMTOFF */
        struct timeval  tp;
        struct timezone tzp;
        gettimeofday(&tp, &tzp);/* specific to 4.3BSD */
@@ -277,11 +363,11 @@ gettz()
         * 60L : 0));
         */
        return (tzp.tz_minuteswest * 60L);
-#endif /* HAVE_TM_ZONE */
+#endif /* HAVE_TM_GMTOFF */
 }
 #endif
-#endif                         /* defined(FTIME) || defined(GETTIMEOFDAY) ||
-                                * defined(TZSET) */
+#endif                         /* defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY) ||
+                                * defined(HAVE_TZSET) */
 
 /* ------------------------------------------------------------------------ */
 #ifdef NOT_USED
@@ -305,7 +391,7 @@ msdos_to_unix_stamp_tm(a)
 static          time_t
 generic_to_unix_stamp(t)
        long            t;
-#if defined(MKTIME) || defined(TIMELOCAL)
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL)
 {
        struct tm       dostm;
 
@@ -326,14 +412,14 @@ generic_to_unix_stamp(t)
        dostm.tm_isdst = 0;     /* correct? */
 #endif
        dostm.tm_isdst = -1;    /* correct? */
-#ifdef MKTIME
+#ifdef HAVE_MKTIME
        return (time_t) mktime(&dostm);
-#else                          /* maybe defined(TIMELOCAL) */
+#else                          /* maybe defined(HAVE_TIMELOCAL) */
        return (time_t) timelocal(&dostm);
 #endif
 }
 
-#else                          /* defined(MKTIME) || defined(TIMELOCAL) */
+#else                          /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
 {
        int             year, month, day, hour, min, sec;
        long            longtime;
@@ -374,7 +460,7 @@ generic_to_unix_stamp(t)
        /* LONGTIME is now the time in seconds, since 1970/01/01 00:00:00.  */
        return (time_t) longtime;
 }
-#endif                         /* defined(MKTIME) || defined(TIMELOCAL) */
+#endif                         /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
 
 /* ------------------------------------------------------------------------ */
 static long
@@ -538,6 +624,7 @@ get_header(fp, hdr)
                                for (i = 0; i < header_size - 3; i++)
                                        hdr->name[i] = (char) get_byte();
                                hdr->name[header_size - 3] = '\0';
+                               name_length = header_size - 3; /* modified by Koji Arai */
                                break;
                        case 2:
                                /*
@@ -750,7 +837,7 @@ write_header(nafp, hdr)
 
        convdelim(hdr->name, DELIM2);
        if (hdr->header_level != HEADER_LEVEL2) {
-               if (p = (char *) rindex(hdr->name, DELIM2))
+               if (p = (char *) strrchr(hdr->name, DELIM2))
                        name_length = strlen(++p);
                else
                        name_length = strlen(hdr->name);
@@ -808,7 +895,7 @@ write_header(nafp, hdr)
                        put_word(hdr->unix_gid);
                        put_word(hdr->unix_uid);
 
-                       if (p = (char *) rindex(hdr->name, DELIM2)) {
+                       if (p = (char *) strrchr(hdr->name, DELIM2)) {
                                int             i;
 
                                name_length = p - hdr->name + 1;
@@ -834,7 +921,7 @@ write_header(nafp, hdr)
                        data[I_HEADER_CHECKSUM] = calc_sum(data + I_METHOD, header_size);
                } else {                /* header level 2 */
                        int             i;
-                       if (p = (char *) rindex(hdr->name, DELIM2))
+                       if (p = (char *) strrchr(hdr->name, DELIM2))
                                name_length = strlen(++p);
                        else {
                                p = hdr->name;
@@ -863,3 +950,40 @@ write_header(nafp, hdr)
 
        convdelim(hdr->name, DELIM);
 }
+
+#ifdef SUPPORT_X0201
+/*
+ * SJIS <-> EUC ÊÑ´¹´Ø¿ô
+ * ¡ÖÆüËܸì¾ðÊó½èÍý¡×  ¥½¥Õ¥È¥Ð¥ó¥¯(³ô)
+ *     ¤è¤êÈ´¿è(by Koji Arai)
+ */
+void
+euc2sjis(int *p1, int *p2)
+{
+    unsigned char c1 = *p1 & 0x7f;
+    unsigned char c2 = *p2 & 0x7f;
+    int rowoff = c1 < 0x5f ? 0x70 : 0xb0;
+    int celoff = c1 % 2 ? (c2 > 0x5f ? 0x20 : 0x1f) : 0x7e;
+    *p1 = ((c1 + 1) >> 1) + rowoff;
+    *p2 += celoff;
+}
+
+void
+sjis2euc(int *p1, int *p2)
+{
+    unsigned char c1 = *p1;
+    unsigned char c2 = *p2;
+    int adjust = c2 < 0x9f;
+    int rowoff = c1 < 0xa0 ? 0x70 : 0xb0;
+    int celoff = adjust ? (c2 > 0x7f ? 0x20 : 0x1f) : 0x7e;
+    *p1 = ((c1 - rowoff) << 1) - adjust;
+    *p2 -= celoff;
+
+    *p1 |= 0x80;
+    *p2 |= 0x80;
+}
+#endif /* SUPPORT_X0201 */
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 2fb7798..9393622 100644 (file)
--- a/src/huf.c
+++ b/src/huf.c
 #include <sys/param.h>
 #endif
 
-#if defined(__STDC__) || defined(NEWSOS)
+#if STDC_HEADERS
 #include <stdlib.h>
+#else
+extern char *malloc ();
 #endif
 
 /* ------------------------------------------------------------------------ */
@@ -459,3 +461,7 @@ decode_start_st1( /* void */ )
        init_getbits();
        blocksize = 0;
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
+/* vi:set ts=4 */
index 6627cd4..3ddef3b 100644 (file)
@@ -83,3 +83,6 @@ decode_start_lz5( /*void*/ )
        memset(&text[256 * 13 + 512 + 18], 0, 128);
        memset(&text[256 * 13 + 512 + 128 + 18], ' ', 128 - 18);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 52203cc..d1935ff 100644 (file)
--- a/src/lha.h
+++ b/src/lha.h
@@ -9,6 +9,11 @@
        Included...
                lharc.h         interface.h             slidehuf.h
 */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>
@@ -310,3 +315,11 @@ extern unsigned            short calccrc();
 /* from lhadd.c */
 extern int             encode_lzhuf();
 extern int      encode_stored_crc();
+
+/* from header.c */
+void euc2sjis(int *p1, int *p2);
+void sjis2euc(int *p1, int *p2);
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 9f1e301..3d23346 100644 (file)
@@ -6,36 +6,39 @@
 /*     Ver. 1.14       Soruce All chagned                              1995.01.14      N.Watazaki              */
 /* ------------------------------------------------------------------------ */
 
-/* Most of System V, define SYSTIME_HAS_NO_TM */
-#ifdef SYSTIME_HAS_NO_TM
-#include <time.h>
-#else
+/* Most of System V, define TM_IN_SYS_TIME */
+#if    TM_IN_SYS_TIME
 #include <sys/time.h>
-#endif /* SYSTIME_HAS_NO_TM */
+#else
+#include <time.h>
+#endif /* TM_IN_SYS_TIME */
 
 /* ------------------------------------------------------------------------ */
 /*     Directory Access Stuff                                                                                                  */
 /* ------------------------------------------------------------------------ */
 #ifndef NODIRECTORY
-#ifdef SYSV_SYSTEM_DIR
-
-#include <dirent.h>
-
-#define DIRENTRY       struct dirent
-#define NAMLEN(p)      strlen (p->d_name)
-
-#else  /* not SYSV_SYSTEM_DIR */
-
-#ifdef NONSYSTEM_DIR_LIBRARY
-#include "lhdir.h"
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
 #else
-#include <sys/dir.h>
-#endif /* not NONSYSTEM_DIR_LIBRARY */
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+#  include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+#  include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+#  include <ndir.h>
+# endif
+# ifdef NONSYSTEM_DIR_LIBRARY                  /* no use ?? */
+#  include "lhdir.h"
+# endif
+#endif
 
-#define DIRENTRY               struct direct
-#define NAMLEN(p)              p->d_namlen
+#define DIRENTRY       struct dirent
 
-#endif /* not SYSV_SYSTEM_DIR */
 #endif  /* NODIRECTORY */
 
 /* ------------------------------------------------------------------------ */
@@ -98,7 +101,7 @@ typedef int                          boolean;
 #define SJC_SECOND_P(c)                        \
   (((unsigned char)(c) >= 0x40) &&     \
    ((unsigned char)(c) < 0xfd) &&      \
-   ((ungigned char)(c) != 0x7f))
+   ((unsigned char)(c) != 0x7f))
 
 #ifdef MULTIBYTE_CHAR
 #define MULTIBYTE_FIRST_P      SJC_FIRST_P
@@ -298,20 +301,22 @@ typedef short                             node;
 /* ------------------------------------------------------------------------ */
 /*     Memory and String function                                                                                              */
 /* ------------------------------------------------------------------------ */
-#include <string.h>
-
-#ifdef NOINDEX
-#define index                  strchr
-#define rindex                 strrchr
-#endif /* NOINDEX */
-
-#ifdef NOBSTRING
-#define bcmp(a,b,n)            memcmp ((a),(b),(n))
-#define bzero(d,n)             memset((d),0,(n))
-#define bcopy(s,d,n)   memmove((d),(s),(n))
-#endif /* NOBSTRING */
+#if STDC_HEADERS
+# include <string.h>
+#else
+# ifndef HAVE_STRCHR
+#  define strchr index
+#  define strrchr rindex
+# endif
+char *strchr (), *strrchr ();
+# ifdef HAVE_MEMCPY
+#  define bcmp(a,b,n)  memcmp((a),(b),(n))
+#  define bzero(d,n)   memset((d),0,(n))
+#  define bcopy(s,d,n) memmove((d),(s),(n))
+# endif
+#endif
 
-#ifdef USESTRCASECMP
+#if HAVE_STRCASECMP
 #define strucmp(p,q)   strcasecmp((p),(q))
 #endif
 
@@ -401,3 +406,6 @@ typedef short                               node;
 /* alphabet = {0, 1, 2, ..., NC - 1} */
 #define CBIT                           9       /* $\lfloor \log_2 NC \rfloor + 1$ */
 #define USHRT_BIT                      16      /* (CHAR_BIT * sizeof(ushort)) */
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 2608ff1..4c2294f 100644 (file)
@@ -61,7 +61,7 @@ add_one(fp, nafp, hdr)
                                          &v_original_size, &v_packed_size);
                fflush(nafp);
                next_pos = ftell(nafp);
-#ifndef NOFTRUNCATE
+#if HAVE_FTRUNCATE
                ftruncate(fileno(nafp), next_pos);
 #endif
                bcopy(LZHUFF0_METHOD, hdr->method, METHOD_TYPE_STRAGE);
@@ -344,7 +344,7 @@ temporary_to_new_archive_file(new_archive_size)
        long            new_archive_size;
 {
        char           *p;
-       p = (char *) rindex(new_archive_name, '/');
+       p = (char *) strrchr(new_archive_name, '/');
        p = p ? p + 1 : new_archive_name;
        unlink(new_archive_name);
        if (rename(temporary_name, p) < 0) {
@@ -628,3 +628,6 @@ char *str2;
 }
 
                
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 1181592..9e5737b 100644 (file)
@@ -147,18 +147,8 @@ commands:                           options:\n\
  x,e EXtract from archive            v  verbose\n\
  l,v List / Verbose List             n  not execute\n\
  u   Update newer files to archive   f  force (over write at extract)\n\
- d   Delete from archive             t  FILES are TEXT file\n");
-#ifdef SUPPORT_LH6
-       fprintf(stderr, "\
+ d   Delete from archive             t  FILES are TEXT file\n\
  m   Move to archive (means 'ad')    o[56] compression method (a/u)\n\
-");
-#endif
-#ifndef SUPPORT_LH6
-       fprintf(stderr, "\
- m   Move to archive (means 'ad')    o  use LHarc compatible method (a/u)\n\
-");
-#endif
-       fprintf(stderr, "\
  c   re-Construct new archive        w=<dir> specify extract directory (a/u/m/x/e)\n\
  p   Print to STDOUT from archive    d  delete FILES after (a/u/c)\n\
  t   Test file CRC in archive        i  ignore directory path (x/e)\n\
@@ -318,12 +308,10 @@ main(argc, argv)
                 compress_method = LZHUFF5_METHOD_NUM;
                 p++;
                 break;
-#ifdef SUPPORT_LH6
                        case '6':
                 compress_method = LZHUFF6_METHOD_NUM;
                 p++;
                 break;
-#endif
                        default:
                 fprintf(stderr, "LHa: error option o%c\n", p[-1]);
                 exit(1);
@@ -821,7 +809,7 @@ find_files(name, v_filec, v_filev)
                newname[len + n] = '\0';
                if (GETSTAT(newname, &fil_stbuf) < 0)
                        continue;
-#ifdef NO_INODE
+#ifndef HAVE_ST_INO
                if ( dp->d_name[0] != '.' ||
                        (n != 1 &&
                         (dp->d_name[1] != '.' ||
@@ -1001,7 +989,7 @@ open_old_archive()
                else
                        return NULL;
        }
-       if (p = (char *) rindex(archive_name, '.')) {
+       if (p = (char *) strrchr(archive_name, '.')) {
                if (strucmp(".LZH", p) == 0
                    || strucmp(".LZS", p) == 0
                    || strucmp(".COM", p) == 0  /* DOS SFX */
@@ -1085,3 +1073,6 @@ copy_old_one(oafp, nafp, hdr)
        }
 }
 
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index aa5efa9..8667725 100644 (file)
@@ -96,3 +96,6 @@ closedir(dirp)
        close(dirp->dd_fd);
        free(dirp);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 6abefcf..0159ec5 100644 (file)
@@ -33,3 +33,7 @@ typedef struct {
 extern DIR                      *opendir();
 extern struct direct *readdir();
 extern int                      closedir();
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 76adc3c..358eebd 100644 (file)
@@ -160,13 +160,13 @@ adjust_info(name, hdr)
                if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
                        chmod(name, hdr->unix_mode);
 #endif
-               if (!getuid()) {
-#ifndef HAVE_NO_LCHOWN
-            if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
-                           lchown(name, hdr->unix_uid, hdr->unix_gid);
-                       else
-#endif /* HAVE_NO_LCHWON */
-                           chown(name, hdr->unix_uid, hdr->unix_gid);
+               if (!getuid()){
+#if HAVE_LCHOWN
+                       if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) == UNIX_FILE_SYMLINK)
+                               lchown(name, hdr->unix_uid, hdr->unix_gid);
+                       else 
+#endif
+                               chown(name, hdr->unix_uid, hdr->unix_gid);
                }
                errno = 0;
        }
@@ -186,8 +186,8 @@ extract_one(afp, hdr)
        boolean         save_quiet, save_verbose, up_flag;
        char           *q = hdr->name, c;
 
-       if (ignore_directory && rindex(hdr->name, '/')) {
-               q = (char *) rindex(hdr->name, '/') + 1;
+       if (ignore_directory && strrchr(hdr->name, '/')) {
+               q = (char *) strrchr(hdr->name, '/') + 1;
        }
        else {
                if (*q == '/') {
@@ -419,3 +419,6 @@ cmd_extract()
 
        return;
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index eca49b6..70028ef 100644 (file)
@@ -338,3 +338,6 @@ cmd_list()
 
        return;
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
diff --git a/src/makefile.dj b/src/makefile.dj
deleted file mode 100644 (file)
index 41ee9fd..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-##############################################################################
-# makefile.dj for LHa on djgpp
-#  Copyright(c) 1996 t.okamoto
-##############################################################################
-
-CC = gcc
-O = .o
-
-MACHINE     = -DSYSTIME_HAS_NO_TM -DFTIME
-SWITCHES = -DNEED_INCREMENTAL_INDICATOR -DNO_INODE
-OPTIMIZE = -O2
-
-LHOBJS         = lharc$(O) lhadd$(O) lhlist$(O) lhext$(O) header$(O)
-HUFOBJS                = append$(O) crcio$(O) dhuf$(O) extract$(O) huf$(O) \
-                 larc$(O) maketbl$(O) maketree$(O) shuf$(O) slide$(O) \
-                 util$(O) patmatch$(O)
-
-OBJS           = $(LHOBJS) $(HUFOBJS) $(LIBRARYOBJS)
-
-CFLAGS         = $(OPTIMIZE) $(SWITCHES) $(MACHINE)
-
-.c.o:
-       gcc -c $(CFLAGS) $<
-
-all : lha
-
-lha    : $(OBJS)
-       $(CC) -o $@ $(OBJS) $(LDFLAGS) 
-
-$(LHOBJS) append$(O) slide$(O) extract$(O) : lha.h
-
-$(HUFOBJS) : lha.h
-crcio$(O) extract$(O) slide$(O) : lha.h
-
-lhdir$(O) : lhdir.h
-
-$(OBJS) : makefile.dj
-
-clean:
-       rm -f core $(OBJS)
-
-moreclean:
-       rm -f core *.o lha.tar lha.tar.Z *~ \#* *.orig
index c0f2f04..b59dad5 100644 (file)
@@ -91,3 +91,7 @@ make_table(nchar, bitlen, tablebits, table)
                start[k] = l;
        }
 }
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index baa0e72..6c2aa6e 100644 (file)
@@ -168,3 +168,7 @@ make_tree(nparm, freqparm, lenparm, codeparm)
        make_code(nparm, lenparm, codeparm);
        return k;               /* return root */
 }
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 75fd739..a1a8f2c 100644 (file)
@@ -37,3 +37,7 @@ patmatch(p, s, f)
        }
        return (!*s);           /* p exhausted, ret true if s exhausted */
 }
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 11ae736..667edf8 100644 (file)
@@ -199,3 +199,6 @@ decode_p_st0(/*void*/)
        }
        return (j << 6) + getbits(6);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 2142f35..56807c5 100644 (file)
@@ -439,3 +439,6 @@ decode(interface)
        }
        free(text);
 }
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
index 5b57a24..79ab837 100644 (file)
@@ -182,7 +182,7 @@ skip_msdos_sfx1_code(fp)
  */
 
 /* ------------------------------------------------------------------------ */
-#ifdef NOSTRDUP
+#ifndef HAVE_STRDUP
 char           *
 strdup(buf)
        char           *buf;
@@ -229,7 +229,7 @@ memmove(dst, src, cnt)
  * Masaru Oki 92.01.28 added mkdir() and rmdir() by Tomohiro Ishikawa
  */
 
-#if defined(NOFTRUNCATE) && !defined(_MINIX)
+#if !defined(HAVE_FTRUNCATE) && !defined(_MINIX)
 
 /* ------------------------------------------------------------------------ */
 int
@@ -261,10 +261,10 @@ rename(from, to)
                return (-1);
        return (0);
 }
-#endif                         /* NOFTRUNCATE */
+#endif                         /* !HAVE_FTRUNCATE */
 /* ------------------------------------------------------------------------ */
 
-#ifdef NOMKDIR
+#ifndef        HAVE_MKDIR
 #ifndef        MKDIRPATH
 #define        MKDIRPATH       "/bin/mkdir"
 #endif
@@ -329,7 +329,7 @@ mkdir(path, mode)
  * strucmp modified: Oct 29 1991 by Masaru Oki
  */
 
-#ifndef USESTRCASECMP
+#ifndef HAVE_STRCASECMP
 static int
 my_toupper(n)
        register int    n;
@@ -354,7 +354,7 @@ strucmp(s, t)
 #endif
 
 /* ------------------------------------------------------------------------ */
-#ifdef NOMEMSET
+#ifndef HAVE_MEMSET
 /* Public Domain memset(3) */
 char           *
 memset(s, c, n)
@@ -367,3 +367,6 @@ memset(s, c, n)
        return s;
 }
 #endif
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */