OSDN Git Service

* src/lharc.c (print_tiny_usage_and_exit): added credit.
[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 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
17 dnl on MINIX, define _MINIX and _POSIX_SOURCE
18 AC_MINIX
19
20 dnl Checks for libraries.
21
22 dnl Checks for header files.
23 AC_HEADER_DIRENT
24 AC_HEADER_STDC
25 AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/time.h)
26
27 dnl Checks for typedefs, structures, and compiler characteristics.
28 AC_HEADER_TIME
29 AC_STRUCT_TM
30 AC_STRUCT_TIMEZONE
31
32 AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
33 [AC_TRY_COMPILE([
34 #if TM_IN_SYS_TIME
35 #include <sys/time.h>
36 #else
37 #include <time.h>
38 #endif
39   ], [struct tm t; t.tm_gmtoff;],
40   ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
41 ])
42
43 if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
44   AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
45 fi
46
47 AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
48 [AC_TRY_COMPILE([
49 #include <sys/types.h>
50 #include <sys/stat.h>
51   ], [struct stat s; s.st_ino;],
52   ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
53 ])
54
55 if test "x$ac_cv_struct_st_ino" = xyes; then
56   AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
57 fi
58
59 dnl Checks for library functions.
60 AC_TYPE_SIGNAL
61 AC_FUNC_UTIME_NULL
62 AC_CHECK_FUNCS(strchr memcpy)
63 AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday)
64 AC_CHECK_FUNCS(mkdir rmdir strdup memset ftruncate lchown mkstemp)
65 AC_CHECK_FUNCS(strcasecmp link)
66
67 if test $ac_header_dirent = no; then
68   AC_LIBOBJ(lhdir)
69 fi
70
71 dnl support kanji code conversion
72 AC_SUBST(DEF_KCODE)
73 AC_ARG_ENABLE(text_conv,
74   [  --enable-text-conv      support text code convert from/to EUC [default=yes]],
75   , enable_text_conv=yes)
76
77 if test $enable_text_conv = yes; then
78   DEF_KCODE=-DEUC
79 fi
80
81 # force support -lh7-
82 AC_SUBST(SUPPORT_LZHUFF_METHOD)
83 SUPPORT_LZHUFF_METHOD=-DSUPPORT_LH7
84
85 dnl whether use the -lh567- method
86 AC_MSG_CHECKING(default archive method is )
87 AC_ARG_WITH(default_method,
88   [  --with-default-method=[567]  create the -lh[567]- archive default [default=5]],
89   [case $withval in
90    [567]) ;;
91    *) AC_MSG_ERROR(you should have specified 5, 6 or 7);;
92    esac],
93   with_default_method=5)
94
95 AC_MSG_RESULT(-lh$with_default_method-)
96 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
98 dnl decide path names
99 AC_MSG_CHECKING(template of the temporary file is )
100 AC_ARG_WITH(tmp_file,
101   [  --with-tmp-file=TEMPLATE temporary file template [default=/tmp/lhXXXXXX]],
102   [case $withval in
103    yes|no) AC_MSG_ERROR(you should have specified path name);;
104    esac],
105   with_tmp_file=/tmp/lhXXXXXX)
106
107 AC_MSG_RESULT($with_tmp_file)
108 AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
109   [temporary file template])
110
111 dnl incremental indicator
112 AC_ARG_ENABLE(indicator,
113   [  --enable-indicator      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   [  --enable-multibyte-char support multibyte(sjis) filename [default=yes]],
125   ,
126   # default
127   enable_multibyte_char=yes)
128
129 if test "x$enable_multibyte_char" = xyes; then
130   AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
131 fi
132
133 AC_CONFIG_FILES([Makefile src/Makefile man/Makefile])
134 AC_OUTPUT