1 | dnl Process this file with autoconf to produce a configure script.
|
---|
2 | dnl This file is part of GNU cpio
|
---|
3 | dnl Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
---|
4 | dnl
|
---|
5 | dnl This program is free software; you can redistribute it and/or modify
|
---|
6 | dnl it under the terms of the GNU General Public License as published by
|
---|
7 | dnl the Free Software Foundation; either version 2, or (at your option)
|
---|
8 | dnl any later version.
|
---|
9 | dnl
|
---|
10 | dnl This program is distributed in the hope that it will be useful,
|
---|
11 | dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
12 | dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
13 | dnl GNU General Public License for more details.
|
---|
14 | dnl
|
---|
15 | dnl You should have received a copy of the GNU General Public License
|
---|
16 | dnl along with this program; if not, write to the Free Software Foundation,
|
---|
17 | dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
---|
18 |
|
---|
19 | AC_INIT([GNU cpio], [2.7], [bug-cpio@gnu.org], [cpio])
|
---|
20 | AC_CONFIG_SRCDIR(src/cpio.h)
|
---|
21 | AC_CONFIG_AUX_DIR([build-aux])
|
---|
22 | AM_INIT_AUTOMAKE
|
---|
23 | AC_CONFIG_HEADERS([config.h])
|
---|
24 |
|
---|
25 | AC_PREREQ([2.59])
|
---|
26 |
|
---|
27 | dnl Check for programs
|
---|
28 | gl_USE_SYSTEM_EXTENSIONS
|
---|
29 | AC_PROG_CC
|
---|
30 | AC_PROG_CPP
|
---|
31 | AC_PROG_GCC_TRADITIONAL
|
---|
32 | AC_PROG_INSTALL
|
---|
33 | AC_PROG_RANLIB
|
---|
34 | AC_C_PROTOTYPES
|
---|
35 |
|
---|
36 | AC_SYS_LARGEFILE
|
---|
37 |
|
---|
38 | AC_TYPE_SIGNAL
|
---|
39 | AC_HEADER_MAJOR
|
---|
40 | AC_C_CONST
|
---|
41 | AC_TYPE_UID_T
|
---|
42 | AC_CHECK_TYPE(gid_t, int)
|
---|
43 | AC_HEADER_STDC
|
---|
44 | AC_HEADER_DIRENT
|
---|
45 |
|
---|
46 | cpio_GNULIB
|
---|
47 | cpio_PAXUTILS
|
---|
48 |
|
---|
49 | AC_SUBST(CPIO_MT_PROG)
|
---|
50 |
|
---|
51 | AC_ARG_ENABLE(mt,
|
---|
52 | AC_HELP_STRING([--enable-mt], [Enable building of mt program]),
|
---|
53 | [case $enableval in
|
---|
54 | yes) CPIO_MT_PROG='mt$(EXEEXT)';;
|
---|
55 | no) ;;
|
---|
56 | esac])
|
---|
57 |
|
---|
58 | AC_CHECK_HEADERS(unistd.h stdlib.h string.h fcntl.h sys/io/trioctl.h utmp.h getopt.h locale.h libintl.h sys/wait.h utime.h locale.h)
|
---|
59 | AC_REPLACE_FUNCS(bcopy mkdir strdup strerror)
|
---|
60 |
|
---|
61 | AC_MSG_CHECKING(for sys_errlist and sys_nerr)
|
---|
62 | AC_TRY_RUN(
|
---|
63 | extern char *sys_errlist[[]];
|
---|
64 | extern int sys_nerr;
|
---|
65 | main() { char *s = sys_errlist[[0]]; return 0; },
|
---|
66 | AC_DEFINE(HAVE_SYS_ERRLIST,1,
|
---|
67 | [Define if your system has sys_errlist global variable])
|
---|
68 | AC_MSG_RESULT(yes),
|
---|
69 | AC_MSG_RESULT(no),
|
---|
70 | AC_MSG_RESULT(don't know))
|
---|
71 |
|
---|
72 | AC_CHECK_DECLS([errno, sys_nerr, sys_errlist, getpwnam, getgrnam, getgrgid, strdup, strerror, getenv, atoi, exit], , , [
|
---|
73 | #include <stdio.h>
|
---|
74 | #include <stdlib.h>
|
---|
75 | #include <errno.h>
|
---|
76 | #ifdef HAVE_STRING_H
|
---|
77 | # include <string.h>
|
---|
78 | #else
|
---|
79 | # include <strings.h>
|
---|
80 | #endif
|
---|
81 | #include <pwd.h>
|
---|
82 | #include <grp.h>])
|
---|
83 |
|
---|
84 | dnl Checks for fnmatch
|
---|
85 | have_fnmatch=no
|
---|
86 | AC_MSG_CHECKING(for working fnmatch)
|
---|
87 | dnl Some versions of Solaris have a fnmatch() function, but it doesn't work!
|
---|
88 | dnl So we run a test program. If we're cross-compiling, do it the old way.
|
---|
89 | AC_TRY_RUN([
|
---|
90 | main() {
|
---|
91 | if (fnmatch ("a*", "abc", 0) == 0) return 0;
|
---|
92 | else return 1; }],
|
---|
93 | have_fnmatch=yes, have_fnmatch=no, have_fnmatch=no)
|
---|
94 | if test $have_fnmatch = yes ; then
|
---|
95 | AC_MSG_RESULT(yes)
|
---|
96 | else
|
---|
97 | AC_MSG_RESULT(no)
|
---|
98 | AC_LIBOBJ(fnmatch)
|
---|
99 | AC_CONFIG_LINKS(src/fnmatch.h:headers/fnmatch.h)
|
---|
100 | fi
|
---|
101 |
|
---|
102 | AC_CHECK_FUNCS(lchown endpwent endgrent)
|
---|
103 | AC_FUNC_VPRINTF
|
---|
104 | AC_FUNC_ALLOCA
|
---|
105 |
|
---|
106 | # Gettext.
|
---|
107 | AM_GNU_GETTEXT([external], [need-formatstring-macros])
|
---|
108 | AM_GNU_GETTEXT_VERSION(0.15)
|
---|
109 |
|
---|
110 | # Initialize the test suite.
|
---|
111 | AC_CONFIG_TESTDIR(tests)
|
---|
112 | AC_CONFIG_FILES([tests/Makefile tests/atlocal]) # FIXME: tests/preset?
|
---|
113 | AM_MISSING_PROG([AUTOM4TE], [autom4te])
|
---|
114 |
|
---|
115 | AC_CONFIG_FILES([Makefile
|
---|
116 | doc/Makefile
|
---|
117 | headers/Makefile
|
---|
118 | lib/Makefile
|
---|
119 | rmt/Makefile
|
---|
120 | src/Makefile
|
---|
121 | po/Makefile.in])
|
---|
122 | AC_OUTPUT
|
---|