From ee1a2376854b3cf025cf69b11ea28863df1f12b2 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 26 Jan 2016 22:34:27 -0800 Subject: [PATCH] Remove GOT_PREFIX, it's a broken hack of limited utility To add flags to the compiler, CFLAGS, CPPFLAGS or LDFLAGS can be used on the configure command line. The need to add flags depends on the location of the headers and libraries of the dependencies, which is orthogonal to the directory where xrdp will be installed. The implementation in configure.ac has a stray closing bracket, making GOT_PREFIX true even if --prefix is not passed. The implementation is inconsistent - the only affected makefiles are for xrdp and libxrdp. Changing rpath manually is wrong in most cases. Libtool should be able to set rpath correctly on its own. Using $(prefix)/lib ignores the libdir setting. For many 64-bit systems, /usr/lib is used for 32-bit libraries. Adding 32-bit libraries to the rpath slows down 64-bit executables, as the dynamic loader searches for libraries in a wrong directory. There is no way to disable GOT_PREFIX if --prefix has to be passed. Fedora RPM patches configure.ac and needs to rerun autoconf and automake after that. --- configure.ac | 2 -- libxrdp/Makefile.am | 5 ----- xrdp/Makefile.am | 5 ----- 3 files changed, 12 deletions(-) diff --git a/configure.ac b/configure.ac index 24ef13c4..12c298e0 100644 --- a/configure.ac +++ b/configure.ac @@ -98,8 +98,6 @@ AC_ARG_ENABLE(opus, AS_HELP_STRING([--enable-opus], [], [enable_opus=no]) AM_CONDITIONAL(XRDP_OPUS, [test x$enable_opus = xyes]) -AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"]) - # checking for openssl AC_CHECK_HEADER([openssl/rc4.h], [], [AC_MSG_ERROR([please install libssl-dev or openssl-devel])], diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am index ec92f8be..5435343b 100644 --- a/libxrdp/Makefile.am +++ b/libxrdp/Makefile.am @@ -28,11 +28,6 @@ EXTRA_LIBS += -ljpeg endif endif -if GOT_PREFIX -EXTRA_INCLUDES += -I$(prefix)/include -EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib -endif - AM_CFLAGS = \ -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ -DXRDP_SBIN_PATH=\"${sbindir}\" \ diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am index 8a8b36eb..8014761a 100644 --- a/xrdp/Makefile.am +++ b/xrdp/Makefile.am @@ -11,11 +11,6 @@ else EXTRA_DEFINES = -DXRDP_NODEBUG endif -if GOT_PREFIX -EXTRA_INCLUDES += -I$(prefix)/include -EXTRA_FLAGS += -L$(prefix)/lib -Wl,-rpath -Wl,$(prefix)/lib -endif - if XRDP_RFXCODEC EXTRA_DEFINES += -DXRDP_RFXCODEC EXTRA_INCLUDES += -I$(top_srcdir)/librfxcodec/include