OSDN Git Service

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