OSDN Git Service

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