OSDN Git Service

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