OSDN Git Service

update
[my-fortune/my-fortune.git] / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3 # $Id: configure.ac 16 2008-01-09 10:28:32Z ace $
4
5
6 AC_PREREQ(2.61)
7 AC_INIT(fortune-my, 0.1, ace@momiage.org)
8                     
9 # Checks for programs.
10 AC_PATH_PROGS(NKF,nkf)
11 AC_PATH_PROGS(STRFILE,strfile)
12 AC_PATH_PROGS(SUDO,sudo)
13
14
15 AC_ARG_WITH(encode,
16         AS_HELP_STRING(
17           [--with-encode=type], [euc,utf8 (default utf8)]),
18           if test x${withval} == 'xutf8' ; then
19             ENCODE="--utf8"
20           elif test x$withval == xeuc; then
21             ENCODE="--euc"
22           else
23             AC_MSG_ERROR(strange encode type)
24           fi
25         )
26 if test x$ENCODE == x; then
27    ENCODE='--utf8'
28 fi
29           
30 AC_ARG_WITH(fortunes-dir,
31         AS_HELP_STRING(
32           [--with-fortunes-dir=PATH], [fortunes data dir.]),
33         [DATADIR=$withval])
34
35 if test x$DATADIR == x; then
36    if test -d /usr/share/games/fortunes; then
37      DATADIR=/usr/share/games/fortunes/my
38    elif test -d /usr/share/games/fortune; then
39      DATADIR=/usr/share/games/fortune/my
40    else
41      AC_MSG_ERROR([fortunes data directory can't find.
42      Please use --with-fortunes-dir=dir.])
43    fi
44 fi
45         
46 #if test x$fortunes_dir == x; then 
47 #  AC_PATH_TOOL(DATADIR, fortunes,,[/usr/share/games/fortunes,/usr/share/games/fortune])
48 #  if test "x$DATADIR" == x; then
49 #     AC_MSG_ERROR([fortunes data directory cannot found.
50 #     Please use --with-fortunes-dir=dir.])
51 #  fi
52 #fi
53         
54 # Checks for libraries.
55
56 # Checks for header files.
57
58 # Checks for typedefs, structures, and compiler characteristics.
59
60 # Checks for library functions.
61 AC_SUBST(nkf)
62 AC_SUBST(strfile)
63 AC_SUBST(sudo)
64 AC_SUBST(DATADIR)
65 AC_CONFIG_FILES(Makefile)
66 AC_SUBST(ENCODE)
67 AC_CONFIG_FILES(txt2.sh)
68 AC_OUTPUT