]> granicus.if.org Git - sudo/commitdiff
Play more nicely with libtool and let it build libreplace (was libmissing)
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 18 Mar 2010 15:42:12 +0000 (11:42 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 18 Mar 2010 15:42:12 +0000 (11:42 -0400)
for us.

compat/Makefile.in
configure
configure.in
plugins/sample/Makefile.in
plugins/sudoers/Makefile.in
src/Makefile.in

index 7cc344b2e03acc9fa3ddbda0642201038bed73f4..beceb6cbe8e20a7cf2964d5a7e4f25381a2ca421 100644 (file)
@@ -48,48 +48,39 @@ SHELL = /bin/sh
 
 LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
 
-LIBOBJS = @LIBOBJS@
-
 LTLIBOBJS = @LTLIBOBJS@
 
-all: libmissing.a libmissing_pic.a
+all: libreplace.la
 
 .SUFFIXES: .o .c .h .lo
 
-.c.o:
-       $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
-
 .c.lo:
        $(LIBTOOL) --mode=compile $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
 
-libmissing.a: $(LIBOBJS)
-       $(AR) rv $@ $(LIBOBJS)
-       $(RANLIB) $@
-
-libmissing_pic.a: $(LTLIBOBJS)
-       $(LIBTOOL) --mode=link $(CC) -o $@ $(LTLIBOBJS)
+libreplace.la: $(LTLIBOBJS)
+       $(LIBTOOL) --mode=link $(CC) -o $@ $(LTLIBOBJS) -no-install
 
 # Dependencies
-$(LIBOBJDIR)$(LIBOBJDIR)closefrom.lo $(LIBOBJDIR)closefrom.o: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)fnmatch.lo $(LIBOBJDIR)fnmatch.o: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)getcwd.lo $(LIBOBJDIR)getcwd.o: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)getline.lo $(LIBOBJDIR)getline.o: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)getprogname.lo $(LIBOBJDIR)getprogname.o: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)glob.lo $(LIBOBJDIR)glob.o: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)isblank.lo $(LIBOBJDIR)isblank.o: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)memrchr.lo $(LIBOBJDIR)memrchr.o: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)mkstemp.lo $(LIBOBJDIR)mkstemp.o: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)nanosleep.lo $(LIBOBJDIR)nanosleep.o: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)sigaction.lo $(LIBOBJDIR)sigaction.o: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h
-$(LIBOBJDIR)$(LIBOBJDIR)snprintf.lo $(LIBOBJDIR)snprintf.o: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strcasecmp.lo $(LIBOBJDIR)strcasecmp.o: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strdup.lo $(LIBOBJDIR)strdup.o: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strndup.lo $(LIBOBJDIR)strndup.o: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strerror.lo $(LIBOBJDIR)strerror.o: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strlcat.lo $(LIBOBJDIR)strlcat.o: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strlcpy.lo $(LIBOBJDIR)strlcpy.o: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)strsignal.lo $(LIBOBJDIR)strsignal.o: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h
-$(LIBOBJDIR)$(LIBOBJDIR)utimes.lo $(LIBOBJDIR)utimes.o: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)closefrom.lo: $(compat)/closefrom.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)fnmatch.lo: $(compat)/fnmatch.c $(compat)/fnmatch.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)getcwd.lo: $(compat)/getcwd.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)getline.lo: $(compat)/getline.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)getprogname.lo: $(compat)/getprogname.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)glob.lo: $(compat)/glob.c $(compat)/glob.h $(compat)/charclass.h $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)isblank.lo: $(compat)/isblank.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)memrchr.lo: $(compat)/memrchr.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)mkstemp.lo: $(compat)/mkstemp.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)nanosleep.lo: $(compat)/nanosleep.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)sigaction.lo: $(compat)/sigaction.c $(incdir)/compat.h $(incdir)/compat.h
+$(LIBOBJDIR)$(LIBOBJDIR)snprintf.lo: $(compat)/snprintf.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strcasecmp.lo: $(compat)/strcasecmp.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strdup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strndup.lo: $(compat)/strdup.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strerror.lo: $(compat)/strerror.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strlcat.lo: $(compat)/strlcat.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strlcpy.lo: $(compat)/strlcpy.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)strsignal.lo: $(compat)/strsignal.c $(incdir)/compat.h $(top_builddir)/config.h
+$(LIBOBJDIR)$(LIBOBJDIR)utimes.lo: $(compat)/utimes.c $(incdir)/compat.h $(compat)/utime.h $(top_builddir)/config.h
 
 install:
 
index edb414de66802320f299010e94ecc848dc84100b..7db87b3075da1ba57996323b080553e59eb4fe53 100755 (executable)
--- a/configure
+++ b/configure
@@ -1509,8 +1509,8 @@ Optional Features:
   --enable-zlib=PATH      Whether to enable or disable zlib
   --enable-gss-krb5-ccache-name
                           Use GSS-API to set the Kerberos V cred cache name
-  --enable-static[=PKGS]  build static libraries [default=no]
   --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
@@ -5882,54 +5882,53 @@ IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
-  enableval=$enable_static; p=${PACKAGE-default}
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+  enableval=$enable_shared; p=${PACKAGE-default}
     case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
     *)
-     enable_static=no
+      enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
        IFS="$lt_save_ifs"
        if test "X$pkg" = "X$p"; then
-         enable_static=yes
+         enable_shared=yes
        fi
       done
       IFS="$lt_save_ifs"
       ;;
     esac
 else
-  enable_static=no
+  enable_shared=yes
 fi
 
 
-
-
-
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
-  enableval=$enable_shared; p=${PACKAGE-default}
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+  enableval=$enable_static; p=${PACKAGE-default}
     case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
     *)
-      enable_shared=no
+     enable_static=no
       # Look at the argument we got.  We use all the common list separators.
       lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
       for pkg in $enableval; do
        IFS="$lt_save_ifs"
        if test "X$pkg" = "X$p"; then
-         enable_shared=yes
+         enable_static=yes
        fi
       done
       IFS="$lt_save_ifs"
       ;;
     esac
 else
-  enable_shared=yes
+  enable_static=yes
 fi
 
 
@@ -6609,7 +6608,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6612 "configure"' > conftest.$ac_ext
+  echo '#line 6611 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -8473,11 +8472,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8476: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8475: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8480: \$? = $ac_status" >&5
+   echo "$as_me:8479: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8763,11 +8762,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8766: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8765: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8770: \$? = $ac_status" >&5
+   echo "$as_me:8769: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -8867,11 +8866,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8870: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8869: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8874: \$? = $ac_status" >&5
+   echo "$as_me:8873: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -11227,7 +11226,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11230 "configure"
+#line 11229 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11327,7 +11326,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 11330 "configure"
+#line 11329 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index daf09e50af3baef2d07303a406c69c402ae2ad64..f1d628feaa027cfda492691a22c539e4bb141b7d 100644 (file)
@@ -1314,7 +1314,6 @@ dnl
 dnl Libtool magic; enable shared libs and disable static libs
 dnl
 AC_CANONICAL_HOST
-AC_DISABLE_STATIC
 AC_LIBTOOL_DLOPEN
 AC_PROG_LIBTOOL
 
index 424afa0c0bd32a8c00941dfe917cb0bd93d537c9..cae6ab6e3b8c755464b17c3b80806b9f262d11de 100644 (file)
@@ -28,13 +28,13 @@ compat = $(top_srcdir)/compat
 
 # Compiler & tools to use
 CC = @CC@
-LIBTOOL = @LIBTOOL@
+LIBTOOL = @LIBTOOL@ --tag=disable-static
 
 # Our install program supports extra flags...
 INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
 
 # Libraries
-LIBS =
+LIBS = $(LIBOBJDIR)/libreplace.la
 
 # C preprocessor flags
 CPPFLAGS = -I$(incdir) -I$(top_builddir) @CPPFLAGS@
@@ -66,8 +66,6 @@ OBJS =        sample_plugin.lo
 
 LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
 
-LTLIBOBJS = $(top_srcdir)/@ac_config_libobj_dir@/libmissing_pic.a
-
 VERSION = @PACKAGE_VERSION@
 
 all: sample_plugin.la
@@ -83,8 +81,8 @@ all: sample_plugin.la
 sample_plugin.lo: $(srcdir)/sample_plugin.c
        $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sample_plugin.c
 
-sample_plugin.la: $(OBJS) $(LTLIBOBJS)
-       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJS) -L$(LIBOBJDIR) -lmissing_pic -module -avoid-version -rpath $(plugindir)
+sample_plugin.la: $(OBJS)
+       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir)
 
 install: install-dirs install-plugin
 
index 651869a67d8bea488e9f185a2b6f8f7e05e2fe44..5e42057bdc8ec8f63561865c0d73cb55dbcb0c16 100644 (file)
@@ -29,13 +29,13 @@ compat = $(top_srcdir)/compat
 
 # Compiler & tools to use
 CC = @CC@
-LIBTOOL = @LIBTOOL@
+LIBTOOL = @LIBTOOL@ --tag=disable-static
 
 # Our install program supports extra flags...
 INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
 
 # Libraries
-LIBS =
+LIBS = $(LIBOBJDIR)/libreplace.la
 
 # C preprocessor flags
 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(srcdir) @CPPFLAGS@
@@ -86,8 +86,6 @@ SUDOERS_OBJS = $(AUTH_OBJS) alloc.lo boottime.lo check.lo fmt_string.lo \
 
 LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
 
-LTLIBOBJS = $(top_srcdir)/@ac_config_libobj_dir@/libmissing_pic.a
-
 VERSION = @PACKAGE_VERSION@
 
 SUDODEP = $(srcdir)/sudoers.h $(incdir)/compat.h \
@@ -110,8 +108,8 @@ all: sudoers.la
 .c.lo:
        $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
 
-sudoers.la: $(SUDOERS_OBJS) $(COMMON_OBJS) $(LTLIBOBJS)
-       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(SUDOERS_OBJS) $(COMMON_OBJS) -L$(LIBOBJDIR) -lmissing_pic -module -avoid-version -rpath $(plugindir)
+sudoers.la: $(SUDOERS_OBJS) $(COMMON_OBJS)
+       $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(SUDOERS_OBJS) $(COMMON_OBJS) $(LIBS) -module -avoid-version -rpath $(plugindir)
 
 # Sudoers dependencies
 sudoers.lo: $(srcdir)/sudoers.c $(SUDODEP) $(srcdir)/interfaces.h
index 57d15267635be8f8b1d8af06bf8cef354cce2970..a83a7176f3b193e95436f87221d6c9fad4252e60 100644 (file)
@@ -28,12 +28,14 @@ compat = $(top_srcdir)/compat
 
 # Compiler & tools to use
 CC = @CC@
+LIBTOOL = @LIBTOOL@ --tag=disable-static
 
 # Our install program supports extra flags...
 INSTALL = $(SHELL) $(top_srcdir)/install-sh -c
 
 # Libraries
-LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ 
+LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ \
+       $(LIBOBJDIR)libreplace.la
 
 # C preprocessor flags
 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I$(srcdir) -I. @CPPFLAGS@
@@ -73,12 +75,10 @@ PROGS = sudo
 #      sudo_edit.o
 OBJS = sudo.o parse_args.o lbuf.o alloc.o error.o zero_bytes.o \
        load_plugins.o conversation.o list.o fmt_string.o tgetpass.o \
-       fileops.o term.o ttysize.o atobool.o script.o pty.o @SUDO_OBJS@ $(LIBOBJS)
+       fileops.o term.o ttysize.o atobool.o script.o pty.o @SUDO_OBJS@
 
 LIBOBJDIR = $(top_srcdir)/@ac_config_libobj_dir@/
 
-LIBOBJS = $(top_srcdir)/@ac_config_libobj_dir@/libmissing.a
-
 VERSION = @PACKAGE_VERSION@
 
 SUDODEP = $(srcdir)/sudo.h $(incdir)/sudo_plugin.h $(incdir)/alloc.h \
@@ -97,7 +97,7 @@ all: $(PROGS)
        $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $<
 
 sudo: $(OBJS)
-       $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS)
+       $(LIBTOOL) --mode=link $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) -static-libtool-libs
 
 sudo_noexec.lo: $(srcdir)/sudo_noexec.c
        $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/sudo_noexec.c