summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore15
-rw-r--r--Makefile.am2
-rw-r--r--include/parted/Makefile.am37
-rw-r--r--include/parted/constraint.in.h (renamed from include/parted/constraint.h)0
-rw-r--r--include/parted/crc32.in.h (renamed from include/parted/crc32.h)0
-rw-r--r--include/parted/debug.in.h (renamed from include/parted/debug.h)0
-rw-r--r--include/parted/device.in.h (renamed from include/parted/device.h)0
-rw-r--r--include/parted/disk.in.h (renamed from include/parted/disk.h)0
-rw-r--r--include/parted/endian.in.h (renamed from include/parted/endian.h)0
-rw-r--r--include/parted/exception.in.h (renamed from include/parted/exception.h)0
-rw-r--r--include/parted/fdasd.in.h (renamed from include/parted/fdasd.h)0
-rw-r--r--include/parted/filesys.in.h (renamed from include/parted/filesys.h)0
-rw-r--r--include/parted/geom.in.h (renamed from include/parted/geom.h)0
-rw-r--r--include/parted/natmath.in.h (renamed from include/parted/natmath.h)0
-rw-r--r--include/parted/parted.in.h (renamed from include/parted/parted.h)0
-rw-r--r--include/parted/timer.in.h (renamed from include/parted/timer.h)0
-rw-r--r--include/parted/unit.in.h (renamed from include/parted/unit.h)0
-rw-r--r--include/parted/vtoc.in.h (renamed from include/parted/vtoc.h)0
18 files changed, 51 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index da8d7af..690bbbf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,21 @@
.tarball-version
.version
/ABOUT-NLS
+/include/parted/constraint.h
+/include/parted/crc32.h
+/include/parted/debug.h
+/include/parted/device.h
+/include/parted/disk.h
+/include/parted/endian.h
+/include/parted/exception.h
+/include/parted/fdasd.h
+/include/parted/filesys.h
+/include/parted/geom.h
+/include/parted/natmath.h
+/include/parted/parted.h
+/include/parted/timer.h
+/include/parted/unit.h
+/include/parted/vtoc.h
ABOUT-NLS
ChangeLog
GNUmakefile
diff --git a/Makefile.am b/Makefile.am
index ae252bd..5e52a42 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = po lib libparted parted partprobe include doc debug tests
+SUBDIRS = po lib include libparted parted partprobe doc debug tests
EXTRA_DIST = \
.version \
diff --git a/include/parted/Makefile.am b/include/parted/Makefile.am
index 022373f..a5d2687 100644
--- a/include/parted/Makefile.am
+++ b/include/parted/Makefile.am
@@ -4,8 +4,7 @@ else
S390_HDRS =
endif
-partedincludedir = $(includedir)/parted
-
+partedincludedir = $(includedir)/parted
partedinclude_HEADERS = constraint.h \
debug.h \
device.h \
@@ -22,4 +21,38 @@ noinst_HEADERS = crc32.h \
endian.h \
$(S390_HDRS)
+BUILT_SOURCES = \
+ $(partedinclude_HEADERS) \
+ $(noinst_HEADERS) \
+ fdasd.h \
+ vtoc.h
+
+EXTRA_DIST = $(BUILT_SOURCES:%.h=%.in.h)
+
+# We use _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE internally,
+# but cannot use those in a published header, so replace each of those
+# strings with its expansion.
+# Technically, attribute const was introduced in gcc-2.95 and
+# attribute pure in 2.96, but to keep it simple, we're testing
+# for 2.96 or newer for both.
+
+hash_if = \n\#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)\n
+subst_const_attr = \
+ s/ _GL_ATTRIBUTE_CONST\b/$(hash_if) __attribute ((__const__))\n\#endif\n/
+subst_pure_attr = \
+ s/ _GL_ATTRIBUTE_PURE\b/$(hash_if) __attribute ((__pure__))\n\#endif\n/
+
+$(BUILT_SOURCES): Makefile.am
+
+SUFFIXES = .in.h .h
+.in.h.h:
+ $(AM_V_GEN)rm -f $@ $@-t
+ $(AM_V_at)perl -p \
+ -e '$(subst_const_attr);' \
+ -e '$(subst_pure_attr);' \
+ $< > $@-t
+ $(AM_V_at)chmod a=r $@-t
+ $(AM_V_at)mv $@-t $@
+
MAINTAINERCLEANFILES = Makefile.in
+MAINTAINERCLEANFILES += $(BUILT_SOURCES)
diff --git a/include/parted/constraint.h b/include/parted/constraint.in.h
index 5f42fa0..5f42fa0 100644
--- a/include/parted/constraint.h
+++ b/include/parted/constraint.in.h
diff --git a/include/parted/crc32.h b/include/parted/crc32.in.h
index 74941f6..74941f6 100644
--- a/include/parted/crc32.h
+++ b/include/parted/crc32.in.h
diff --git a/include/parted/debug.h b/include/parted/debug.in.h
index 09b47ab..09b47ab 100644
--- a/include/parted/debug.h
+++ b/include/parted/debug.in.h
diff --git a/include/parted/device.h b/include/parted/device.in.h
index a3d1737..a3d1737 100644
--- a/include/parted/device.h
+++ b/include/parted/device.in.h
diff --git a/include/parted/disk.h b/include/parted/disk.in.h
index 46bde3f..46bde3f 100644
--- a/include/parted/disk.h
+++ b/include/parted/disk.in.h
diff --git a/include/parted/endian.h b/include/parted/endian.in.h
index 0e7c923..0e7c923 100644
--- a/include/parted/endian.h
+++ b/include/parted/endian.in.h
diff --git a/include/parted/exception.h b/include/parted/exception.in.h
index dd302b8..dd302b8 100644
--- a/include/parted/exception.h
+++ b/include/parted/exception.in.h
diff --git a/include/parted/fdasd.h b/include/parted/fdasd.in.h
index ac30134..ac30134 100644
--- a/include/parted/fdasd.h
+++ b/include/parted/fdasd.in.h
diff --git a/include/parted/filesys.h b/include/parted/filesys.in.h
index 2f74c91..2f74c91 100644
--- a/include/parted/filesys.h
+++ b/include/parted/filesys.in.h
diff --git a/include/parted/geom.h b/include/parted/geom.in.h
index 15ad017..15ad017 100644
--- a/include/parted/geom.h
+++ b/include/parted/geom.in.h
diff --git a/include/parted/natmath.h b/include/parted/natmath.in.h
index e1d09eb..e1d09eb 100644
--- a/include/parted/natmath.h
+++ b/include/parted/natmath.in.h
diff --git a/include/parted/parted.h b/include/parted/parted.in.h
index fbcb9aa..fbcb9aa 100644
--- a/include/parted/parted.h
+++ b/include/parted/parted.in.h
diff --git a/include/parted/timer.h b/include/parted/timer.in.h
index 7f25b2e..7f25b2e 100644
--- a/include/parted/timer.h
+++ b/include/parted/timer.in.h
diff --git a/include/parted/unit.h b/include/parted/unit.in.h
index 584a0c4..584a0c4 100644
--- a/include/parted/unit.h
+++ b/include/parted/unit.in.h
diff --git a/include/parted/vtoc.h b/include/parted/vtoc.in.h
index d79ce39..d79ce39 100644
--- a/include/parted/vtoc.h
+++ b/include/parted/vtoc.in.h