bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib taking over libobjs?


From: Simon Josefsson
Subject: Re: gnulib taking over libobjs?
Date: Tue, 10 Oct 2006 15:10:38 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

The last patch wasn't working, but this is somewhat better.

However, I've run into this error:

address@hidden:/tmp/jas4711/libidn-0.6.8/gl$ make
make  all-am
if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H  -I. -I. 
-I..      -g -O2 -MT ../gl/error.lo -MD -MP -MF ".deps/../gl/error.Tpo" -c -o 
../gl/error.lo ../gl/error.c;  then mv -f ".deps/../gl/error.Tpo" 
".deps/../gl/error.Plo"; else rm -f ".deps/../gl/error.Tpo"; exit 1; fi
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -MT ../gl/error.lo -MD -MP -MF 
.deps/../gl/error.Tpo -c ../gl/error.c  -fPIC -DPIC -o ../gl/.libs/error.o
cc1: No such file or directory: opening dependency file .deps/../gl/error.Tpo
*** Error code 1

Stop.
make: stopped in /tmp/jas4711/libidn-0.6.8/gl
*** Error code 1

The Makefile reads:

gl_LIBOBJS =  ${top_builddir}/gl/error.o ${top_builddir}/gl/getopt.o 
${top_builddir}/gl/getopt1.o
gl_LTLIBOBJS =  ${top_builddir}/gl/error.lo ${top_builddir}/gl/getopt.lo 
${top_builddir}/gl/getopt1.lo
...
libgnu_la_LIBADD = $(gl_LTLIBOBJS)
libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)

The problem seems to be that libtool doesn't understand relative
dependencies in libgnu_la_DEPENDENCIES, and the -MF parameter becomes
wrong.

I'm stuck.  Any ideas?

/Simon

Index: gnulib-tool
===================================================================
RCS file: /sources/gnulib/gnulib/gnulib-tool,v
retrieving revision 1.176
diff -u -p -u -w -r1.176 gnulib-tool
--- gnulib-tool 7 Oct 2006 14:54:51 -0000       1.176
+++ gnulib-tool 10 Oct 2006 12:59:48 -0000
@@ -1067,6 +1067,7 @@ func_modules_to_filelist ()
 # - libname         library name
 # - makefile_name   from --makefile-name
 # - libtool         true if libtool will be used, false or blank otherwise
+# - macro_prefix    prefix of gl_LIBOBJS macros to use
 # - actioncmd       (optional) command that will reproduce this invocation
 func_emit_lib_Makefile_am ()
 {
@@ -1137,7 +1138,8 @@ func_emit_lib_Makefile_am ()
   echo "${libname}_${libext}_SOURCES ="
   # Here we use $(LIBOBJS), not @address@hidden The value is the same. However,
   # automake during its analyses looks for $(LIBOBJS), not for @address@hidden
-  echo "${libname}_${libext}_LIBADD = \$(${perhapsLT}LIBOBJS)"
+  echo "${libname}_${libext}_LIBADD = \$(${macro_prefix}_${perhapsLT}LIBOBJS)"
+  echo "${libname}_${libext}_DEPENDENCIES = 
\$(${macro_prefix}_${perhapsLT}LIBOBJS)"
   if test "$libtool" = true; then
     echo "${libname}_${libext}_LDFLAGS = \$(AM_LDFLAGS)"
   fi
@@ -1880,6 +1882,8 @@ func_import ()
     echo "# \"Check for header files, types and library functions\"."
     echo "AC_DEFUN([${macro_prefix}_INIT],"
     echo "["
+    echo "  m4_pushdef([AC_LIBOBJ], m4_defn([${macro_prefix}_LIBOBJ]))"
+    echo "  m4_pushdef([AC_REPLACE_FUNCS], 
m4_defn([${macro_prefix}_REPLACE_FUNCS]))"
     if test "$libtool" = true; then
       echo "  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])"
       echo "  gl_cond_libtool=true"
@@ -1925,7 +1929,33 @@ func_import ()
       echo "  ${libname_upper}_LTLIBDEPS=\"\$gl_ltlibdeps\""
       echo "  AC_SUBST([${libname_upper}_LTLIBDEPS])"
     fi
+    echo "  m4_popdef([AC_REPLACE_FUNCS])"
+    echo "  m4_popdef([AC_LIBOBJ])"
+    echo "  AC_CONFIG_COMMANDS_PRE(["
+    echo "    ${macro_prefix}_libobjs="
+    echo "    ${macro_prefix}_ltlibobjs="
+    echo "    for i in : \$${macro_prefix}_LIBOBJS; do test \"x\$i\" = x: && 
continue"
+    echo "      # 1. Remove the extension."
+    echo "      sed_drop_objext='s/\.o\$//;s/\.obj\$//'"
+    echo "      i=\`echo \"\$i\" | sed \"\$sed_drop_objext\"\`"
+    echo "      # 2. Prepend gnulib \${sourcebase}"
+    echo "      ${macro_prefix}_libobjs=\"\$${macro_prefix}_libobjs 
\\\${top_builddir}/${sourcebase}/\$i.\$ac_objext\""
+    echo "      ${macro_prefix}_ltlibobjs=\"\$${macro_prefix}_ltlibobjs 
\\\${top_builddir}/${sourcebase}/\$i.lo\""
+    echo "    done"
+    echo "    AC_SUBST([${macro_prefix}_LIBOBJS], [\$${macro_prefix}_libobjs])"
+    echo "    AC_SUBST([${macro_prefix}_LTLIBOBJS], 
[\$${macro_prefix}_ltlibobjs])"
+    echo "  ])"
     echo "])"
+
+    echo "# Like AC_LIBOBJ, except that the module name goes"
+    echo "# into ${macro_prefix}_LIBOBJS instead of into LIBOBJS."
+    echo "AC_DEFUN([${macro_prefix}_LIBOBJ],"
+    echo "  [${macro_prefix}_LIBOBJS=\"\$${macro_prefix}_LIBOBJS 
\$1.\$ac_objext\"])"
+    echo
+    echo "# Like AC_REPLACE_FUNCS, except that the module name goes"
+    echo "# into ${macro_prefix}_LIBOBJS instead of into LIBOBJS."
+    echo "AC_DEFUN([${macro_prefix}_REPLACE_FUNCS],"
+    echo "  [AC_CHECK_FUNCS([\$1], , [${macro_prefix}_LIBOBJ(\$ac_func)])])"
     echo
     echo "# This macro records the list of files which have been installed by"
     echo "# gnulib-tool and may be removed by future gnulib-tool invocations."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]