-dnl Copyright © 2019-2022 Nick Bowler
+dnl Copyright © 2019-2023 Nick Bowler
dnl License GPLv2+: GNU General Public License version 2 or any later version.
dnl This is free software: you are free to change and redistribute it.
dnl There is NO WARRANTY, to the extent permitted by law.
mv stderr str_stderr
TEST_COMPILE_GOBJECT([main.c], [0], [], [stderr])
mv stderr main_stderr
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main str.o main.o])
+TEST_LINK_GOBJECT([main], [str.o main.o])
AT_DATA([str.awk],
[[/want a string/ { lines[NR] = 1; }
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main test.o main.o])
+TEST_LINK_GOBJECT([main], [test.o main.o])
AT_CLEANUP
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test.o test-mod.o main.o])
+TEST_LINK_GOBJECT([main], [test.o test-mod.o main.o])
AT_CHECK([./main], [0], [Hello, World
])
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test.o main.o])
+TEST_LINK_GOBJECT([main], [test.o main.o])
AT_CHECK([./main], [0], [42
123
])
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test.o test-mod.o main.o])
+TEST_LINK_GOBJECT([main], [test.o test-mod.o main.o])
AT_CHECK([./main], [0], [54
123
])
-dnl Copyright © 2020 Nick Bowler
+dnl Copyright © 2020, 2022-2023 Nick Bowler
dnl License GPLv2+: GNU General Public License version 2 or any later version.
dnl This is free software: you are free to change and redistribute it.
dnl There is NO WARRANTY, to the extent permitted by law.
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-fooable.o main.o])
+TEST_LINK_GOBJECT([main], [test-a.o test-fooable.o main.o])
AT_CHECK([./main], [0], [42
])
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-a-mod.o test-fooable.o main.o])
+TEST_LINK_GOBJECT([main], [test-a.o test-a-mod.o test-fooable.o main.o])
AT_CHECK([./main], [0], [54
])
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-b.o test-fooable.o main.o])
+TEST_LINK_GOBJECT([main], [test-a.o test-b.o test-fooable.o main.o])
AT_CHECK([./main], [0], [Test:A foo called
42
Test:B foo called
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-b.o test-b-mod.o test-fooable.o main.o])
-
+TEST_LINK_GOBJECT([main],
+ [test-a.o test-b.o test-b-mod.o test-fooable.o main.o])
AT_CHECK([./main], [0], [Test:A foo called
42
Test:B foo called
}
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-a-mod.o test-b.o test-b-mod.o test-fooable.o main.o])
-
+TEST_LINK_GOBJECT([main],
+ [test-a.o test-a-mod.o test-b.o test-b-mod.o test-fooable.o main.o])
AT_CHECK([./main], [0], [Test:A foo called
42
Test:B foo called
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-b.o test-c.o test-fooable.o main.o])
+TEST_LINK_GOBJECT([main], [test-a.o test-b.o test-c.o test-fooable.o main.o])
AT_CHECK([./main], [0], [Test:C foo called
Test:B foo called
Test:A foo called
]])
TEST_COMPILE_GOBJECT([main.c], [0], [], [ignore])
-
-AT_CHECK([$CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o main \
- test-a.o test-a-mod.o test-b.o test-b-mod.o test-c.o test-c-mod.o \
- test-fooable.o main.o])
+TEST_LINK_GOBJECT([main], m4_join([ ],
+ [test-a.o test-a-mod.o test-b.o test-b-mod.o test-c.o test-c-mod.o],
+ [test-fooable.o main.o]))
AT_CHECK([./main], [0], [Test:C foo called
Test:B foo called
Test:A foo called
-AT_COPYRIGHT([Copyright © 2019-2020 Nick Bowler
+AT_COPYRIGHT([Copyright © 2019-2020, 2023 Nick Bowler
License GPLv2+: GNU General Public License version 2 or any later version.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.])
m4_define([TEST_COMPILE_GOBJECT], [AT_CHECK([$HAVE_GOBJECT || exit 77
$CC $CPPFLAGS $CFLAGS $LIBGOBJECT_CFLAGS -c $1], m4_shift($@))])
+m4_define([TEST_LINK_GOBJECT],
+ [AT_CHECK([$SHELL "$builddir/libtool" --quiet --tag=CC --mode=link \
+ $CC $CFLAGS $LDFLAGS $LIBGOBJECT_LIBS -o $1 $2])])
+
dnl Same as TEST_COMPILE_GOBJECT, except that the C++ compiler is used.
m4_define([TEST_COMPILEXX_GOBJECT], [AT_CHECK([$HAVE_GOBJECT || exit 77
$CXX $CPPFLAGS $CXXFLAGS $LIBGOBJECT_CFLAGS -c $1], m4_shift($@))])
CPPFLAGS="-I$builddir $CPPFLAGS"
:; {
AS_ECHO(["AUTOCONF = ${AUTOCONF=autoconf}"])
- command -v $AUTOCONF
+ command -v $AUTOCONF 2>&1
(set -x; $AUTOCONF --version) 2>&1
echo
AS_UNSET([MAKEFLAGS])
AS_ECHO(["MAKE = ${MAKE=make}"])
- command -v $MAKE
+ command -v $MAKE 2>&1
(set -x; $MAKE --version) 2>&1
echo
} >&AS_MESSAGE_LOG_FD