Re: [PATCH] Supply all code using dl*() with DLOPEN_LIBS
On Wed, Oct 28, 2009 at 4:34 PM, Mikhail Gusarov dotted...@dottedmag.net wrote: Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov dotted...@dottedmag.net --- configure.ac | 5 +++-- glx/Makefile.am | 4 hw/xfree86/loader/Makefile.am | 1 + os/Makefile.am | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 53342c5..2c3b0b8 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS=-ldl)) +AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_FUNC_VPRINTF @@ -922,7 +923,7 @@ if test x$GLX = xyes; then AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS=$GLX_SYS_LIBS $DLOPEN_LIBS + GLX_SYS_LIBS=$GLX_SYS_LIBS else GLX=no fi @@ -1513,7 +1514,7 @@ if test x$XORG = xyes; then AC_CHECK_FUNCS([pci_device_vgaarb_init]) LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS - XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB + XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB XORG_CFLAGS=$XORG_CFLAGS $PCIACCESS_CFLAGS case $host_os in diff --git a/glx/Makefile.am b/glx/Makefile.am index a23ae0a..3a83770 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -58,6 +58,8 @@ if DRI2_AIGLX libglxdri_la_SOURCES += glxdri2.c endif +libglxdri_la_LIBADD = @DLOPEN_LIBS@ Is there a reason not to just use the variable $(DLOPEN_LIBS)? It will already be in the Makefile since it's AC_SUBST'd. This just makes it so -ldl is unnecessarily hardcoded into another variable. I know you're not the first one to do this. It seems to be a popular exercise in the server. Otherwise, Reviewed-by: Dan Nicholson dbn.li...@gmail.com -- Dan ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Supply all code using dl*() with DLOPEN_LIBS
On Thu, Oct 29, 2009 at 6:16 AM, Mikhail Gusarov dotted...@dottedmag.net wrote: Twas brillig at 06:06:10 29.10.2009 UTC-07 when dbn.li...@gmail.com did gyre and gimble: +libglxdri_la_LIBADD = @DLOPEN_LIBS@ DN Is there a reason not to just use the variable $(DLOPEN_LIBS)? Use where? Do you just mean s/@DLOPEN_LIBS@/$(DLOPEN_LIBS)/g ? Yes. The current patch will result in: Makefile: DLOPEN_LIBS = -ldl ... libglxdri_la_LIBADD = -ldl Since the variable is already in the Makefile, it would be nicer to use it. Makefile: DLOPEN_LIBS = -ldl ... libglxdri_la_LIBADD = $(DLOPEN_LIBS) It's both clearer what's going and allows flexibility (in corner cases) for zero cost. -- Dan ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Supply all code using dl*() with DLOPEN_LIBS
Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov dotted...@dottedmag.net --- configure.ac |5 +++-- glx/Makefile.am |4 hw/xfree86/loader/Makefile.am |1 + os/Makefile.am|2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 53342c5..2c3b0b8 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS=-ldl)) +AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_FUNC_VPRINTF @@ -922,7 +923,7 @@ if test x$GLX = xyes; then AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS=$GLX_SYS_LIBS $DLOPEN_LIBS + GLX_SYS_LIBS=$GLX_SYS_LIBS else GLX=no fi @@ -1513,7 +1514,7 @@ if test x$XORG = xyes; then AC_CHECK_FUNCS([pci_device_vgaarb_init]) LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS - XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB + XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB XORG_CFLAGS=$XORG_CFLAGS $PCIACCESS_CFLAGS case $host_os in diff --git a/glx/Makefile.am b/glx/Makefile.am index a23ae0a..9d9fa3c 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -58,6 +58,8 @@ if DRI2_AIGLX libglxdri_la_SOURCES += glxdri2.c endif +libglxdri_la_LIBADD = $(DLOPEN_LIBS) + libglx_la_SOURCES = \ $(indirect_sources) \ $(glapi_sources) \ @@ -95,3 +97,5 @@ libglx_la_SOURCES = \ swap_interval.c \ unpack.h \ xfont.c + +libglx_la_LIBADD = $(DLOPEN_LIBS) diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index 0bfa7a2..d3c17d1 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -21,6 +21,7 @@ libloader_la_SOURCES = \ dlloader.c \ os.c \ sdksyms.c +libloader_la_LIBADD = $(DLOPEN_LIBS) CLEANFILES = sdksyms.c sdksyms.dep diff --git a/os/Makefile.am b/os/Makefile.am index 9902f04..66a4a0f 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -26,7 +26,7 @@ libos_la_SOURCES =\ xstrans.c \ xprintf.c \ $(XORG_SRCS) -libos_la_LIBADD = @SHA1_LIBS@ +libos_la_LIBADD = @SHA1_LIBS@ $(DLOPEN_LIBS) if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) -- 1.6.5 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Supply all code using dl*() with DLOPEN_LIBS
On Thu, Oct 29, 2009 at 11:46 AM, Mikhail Gusarov dotted...@dottedmag.net wrote: Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov dotted...@dottedmag.net Looks good. Reviewed-by: Dan Nicholson dbn.li...@gmail.com -- Dan ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel
[PATCH] Supply all code using dl*() with DLOPEN_LIBS
Previously DLOPEN_LIBS was managed in top-level configure.ac. Instead bundle it with the code using dl*() functions to avoid breakages in uncommon configurations. Signed-off-by: Mikhail Gusarov dotted...@dottedmag.net --- configure.ac |5 +++-- glx/Makefile.am |4 hw/xfree86/loader/Makefile.am |1 + os/Makefile.am|2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 53342c5..2c3b0b8 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,7 @@ dnl Check to see if dlopen is in default libraries (like Solaris, which dnl has it in libc), or if libdl is needed to get it. AC_CHECK_FUNC([dlopen], [], AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS=-ldl)) +AC_SUBST(DLOPEN_LIBS) dnl Checks for library functions. AC_FUNC_VPRINTF @@ -922,7 +923,7 @@ if test x$GLX = xyes; then AC_SUBST(XLIB_CFLAGS) AC_DEFINE(GLXEXT, 1, [Build GLX extension]) GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS=$GLX_SYS_LIBS $DLOPEN_LIBS + GLX_SYS_LIBS=$GLX_SYS_LIBS else GLX=no fi @@ -1513,7 +1514,7 @@ if test x$XORG = xyes; then AC_CHECK_FUNCS([pci_device_vgaarb_init]) LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS - XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB + XORG_SYS_LIBS=$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $SELINUX_LIB XORG_CFLAGS=$XORG_CFLAGS $PCIACCESS_CFLAGS case $host_os in diff --git a/glx/Makefile.am b/glx/Makefile.am index a23ae0a..3a83770 100644 --- a/glx/Makefile.am +++ b/glx/Makefile.am @@ -58,6 +58,8 @@ if DRI2_AIGLX libglxdri_la_SOURCES += glxdri2.c endif +libglxdri_la_LIBADD = @DLOPEN_LIBS@ + libglx_la_SOURCES = \ $(indirect_sources) \ $(glapi_sources) \ @@ -95,3 +97,5 @@ libglx_la_SOURCES = \ swap_interval.c \ unpack.h \ xfont.c + +libglx_la_LIBADD = @DLOPEN_LIBS@ diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index 0bfa7a2..15ce00e 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -21,6 +21,7 @@ libloader_la_SOURCES = \ dlloader.c \ os.c \ sdksyms.c +libloader_la_LIBADD = @DLOPEN_LIBS@ CLEANFILES = sdksyms.c sdksyms.dep diff --git a/os/Makefile.am b/os/Makefile.am index 9902f04..be43829 100644 --- a/os/Makefile.am +++ b/os/Makefile.am @@ -26,7 +26,7 @@ libos_la_SOURCES =\ xstrans.c \ xprintf.c \ $(XORG_SRCS) -libos_la_LIBADD = @SHA1_LIBS@ +libos_la_LIBADD = @SHA1_LIBS@ @DLOPEN_LIBS@ if SECURE_RPC libos_la_SOURCES += $(SECURERPC_SRCS) -- 1.6.5 ___ xorg-devel mailing list xorg-devel@lists.x.org http://lists.x.org/mailman/listinfo/xorg-devel