1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(lha, 1.14i-ac20020527a, 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 dnl Checks for programs.
12 AC_PROG_GCC_TRADITIONAL
18 dnl Checks for libraries.
20 dnl 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 dnl 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 dnl 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 dnl 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 dnl 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)
93 AC_MSG_RESULT(-lh$with_default_method-)
94 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])
96 dnl decide temporary path names
97 AC_MSG_CHECKING(template of the temporary file is )
99 AC_HELP_STRING([--with-tmp-file=TEMPLATE],
100 [temporary file template [[default=/tmp/lhXXXXXX]]]),
102 yes) with_tmp_file=/tmp/lhXXXXXX ;;
105 with_tmp_file=/tmp/lhXXXXXX)
107 AC_MSG_RESULT($with_tmp_file)
108 if test x"$with_tmp_file" != xno; then
109 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
110 [temporary file template for mktemp/mkstemp])
113 dnl incremental indicator
114 AC_ARG_ENABLE(indicator,
115 AC_HELP_STRING([--enable-indicator],
116 [need incremental indicator [[default=yes]]]),
119 enable_indicator=yes)
121 if test "x$enable_indicator" = xyes; then
122 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
125 dnl support multibyte filename
126 AC_ARG_ENABLE(multibyte-char,
127 AC_HELP_STRING([--enable-multibyte-char],
128 [support multibyte filename [[default=yes]]]),
131 enable_multibyte_char=yes)
133 if test "x$enable_multibyte_char" = xyes; then
134 AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
137 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
138 AC_CONFIG_FILES([tests/Makefile tests/lha-test])