bug-gnulib
[Top][All Lists]
Advanced

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

prefer lib_SOURCES to unconditional AC_LIBOBJ


From: Bruno Haible
Subject: prefer lib_SOURCES to unconditional AC_LIBOBJ
Date: Sun, 22 Dec 2019 10:57:08 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

In the module descriptions, an unconditional AC_LIBOBJ is equivalent to a
'lib_SOURCES += ...' statement. As a matter of style, the latter should be
preferred because
  - It's simpler: With lib_SOURCES, gnulib-tool interacts with Automake
    directly. Whereas with AC_LIBOBJ, gnulib-tool interacts with Autoconf
    which then substitutes the file name to the Makefile.
  - AC_LIBOBJ is sensitive to the "current" lib directory.

I like to summarize this: File names belong in Makefiles, not in Autoconf
macros.


2019-12-22  Bruno Haible  <address@hidden>

        Prefer lib_SOURCES to unconditional AC_LIBOBJ.
        * modules/at-internal: Prefer a lib_SOURCES augmentation to an
        unconditional AC_LIBOBJ.
        * modules/selinux-at: Likewise.
        * modules/xmemdup0: Likewise.
        * modules/xstrtoll: Likewise.

diff --git a/modules/at-internal b/modules/at-internal
index 524750b..d58c9b0 100644
--- a/modules/at-internal
+++ b/modules/at-internal
@@ -14,9 +14,9 @@ sys_stat
 unistd
 
 configure.ac:
-AC_LIBOBJ([openat-proc])
 
 Makefile.am:
+lib_SOURCES += openat-priv.h openat-proc.c
 
 Include:
 "openat-priv.h"
diff --git a/modules/selinux-at b/modules/selinux-at
index 62dd6e6..29d188e 100644
--- a/modules/selinux-at
+++ b/modules/selinux-at
@@ -21,9 +21,9 @@ unistd
 
 configure.ac:
 AC_CHECK_HEADERS([selinux/flask.h])
-AC_LIBOBJ([selinux-at])
 
 Makefile.am:
+lib_SOURCES += selinux-at.h selinux-at.c
 
 Include:
 "selinux-at.h"
diff --git a/modules/xmemdup0 b/modules/xmemdup0
index d7ea438..a82609a 100644
--- a/modules/xmemdup0
+++ b/modules/xmemdup0
@@ -9,9 +9,9 @@ Depends-on:
 xalloc
 
 configure.ac:
-AC_LIBOBJ([xmemdup0])
 
 Makefile.am:
+lib_SOURCES += xmemdup0.h xmemdup0.c
 
 Include:
 "xmemdup0.h"
diff --git a/modules/xstrtoll b/modules/xstrtoll
index ccff7f1..b36db46 100644
--- a/modules/xstrtoll
+++ b/modules/xstrtoll
@@ -12,10 +12,9 @@ strtoull
 xstrtol
 
 configure.ac:
-AC_LIBOBJ([xstrtoll])
-AC_LIBOBJ([xstrtoull])
 
 Makefile.am:
+lib_SOURCES += xstrtoll.c xstrtoull.c
 
 Include:
 "xstrtol.h"




reply via email to

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