]> granicus.if.org Git - sudo/commitdiff
Instead of building libutil statically for --disable-shared-libutil,
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 1 Oct 2014 20:32:30 +0000 (14:32 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 1 Oct 2014 20:32:30 +0000 (14:32 -0600)
just treat it as a convenience library.  Do the same with sudoers
for --enable-static-sudoers.  Fixes link errors on Solaris among
others when --disable-shared-libutil is used.

configure
configure.ac
lib/util/Makefile.in
plugins/sudoers/Makefile.in

index 7c5714af92557060981c2fac2835b53604749184..59b884dea4a07e5d3da880a4f4429591cd952244 100755 (executable)
--- a/configure
+++ b/configure
@@ -781,11 +781,11 @@ SUDO_OBJS
 SUDOERS_OBJS
 COMMON_OBJS
 LT_DEP_LIBS
-LT_STATIC_LIBUTIL
 LT_STATIC
 LT_LDEXPORTS
 LT_LDDEP
 LT_LDFLAGS
+LIBUTIL_LDFLAGS
 SUDOERS_LDFLAGS
 LDFLAGS
 CPPFLAGS
@@ -22040,11 +22040,10 @@ if test "$enable_shared_libutil" = "no"; then
     if test X"$STATIC_SUDOERS" = X""; then
        as_fn_error $? "\"--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled.\"" "$LINENO" 5
     else
-       # Disable use shared version of libsudo_util.
-       LT_STATIC_LIBUTIL="--tag=disable-shared"
+       # Do not install sudoers or libsudo_util.
+       SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS}${SUDOERS_LDFLAGS+ }-no-install"
+       LIBUTIL_LDFLAGS="${LIBUTIL_LDFLAGS}${LIBUTIL_LDFLAGS+ }-no-install"
     fi
-else
-    LT_STATIC_LIBUTIL="$LT_STATIC"
 fi
 
 # On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
index 47713196cb29a4c32ba95f4b23ef67b1daaf82eb..4106f4517e9c8b726b92829cb8b51ec222b35a7a 100644 (file)
@@ -21,11 +21,11 @@ AC_SUBST([PROGS])
 AC_SUBST([CPPFLAGS])
 AC_SUBST([LDFLAGS])
 AC_SUBST([SUDOERS_LDFLAGS])
+AC_SUBST([LIBUTIL_LDFLAGS])
 AC_SUBST([LT_LDFLAGS])
 AC_SUBST([LT_LDDEP])
 AC_SUBST([LT_LDEXPORTS])
 AC_SUBST([LT_STATIC])
-AC_SUBST([LT_STATIC_LIBUTIL])
 AC_SUBST([LT_DEP_LIBS])
 AC_SUBST([COMMON_OBJS])
 AC_SUBST([SUDOERS_OBJS])
@@ -3608,11 +3608,10 @@ if test "$enable_shared_libutil" = "no"; then
     if test X"$STATIC_SUDOERS" = X""; then
        AC_MSG_ERROR(["--disable-shared-libutil may only be specified with --enable-static-sudoers or when dynamic linking is disabled."])
     else
-       # Disable use shared version of libsudo_util.
-       LT_STATIC_LIBUTIL="--tag=disable-shared"
+       # Do not install sudoers or libsudo_util.
+       SUDOERS_LDFLAGS="${SUDOERS_LDFLAGS}${SUDOERS_LDFLAGS+ }-no-install"
+       LIBUTIL_LDFLAGS="${LIBUTIL_LDFLAGS}${LIBUTIL_LDFLAGS+ }-no-install"
     fi
-else
-    LT_STATIC_LIBUTIL="$LT_STATIC"
 fi
 
 # On HP-UX, you cannot dlopen() a shared object that uses pthreads unless
index ad14034be0bc97b05e86f55da865bc5e9cfb83cd..a65f863254ba261a6c909e72030ba4c89a3686b2 100644 (file)
@@ -45,7 +45,7 @@ shlib_opt = util.opt
 
 # Compiler & tools to use
 CC = @CC@
-LIBTOOL = @LIBTOOL@ @LT_STATIC_LIBUTIL@
+LIBTOOL = @LIBTOOL@ @LT_STATIC@
 SED = @SED@
 
 # Our install program supports extra flags...
@@ -60,7 +60,7 @@ CFLAGS = @CFLAGS@
 
 # Flags to pass to the link stage
 LDFLAGS = @LDFLAGS@
-LT_LDFLAGS = @LT_LDFLAGS@ @LT_LDEXPORTS@
+LT_LDFLAGS = @LIBUTIL_LDFLAGS@ @LT_LDFLAGS@ @LT_LDEXPORTS@
 
 # PIE flags
 PIE_CFLAGS = @PIE_CFLAGS@
@@ -134,7 +134,12 @@ $(shlib_opt): $(shlib_exp)
        @$(SED) 's/^/+e /' $(shlib_exp) > $@
 
 libsudo_util.la: $(LTOBJS) @LT_LDDEP@
-       $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) -version-info $(SHLIB_VERSION) -rpath $(libexecdir)/sudo @LT_DEP_LIBS@ @LIBDL@
+       case "$(LT_LDFLAGS)" in \
+       *-no-install*) \
+           $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(LT_LDFLAGS) $(LTOBJS);; \
+       *) \
+           $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) -version-info $(SHLIB_VERSION) -rpath $(libexecdir)/sudo @LT_DEP_LIBS@ @LIBDL@;; \
+       esac
 
 siglist.c: mksiglist
        ./mksiglist > $@
@@ -182,8 +187,8 @@ progname_test: $(PROGNAME_TEST_OBJS)
 pre-install:
 
 install: install-dirs
-       case "$(LIBTOOL)" in \
-       *disable-shared*) ;; \
+       case "$(LT_LDFLAGS)" in \
+       *-no-install*) ;; \
        *)  if [ X"$(shlib_enable)" = X"yes" ]; then \
                INSTALL_BACKUP='~' $(LIBTOOL) --quiet --mode=install $(INSTALL) $(INSTALL_OWNER) libsudo_util.la $(DESTDIR)$(libexecdir)/sudo; \
            fi;; \
index 72b2d69066421fb3c11f72a0260dd490c2726746..487314bc2332bb3d1b3c0a7a67c1ebd9778d7433 100644 (file)
@@ -201,7 +201,12 @@ libparsesudoers.la: $(LIBPARSESUDOERS_OBJS)
        $(LIBTOOL) --mode=link $(CC) -o $@ $(LIBPARSESUDOERS_OBJS) -no-install
 
 sudoers.la: $(SUDOERS_OBJS) $(LT_LIBS) libparsesudoers.la @LT_LDDEP@
-       $(LIBTOOL) @LT_STATIC@ --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(SUDOERS_OBJS) libparsesudoers.la $(SUDOERS_LIBS) -module -avoid-version -rpath $(plugindir) -shrext .so
+       case "$(LT_LDFLAGS)" in \
+       *-no-install*) \
+           $(LIBTOOL) @LT_STATIC@ --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(SUDOERS_OBJS) libparsesudoers.la $(SUDOERS_LIBS) -module;; \
+       *) \
+           $(LIBTOOL) @LT_STATIC@ --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) -o $@ $(SUDOERS_OBJS) libparsesudoers.la $(SUDOERS_LIBS) -module -avoid-version -rpath $(plugindir) -shrext .so;; \
+       esac
 
 visudo: libparsesudoers.la $(VISUDO_OBJS) $(LT_LIBS)
        $(LIBTOOL) --mode=link $(CC) -o $@ $(VISUDO_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) libparsesudoers.la $(LIBS) $(VISUDO_LIBS)
@@ -309,9 +314,12 @@ install-doc: install-dirs
        @LDAP@$(INSTALL) $(INSTALL_OWNER) -m 0755 $(srcdir)/sudoers2ldif $(DESTDIR)$(docdir)
 
 install-plugin: sudoers.la install-dirs
-       if [ X"$(shlib_enable)" = X"yes" ]; then \
-           INSTALL_BACKUP='~' $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudoers.la $(DESTDIR)$(plugindir); \
-       fi
+       case "$(LT_LDFLAGS)" in \
+       *-no-install*) ;; \
+       *)  if [ X"$(shlib_enable)" = X"yes" ]; then \
+               INSTALL_BACKUP='~' $(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_OWNER) -m $(shlib_mode) sudoers.la $(DESTDIR)$(plugindir); \
+           fi;; \
+       esac
 
 install-sudoers: install-dirs
        $(INSTALL) -d $(INSTALL_OWNER) -m 0750 $(DESTDIR)$(sudoersdir)/sudoers.d