Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update m4 #280

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ before_script:
script:
- ${CC} --version
- ./bootstrap.sh -a
- ./configure --enable-ssl
- ./configure --enable-ssl --with-postgresql=no
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s the reason for this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this should not be necessary!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, otherwise make dies

libgearman-server/plugins/queue/postgres/queue.cc:55:11: fatal error: libpq-fe.h: No such file or directory
 # include <libpq-fe.h>
           ^~~~~~~~~~~~

Digging deeper:

$ locate libpq-fe.h
/usr/include/postgresql/libpq-fe.h
$ git diff libgearman-server/plugins/queue/postgres/queue.cc
diff --git a/libgearman-server/plugins/queue/postgres/queue.cc b/libgearman-server/plugins/queue/postgres/queue.cc
index ed834aab..c7735dd6 100644
--- a/libgearman-server/plugins/queue/postgres/queue.cc
+++ b/libgearman-server/plugins/queue/postgres/queue.cc
@@ -52,7 +52,7 @@
 #pragma GCC diagnostic push
 #if defined(HAVE_LIBPQ) and HAVE_LIBPQ
 # pragma GCC diagnostic ignored "-Wundef"
-# include <libpq-fe.h>
+# include <postgresql/libpq-fe.h>
 #endif
 
 #include <cerrno>

$ make
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `gearmand::plugins::queue::Postgres::~Postgres()':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:128: undefined reference to `PQfinish'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_add(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:285: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:286: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:288: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:289: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:293: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_done(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:327: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:328: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:330: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:331: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:335: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_replay(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long), void*)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:350: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:351: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:353: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:354: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:374: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:382: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:392: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:391: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:389: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:388: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:387: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:386: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:358: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:367: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:400: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:395: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:378: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_initialize':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:196: undefined reference to `PQconnectdb'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:198: undefined reference to `PQstatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:201: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:204: undefined reference to `PQsetNoticeProcessor'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:208: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:209: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:212: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:214: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:218: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:220: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:224: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:225: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:227: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:229: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:235: undefined reference to `PQclear'
collect2: error: ld returned 1 exit status
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `gearmand::plugins::queue::Postgres::~Postgres()':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:128: undefined reference to `PQfinish'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_add(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:285: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:286: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:288: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:289: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:293: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_done(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:327: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:328: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:330: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:331: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:335: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_libpq_replay(gearman_server_st*, void*, gearmand_error_t (*)(gearman_server_st*, void*, char const*, unsigned long, char const*, unsigned long, void const*, unsigned long, gearman_job_priority_t, long), void*)':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:350: undefined reference to `PQexecParams'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:351: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:353: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:354: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:374: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:382: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:392: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:391: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:389: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:388: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:387: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:386: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:358: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetvalue'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:360: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:367: undefined reference to `PQgetlength'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:400: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:395: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:378: undefined reference to `PQclear'
libgearman-server/.libs/libgearman-server.a(lt5-libgearman_server_libgearman_server_la-queue.o): In function `_initialize':
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:196: undefined reference to `PQconnectdb'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:198: undefined reference to `PQstatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:201: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:204: undefined reference to `PQsetNoticeProcessor'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:208: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:209: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:212: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:214: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:218: undefined reference to `PQntuples'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:220: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:224: undefined reference to `PQexec'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:225: undefined reference to `PQresultStatus'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:227: undefined reference to `PQerrorMessage'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:229: undefined reference to `PQclear'
/opt/devel/Gearman/gearmand/libgearman-server/plugins/queue/postgres/queue.cc:235: undefined reference to `PQclear'
Makefile:4472: recipe for target 'gearmand/hostile_gearmand' failed
make[2]: *** [gearmand/hostile_gearmand] Error 1
collect2: error: ld returned 1 exit status
make[2]: *** Waiting for unfinished jobs....
Makefile:4460: recipe for target 'gearmand/gearmand' failed
make[2]: *** [gearmand/gearmand] Error 1
ar: `u' modifier ignored since `D' is the default (see `U')
make[2]: Leaving directory '/opt/devel/Gearman/gearmand'
Makefile:8319: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/opt/devel/Gearman/gearmand'
Makefile:3082: recipe for target 'all' failed
make: *** [all] Error 2

As to me (and not only to me) it is convenient and pragmatic solution.

Copy link
Member

@esabol esabol Feb 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As to me (and not only to me) it is convenient and pragmatic solution.

Well, I strongly disagree. The person configuring gearmand should not have to specify --postgresql=no. Configure should be able to determine whether or not PostgreSQL is installed and configure itself accordingly. This is a regression from how previous releases work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bootstrap should be running defaults. Let's figure out why it can't find that file.

- make
- make test

Expand Down
4 changes: 2 additions & 2 deletions m4/ax_add_am_macro.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html
# https://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html
# ===========================================================================
#
# SYNOPSIS
Expand All @@ -21,7 +21,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 9
#serial 10

AC_DEFUN([AX_ADD_AM_MACRO],[
AC_REQUIRE([AX_AM_MACROS])
Expand Down
4 changes: 2 additions & 2 deletions m4/ax_am_jobserver.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_am_jobserver.html
# https://www.gnu.org/software/autoconf-archive/ax_am_jobserver.html
# ===========================================================================
#
# SYNOPSIS
Expand Down Expand Up @@ -33,7 +33,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 7
#serial 8

AC_DEFUN([AX_AM_JOBSERVER], [
AC_REQUIRE([AX_COUNT_CPUS])
Expand Down
4 changes: 2 additions & 2 deletions m4/ax_am_macros.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_am_macros.html
# https://www.gnu.org/software/autoconf-archive/ax_am_macros.html
# ===========================================================================
#
# SYNOPSIS
Expand All @@ -24,7 +24,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 9
#serial 10

AC_DEFUN([AX_AM_MACROS],
[
Expand Down
20 changes: 11 additions & 9 deletions m4/ax_append_compile_flags.m4
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
# ===========================================================================
# ============================================================================
# https://www.gnu.org/software/autoconf-archive/ax_append_compile_flags.html
# ============================================================================
#
# SYNOPSIS
#
# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
# AX_APPEND_COMPILE_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
Expand All @@ -20,6 +20,8 @@
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and
# AX_CHECK_COMPILE_FLAG. Please keep this macro in sync with
# AX_APPEND_LINK_FLAGS.
Expand All @@ -39,7 +41,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
Expand All @@ -54,12 +56,12 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 3
#serial 6

AC_DEFUN([AX_APPEND_COMPILE_FLAGS],
[AC_REQUIRE([AX_CHECK_COMPILE_FLAG])
AC_REQUIRE([AX_APPEND_FLAG])
[AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3])
AX_CHECK_COMPILE_FLAG([$flag], [AX_APPEND_FLAG([$flag], [$2])], [], [$3], [$4])
done
])dnl AX_APPEND_COMPILE_FLAGS
34 changes: 18 additions & 16 deletions m4/ax_append_flag.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
# ===========================================================================
#
# SYNOPSIS
Expand Down Expand Up @@ -34,7 +34,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
Expand All @@ -49,21 +49,23 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 2
#serial 7

AC_DEFUN([AX_APPEND_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
AS_VAR_SET_IF(FLAGS,
[case " AS_VAR_GET(FLAGS) " in
*" $1 "*)
AC_RUN_LOG([: FLAGS already contains $1])
;;
*)
AC_RUN_LOG([: FLAGS="$FLAGS $1"])
AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
;;
esac],
[AS_VAR_SET(FLAGS,["$1"])])
[dnl
AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
AS_VAR_SET_IF(FLAGS,[
AS_CASE([" AS_VAR_GET(FLAGS) "],
[*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
[
AS_VAR_APPEND(FLAGS,[" $1"])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
],
[
AS_VAR_SET(FLAGS,[$1])
AC_RUN_LOG([: FLAGS="$FLAGS"])
])
AS_VAR_POPDEF([FLAGS])dnl
])dnl AX_APPEND_FLAG
16 changes: 9 additions & 7 deletions m4/ax_append_link_flags.m4
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS])
# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
#
# DESCRIPTION
#
Expand All @@ -19,6 +19,8 @@
# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
# issue an error when a bad flag is given.
#
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
#
# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
#
Expand All @@ -37,7 +39,7 @@
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
Expand All @@ -52,12 +54,12 @@
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.

#serial 3
#serial 6

AC_DEFUN([AX_APPEND_LINK_FLAGS],
[AC_REQUIRE([AX_CHECK_LINK_FLAG])
AC_REQUIRE([AX_APPEND_FLAG])
[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
for flag in $1; do
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3])
AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
done
])dnl AX_APPEND_LINK_FLAGS
4 changes: 2 additions & 2 deletions m4/ax_append_to_file.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_append_to_file.html
# https://www.gnu.org/software/autoconf-archive/ax_append_to_file.html
# ===========================================================================
#
# SYNOPSIS
Expand All @@ -19,7 +19,7 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 7
#serial 8

AC_DEFUN([AX_APPEND_TO_FILE],[
AC_REQUIRE([AX_FILE_ESCAPES])
Expand Down
Loading