* [PATCH] tools: honour --libdir when it is passed to ./configure
@ 2012-06-20 0:46 Matt Wilson
2012-06-20 8:51 ` Roger Pau Monne
2012-06-20 9:10 ` Ian Campbell
0 siblings, 2 replies; 9+ messages in thread
From: Matt Wilson @ 2012-06-20 0:46 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
Currently shared libraries are automatically installed into /usr/lib
or /usr/lib64, depending on the supplied --prefix value and
$(XEN_TARGET_ARCH). Some systems, like recent Debian and Ubuntu releases,
do not use /usr/lib64, but instead /usr/lib/x86_64-linux-gnu.
With this change, packagers can supply the desired location for shared
libraries on the ./configure command line. Packagers need to note that
the default behaviour on 64-bit Linux systems will be to install shared
libraries in /usr/lib, not /usr/lib64, unless a --libdir value is provided
to ./configure.
Additionally, the libfsimage plugins are now loaded explicitly from
$LIBDIR/fs, removing platform-based decision trees in code.
Signed-off-by: Matt Wilson <msw@amazon.com>
diff -r 32034d1914a6 -r 0a592e08ac31 config/StdGNU.mk
--- a/config/StdGNU.mk Thu Jun 07 19:46:57 2012 +0100
+++ b/config/StdGNU.mk Wed Jun 20 00:40:15 2012 +0000
@@ -35,7 +35,6 @@ INCLUDEDIR = $(PREFIX)/include
LIBLEAFDIR = lib
LIBLEAFDIR_x86_32 = lib
LIBLEAFDIR_x86_64 ?= lib64
-LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
LIBEXEC = $(LIBDIR_x86_32)/xen/bin
diff -r 32034d1914a6 -r 0a592e08ac31 config/SunOS.mk
--- a/config/SunOS.mk Thu Jun 07 19:46:57 2012 +0100
+++ b/config/SunOS.mk Wed Jun 20 00:40:15 2012 +0000
@@ -24,7 +24,6 @@ BINDIR = $(PREFIX)/bin
INCLUDEDIR = $(PREFIX)/include
LIBLEAFDIR = lib
LIBLEAFDIR_x86_64 = lib/amd64
-LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
MANDIR = $(PREFIX)/share/man
MAN1DIR = $(MANDIR)/man1
diff -r 32034d1914a6 -r 0a592e08ac31 config/Tools.mk.in
--- a/config/Tools.mk.in Thu Jun 07 19:46:57 2012 +0100
+++ b/config/Tools.mk.in Wed Jun 20 00:40:15 2012 +0000
@@ -1,5 +1,7 @@
# Prefix and install folder
PREFIX := @prefix@
+exec_prefix := @exec_prefix@
+LIBDIR := @libdir@
LIBLEAFDIR_x86_64 := @LIB_PATH@
# A debug build of tools?
diff -r 32034d1914a6 -r 0a592e08ac31 config/x86_64.mk
--- a/config/x86_64.mk Thu Jun 07 19:46:57 2012 +0100
+++ b/config/x86_64.mk Wed Jun 20 00:40:15 2012 +0000
@@ -11,7 +11,6 @@ CONFIG_IOEMU := y
CFLAGS += -m64
LIBLEAFDIR = $(LIBLEAFDIR_x86_64)
-LIBDIR = $(LIBDIR_x86_64)
SunOS_LIBDIR = $(SunOS_LIBDIR_x86_64)
diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/Rules.mk
--- a/tools/libfsimage/Rules.mk Thu Jun 07 19:46:57 2012 +0100
+++ b/tools/libfsimage/Rules.mk Wed Jun 20 00:40:15 2012 +0000
@@ -1,17 +1,12 @@
include $(XEN_ROOT)/tools/Rules.mk
-CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/
+CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
CFLAGS += -Werror -D_GNU_SOURCE
LDFLAGS += -L../common/
PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
-FSDIR-$(CONFIG_Linux) = $(LIBDIR)/fs/$(FS)
-FSDIR-$(CONFIG_SunOS)-x86_64 = $(PREFIX)/lib/fs/$(FS)/64
-FSDIR-$(CONFIG_SunOS)-x86_32 = $(PREFIX)/lib/fs/$(FS)/
-FSDIR-$(CONFIG_SunOS) = $(FSDIR-$(CONFIG_SunOS)-$(XEN_TARGET_ARCH))
-FSDIR-$(CONFIG_NetBSD) = $(LIBDIR)/fs/$(FS)
-FSDIR = $(FSDIR-y)
+FSDIR = $(LIBDIR)/fs
FSLIB = fsimage.so
@@ -20,8 +15,8 @@ fs-all: $(FSLIB)
.PHONY: fs-install
fs-install: fs-all
- $(INSTALL_DIR) $(DESTDIR)$(FSDIR)
- $(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)
+ $(INSTALL_DIR) $(DESTDIR)$(FSDIR)/$(FS)
+ $(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)/$(FS)
$(FSLIB): $(PIC_OBJS)
$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/common/Makefile
--- a/tools/libfsimage/common/Makefile Thu Jun 07 19:46:57 2012 +0100
+++ b/tools/libfsimage/common/Makefile Wed Jun 20 00:40:15 2012 +0000
@@ -1,5 +1,5 @@
XEN_ROOT = $(CURDIR)/../../..
-include $(XEN_ROOT)/tools/Rules.mk
+include $(XEN_ROOT)/tools/libfsimage/Rules.mk
MAJOR = 1.0
MINOR = 0
diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/common/fsimage_plugin.c
--- a/tools/libfsimage/common/fsimage_plugin.c Thu Jun 07 19:46:57 2012 +0100
+++ b/tools/libfsimage/common/fsimage_plugin.c Wed Jun 20 00:40:15 2012 +0000
@@ -122,7 +122,6 @@ fail:
static int load_plugins(void)
{
const char *fsdir = getenv("FSIMAGE_FSDIR");
- const char *isadir = "";
struct dirent *dp = NULL;
struct dirent *dpp;
DIR *dir = NULL;
@@ -131,27 +130,12 @@ static int load_plugins(void)
int err;
int ret = -1;
-#if defined(FSIMAGE_FSDIR)
+#if !defined(FSIMAGE_FSDIR)
+#error FSIMAGE_FSDIR not defined
+#else
if (fsdir == NULL)
fsdir = FSIMAGE_FSDIR;
-#elif defined(__sun__)
- if (fsdir == NULL)
- fsdir = "/usr/lib/fs";
-
- if (sizeof(void *) == 8)
- isadir = "64/";
-#elif defined(__ia64__)
- if (fsdir == NULL)
- fsdir = "/usr/lib/fs";
-#else
- if (fsdir == NULL) {
- if (sizeof(void *) == 8)
- fsdir = "/usr/lib64/fs";
- else
- fsdir = "/usr/lib/fs";
- }
#endif
-
if ((name_max = pathconf(fsdir, _PC_NAME_MAX)) == -1)
goto fail;
@@ -172,8 +156,8 @@ static int load_plugins(void)
if (strcmp(dpp->d_name, "..") == 0)
continue;
- (void) snprintf(tmp, name_max, "%s/%s/%sfsimage.so", fsdir,
- dpp->d_name, isadir);
+ (void) snprintf(tmp, name_max, "%s/%s/fsimage.so", fsdir,
+ dpp->d_name);
if (init_plugin(tmp) != 0)
goto fail;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 0:46 [PATCH] tools: honour --libdir when it is passed to ./configure Matt Wilson
@ 2012-06-20 8:51 ` Roger Pau Monne
2012-06-20 16:44 ` Matt Wilson
2012-06-20 9:10 ` Ian Campbell
1 sibling, 1 reply; 9+ messages in thread
From: Roger Pau Monne @ 2012-06-20 8:51 UTC (permalink / raw)
To: Matt Wilson; +Cc: Ian Campbell, xen-devel
Matt Wilson wrote:
> Currently shared libraries are automatically installed into /usr/lib
> or /usr/lib64, depending on the supplied --prefix value and
> $(XEN_TARGET_ARCH). Some systems, like recent Debian and Ubuntu releases,
> do not use /usr/lib64, but instead /usr/lib/x86_64-linux-gnu.
>
> With this change, packagers can supply the desired location for shared
> libraries on the ./configure command line. Packagers need to note that
> the default behaviour on 64-bit Linux systems will be to install shared
> libraries in /usr/lib, not /usr/lib64, unless a --libdir value is provided
> to ./configure.
>
> Additionally, the libfsimage plugins are now loaded explicitly from
> $LIBDIR/fs, removing platform-based decision trees in code.
>
> Signed-off-by: Matt Wilson<msw@amazon.com>
Thanks for the patch! The way FSIMAGE_FSDIR is set is really wrong.
> diff -r 32034d1914a6 -r 0a592e08ac31 config/StdGNU.mk
> --- a/config/StdGNU.mk Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/StdGNU.mk Wed Jun 20 00:40:15 2012 +0000
> @@ -35,7 +35,6 @@ INCLUDEDIR = $(PREFIX)/include
> LIBLEAFDIR = lib
> LIBLEAFDIR_x86_32 = lib
> LIBLEAFDIR_x86_64 ?= lib64
> -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
> LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
> LIBEXEC = $(LIBDIR_x86_32)/xen/bin
> diff -r 32034d1914a6 -r 0a592e08ac31 config/SunOS.mk
> --- a/config/SunOS.mk Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/SunOS.mk Wed Jun 20 00:40:15 2012 +0000
> @@ -24,7 +24,6 @@ BINDIR = $(PREFIX)/bin
> INCLUDEDIR = $(PREFIX)/include
> LIBLEAFDIR = lib
> LIBLEAFDIR_x86_64 = lib/amd64
> -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
> MANDIR = $(PREFIX)/share/man
> MAN1DIR = $(MANDIR)/man1
Can we clean this a little bit more, and remove LIBDIR_x86_32,
LIBLEAFDIR_x86_64, LIBDIR_x86_64, LIBDIR_x86_32 and LIBLEAFDIR?
> diff -r 32034d1914a6 -r 0a592e08ac31 config/Tools.mk.in
> --- a/config/Tools.mk.in Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/Tools.mk.in Wed Jun 20 00:40:15 2012 +0000
> @@ -1,5 +1,7 @@
> # Prefix and install folder
> PREFIX := @prefix@
> +exec_prefix := @exec_prefix@
> +LIBDIR := @libdir@
> LIBLEAFDIR_x86_64 := @LIB_PATH@
>
> # A debug build of tools?
> diff -r 32034d1914a6 -r 0a592e08ac31 config/x86_64.mk
> --- a/config/x86_64.mk Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/x86_64.mk Wed Jun 20 00:40:15 2012 +0000
> @@ -11,7 +11,6 @@ CONFIG_IOEMU := y
> CFLAGS += -m64
>
> LIBLEAFDIR = $(LIBLEAFDIR_x86_64)
> -LIBDIR = $(LIBDIR_x86_64)
>
> SunOS_LIBDIR = $(SunOS_LIBDIR_x86_64)
>
> diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/Rules.mk
> --- a/tools/libfsimage/Rules.mk Thu Jun 07 19:46:57 2012 +0100
> +++ b/tools/libfsimage/Rules.mk Wed Jun 20 00:40:15 2012 +0000
> @@ -1,17 +1,12 @@
> include $(XEN_ROOT)/tools/Rules.mk
>
> -CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/
> +CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
I would prefer to set FSIMAGE_FSDIR or an equivalent define in
tools/config.h and include that header in
tools/libfsimage/common/fsimage_plugin.h, so we don't have to pass that
value from the compiler command line.
> CFLAGS += -Werror -D_GNU_SOURCE
> LDFLAGS += -L../common/
>
> PIC_OBJS := $(patsubst %.c,%.opic,$(LIB_SRCS-y))
>
> -FSDIR-$(CONFIG_Linux) = $(LIBDIR)/fs/$(FS)
> -FSDIR-$(CONFIG_SunOS)-x86_64 = $(PREFIX)/lib/fs/$(FS)/64
> -FSDIR-$(CONFIG_SunOS)-x86_32 = $(PREFIX)/lib/fs/$(FS)/
> -FSDIR-$(CONFIG_SunOS) = $(FSDIR-$(CONFIG_SunOS)-$(XEN_TARGET_ARCH))
> -FSDIR-$(CONFIG_NetBSD) = $(LIBDIR)/fs/$(FS)
> -FSDIR = $(FSDIR-y)
> +FSDIR = $(LIBDIR)/fs
>
> FSLIB = fsimage.so
>
> @@ -20,8 +15,8 @@ fs-all: $(FSLIB)
>
> .PHONY: fs-install
> fs-install: fs-all
> - $(INSTALL_DIR) $(DESTDIR)$(FSDIR)
> - $(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)
> + $(INSTALL_DIR) $(DESTDIR)$(FSDIR)/$(FS)
> + $(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)/$(FS)
>
> $(FSLIB): $(PIC_OBJS)
> $(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
> diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/common/Makefile
> --- a/tools/libfsimage/common/Makefile Thu Jun 07 19:46:57 2012 +0100
> +++ b/tools/libfsimage/common/Makefile Wed Jun 20 00:40:15 2012 +0000
> @@ -1,5 +1,5 @@
> XEN_ROOT = $(CURDIR)/../../..
> -include $(XEN_ROOT)/tools/Rules.mk
> +include $(XEN_ROOT)/tools/libfsimage/Rules.mk
>
> MAJOR = 1.0
> MINOR = 0
> diff -r 32034d1914a6 -r 0a592e08ac31 tools/libfsimage/common/fsimage_plugin.c
> --- a/tools/libfsimage/common/fsimage_plugin.c Thu Jun 07 19:46:57 2012 +0100
> +++ b/tools/libfsimage/common/fsimage_plugin.c Wed Jun 20 00:40:15 2012 +0000
> @@ -122,7 +122,6 @@ fail:
> static int load_plugins(void)
> {
> const char *fsdir = getenv("FSIMAGE_FSDIR");
> - const char *isadir = "";
> struct dirent *dp = NULL;
> struct dirent *dpp;
> DIR *dir = NULL;
> @@ -131,27 +130,12 @@ static int load_plugins(void)
> int err;
> int ret = -1;
>
> -#if defined(FSIMAGE_FSDIR)
> +#if !defined(FSIMAGE_FSDIR)
> +#error FSIMAGE_FSDIR not defined
> +#else
> if (fsdir == NULL)
> fsdir = FSIMAGE_FSDIR;
> -#elif defined(__sun__)
> - if (fsdir == NULL)
> - fsdir = "/usr/lib/fs";
> -
> - if (sizeof(void *) == 8)
> - isadir = "64/";
> -#elif defined(__ia64__)
> - if (fsdir == NULL)
> - fsdir = "/usr/lib/fs";
> -#else
> - if (fsdir == NULL) {
> - if (sizeof(void *) == 8)
> - fsdir = "/usr/lib64/fs";
> - else
> - fsdir = "/usr/lib/fs";
> - }
> #endif
> -
> if ((name_max = pathconf(fsdir, _PC_NAME_MAX)) == -1)
> goto fail;
>
> @@ -172,8 +156,8 @@ static int load_plugins(void)
> if (strcmp(dpp->d_name, "..") == 0)
> continue;
>
> - (void) snprintf(tmp, name_max, "%s/%s/%sfsimage.so", fsdir,
> - dpp->d_name, isadir);
> + (void) snprintf(tmp, name_max, "%s/%s/fsimage.so", fsdir,
> + dpp->d_name);
>
> if (init_plugin(tmp) != 0)
> goto fail;
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 0:46 [PATCH] tools: honour --libdir when it is passed to ./configure Matt Wilson
2012-06-20 8:51 ` Roger Pau Monne
@ 2012-06-20 9:10 ` Ian Campbell
2012-06-20 16:41 ` Matt Wilson
1 sibling, 1 reply; 9+ messages in thread
From: Ian Campbell @ 2012-06-20 9:10 UTC (permalink / raw)
To: Matt Wilson; +Cc: xen-devel
On Wed, 2012-06-20 at 01:46 +0100, Matt Wilson wrote:
> Currently shared libraries are automatically installed into /usr/lib
> or /usr/lib64, depending on the supplied --prefix value and
> $(XEN_TARGET_ARCH). Some systems, like recent Debian and Ubuntu releases,
> do not use /usr/lib64, but instead /usr/lib/x86_64-linux-gnu.
>
> With this change, packagers can supply the desired location for shared
> libraries on the ./configure command line. Packagers need to note that
> the default behaviour on 64-bit Linux systems will be to install shared
> libraries in /usr/lib, not /usr/lib64, unless a --libdir value is provided
> to ./configure.
>
> Additionally, the libfsimage plugins are now loaded explicitly from
> $LIBDIR/fs, removing platform-based decision trees in code.
>
> Signed-off-by: Matt Wilson <msw@amazon.com>
Thanks for doing this.
> diff -r 32034d1914a6 -r 0a592e08ac31 config/StdGNU.mk
> --- a/config/StdGNU.mk Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/StdGNU.mk Wed Jun 20 00:40:15 2012 +0000
> @@ -35,7 +35,6 @@ INCLUDEDIR = $(PREFIX)/include
> LIBLEAFDIR = lib
> LIBLEAFDIR_x86_32 = lib
> LIBLEAFDIR_x86_64 ?= lib64
> -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
> LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
Roger already asked if we can somehow get rid of all the LEAFDIR stuff
too.
> diff -r 32034d1914a6 -r 0a592e08ac31 config/Tools.mk.in
> --- a/config/Tools.mk.in Thu Jun 07 19:46:57 2012 +0100
> +++ b/config/Tools.mk.in Wed Jun 20 00:40:15 2012 +0000
> @@ -1,5 +1,7 @@
> # Prefix and install folder
> PREFIX := @prefix@
> +exec_prefix := @exec_prefix@
Is exec_prefix related to this change?
> +LIBDIR := @libdir@
> LIBLEAFDIR_x86_64 := @LIB_PATH@
>
> # A debug build of tools?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 9:10 ` Ian Campbell
@ 2012-06-20 16:41 ` Matt Wilson
2012-06-20 16:44 ` Ian Campbell
0 siblings, 1 reply; 9+ messages in thread
From: Matt Wilson @ 2012-06-20 16:41 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
On Wed, Jun 20, 2012 at 02:10:35AM -0700, Ian Campbell wrote:
> On Wed, 2012-06-20 at 01:46 +0100, Matt Wilson wrote:
> >
> > LIBLEAFDIR = lib
> > LIBLEAFDIR_x86_32 = lib
> > LIBLEAFDIR_x86_64 ?= lib64
> > -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> > LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
> > LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
>
> Roger already asked if we can somehow get rid of all the LEAFDIR stuff
> too.
That'd be lovely. I was a little worried about the python syspath
bits, but now that I've looked to see that it uses distutils that
should be fine.
> > diff -r 32034d1914a6 -r 0a592e08ac31 config/Tools.mk.in
> > --- a/config/Tools.mk.in Thu Jun 07 19:46:57 2012 +0100
> > +++ b/config/Tools.mk.in Wed Jun 20 00:40:15 2012 +0000
> > @@ -1,5 +1,7 @@
> > # Prefix and install folder
> > PREFIX := @prefix@
> > +exec_prefix := @exec_prefix@
>
> Is exec_prefix related to this change?
Yes, libdir defauts to ${exec_prefix}/lib, so if we don't bring
exec_prefix into Tooks.mk, files will land in /lib by default instead
of /usr/lib.
Matt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 8:51 ` Roger Pau Monne
@ 2012-06-20 16:44 ` Matt Wilson
2012-06-20 16:51 ` Ian Campbell
2012-06-20 18:27 ` Matt Wilson
0 siblings, 2 replies; 9+ messages in thread
From: Matt Wilson @ 2012-06-20 16:44 UTC (permalink / raw)
To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel
On Wed, Jun 20, 2012 at 01:51:17AM -0700, Roger Pau Monne wrote:
> Matt Wilson wrote:
> > Signed-off-by: Matt Wilson<msw@amazon.com>
>
> Thanks for the patch! The way FSIMAGE_FSDIR is set is really wrong.
No problem. The FSIMAGE_FSDIR bit was a gross hack so I didn't have to
touch autoconf, which I try to avoid. ;-)
> > diff -r 32034d1914a6 -r 0a592e08ac31 config/SunOS.mk
> > --- a/config/SunOS.mk Thu Jun 07 19:46:57 2012 +0100
> > +++ b/config/SunOS.mk Wed Jun 20 00:40:15 2012 +0000
> > @@ -24,7 +24,6 @@ BINDIR = $(PREFIX)/bin
> > INCLUDEDIR = $(PREFIX)/include
> > LIBLEAFDIR = lib
> > LIBLEAFDIR_x86_64 = lib/amd64
> > -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> > LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
> > MANDIR = $(PREFIX)/share/man
> > MAN1DIR = $(MANDIR)/man1
>
> Can we clean this a little bit more, and remove LIBDIR_x86_32,
> LIBLEAFDIR_x86_64, LIBDIR_x86_64, LIBDIR_x86_32 and LIBLEAFDIR?
I was thinking that too, but was a little worried about expectations
on Solaris. Maybe I souldn't.
> > -CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/
> > +CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
>
> I would prefer to set FSIMAGE_FSDIR or an equivalent define in
> tools/config.h and include that header in
> tools/libfsimage/common/fsimage_plugin.h, so we don't have to pass that
> value from the compiler command line.
Makes sense.
Matt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 16:41 ` Matt Wilson
@ 2012-06-20 16:44 ` Ian Campbell
0 siblings, 0 replies; 9+ messages in thread
From: Ian Campbell @ 2012-06-20 16:44 UTC (permalink / raw)
To: Matt Wilson; +Cc: xen-devel
On Wed, 2012-06-20 at 17:41 +0100, Matt Wilson wrote:
> On Wed, Jun 20, 2012 at 02:10:35AM -0700, Ian Campbell wrote:
> > On Wed, 2012-06-20 at 01:46 +0100, Matt Wilson wrote:
> > >
> > > LIBLEAFDIR = lib
> > > LIBLEAFDIR_x86_32 = lib
> > > LIBLEAFDIR_x86_64 ?= lib64
> > > -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> > > LIBDIR_x86_32 = $(PREFIX)/$(LIBLEAFDIR_x86_32)
> > > LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
> >
> > Roger already asked if we can somehow get rid of all the LEAFDIR stuff
> > too.
>
> That'd be lovely. I was a little worried about the python syspath
> bits, but now that I've looked to see that it uses distutils that
> should be fine.
Cool!
> > > diff -r 32034d1914a6 -r 0a592e08ac31 config/Tools.mk.in
> > > --- a/config/Tools.mk.in Thu Jun 07 19:46:57 2012 +0100
> > > +++ b/config/Tools.mk.in Wed Jun 20 00:40:15 2012 +0000
> > > @@ -1,5 +1,7 @@
> > > # Prefix and install folder
> > > PREFIX := @prefix@
> > > +exec_prefix := @exec_prefix@
> >
> > Is exec_prefix related to this change?
>
> Yes, libdir defauts to ${exec_prefix}/lib, so if we don't bring
> exec_prefix into Tooks.mk, files will land in /lib by default instead
> of /usr/lib.
Ah, makes perfect sense, thanks.
Ian.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 16:44 ` Matt Wilson
@ 2012-06-20 16:51 ` Ian Campbell
2012-06-20 18:27 ` Matt Wilson
1 sibling, 0 replies; 9+ messages in thread
From: Ian Campbell @ 2012-06-20 16:51 UTC (permalink / raw)
To: Matt Wilson; +Cc: xen-devel, Roger Pau Monne
> > > diff -r 32034d1914a6 -r 0a592e08ac31 config/SunOS.mk
> > > --- a/config/SunOS.mk Thu Jun 07 19:46:57 2012 +0100
> > > +++ b/config/SunOS.mk Wed Jun 20 00:40:15 2012 +0000
> > > @@ -24,7 +24,6 @@ BINDIR = $(PREFIX)/bin
> > > INCLUDEDIR = $(PREFIX)/include
> > > LIBLEAFDIR = lib
> > > LIBLEAFDIR_x86_64 = lib/amd64
> > > -LIBDIR = $(PREFIX)/$(LIBLEAFDIR)
> > > LIBDIR_x86_64 = $(PREFIX)/$(LIBLEAFDIR_x86_64)
> > > MANDIR = $(PREFIX)/share/man
> > > MAN1DIR = $(MANDIR)/man1
> >
> > Can we clean this a little bit more, and remove LIBDIR_x86_32,
> > LIBLEAFDIR_x86_64, LIBDIR_x86_64, LIBDIR_x86_32 and LIBLEAFDIR?
>
> I was thinking that too, but was a little worried about expectations
> on Solaris. Maybe I souldn't.
I'm sure that Solaris doesn't work already, feel free to break it.
We should probably just nuke all these vestigial Solaris bits in 4.3...
Ian.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 16:44 ` Matt Wilson
2012-06-20 16:51 ` Ian Campbell
@ 2012-06-20 18:27 ` Matt Wilson
2012-06-21 9:12 ` Roger Pau Monne
1 sibling, 1 reply; 9+ messages in thread
From: Matt Wilson @ 2012-06-20 18:27 UTC (permalink / raw)
To: Roger Pau Monne; +Cc: Ian Campbell, xen-devel
On Wed, Jun 20, 2012 at 09:44:13AM -0700, Wilson, Matt wrote:
> On Wed, Jun 20, 2012 at 01:51:17AM -0700, Roger Pau Monne wrote:
> > Matt Wilson wrote:
> > > +CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
> >
> > I would prefer to set FSIMAGE_FSDIR or an equivalent define in
> > tools/config.h and include that header in
> > tools/libfsimage/common/fsimage_plugin.h, so we don't have to pass that
> > value from the compiler command line.
It turns out to be tricky to do this, since you have to recursively
expand the value from libdir="${exec_prefix}/lib". Also, it's counter
to the generally accepted pattern for passing these types of variables
down when using autoconf, which actually is to use -D in CFLAGS.
See also this thread:
http://stackoverflow.com/questions/5867136/autoconf-how-to-get-installation-paths-into-config-h
Matt
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] tools: honour --libdir when it is passed to ./configure
2012-06-20 18:27 ` Matt Wilson
@ 2012-06-21 9:12 ` Roger Pau Monne
0 siblings, 0 replies; 9+ messages in thread
From: Roger Pau Monne @ 2012-06-21 9:12 UTC (permalink / raw)
To: Matt Wilson; +Cc: Ian Campbell, xen-devel
Matt Wilson wrote:
> On Wed, Jun 20, 2012 at 09:44:13AM -0700, Wilson, Matt wrote:
>> On Wed, Jun 20, 2012 at 01:51:17AM -0700, Roger Pau Monne wrote:
>>> Matt Wilson wrote:
>>>> +CFLAGS += -Wno-unknown-pragmas -I$(XEN_ROOT)/tools/libfsimage/common/ -DFSIMAGE_FSDIR=\"$(FSDIR)\"
>>> I would prefer to set FSIMAGE_FSDIR or an equivalent define in
>>> tools/config.h and include that header in
>>> tools/libfsimage/common/fsimage_plugin.h, so we don't have to pass that
>>> value from the compiler command line.
>
> It turns out to be tricky to do this, since you have to recursively
> expand the value from libdir="${exec_prefix}/lib". Also, it's counter
> to the generally accepted pattern for passing these types of variables
> down when using autoconf, which actually is to use -D in CFLAGS.
>
> See also this thread:
> http://stackoverflow.com/questions/5867136/autoconf-how-to-get-installation-paths-into-config-h
Fair enough, thanks.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-06-21 9:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 0:46 [PATCH] tools: honour --libdir when it is passed to ./configure Matt Wilson
2012-06-20 8:51 ` Roger Pau Monne
2012-06-20 16:44 ` Matt Wilson
2012-06-20 16:51 ` Ian Campbell
2012-06-20 18:27 ` Matt Wilson
2012-06-21 9:12 ` Roger Pau Monne
2012-06-20 9:10 ` Ian Campbell
2012-06-20 16:41 ` Matt Wilson
2012-06-20 16:44 ` Ian Campbell
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.