OSDN Git Service

* configure.in, configure.ac, config.h.in: checks having
[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 AC_CHECK_HEADERS(pwd.h grp.h)
25
26 dnl Checks for typedefs, structures, and compiler characteristics.
27 AC_C_CONST
28 AC_HEADER_TIME
29 AC_STRUCT_TM
30 AC_STRUCT_TIMEZONE
31
32 AC_CHECK_MEMBERS([struct tm.tm_gmtoff, struct stat.st_ino],,,
33 [
34 #if HAVE_SYS_TYPES_H
35 # include <sys/types.h>
36 #endif
37 #if HAVE_SYS_STAT_H
38 # include <sys/stat.h>
39 #endif
40 #if TIME_WITH_SYS_TIME
41 # include <sys/time.h>
42 # include <time.h>
43 #else
44 # if HAVE_SYS_TIME_H
45 #  include <sys/time.h>
46 # else
47 #  include <time.h>
48 # endif
49 #endif
50 ])
51
52 dnl Checks for library functions.
53 AC_TYPE_SIGNAL
54 AC_FUNC_FORK
55 AC_FUNC_UTIME_NULL
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)
61
62 if test $ac_header_dirent = no; then
63   AC_LIBOBJ(lhdir)
64 fi
65
66 dnl support kanji code conversion
67 AC_SUBST(DEF_KCODE)
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)
72
73 if test $enable_text_conv = yes; then
74   DEF_KCODE=-DEUC
75 fi
76
77 # force support -lh7-
78 AC_SUBST(SUPPORT_LZHUFF_METHOD)
79 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
80
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]]]),
86   [case $withval in
87    [567]) ;;
88    *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
89    esac],
90   with_default_method=5)
91
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])
94
95 dnl decide temporary path names
96 AC_MSG_CHECKING(template of the temporary file is )
97 AC_ARG_WITH(tmp_file,
98   AC_HELP_STRING([--with-tmp-file=TEMPLATE],
99                  [temporary file template [[default=/tmp/lhXXXXXX]]]),
100   [case $withval in
101    yes)  with_tmp_file=/tmp/lhXXXXXX ;;
102    no)   ;;
103    esac],
104   with_tmp_file=/tmp/lhXXXXXX)
105
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])
110 fi
111
112 dnl incremental indicator
113 AC_ARG_ENABLE(indicator,
114   AC_HELP_STRING([--enable-indicator],
115                  [need incremental indicator [[default=yes]]]),
116   ,
117   # default
118   enable_indicator=yes)
119
120 if test "x$enable_indicator" = xyes; then
121   AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
122 fi
123
124 dnl support multibyte filename
125 AC_ARG_ENABLE(multibyte-char,
126   AC_HELP_STRING([--enable-multibyte-char],
127                  [support multibyte filename [[default=yes]]]),
128   ,
129   # default
130   enable_multibyte_char=yes)
131
132 if test "x$enable_multibyte_char" = xyes; then
133   AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
134 fi
135
136 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
137 AC_CONFIG_FILES([tests/Makefile tests/lha-test])
138 AC_OUTPUT