]> code.delx.au - gnu-emacs-elpa/blob - packages/notes-mode/configure.in
Add notes-mode.
[gnu-emacs-elpa] / packages / notes-mode / configure.in
1
2 dnl
3 dnl notes-mode configure.in
4 dnl Copyright (C) 1997-1998 by John Heidemann <johnh@isi.edu>
5 dnl
6
7 dnl Process this file with autoconf to produce a configure script.
8 AC_INIT(mkindexcache)
9
10 AC_SUBST(package)
11 package=notes-mode
12
13 dnl
14 dnl Find emacs
15 dnl
16 AC_CHECK_PROGS(emacsbin, emacs gemacs xemacs)
17
18 dnl
19 dnl Find perl*.
20 dnl
21 AC_PATH_PROGS(perlbin, perl perl5, no)
22 perl_vers=`$perlbin -e 'print $]'`
23 case $perl_vers in
24 [1234].*) perlbin=no;;
25 esac
26 if test "$perlbin" = no; then
27 AC_MSG_ERROR($package requires perl 5.0 or later.)
28 fi
29
30 dnl
31 dnl mkdir -p
32 dnl
33 AC_MSG_CHECKING([mkdir -p])
34 if mkdir -p /tmp/mkdir.$$
35 then
36 mkdir_p="mkdir -p "
37 rmdir /tmp/mkdir.$$
38 AC_MSG_RESULT($mkdir_p)
39 elif test -x ./install-sh
40 then
41 mkdir_p="./install-sh -d "
42 AC_MSG_RESULT($mkdir_p)
43 else
44 AC_MSG_RESULT([none found])
45 AC_MSG_WARN([ Couldn't find mkdir -p. You may have to manually mkdir some directories.])
46 mkdir_p="mkdir "
47 fi
48 AC_SUBST(mkdir_p)
49
50 dnl
51 dnl Generic things
52 dnl
53 AC_SUBST(prefix)
54 prefix_specified=true
55 if test "x$prefix" = xNONE -o "x$prefix" = xnone
56 then
57 # hack for install purposes
58 prefix=/usr/local
59 prefix_specified=false
60 fi
61
62 dnl
63 dnl Find lisp install
64 dnl
65 AC_MSG_CHECKING(lisp installation directory)
66 AC_ARG_WITH(lisp-dir, --with-lisp-dir=path specify a path for where to install .el files,lisp_dir=$withval,lisp_dir="")
67 if test x$lisp_dir = x
68 then
69 lisp_dir=`$emacsbin -batch -q -l notes-bootstrap.el -f notes-load-path | grep site-lisp | sed '2,$d'`
70 fi
71 if test "x$lisp_dir" = x
72 then
73 AC_MSG_RESULT(no site-lisp)
74 echo " ERROR: could not find site-lisp directory in load-path."
75 echo " Specify destination for lisp file with --with-lisp-dir=/your/path"
76 exit 1
77 fi
78 AC_MSG_RESULT($lisp_dir)
79 if $prefix_specified
80 then
81 if test "x$withval" = x
82 then
83 echo " WARNING: you gave a prefix of $prefix, but emacs wants lisp"
84 echo " code in $lisp_dir and so that's where it will be installed."
85 echo " (Currently --prefix doesn't change where lisp code goes.)"
86 echo " If you want to force it under your prefix,"
87 echo " then specify the configure option --with-lisp-dir=$prefix/whatever"
88 fi
89 fi
90 if test -w "$lisp_dir" -o ! -d "$lisp_dir"
91 then
92 :
93 else
94 echo " WARNING: You do not have write permissions to $lisp_dir."
95 echo " (Where the lisp code will be installed.)"
96 echo " Please do make install with more privileges (as root?),"
97 echo " fix permissions on the directory,"
98 echo " or specify a writable destination with --with-lisp-dir=/your/path."
99 fi
100 AC_SUBST(lisp_dir)
101
102 AC_MSG_CHECKING(script install directory)
103 AC_SUBST(datadir)
104 AC_MSG_RESULT($datadir/$package)
105 tdatadir=`eval "echo $datadir"`
106 if test -w "$tdatadir" -o ! -d "$tdatadir"
107 then
108 :
109 else
110 echo " WARNING: You do not have write permissions to $datadir ($tdatadir)."
111 echo " (The program scripts will be installed in $datadir/$package.)"
112 echo " Please do make install with more priviledges (as root?),"
113 echo " fix permissions on the directory,"
114 echo " or specify a writable destination with --datadir=/your/path."
115 fi
116 AC_MSG_CHECKING(info install directory)
117 AC_SUBST(infodir)
118 AC_MSG_RESULT($infodir)
119 tinfodir=`eval "echo $infodir"`
120 if test -w "$tinfodir" -o ! -d "$tinfodir"
121 then
122 :
123 else
124 echo " WARNING: You do not have write permissions to $infodir ($tinfodir)."
125 echo " (Where the info documentation will be put.)"
126 echo " Please do make install with more priviledges (as root?),"
127 echo " fix permissions on the directory,"
128 echo " or specify a writable destination with --infodir=/your/path."
129 fi
130 dnl install-info
131 AC_PATH_PROG(install_info, install-info, no, $PATH:/sbin:/usr/sbin)
132 install_info_section='--section=Emacs'
133 if test x"$install_info" = xno
134 then
135 echo " WARNING: Could not find install-info."
136 echo " you will need to add notes-info.info to"
137 echo " master file ($infodir/dir) manually."
138 else
139 dnl detect debian install-info
140 AC_MSG_CHECKING(debian install-info)
141 if $install_info --version 2>&1 |grep 'Ian Jackson' >/dev/null
142 then
143 install_info=no
144 echo " WARNING: You appear to have the Debian install info."
145 echo " Their install-info 1.10.21 has an incompatible usage of --section."
146 echo " Please get them to fix this problem."
147 echo " For now, I will install without specifying a section"
148 install_info_section=''
149 else
150 :
151 fi
152 fi
153 AC_SUBST(install_info_section)
154
155 AC_PROG_INSTALL
156
157 AC_OUTPUT(Makefile)