summaryrefslogtreecommitdiff
path: root/am
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-25 12:29:46 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-10-25 12:29:46 -0700
commitc42b3ab659c294e1c2a0de4b8bcbb4611eb3d005 (patch)
tree0116a99245903017b6839adc68b3cb2a900455a2 /am
downloadcpio-c42b3ab659c294e1c2a0de4b8bcbb4611eb3d005.tar.gz
cpio-c42b3ab659c294e1c2a0de4b8bcbb4611eb3d005.tar.bz2
cpio-c42b3ab659c294e1c2a0de4b8bcbb4611eb3d005.zip
Imported Upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'am')
-rw-r--r--am/flushleft.m428
-rw-r--r--am/pack.m467
-rw-r--r--am/sysdep.m43
3 files changed, 98 insertions, 0 deletions
diff --git a/am/flushleft.m4 b/am/flushleft.m4
new file mode 100644
index 0000000..d1cc11d
--- /dev/null
+++ b/am/flushleft.m4
@@ -0,0 +1,28 @@
+# This file is part of GNU cpio
+# Copyright (C) 2009 Free Software Foundation
+#
+# GNU cpio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU cpio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU cpio. If not, see <http://www.gnu.org/licenses/>.
+
+dnl CPIO_FLUSHLEFT -- remove all whitespace at the beginning of lines
+dnl This is useful for c-code which may include cpp statements
+dnl
+dnl WARNING: When editing this macro, make sure your editor does not
+dnl clobber the regexp argument to m4_bpatsubst: it must contain one
+dnl space and one tab (ASCII 9) character.
+dnl
+AC_DEFUN([CPIO_FLUSHLEFT],
+ [m4_changequote(`,')dnl
+ m4_bpatsubst(`$1', `^[ ]+')
+ m4_changequote([,])])dnl
+
diff --git a/am/pack.m4 b/am/pack.m4
new file mode 100644
index 0000000..c03c948
--- /dev/null
+++ b/am/pack.m4
@@ -0,0 +1,67 @@
+# This file is part of GNU cpio
+# Copyright (C) 2009 Free Software Foundation
+#
+# GNU cpio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GNU cpio is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU cpio. If not, see <http://www.gnu.org/licenses/>.
+
+# CPIO_PACKED_STRUCTS is based on code from ClamAV
+AC_DEFUN([CPIO_PACKED_STRUCTS],[
+ dnl check for __attribute__((packed))
+ AC_MSG_CHECKING([for structure packing via __attribute__((packed))])
+ AC_CACHE_VAL(cpio_cv_have_attrib_packed,[
+ AC_TRY_COMPILE(,
+ [struct { int i __attribute__((packed)); } s; ],
+ [have_attrib_packed=yes],
+ [have_attrib_packed=no])
+ ])
+ AC_MSG_RESULT($have_attrib_packed)
+
+ if test "$have_attrib_packed" = no; then
+ AC_MSG_CHECKING(for structure packing via pragma)
+ AC_CACHE_VAL(cpio_cv_have_pragma_pack,[
+ AC_TRY_RUN(CPIO_FLUSHLEFT([
+ int main(int argc, char **argv) {
+ #pragma pack(1)
+ struct { char c; long l; } s;
+ return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ]),
+ [have_pragma_pack=yes],
+ [have_pragma_pack=no])
+ ])
+ AC_MSG_RESULT($have_pragma_pack)
+ if test "$have_pragma_pack" = yes; then
+ AC_DEFINE(HAVE_PRAGMA_PACK, 1, "pragma pack")
+ else
+ AC_MSG_CHECKING(for structure packing via hppa/hp-ux pragma)
+ AC_CACHE_VAL(cpio_cv_have_pragma_pack_hpux,[
+ AC_TRY_RUN(CPIO_FLUSHLEFT([
+ /* hppa/hp-ux wants pragma outside of function */
+ #pragma pack 1
+ struct { char c; long l; } s;
+ int main(int argc, char **argv) {
+ return sizeof(s)==sizeof(s.c)+sizeof(s.l) ? 0:1; } ]),
+ [have_pragma_pack_hpux=yes],
+ [have_pragma_pack_hpux=no])
+ ])
+ AC_MSG_RESULT($have_pragma_pack_hpux)
+ AC_DEFINE(HAVE_PRAGMA_PACK_HPPA, 1, "pragma pack hppa/hp-ux style")
+ fi
+ fi
+
+ if test "${have_attrib_packed}${have_pragma_pack}$have_pragma_pack_hpux" = "nonono"; then
+ AC_MSG_ERROR(Need to know how to pack structures with this compiler)
+ fi
+
+ if test "$have_attrib_packed" = yes; then
+ AC_DEFINE(HAVE_ATTRIB_PACKED, 1, [attrib packed])
+ fi
+])
diff --git a/am/sysdep.m4 b/am/sysdep.m4
new file mode 100644
index 0000000..bb6fa41
--- /dev/null
+++ b/am/sysdep.m4
@@ -0,0 +1,3 @@
+# -*- buffer-read-only: t -*- vi: set ro:
+# THIS FILE IS GENERATED AUTOMATICALLY. PLEASE DO NOT EDIT.
+AC_DEFUN([CPIO_SYSDEP],[AC_CHECK_FUNCS([ getpwuid getpwnam getgrgid getgrnam pipe fork getuid geteuid getgid setuid setgid mknod symlink link chown])])