]> git.deb.at Git - pkg/abook.git/blob - aclocal.m4
Initial revision
[pkg/abook.git] / aclocal.m4
1 dnl aclocal.m4 generated automatically by aclocal 1.4
2
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
7
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
12
13 dnl ---------------------------------------------------------------------------
14 dnl Look for the curses libraries.  Older curses implementations may require
15 dnl termcap/termlib to be linked as well.
16 AC_DEFUN([CF_CURSES_LIBS],[
17 AC_CHECK_FUNC(initscr,,[
18 case $host_os in #(vi
19 freebsd*) #(vi
20         AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
21         ;;
22 hpux10.*|hpux11.*)
23         AC_CHECK_LIB(cur_colr,initscr,[
24                 LIBS="-lcur_colr $LIBS"
25                 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
26                 ac_cv_func_initscr=yes
27                 ],[
28         AC_CHECK_LIB(Hcurses,initscr,[
29                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
30                 LIBS="-lHcurses $LIBS"
31                 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
32                 ac_cv_func_initscr=yes
33                 ])])
34         ;;
35 linux*) # Suse Linux does not follow /usr/lib convention
36         LIBS="$LIBS -L/lib"
37         ;;
38 esac
39
40 if test ".$With5lib" != ".no" ; then
41 if test -d /usr/5lib ; then
42         # SunOS 3.x or 4.x
43         CPPFLAGS="$CPPFLAGS -I/usr/5include"
44         LIBS="$LIBS -L/usr/5lib"
45 fi
46 fi
47
48 if test ".$ac_cv_func_initscr" != .yes ; then
49         cf_save_LIBS="$LIBS"
50         cf_term_lib=""
51         cf_curs_lib=""
52
53         # Check for library containing tgoto.  Do this before curses library
54         # because it may be needed to link the test-case for initscr.
55         AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
56                 for cf_term_lib in termcap termlib unknown
57                 do
58                         AC_CHECK_LIB($cf_term_lib,tgoto,[break])
59                 done
60         ])
61
62         # Check for library containing initscr
63         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
64         for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
65         do
66                 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
67         done
68         test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
69
70         LIBS="-l$cf_curs_lib $cf_save_LIBS"
71         if test "$cf_term_lib" = unknown ; then
72                 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
73                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
74                         [initscr()],
75                         [cf_result=yes],
76                         [cf_result=no])
77                 AC_MSG_RESULT($cf_result)
78                 test $cf_result = no && AC_ERROR(Cannot link curses library)
79         elif test "$cf_term_lib" != predefined ; then
80                 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
81                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
82                         [initscr(); tgoto((char *)0, 0, 0);],
83                         [cf_result=no],
84                         [
85                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
86                         AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
87                                 [initscr()],
88                                 [cf_result=yes],
89                                 [cf_result=error])
90                         ])
91                 AC_MSG_RESULT($cf_result)
92         fi
93 fi
94
95 ])])
96
97 # Do all the work for Automake.  This macro actually does too much --
98 # some checks are only needed if your package does certain things.
99 # But this isn't really a big deal.
100
101 # serial 1
102
103 dnl Usage:
104 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
105
106 AC_DEFUN(AM_INIT_AUTOMAKE,
107 [AC_REQUIRE([AC_PROG_INSTALL])
108 PACKAGE=[$1]
109 AC_SUBST(PACKAGE)
110 VERSION=[$2]
111 AC_SUBST(VERSION)
112 dnl test to see if srcdir already configured
113 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
114   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
115 fi
116 ifelse([$3],,
117 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
118 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
119 AC_REQUIRE([AM_SANITY_CHECK])
120 AC_REQUIRE([AC_ARG_PROGRAM])
121 dnl FIXME This is truly gross.
122 missing_dir=`cd $ac_aux_dir && pwd`
123 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
124 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
125 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
126 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
127 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
128 AC_REQUIRE([AC_PROG_MAKE_SET])])
129
130 #
131 # Check to make sure that the build environment is sane.
132 #
133
134 AC_DEFUN(AM_SANITY_CHECK,
135 [AC_MSG_CHECKING([whether build environment is sane])
136 # Just in case
137 sleep 1
138 echo timestamp > conftestfile
139 # Do `set' in a subshell so we don't clobber the current shell's
140 # arguments.  Must try -L first in case configure is actually a
141 # symlink; some systems play weird games with the mod time of symlinks
142 # (eg FreeBSD returns the mod time of the symlink's containing
143 # directory).
144 if (
145    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
146    if test "[$]*" = "X"; then
147       # -L didn't work.
148       set X `ls -t $srcdir/configure conftestfile`
149    fi
150    if test "[$]*" != "X $srcdir/configure conftestfile" \
151       && test "[$]*" != "X conftestfile $srcdir/configure"; then
152
153       # If neither matched, then we have a broken ls.  This can happen
154       # if, for instance, CONFIG_SHELL is bash and it inherits a
155       # broken ls alias from the environment.  This has actually
156       # happened.  Such a system could not be considered "sane".
157       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
158 alias in your environment])
159    fi
160
161    test "[$]2" = conftestfile
162    )
163 then
164    # Ok.
165    :
166 else
167    AC_MSG_ERROR([newly created file is older than distributed files!
168 Check your system clock])
169 fi
170 rm -f conftest*
171 AC_MSG_RESULT(yes)])
172
173 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
174 dnl The program must properly implement --version.
175 AC_DEFUN(AM_MISSING_PROG,
176 [AC_MSG_CHECKING(for working $2)
177 # Run test in a subshell; some versions of sh will print an error if
178 # an executable is not found, even if stderr is redirected.
179 # Redirect stdin to placate older versions of autoconf.  Sigh.
180 if ($2 --version) < /dev/null > /dev/null 2>&1; then
181    $1=$2
182    AC_MSG_RESULT(found)
183 else
184    $1="$3/missing $2"
185    AC_MSG_RESULT(missing)
186 fi
187 AC_SUBST($1)])
188
189 # Like AC_CONFIG_HEADER, but automatically create stamp file.
190
191 AC_DEFUN(AM_CONFIG_HEADER,
192 [AC_PREREQ([2.12])
193 AC_CONFIG_HEADER([$1])
194 dnl When config.status generates a header, we must update the stamp-h file.
195 dnl This file resides in the same directory as the config header
196 dnl that is generated.  We must strip everything past the first ":",
197 dnl and everything past the last "/".
198 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
199 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
200 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
201 <<am_indx=1
202 for am_file in <<$1>>; do
203   case " <<$>>CONFIG_HEADERS " in
204   *" <<$>>am_file "*<<)>>
205     echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
206     ;;
207   esac
208   am_indx=`expr "<<$>>am_indx" + 1`
209 done<<>>dnl>>)
210 changequote([,]))])
211
212
213 # serial 1
214
215 AC_DEFUN(AM_C_PROTOTYPES,
216 [AC_REQUIRE([AM_PROG_CC_STDC])
217 AC_REQUIRE([AC_PROG_CPP])
218 AC_MSG_CHECKING([for function prototypes])
219 if test "$am_cv_prog_cc_stdc" != no; then
220   AC_MSG_RESULT(yes)
221   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
222   U= ANSI2KNR=
223 else
224   AC_MSG_RESULT(no)
225   U=_ ANSI2KNR=./ansi2knr
226   # Ensure some checks needed by ansi2knr itself.
227   AC_HEADER_STDC
228   AC_CHECK_HEADERS(string.h)
229 fi
230 AC_SUBST(U)dnl
231 AC_SUBST(ANSI2KNR)dnl
232 ])
233
234
235 # serial 1
236
237 # @defmac AC_PROG_CC_STDC
238 # @maindex PROG_CC_STDC
239 # @ovindex CC
240 # If the C compiler in not in ANSI C mode by default, try to add an option
241 # to output variable @code{CC} to make it so.  This macro tries various
242 # options that select ANSI C on some system or another.  It considers the
243 # compiler to be in ANSI C mode if it handles function prototypes correctly.
244 #
245 # If you use this macro, you should check after calling it whether the C
246 # compiler has been set to accept ANSI C; if not, the shell variable
247 # @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
248 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
249 # program @code{ansi2knr}, which comes with Ghostscript.
250 # @end defmac
251
252 AC_DEFUN(AM_PROG_CC_STDC,
253 [AC_REQUIRE([AC_PROG_CC])
254 AC_BEFORE([$0], [AC_C_INLINE])
255 AC_BEFORE([$0], [AC_C_CONST])
256 dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
257 dnl a magic option to avoid problems with ANSI preprocessor commands
258 dnl like #elif.
259 dnl FIXME: can't do this because then AC_AIX won't work due to a
260 dnl circular dependency.
261 dnl AC_BEFORE([$0], [AC_PROG_CPP])
262 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
263 AC_CACHE_VAL(am_cv_prog_cc_stdc,
264 [am_cv_prog_cc_stdc=no
265 ac_save_CC="$CC"
266 # Don't try gcc -ansi; that turns off useful extensions and
267 # breaks some systems' header files.
268 # AIX                   -qlanglvl=ansi
269 # Ultrix and OSF/1      -std1
270 # HP-UX                 -Aa -D_HPUX_SOURCE
271 # SVR4                  -Xc -D__EXTENSIONS__
272 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
273 do
274   CC="$ac_save_CC $ac_arg"
275   AC_TRY_COMPILE(
276 [#include <stdarg.h>
277 #include <stdio.h>
278 #include <sys/types.h>
279 #include <sys/stat.h>
280 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
281 struct buf { int x; };
282 FILE * (*rcsopen) (struct buf *, struct stat *, int);
283 static char *e (p, i)
284      char **p;
285      int i;
286 {
287   return p[i];
288 }
289 static char *f (char * (*g) (char **, int), char **p, ...)
290 {
291   char *s;
292   va_list v;
293   va_start (v,p);
294   s = g (p, va_arg (v,int));
295   va_end (v);
296   return s;
297 }
298 int test (int i, double x);
299 struct s1 {int (*f) (int a);};
300 struct s2 {int (*f) (double a);};
301 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
302 int argc;
303 char **argv;
304 ], [
305 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
306 ],
307 [am_cv_prog_cc_stdc="$ac_arg"; break])
308 done
309 CC="$ac_save_CC"
310 ])
311 if test -z "$am_cv_prog_cc_stdc"; then
312   AC_MSG_RESULT([none needed])
313 else
314   AC_MSG_RESULT($am_cv_prog_cc_stdc)
315 fi
316 case "x$am_cv_prog_cc_stdc" in
317   x|xno) ;;
318   *) CC="$CC $am_cv_prog_cc_stdc" ;;
319 esac
320 ])
321