1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([LHa for UNIX], 1.14i-ac20020629, jca02266@nifty.ne.jp, lha)
5 AM_CONFIG_HEADER(config.h)
7 AC_DEFINE_UNQUOTED(PLATFORM, "$ac_cv_host",
8 [the type of system on which the package will run.])
10 # Checks for programs.
12 AC_PROG_GCC_TRADITIONAL
18 # Checks for libraries.
19 AC_SEARCH_LIBS(opendir, [mingwex])
21 # Checks for header files.
24 AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/param.h sys/time.h)
25 AC_CHECK_HEADERS(pwd.h grp.h)
27 # Checks for typedefs, structures, and compiler characteristics.
33 AC_CHECK_TYPES([uid_t, gid_t])
34 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
37 # include <sys/types.h>
40 # include <sys/stat.h>
42 #if TIME_WITH_SYS_TIME
43 # include <sys/time.h>
47 # include <sys/time.h>
54 # Checks for library functions.
58 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove strcasecmp)
59 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
60 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp link)
61 AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam)
62 AC_REPLACE_FUNCS(vsnprintf)
64 if test $ac_header_dirent = no; then
68 # checking whether 8 bit clean or not
69 AC_CACHE_CHECK([whether strchr()/strrchr() is 8bit clean],
70 [lha_cv_strchr_8bit_clean],
77 # define strrchr rindex
79 char *strchr (), *strrchr ();
85 if (strchr(s, 0xff) != s) return 1;
86 if (strchr(s, '\xff') != s) return 1;
89 ], lha_cv_strchr_8bit_clean=yes,lha_cv_strchr_8bit_clean=no))
91 if test $lha_cv_strchr_8bit_clean = yes; then
92 AC_DEFINE(STRCHR_8BIT_CLEAN, 1,
93 [Define to 1 if strchr()/strrchr() works correctly.])
96 # support kanji code conversion
98 AC_ARG_ENABLE(text_conv,
99 AC_HELP_STRING([--enable-text-conv],
100 [support text code convert from/to EUC [[default=yes]]]),
101 , enable_text_conv=yes)
103 if test $enable_text_conv = yes; then
107 # force support -lh7-
108 AC_SUBST(SUPPORT_LZHUFF_METHOD)
109 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
111 # whether use the -lh567- method
112 AC_MSG_CHECKING(default archive method is )
113 AC_ARG_WITH(default_method,
114 AC_HELP_STRING([--with-default-method=[[567]]],
115 [create the -lh[[567]]- archive default [[default=5]]]),
118 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
120 with_default_method=5)
121 AC_MSG_RESULT(-lh$with_default_method-)
122 AC_DEFINE_UNQUOTED(DEFAULT_LZHUFF_METHOD, LZHUFF${with_default_method}_METHOD_NUM, [Define it to 5, 6 or 7 which you want to use -lhX- method, default])
124 # decide temporary path names
125 AC_MSG_CHECKING(template of the temporary file is )
126 AC_ARG_WITH(tmp_file,
127 AC_HELP_STRING([--with-tmp-file=TEMPLATE],
128 [temporary file template [[default=/tmp/lhXXXXXX]]]),
130 yes) with_tmp_file=/tmp/lhXXXXXX ;;
133 with_tmp_file=/tmp/lhXXXXXX)
134 AC_MSG_RESULT($with_tmp_file)
135 if test x"$with_tmp_file" != xno; then
136 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
137 [temporary file template for mktemp/mkstemp])
140 # incremental indicator
141 AC_ARG_ENABLE(indicator,
142 AC_HELP_STRING([--enable-indicator],
143 [need incremental indicator [[default=yes]]]),
146 enable_indicator=yes)
147 if test "x$enable_indicator" = xyes; then
148 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1,
149 [Define to 1 if you want to use the incremental indicator])
152 # support multibyte filename
153 AC_MSG_CHECKING(kanji code for filename is )
154 AC_ARG_ENABLE(multibyte-filename,
155 AC_HELP_STRING([--enable-multibyte-filename],
156 [support multibyte filename. specify kanji code (euc, sjis, utf8 or auto) [[default=auto]]]),,
158 enable_multibyte_filename=auto)
160 case $enable_multibyte_filename in
163 #if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__hpux)
165 #endif], enable_multibyte_filename=CODE_SJIS,
167 #if defined(__APPLE__) /* for Mac OS X */
169 #endif], enable_multibyte_filename=CODE_UTF8,
170 enable_multibyte_filename=CODE_EUC));;
171 sjis) enable_multibyte_filename=CODE_SJIS;;
172 euc) enable_multibyte_filename=CODE_EUC;;
173 utf8) enable_multibyte_filename=CODE_UTF8;;
175 *) AC_MSG_ERROR([you should specify auto, sjis or euc as your system filename code.]);;
178 AC_MSG_RESULT($enable_multibyte_filename)
179 if test x$enable_multibyte_filename != xno; then
180 AC_DEFINE_UNQUOTED(MULTIBYTE_FILENAME, $enable_multibyte_filename,
181 [Define to CODE_EUC or CODE_SJIS if you want to use multibyte filename])
184 # make user/group name extented header
185 AC_ARG_ENABLE(user-name-header,
186 AC_HELP_STRING([--enable-user-name-header],
187 [make user/group name extended header [[default=no]]]),
190 enable_user_name_header=no)
191 if test "x$user_name_header" = xyes; then
192 AC_DEFINE(INCLUDE_OWNER_NAME_IN_HEADER, 1,
193 [Define to 1 if you want to use the user/group name extened header])
196 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
197 AC_CONFIG_FILES([tests/Makefile tests/lha-test])