1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(lha, 1.14i-ac20020525)
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)
25 dnl Checks for typedefs, structures, and compiler characteristics.
31 AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
38 ], [struct tm t; t.tm_gmtoff;],
39 ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
42 if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
43 AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
46 AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
48 #include <sys/types.h>
50 ], [struct stat s; s.st_ino;],
51 ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
54 if test "x$ac_cv_struct_st_ino" = xyes; then
55 AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
58 dnl Checks for library functions.
62 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove)
63 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
64 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp)
65 AC_CHECK_FUNCS(strcasecmp link)
67 if test $ac_header_dirent = no; then
71 dnl support kanji code conversion
73 AC_ARG_ENABLE(text_conv,
74 AC_HELP_STRING([--enable-text-conv],
75 [support text code convert from/to EUC [[default=yes]]]),
76 , enable_text_conv=yes)
78 if test $enable_text_conv = yes; then
83 AC_SUBST(SUPPORT_LZHUFF_METHOD)
84 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
86 dnl whether use the -lh567- method
87 AC_MSG_CHECKING(default archive method is )
88 AC_ARG_WITH(default_method,
89 AC_HELP_STRING([--with-default-method=[[567]]],
90 [create the -lh[[567]]- archive default [[default=5]]]),
93 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
95 with_default_method=5)
97 AC_MSG_RESULT(-lh$with_default_method-)
98 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])
100 dnl decide temporary path names
101 AC_MSG_CHECKING(template of the temporary file is )
102 AC_ARG_WITH(tmp_file,
103 AC_HELP_STRING([--with-tmp-file=TEMPLATE],
104 [temporary file template [[default=/tmp/lhXXXXXX]]]),
106 yes) with_tmp_file=/tmp/lhXXXXXX ;;
109 with_tmp_file=/tmp/lhXXXXXX)
111 AC_MSG_RESULT($with_tmp_file)
112 if test x"$with_tmp_file" != xno; then
113 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
114 [temporary file template for mktemp/mkstemp])
117 dnl incremental indicator
118 AC_ARG_ENABLE(indicator,
119 AC_HELP_STRING([--enable-indicator],
120 [need incremental indicator [[default=yes]]]),
123 enable_indicator=yes)
125 if test "x$enable_indicator" = xyes; then
126 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
129 dnl support multibyte filename
130 AC_ARG_ENABLE(multibyte-char,
131 AC_HELP_STRING([--enable-multibyte-char],
132 [support multibyte filename [[default=yes]]]),
135 enable_multibyte_char=yes)
137 if test "x$enable_multibyte_char" = xyes; then
138 AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
141 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
142 AC_CONFIG_FILES([tests/Makefile tests/lha-test])