* [mdadm PATCH] Move symbol definitions from source files to Makefile.
@ 2010-01-28 15:47 Artur Wojcik
2010-01-28 17:02 ` Andre Noll
2010-01-29 9:45 ` Neil Brown
0 siblings, 2 replies; 5+ messages in thread
From: Artur Wojcik @ 2010-01-28 15:47 UTC (permalink / raw)
To: linux-raid; +Cc: dan.j.williams, ed.ciechanowski
This patch will move _GNU_SOURCE and _FILE_OFFSET_BITS=64 from
various source files to Makefile.
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
---
Makefile | 10 +++++++---
managemon.c | 3 ---
mdadm.h | 2 --
mdmon.c | 4 ----
msg.c | 3 ---
5 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile
index deb6c34..901b3e0 100644
--- a/Makefile
+++ b/Makefile
@@ -47,10 +47,14 @@ ifdef WARN_UNUSED
CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
endif
+CPPFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+
ifdef DEBIAN
-CPPFLAGS= -DDEBIAN
-else
-CPPFLAGS=
+CPPFLAGS += -DDEBIAN
+endif
+
+ifdef DEBUG
+CPPFLAGS += -DDEBUG
endif
SYSCONFDIR = /etc
diff --git a/managemon.c b/managemon.c
index 47ed892..31809b6 100644
--- a/managemon.c
+++ b/managemon.c
@@ -99,9 +99,6 @@
* - Watch for change in raid-disks, chunk-size, etc. Update metadata and
* start a reshape.
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include "mdadm.h"
#include "mdmon.h"
#include <sys/syscall.h>
diff --git a/mdadm.h b/mdadm.h
index 4f193a8..2ea0175 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -22,8 +22,6 @@
* Email: <neilb@suse.de>
*/
-#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <unistd.h>
#if !defined(__dietlibc__) && !defined(__KLIBC__)
extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
diff --git a/mdmon.c b/mdmon.c
index 0ec4259..e378ffe 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -39,10 +39,6 @@
*
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
-
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/msg.c b/msg.c
index 8d52b94..7390fcb 100644
--- a/msg.c
+++ b/msg.c
@@ -16,9 +16,6 @@
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
#include <unistd.h>
#include <stdio.h>
#include <string.h>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [mdadm PATCH] Move symbol definitions from source files to Makefile.
2010-01-28 15:47 [mdadm PATCH] Move symbol definitions from source files to Makefile Artur Wojcik
@ 2010-01-28 17:02 ` Andre Noll
2010-01-29 9:45 ` Neil Brown
1 sibling, 0 replies; 5+ messages in thread
From: Andre Noll @ 2010-01-28 17:02 UTC (permalink / raw)
To: Artur Wojcik; +Cc: linux-raid, dan.j.williams, ed.ciechanowski
[-- Attachment #1: Type: text/plain, Size: 739 bytes --]
On 16:47, Artur Wojcik wrote:
> This patch will move _GNU_SOURCE and _FILE_OFFSET_BITS=64 from
> various source files to Makefile.
That's fine by me, but let's see what Neil has to say about this.
While cleaning up the #defines, we might want to get rid of a couple
of unused ones at the same time. BLKPG_ADD_PARTITION, START_MD,
REGISTER_DEV, MD_FEATURE_ALL, STDC, OF seem to be good candidates
for removal.
There are also quite some unused defines in super-ddf.c and
super-intel.c, presumably because these files contain code that was
copied from somewhere else. I'm not sure if it is worth to kill these
as well though.
Thanks
Andre
--
The only person who always got his work done by Friday was Robinson Crusoe
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mdadm PATCH] Move symbol definitions from source files to Makefile.
2010-01-28 15:47 [mdadm PATCH] Move symbol definitions from source files to Makefile Artur Wojcik
2010-01-28 17:02 ` Andre Noll
@ 2010-01-29 9:45 ` Neil Brown
2010-01-29 15:05 ` Artur Wojcik
1 sibling, 1 reply; 5+ messages in thread
From: Neil Brown @ 2010-01-29 9:45 UTC (permalink / raw)
To: Artur Wojcik; +Cc: linux-raid, dan.j.williams, ed.ciechanowski
On Thu, 28 Jan 2010 16:47:45 +0100
Artur Wojcik <artur.wojcik@intel.com> wrote:
> This patch will move _GNU_SOURCE and _FILE_OFFSET_BITS=64 from
> various source files to Makefile.
Why?
NeilBrown
>
> Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
> ---
> Makefile | 10 +++++++---
> managemon.c | 3 ---
> mdadm.h | 2 --
> mdmon.c | 4 ----
> msg.c | 3 ---
> 5 files changed, 7 insertions(+), 15 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index deb6c34..901b3e0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -47,10 +47,14 @@ ifdef WARN_UNUSED
> CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
> endif
>
> +CPPFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
> +
> ifdef DEBIAN
> -CPPFLAGS= -DDEBIAN
> -else
> -CPPFLAGS=
> +CPPFLAGS += -DDEBIAN
> +endif
> +
> +ifdef DEBUG
> +CPPFLAGS += -DDEBUG
> endif
>
> SYSCONFDIR = /etc
> diff --git a/managemon.c b/managemon.c
> index 47ed892..31809b6 100644
> --- a/managemon.c
> +++ b/managemon.c
> @@ -99,9 +99,6 @@
> * - Watch for change in raid-disks, chunk-size, etc. Update metadata and
> * start a reshape.
> */
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
> #include "mdadm.h"
> #include "mdmon.h"
> #include <sys/syscall.h>
> diff --git a/mdadm.h b/mdadm.h
> index 4f193a8..2ea0175 100644
> --- a/mdadm.h
> +++ b/mdadm.h
> @@ -22,8 +22,6 @@
> * Email: <neilb@suse.de>
> */
>
> -#define _GNU_SOURCE
> -#define _FILE_OFFSET_BITS 64
> #include <unistd.h>
> #if !defined(__dietlibc__) && !defined(__KLIBC__)
> extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence));
> diff --git a/mdmon.c b/mdmon.c
> index 0ec4259..e378ffe 100644
> --- a/mdmon.c
> +++ b/mdmon.c
> @@ -39,10 +39,6 @@
> *
> */
>
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
> -
> #include <unistd.h>
> #include <stdlib.h>
> #include <sys/types.h>
> diff --git a/msg.c b/msg.c
> index 8d52b94..7390fcb 100644
> --- a/msg.c
> +++ b/msg.c
> @@ -16,9 +16,6 @@
> * this program; if not, write to the Free Software Foundation, Inc.,
> * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
> */
> -#ifndef _GNU_SOURCE
> -#define _GNU_SOURCE
> -#endif
> #include <unistd.h>
> #include <stdio.h>
> #include <string.h>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mdadm PATCH] Move symbol definitions from source files to Makefile.
2010-01-29 9:45 ` Neil Brown
@ 2010-01-29 15:05 ` Artur Wojcik
2010-01-29 21:54 ` Neil Brown
0 siblings, 1 reply; 5+ messages in thread
From: Artur Wojcik @ 2010-01-29 15:05 UTC (permalink / raw)
To: Neil Brown; +Cc: linux-raid, Williams, Dan J, Ciechanowski, Ed
On Fri, 2010-01-29 at 09:45 +0000, Neil Brown wrote:
> On Thu, 28 Jan 2010 16:47:45 +0100
> Artur Wojcik <artur.wojcik@intel.com> wrote:
>
> > This patch will move _GNU_SOURCE and _FILE_OFFSET_BITS=64 from
> > various source files to Makefile.
>
> Why?
>
The reason is to clean up the code. The new files will appear soon and I
want this two definitions to be set globally instead of per source file.
There's the plan to use GNU autotools to simply the build process, too.
Thanks,
Artur
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [mdadm PATCH] Move symbol definitions from source files to Makefile.
2010-01-29 15:05 ` Artur Wojcik
@ 2010-01-29 21:54 ` Neil Brown
0 siblings, 0 replies; 5+ messages in thread
From: Neil Brown @ 2010-01-29 21:54 UTC (permalink / raw)
To: Artur Wojcik; +Cc: linux-raid, Williams, Dan J, Ciechanowski, Ed
On Fri, 29 Jan 2010 16:05:58 +0100
Artur Wojcik <artur.wojcik@intel.com> wrote:
> On Fri, 2010-01-29 at 09:45 +0000, Neil Brown wrote:
> > On Thu, 28 Jan 2010 16:47:45 +0100
> > Artur Wojcik <artur.wojcik@intel.com> wrote:
> >
> > > This patch will move _GNU_SOURCE and _FILE_OFFSET_BITS=64 from
> > > various source files to Makefile.
> >
> > Why?
> >
>
> The reason is to clean up the code. The new files will appear soon and I
> want this two definitions to be set globally instead of per source file.
Personally, I prefer them to be set just where they are needed. You could
possibly convince me to put them in mdadm.h, but not in Makefile.
>
> There's the plan to use GNU autotools to simply the build process, too.
That plan should be dropped immediately. It won't happen.
NeilBrown
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-29 21:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-28 15:47 [mdadm PATCH] Move symbol definitions from source files to Makefile Artur Wojcik
2010-01-28 17:02 ` Andre Noll
2010-01-29 9:45 ` Neil Brown
2010-01-29 15:05 ` Artur Wojcik
2010-01-29 21:54 ` Neil Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.