From 8174c9ca720fdcb98f0da09de792ecea9d340691 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 4 Jan 2007 14:39:17 +0100 Subject: [PATCH] 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 --- config/include-Makefile.am | 2 -- mount/Makefile.am | 13 +++++++------ mount/fstab.c | 4 ++-- mount/fstab.h | 2 +- mount/mount.c | 7 +++++-- mount/{mntent.c => mount_mntent.c} | 2 +- mount/{mntent.h => mount_mntent.h} | 6 +++--- mount/{paths.h => mount_paths.h} | 5 +++++ 8 files changed, 24 insertions(+), 17 deletions(-) rename mount/{mntent.c => mount_mntent.c} (99%) rename mount/{mntent.h => mount_mntent.h} (87%) rename mount/{paths.h => mount_paths.h} (78%) diff --git a/config/include-Makefile.am b/config/include-Makefile.am index dceb914c..d3fffa76 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 87ff57b2..951fd405 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 1bedcf4b..2de44e68 100644 --- a/mount/fstab.c +++ b/mount/fstab.c @@ -9,12 +9,12 @@ #include #include #include -#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 f1d4e5c6..3daa8146 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 5dc62ef6..28770933 100644 --- a/mount/mount.c +++ b/mount/mount.c @@ -21,11 +21,14 @@ #include #include +#include +#include + #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 similarity index 99% rename from mount/mntent.c rename to mount/mount_mntent.c index 5c07c50f..9fecc924 100644 --- a/mount/mntent.c +++ b/mount/mount_mntent.c @@ -9,7 +9,7 @@ #include /* for index */ #include /* for isdigit */ #include /* 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 similarity index 87% rename from mount/mntent.h rename to mount/mount_mntent.h index 81e5dc89..3b742153 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 similarity index 78% rename from mount/paths.h rename to mount/mount_paths.h index d8cc575c..fe84e1d7 100644 --- a/mount/paths.h +++ b/mount/mount_paths.h @@ -1,3 +1,6 @@ +#ifndef MOUNT_PATHS_H +#define MOUNT_PATHS_H + #include #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 */ -- 2.39.5