1 # Process this file with autoconf to produce a configure script.
2 AC_INIT([LHa for UNIX], 1.14i-ac20020617, jca02266@nifty.ne.jp, lha)
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 # checks readdir(). opendir() has been checked and cached by AC_HEADER_DIRENT.
58 AC_SEARCH_LIBS(readdir, [mingwex])
59 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove)
60 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
61 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp)
62 AC_CHECK_FUNCS(strcasecmp link)
63 AC_CHECK_FUNCS(getpwuid getgrgid getpwnam getgrnam)
65 if test $ac_header_dirent = no; then
69 # support kanji code conversion
71 AC_ARG_ENABLE(text_conv,
72 AC_HELP_STRING([--enable-text-conv],
73 [support text code convert from/to EUC [[default=yes]]]),
74 , enable_text_conv=yes)
76 if test $enable_text_conv = yes; then
81 AC_SUBST(SUPPORT_LZHUFF_METHOD)
82 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
84 # whether use the -lh567- method
85 AC_MSG_CHECKING(default archive method is )
86 AC_ARG_WITH(default_method,
87 AC_HELP_STRING([--with-default-method=[[567]]],
88 [create the -lh[[567]]- archive default [[default=5]]]),
91 *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
93 with_default_method=5)
94 AC_MSG_RESULT(-lh$with_default_method-)
95 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])
97 # decide temporary path names
98 AC_MSG_CHECKING(template of the temporary file is )
100 AC_HELP_STRING([--with-tmp-file=TEMPLATE],
101 [temporary file template [[default=/tmp/lhXXXXXX]]]),
103 yes) with_tmp_file=/tmp/lhXXXXXX ;;
106 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 # incremental indicator
114 AC_ARG_ENABLE(indicator,
115 AC_HELP_STRING([--enable-indicator],
116 [need incremental indicator [[default=yes]]]),
119 enable_indicator=yes)
120 if test "x$enable_indicator" = xyes; then
121 AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1,
122 [Define to 1 if you want to use the incremental indicator])
125 # support multibyte filename
126 AC_ARG_ENABLE(multibyte-filename,
127 AC_HELP_STRING([--enable-multibyte-filename],
128 [support multibyte filename [[default=yes]]]),
131 enable_multibyte_filename=yes)
132 if test "x$enable_multibyte_filename" = xyes; then
133 AC_DEFINE(MULTIBYTE_FILENAME, 1,
134 [Define to 1 if you want to use multibyte filename])
137 # make user/group name extented header
138 AC_ARG_ENABLE(user-name-header,
139 AC_HELP_STRING([--enable-user-name-header],
140 [make user/group name extended header [[default=no]]]),
143 enable_user_name_header=no)
144 if test "x$user_name_header" = xyes; then
145 AC_DEFINE(INCLUDE_OWNER_NAME_IN_HEADER, 1,
146 [Define to 1 if you want to use the user/group name extened header])
149 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
150 AC_CONFIG_FILES([tests/Makefile tests/lha-test])