summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2007-01-04 14:39:17 +0100
committerKarel Zak2007-01-04 14:39:17 +0100
commit8174c9ca720fdcb98f0da09de792ecea9d340691 (patch)
tree40e4503fc4d1a9038ed1db90c3cae7eecda74372
parenttests: add basic infrastructure for regression tests (diff)
downloadkernel-qcow2-util-linux-8174c9ca720fdcb98f0da09de792ecea9d340691.tar.gz
kernel-qcow2-util-linux-8174c9ca720fdcb98f0da09de792ecea9d340691.tar.xz
kernel-qcow2-util-linux-8174c9ca720fdcb98f0da09de792ecea9d340691.zip
build-sys: remove DEFAULT_INCLUDES workaround
The automake stuff uses "-I.". as a default gcc option for includes. This is a problem for source code where is local includes with a same name like system includes (e.g. mntent.h, paths.h). Possible workaround is overwrite the automake DEFAULT_INCLUDES variable. But this solution produces warnings. The best way (this patch) is probably rename the files and remove DEFAULT_INCLUDES. Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--config/include-Makefile.am2
-rw-r--r--mount/Makefile.am13
-rw-r--r--mount/fstab.c4
-rw-r--r--mount/fstab.h2
-rw-r--r--mount/mount.c7
-rw-r--r--mount/mount_mntent.c (renamed from mount/mntent.c)2
-rw-r--r--mount/mount_mntent.h (renamed from mount/mntent.h)6
-rw-r--r--mount/mount_paths.h (renamed from mount/paths.h)5
8 files changed, 24 insertions, 17 deletions
diff --git a/config/include-Makefile.am b/config/include-Makefile.am
index dceb914ce..d3fffa760 100644
--- a/config/include-Makefile.am
+++ b/config/include-Makefile.am
@@ -6,7 +6,5 @@ mandir = $(datadir)/man
AM_CPPFLAGS = -include $(top_builddir)/config.h -I$(top_srcdir)/include
-DEFAULT_INCLUDES =
-
DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
diff --git a/mount/Makefile.am b/mount/Makefile.am
index 87ff57b21..951fd4051 100644
--- a/mount/Makefile.am
+++ b/mount/Makefile.am
@@ -8,12 +8,13 @@ bin_PROGRAMS = mount umount
sbin_PROGRAMS = losetup swapon
man_MANS = fstab.5 nfs.5 mount.8 swapoff.8 swapon.8 umount.8 losetup.8
-MNTHDRS = fstab.h linux_fs.h mntent.h mount_constants.h my_dev_t.h paths.h \
- get_label_uuid.h lomount.h mount_blkid.h mount_guess_fstype.h \
- nfs_mount4.h realpath.h xmalloc.h getusername.h loop.h mount_by_label.h \
- mount_guess_rootdev.h nfsmount.h sundries.h
+MNTHDRS = fstab.h linux_fs.h mount_mntent.h mount_constants.h my_dev_t.h \
+ mount_paths.h get_label_uuid.h lomount.h mount_blkid.h \
+ mount_guess_fstype.h nfs_mount4.h realpath.h xmalloc.h \
+ getusername.h loop.h mount_by_label.h mount_guess_rootdev.h \
+ nfsmount.h sundries.h
-mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \
+mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
get_label_uuid.c mount_by_label.c mount_blkid.c mount_guess_fstype.c \
getusername.c \
nfsmount.c nfsmount_xdr.c nfsmount_clnt.c \
@@ -22,7 +23,7 @@ mount_SOURCES = mount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \
mount_LDADD = $(top_srcdir)/lib/libenv.a $(top_srcdir)/lib/libsetproctitle.a
-umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mntent.c \
+umount_SOURCES = umount.c fstab.c sundries.c xmalloc.c realpath.c mount_mntent.c \
getusername.c get_label_uuid.c mount_by_label.c mount_blkid.c \
lomount.c \
$(MNTHDRS)
diff --git a/mount/fstab.c b/mount/fstab.c
index 1bedcf4b7..2de44e68f 100644
--- a/mount/fstab.c
+++ b/mount/fstab.c
@@ -9,12 +9,12 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
-#include "mntent.h"
+#include "mount_mntent.h"
#include "fstab.h"
#include "sundries.h"
#include "xmalloc.h"
#include "mount_blkid.h"
-#include "paths.h"
+#include "mount_paths.h"
#include "nls.h"
#define streq(s, t) (strcmp ((s), (t)) == 0)
diff --git a/mount/fstab.h b/mount/fstab.h
index f1d4e5c64..3daa81469 100644
--- a/mount/fstab.h
+++ b/mount/fstab.h
@@ -1,4 +1,4 @@
-#include "mntent.h"
+#include "mount_mntent.h"
int mtab_is_writable(void);
int mtab_does_not_exist(void);
int is_mounted_once(const char *name);
diff --git a/mount/mount.c b/mount/mount.c
index 5dc62ef62..28770933e 100644
--- a/mount/mount.c
+++ b/mount/mount.c
@@ -21,11 +21,14 @@
#include <sys/wait.h>
#include <sys/mount.h>
+#include <mntent.h>
+#include <paths.h>
+
#include "mount_blkid.h"
#include "mount_constants.h"
#include "sundries.h"
#include "xmalloc.h"
-#include "mntent.h"
+#include "mount_mntent.h"
#include "fstab.h"
#include "lomount.h"
#include "loop.h"
@@ -34,7 +37,7 @@
#include "mount_guess_fstype.h"
#include "mount_by_label.h"
#include "getusername.h"
-#include "paths.h"
+#include "mount_paths.h"
#include "env.h"
#include "nls.h"
diff --git a/mount/mntent.c b/mount/mount_mntent.c
index 5c07c50f4..9fecc924a 100644
--- a/mount/mntent.c
+++ b/mount/mount_mntent.c
@@ -9,7 +9,7 @@
#include <string.h> /* for index */
#include <ctype.h> /* for isdigit */
#include <sys/stat.h> /* for umask */
-#include "mntent.h"
+#include "mount_mntent.h"
#include "sundries.h" /* for xmalloc */
#include "nls.h"
diff --git a/mount/mntent.h b/mount/mount_mntent.h
index 81e5dc89a..3b7421535 100644
--- a/mount/mntent.h
+++ b/mount/mount_mntent.h
@@ -1,5 +1,5 @@
-#ifndef MY_MNTENT_H
-#define MY_MNTENT_H
+#ifndef MOUNT_MNTENT_H
+#define MOUNT_MNTENT_H
struct my_mntent {
const char *mnt_fsname;
@@ -25,4 +25,4 @@ void my_endmntent (mntFILE *mfp);
int my_addmntent (mntFILE *mfp, struct my_mntent *mnt);
struct my_mntent *my_getmntent (mntFILE *mfp);
-#endif
+#endif /* MOUNT_MNTENT_H */
diff --git a/mount/paths.h b/mount/mount_paths.h
index d8cc575ca..fe84e1d7e 100644
--- a/mount/paths.h
+++ b/mount/mount_paths.h
@@ -1,3 +1,6 @@
+#ifndef MOUNT_PATHS_H
+#define MOUNT_PATHS_H
+
#include <mntent.h>
#define _PATH_FSTAB "/etc/fstab"
#ifdef _PATH_MOUNTED
@@ -8,3 +11,5 @@
#define MOUNTED_TEMP "/etc/mtab.tmp"
#endif
#define LOCK_TIMEOUT 10
+
+#endif /* MOUNT_PATHS_H */