OSDN Git Service

752636a7bf97896e34b8ba21aa91f3a4f7fc84f2
[lha/lha.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(lha, 1.14i-ac20020527a, jca02266@nifty.ne.jp)
3 AC_CANONICAL_TARGET
4 AM_INIT_AUTOMAKE
5 AM_CONFIG_HEADER(config.h)
6
7 AC_DEFINE_UNQUOTED(PLATFORM, "$ac_cv_host",
8                    [the type of system on which the package will run.])
9
10 dnl Checks for programs.
11 AC_PROG_CC
12 AC_PROG_GCC_TRADITIONAL
13 AC_PROG_INSTALL
14 AC_PROG_MAKE_SET
15 AC_MINIX
16 AM_C_PROTOTYPES
17
18 dnl Checks for libraries.
19
20 dnl Checks for header files.
21 AC_HEADER_DIRENT
22 AC_HEADER_STDC
23 AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/param.h sys/time.h)
24
25 dnl Checks for typedefs, structures, and compiler characteristics.
26 AC_C_CONST
27 AC_HEADER_TIME
28 AC_STRUCT_TM
29 AC_STRUCT_TIMEZONE
30
31 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
32 [
33 #if HAVE_SYS_TYPES_H
34 # include <sys/types.h>
35 #endif
36 #if HAVE_SYS_STAT_H
37 # include <sys/stat.h>
38 #endif
39 #if TIME_WITH_SYS_TIME
40 # include <sys/time.h>
41 # include <time.h>
42 #else
43 # if HAVE_SYS_TIME_H
44 #  include <sys/time.h>
45 # else
46 #  include <time.h>
47 # endif
48 #endif
49 ])
50
51 dnl Checks for library functions.
52 AC_TYPE_SIGNAL
53 AC_FUNC_FORK
54 AC_FUNC_UTIME_NULL
55 AC_CHECK_FUNCS(strchr strdup memcpy memset memmove)
56 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday utime)
57 AC_CHECK_FUNCS(mkdir rmdir ftruncate lchown mkstemp)
58 AC_CHECK_FUNCS(strcasecmp link)
59
60 if test $ac_header_dirent = no; then
61   AC_LIBOBJ(lhdir)
62 fi
63
64 dnl support kanji code conversion
65 AC_SUBST(DEF_KCODE)
66 AC_ARG_ENABLE(text_conv,
67   AC_HELP_STRING([--enable-text-conv],
68                  [support text code convert from/to EUC [[default=yes]]]),
69   , enable_text_conv=yes)
70
71 if test $enable_text_conv = yes; then
72   DEF_KCODE=-DEUC
73 fi
74
75 # force support -lh7-
76 AC_SUBST(SUPPORT_LZHUFF_METHOD)
77 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
78
79 dnl whether use the -lh567- method
80 AC_MSG_CHECKING(default archive method is )
81 AC_ARG_WITH(default_method,
82   AC_HELP_STRING([--with-default-method=[[567]]],
83                  [create the -lh[[567]]- archive default [[default=5]]]),
84   [case $withval in
85    [567]) ;;
86    *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
87    esac],
88   with_default_method=5)
89
90 AC_MSG_RESULT(-lh$with_default_method-)
91 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])
92
93 dnl decide temporary path names
94 AC_MSG_CHECKING(template of the temporary file is )
95 AC_ARG_WITH(tmp_file,
96   AC_HELP_STRING([--with-tmp-file=TEMPLATE],
97                  [temporary file template [[default=/tmp/lhXXXXXX]]]),
98   [case $withval in
99    yes)  with_tmp_file=/tmp/lhXXXXXX ;;
100    no)   ;;
101    esac],
102   with_tmp_file=/tmp/lhXXXXXX)
103
104 AC_MSG_RESULT($with_tmp_file)
105 if test x"$with_tmp_file" != xno; then
106   AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
107     [temporary file template for mktemp/mkstemp])
108 fi
109
110 dnl incremental indicator
111 AC_ARG_ENABLE(indicator,
112   AC_HELP_STRING([--enable-indicator],
113                  [need incremental indicator [[default=yes]]]),
114   ,
115   # default
116   enable_indicator=yes)
117
118 if test "x$enable_indicator" = xyes; then
119   AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
120 fi
121
122 dnl support multibyte filename
123 AC_ARG_ENABLE(multibyte-char,
124   AC_HELP_STRING([--enable-multibyte-char],
125                  [support multibyte filename [[default=yes]]]),
126   ,
127   # default
128   enable_multibyte_char=yes)
129
130 if test "x$enable_multibyte_char" = xyes; then
131   AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
132 fi
133
134 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
135 AC_CONFIG_FILES([tests/Makefile tests/lha-test])
136 AC_OUTPUT