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_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
35 # include <sys/types.h>
38 # include <sys/stat.h>
40 #if TIME_WITH_SYS_TIME
41 # include <sys/time.h>
45 # include <sys/time.h>
52 dnl Checks for library functions.
56 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove)
57 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
58 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp)
59 AC_CHECK_FUNCS(strcasecmp link)
60 AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam)
62 if test $ac_header_dirent = no; then
66 dnl support kanji code conversion
68 AC_ARG_ENABLE(text_conv,
69 AC_HELP_STRING([--enable-text-conv],
70 [support text code convert from/to EUC [[default=yes]]]),
71 , enable_text_conv=yes)
73 if test $enable_text_conv = yes; then
78 AC_SUBST(SUPPORT_LZHUFF_METHOD)
79 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
81 dnl whether use the -lh567- method
82 AC_MSG_CHECKING(default archive method is )
83 AC_ARG_WITH(default_method,
84 AC_HELP_STRING([--with-default-method=[[567]]],
85 [create the -lh[[567]]- archive default [[default=5]]]),
88 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
90 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 dnl 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)
106 AC_MSG_RESULT($with_tmp_file)
107 if test x"$with_tmp_file" != xno; then
108 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
109 [temporary file template for mktemp/mkstemp])
112 dnl incremental indicator
113 AC_ARG_ENABLE(indicator,
114 AC_HELP_STRING([--enable-indicator],
115 [need incremental indicator [[default=yes]]]),
118 enable_indicator=yes)
120 if test "x$enable_indicator" = xyes; then
121 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
124 dnl support multibyte filename
125 AC_ARG_ENABLE(multibyte-char,
126 AC_HELP_STRING([--enable-multibyte-char],
127 [support multibyte filename [[default=yes]]]),
130 enable_multibyte_char=yes)
132 if test "x$enable_multibyte_char" = xyes; then
133 AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
136 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
137 AC_CONFIG_FILES([tests/Makefile tests/lha-test])