1 dnl Process this file with autoconf to produce a configure script.
3 AM_INIT_AUTOMAKE(lha, 1.14i)
4 AM_CONFIG_HEADER(config.h)
8 AC_DEFINE_UNQUOTED(PLATFORM, "$ac_cv_host",
9 [the type of system on which the package will run.])
11 dnl Checks for programs.
13 AC_PROG_GCC_TRADITIONAL
17 dnl on MINIX, define _MINIX and _POSIX_SOURCE
23 dnl Checks for libraries.
25 dnl Checks for header files.
28 AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/time.h)
30 dnl Checks for typedefs, structures, and compiler characteristics.
35 AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
42 ], [struct tm t; t.tm_gmtoff;],
43 ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
46 if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
47 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
50 AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
52 #include <sys/types.h>
54 ], [struct stat s; s.st_ino;],
55 ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
58 if test "x$ac_cv_struct_st_ino" = xyes; then
59 AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
62 dnl Checks for library functions.
65 AC_CHECK_FUNCS(strchr memcpy)
66 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday)
67 AC_CHECK_FUNCS(mkdir rmdir strdup memset ftruncate lchown mkstemp)
68 AC_CHECK_FUNCS(strcasecmp link)
71 if test $ac_header_dirent = no; then
72 LIBOBJS="$LIBOBJS lhdir.o"
75 dnl support kanji code conversion
77 AC_ARG_ENABLE(text_conv,
78 [ --enable-text-conv support text code convert from/to EUC [default=yes]],
79 , enable_text_conv=yes)
81 if test $enable_text_conv = yes; then
86 AC_SUBST(SUPPORT_LZHUFF_METHOD)
87 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
89 dnl whether use the -lh567- method
90 AC_MSG_CHECKING(default archive method is )
91 AC_ARG_WITH(default_method,
92 [ --with-default-method=[567] create the -lh[567]- archive default [default=5]],
95 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
97 with_default_method=5)
99 AC_MSG_RESULT(-lh$with_default_method-)
100 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])
102 dnl decide path names
103 AC_MSG_CHECKING(template of the temporary file is )
104 AC_ARG_WITH(tmp_file,
105 [ --with-tmp-file=TEMPLATE temporary file template [default=/tmp/lhXXXXXX]],
107 yes|no) AC_MSG_ERROR(you should have specified path name);;
109 with_tmp_file=/tmp/lhXXXXXX)
111 AC_MSG_RESULT($with_tmp_file)
112 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
113 [temporary file template])
115 dnl incremental indicator
116 AC_ARG_ENABLE(indicator,
117 [ --enable-indicator need incremental indicator [default=yes]],
120 enable_indicator=yes)
122 if test "x$enable_indicator" = xyes; then
123 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
126 dnl support multibyte filename
127 AC_ARG_ENABLE(multibyte-char,
128 [ --enable-multibyte-char support multibyte(sjis) 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_OUTPUT([Makefile src/Makefile man/Makefile])