[Top][All Lists]

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

problem with AC_LIBOBJ and square brackets

From: Jim Meyering
Subject: problem with AC_LIBOBJ and square brackets
Date: Thu, 10 Jan 2002 13:09:40 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.50 (i686-pc-linux-gnu)


I have just noticed that when I use AC_LIBOBJ like this
(with the optional-to-autoconf brackets):


automake fails because it can't open the file named `[mountlist].c'

To demonstrate the problem, I applied this patch to the latest
sources from the official repository:

--- libobj9.test.~1~    Mon Oct 22 04:52:39 2001
+++ libobj9.test        Thu Jan 10 12:53:59 2002
@@ -11,7 +11,7 @@ AM_INIT_AUTOMAKE(nonesuch, nonesuch)
-LIBOBJS="$LIBOBJS mountlist.$ac_objext"
Then run that test:

  $ VERBOSE=yes , check TESTS=libobj9.test
  make  check-TESTS
  make[1]: Entering directory `/mirror/d/automake/tests'
  === Running test ./libobj9.test required file `./[mountlist].c' not found
  FAIL: libobj9.test
  1 of 1 tests failed
  make[1]: *** [check-TESTS] Error 1
  make[1]: Leaving directory `/mirror/d/automake/tests'
  make: *** [check-am] Error 2
  [Exit 2]

I saw that there are some existing uses of that syntax
both in automake,

  ./m4/regex.m4:    AC_LIBOBJ([regex])
  ./m4/regex.m4:  AC_CHECK_FUNC(re_rx_search, , [AC_LIBOBJ([rx])])

and in autoconf (here are a few):

  ./lib/autoconf/types.m4:#                     [AC_LIBOBJ([fileblocks])])
  ./lib/autoconf/functions.m4:  AC_LIBOBJ([mktime])
  ./lib/autoconf/functions.m4:  AC_LIBOBJ([$1])

The patch looks easy and safe:

2002-01-10  Jim Meyering  <address@hidden>

        * (scan_one_autoconf_file): Unquote AC_LIBOBJ argument.

---     Thu Jan 10 05:18:41 2002
+++ Thu Jan 10 13:02:13 2002
@@ -4719,7 +4719,7 @@ sub scan_one_autoconf_file
        elsif (/AC_LIBOBJ\(([^)]+)\)/)
-           $libsources{"$1.c"} = $here;
+           $libsources{unquote_m4_arg ($1) . ".c"} = $here;
         elsif (/AC_LIBSOURCE\(([^)]+)\)/)

If no one objects today, I'll commit the above and add a new file:

reply via email to

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