aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2004-08-30 16:14:06 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2004-08-30 16:14:06 +0000
commit3017690e98fafb5fa2eaf17b020a2993845e5f13 (patch)
tree5fb3fdbdf51010a357f9dea4aeb56d7003281bf6
parent75b7015cc2475a1f470d4914c51b6de07eb4144c (diff)
downloadcpio-3017690e98fafb5fa2eaf17b020a2993845e5f13.tar.gz
cpio-3017690e98fafb5fa2eaf17b020a2993845e5f13.tar.bz2
Check for AC_SYS_LARGEFILE.
Use AC_CONFIG_LINKS to provide for fnmatch.h and getopt.h on the systems where these are missing Check for argp and replace it if necessary.
-rw-r--r--configure.ac69
1 files changed, 67 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 6aaa94a..392538e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,6 +33,9 @@ AC_PROG_INSTALL
AC_AIX
AC_MINIX
AC_ISC_POSIX
+
+AC_SYS_LARGEFILE
+
AC_TYPE_SIGNAL
AC_HEADER_MAJOR
AC_C_CONST
@@ -105,6 +108,7 @@ if test $have_fnmatch = yes ; then
else
AC_MSG_RESULT(no)
AC_LIBOBJ(fnmatch)
+ AC_CONFIG_LINKS(src/fnmatch.h:headers/fnmatch.h)
fi
AC_CHECK_FUNCS(lchown endpwent endgrent)
@@ -135,11 +139,67 @@ int argc; char **argv;
cpio_cv_have_gnu_getopt=no)
if test x"$cpio_cv_have_gnu_getopt" != xyes ; then
- dnl MU_HEADER(getopt.h)
+ AC_CONFIG_LINKS(src/getopt.h:headers/getopt.h)
AC_LIBOBJ(getopt)
AC_LIBOBJ(getopt1)
fi
+USE_INCLUDED_ARGP=
+AC_ARG_WITH([included-argp],
+ AC_HELP_STRING([--with-included-argp],
+ [Use included argp library]),
+ [USE_INCLUDED_ARGP=${withval}],
+ [AC_CHECK_HEADER(argp.h,
+ [AC_CHECK_FUNCS(argp_parse, :,
+ [USE_INCLUDED_ARGP=yes])],
+ [USE_INCLUDED_ARGP=yes])])
+
+if test "$USE_INCLUDED_ARGP" = yes; then
+ AC_LIBOBJ(argp-ba)
+ AC_LIBOBJ(argp-eexst)
+ AC_LIBOBJ(argp-fmtstream)
+ AC_LIBOBJ(argp-fs-xinl)
+ AC_LIBOBJ(argp-help)
+ AC_LIBOBJ(argp-parse)
+ AC_LIBOBJ(argp-pv)
+ AC_LIBOBJ(argp-pvh)
+ AC_LIBOBJ(argp-xinl)
+ AC_LIBOBJ(pin)
+ AC_CONFIG_LINKS(src/argp.h:headers/argp.h)
+fi
+
+save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS -Isrc"
+AC_MSG_CHECKING(whether extern program_invocation_name is present)
+AC_TRY_COMPILE([#include <argp.h>
+#include <errno.h>],
+[ program_invocation_name = "test"; ],
+[AC_DEFINE(PROGRAM_INVOCATION_NAME_DECLARED,1,
+ [Define if program_invocation_name is declared in argp.h])
+ AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)])
+
+AH_BOTTOM([
+#ifndef PROGRAM_INVOCATION_NAME_DECLARED
+extern char *program_invocation_short_name;
+extern char *program_invocation_name;
+#endif])
+
+AC_MSG_CHECKING(whether program_invocation_name is declared)
+AC_TRY_COMPILE([#include <argp.h>
+#include <errno.h>],
+[
+#ifndef PROGRAM_INVOCATION_NAME_DECLARED
+ extern char *program_invocation_name;
+#endif
+ program_invocation_name = "test";
+],
+[AC_DEFINE(HAVE_PROGRAM_INVOCATION_NAME,1,
+ [Define if the variable program_invocation_name exists])
+ AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)])
+CPPFLAGS=$save_CPPFLAGS
+
# Gettext.
AM_GNU_GETTEXT([external], [need-ngettext])
AM_GNU_GETTEXT_VERSION(0.13)
@@ -150,4 +210,9 @@ AH_BOTTOM([
#define N_(s) gettext_noop(s)
])
-AC_OUTPUT(Makefile doc/Makefile src/Makefile po/Makefile.in)
+AC_CONFIG_FILES([Makefile
+ doc/Makefile
+ headers/Makefile
+ src/Makefile
+ po/Makefile.in])
+AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.