1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(lha, 1.14i-ac20020605, jca02266@nifty.ne.jp)
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.
20 # Checks for header files.
23 AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/param.h sys/time.h)
24 AC_CHECK_HEADERS(pwd.h grp.h)
26 # Checks for typedefs, structures, and compiler characteristics.
32 AC_CHECK_TYPES([uid_t, gid_t])
33 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
36 # include <sys/types.h>
39 # include <sys/stat.h>
41 #if TIME_WITH_SYS_TIME
42 # include <sys/time.h>
46 # include <sys/time.h>
53 # Checks for library functions.
57 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove)
58 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
59 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp)
60 AC_CHECK_FUNCS(strcasecmp link)
61 AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam)
63 if test $ac_header_dirent = no; then
67 # support kanji code conversion
69 AC_ARG_ENABLE(text_conv,
70 AC_HELP_STRING([--enable-text-conv],
71 [support text code convert from/to EUC [[default=yes]]]),
72 , enable_text_conv=yes)
74 if test $enable_text_conv = yes; then
79 AC_SUBST(SUPPORT_LZHUFF_METHOD)
80 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
82 # whether use the -lh567- method
83 AC_MSG_CHECKING(default archive method is )
84 AC_ARG_WITH(default_method,
85 AC_HELP_STRING([--with-default-method=[[567]]],
86 [create the -lh[[567]]- archive default [[default=5]]]),
89 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
91 with_default_method=5)
92 AC_MSG_RESULT(-lh$with_default_method-)
93 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])
95 # decide temporary path names
96 AC_MSG_CHECKING(template of the temporary file is )
98 AC_HELP_STRING([--with-tmp-file=TEMPLATE],
99 [temporary file template [[default=/tmp/lhXXXXXX]]]),
101 yes) with_tmp_file=/tmp/lhXXXXXX ;;
104 with_tmp_file=/tmp/lhXXXXXX)
105 AC_MSG_RESULT($with_tmp_file)
106 if test x"$with_tmp_file" != xno; then
107 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
108 [temporary file template for mktemp/mkstemp])
111 # incremental indicator
112 AC_ARG_ENABLE(indicator,
113 AC_HELP_STRING([--enable-indicator],
114 [need incremental indicator [[default=yes]]]),
117 enable_indicator=yes)
118 if test "x$enable_indicator" = xyes; then
119 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1,
120 [Define to 1 if you want to use the incremental indicator])
123 # support multibyte filename
124 AC_ARG_ENABLE(multibyte-char,
125 AC_HELP_STRING([--enable-multibyte-char],
126 [support multibyte filename [[default=yes]]]),
129 enable_multibyte_char=yes)
130 if test "x$enable_multibyte_char" = xyes; then
131 AC_DEFINE(MULTIBYTE_CHAR, 1,
132 [Define to 1 if you want to use multibyte filename])
135 # make user/group name extented header
136 AC_ARG_ENABLE(user-name-header,
137 AC_HELP_STRING([--enable-user-name-header],
138 [make user/group name extended header [[default=no]]]),
141 enable_user_name_header=no)
142 if test "x$user_name_header" = xyes; then
143 AC_DEFINE(MAKE_USER_NAME_HEADER, 1,
144 [Define to 1 if you want to make user/group name extended header])
147 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
148 AC_CONFIG_FILES([tests/Makefile tests/lha-test])