From 4b488a3cdb9f40f91f81008b131e41b676a9937c Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 24 Nov 2013 19:28:57 -0700
Subject: Updates for newer autotools and misc fixes


diff --git a/configure.ac b/configure.ac
index 5161979..cb0524a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ AC_INIT([LHa for UNIX], 1.14i-ac20050924p1, arai@users.sourceforge.jp, lha)
 AC_CANONICAL_HOST
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS([config.h])
 
 AC_DEFINE_UNQUOTED(PLATFORM, "$ac_cv_host",
 		   [the type of system on which the package will run.])
@@ -14,7 +14,6 @@ AC_PROG_GCC_TRADITIONAL
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
 AC_MINIX
-AM_C_PROTOTYPES
 AC_SYS_LARGEFILE
 
 # Checks for libraries.
diff --git a/src/prototypes.h b/src/prototypes.h
index 79e1330..cd456eb 100644
--- a/src/prototypes.h
+++ b/src/prototypes.h
@@ -70,10 +70,10 @@ void temporary_to_new_archive_file P_((size_t new_archive_size));
 void cmd_add P_((void));
 void cmd_delete P_((void));
 /* lharc.c */
-void message P_((char *fmt, ...));
-void warning P_((char *fmt, ...));
-void error P_((char *fmt, ...));
-void fatal_error P_((char *fmt, ...));
+//void message P_((char *fmt, ...));
+//void warning P_((char *fmt, ...));
+//void error P_((char *fmt, ...));
+//void fatal_error P_((char *fmt, ...));
 void cleanup P_((void));
 RETSIGTYPE interrupt P_((int signo));
 void *xmalloc P_((size_t size));
@@ -122,7 +122,7 @@ unsigned int decode P_((struct interfacing *interface));
 size_t copyfile P_((FILE *f1, FILE *f2, size_t size, int text_flg, unsigned int *crcp));
 int encode_stored_crc P_((FILE *ifp, FILE *ofp, size_t size, size_t *original_size_var, size_t *write_size_var));
 boolean archive_is_msdos_sfx1 P_((char *name));
-int xsnprintf P_((char *dest, size_t size, char *fmt, ...));
+//int xsnprintf P_((char *dest, size_t size, char *fmt, ...));
 char *xstrchr P_((const char *s, int c));
 char *xstrrchr P_((const char *s, int c));
 char *xmemchr P_((const char *s, int c, size_t n));
-- 
1.8.3.4


From d8d031cbd5bdeceb1f75653ccd00483501964672 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 17 Jul 2014 09:00:08 +0200
Subject: Detect and use Haiku's version of libiconv.

* Makes it possible to extract archives with non-utf8 files inside.

diff --git a/configure.ac b/configure.ac
index cb0524a..35763ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,7 +62,7 @@ AC_CHECK_FUNCS(strchr strdup memcpy memset memmove strcasecmp)
 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
 AC_CHECK_FUNCS(ftruncate chsize lchown mkstemp ftello)
 AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam)
-AC_CHECK_FUNCS(iconv basename)
+AC_CHECK_FUNCS(libiconv basename)
 AC_REPLACE_FUNCS(vsnprintf fnmatch)
 
 if test $ac_header_dirent = no; then
diff --git a/src/header.c b/src/header.c
index e8d083d..c157727 100644
--- a/src/header.c
+++ b/src/header.c
@@ -1736,7 +1736,7 @@ ConvertUTF8ToEncoding(const char* inUTF8Buf,
     return cfResult;
 }
 
-#elif HAVE_ICONV
+#elif HAVE_LIBICONV
 #include <iconv.h>
 
 static int
@@ -1786,7 +1786,7 @@ sjis_to_utf8(char *dst, const char *src, size_t dstsize)
                             kCFStringEncodingDOSJapanese,
                             kCFStringEncodingUseHFSPlusCanonical) == 0)
       return dst;
-#elif HAVE_ICONV
+#elif HAVE_LIBICONV
   if (ConvertEncodingByIconv(src, dst, dstsize, "SJIS", "UTF-8") != -1)
       return dst;
 #else
@@ -1810,7 +1810,7 @@ utf8_to_sjis(char *dst, const char *src, size_t dstsize)
                             kCFStringEncodingDOSJapanese,
                             kCFStringEncodingUseHFSPlusCanonical) == 0)
       return dst;
-#elif HAVE_ICONV
+#elif HAVE_LIBICONV
   if (ConvertEncodingByIconv(src, dst, dstsize, "UTF-8", "SJIS") != -1)
       return dst;
 #else
-- 
1.8.3.4

