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

Build cleanup #85

Open
wants to merge 9 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
8 changes: 0 additions & 8 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,4 @@ clean-all:

.PHONY: $(PHONY_TARGETS)

# TODO(jmmv): Remove after atf 0.22.
Copy link
Member

Choose a reason for hiding this comment

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

OK

install-data-hook:
cd $(DESTDIR)$(man3dir) && \
for binding in c c++ sh; do \
rm -f "atf-$${binding}-api.3"; \
$(LN_S) "atf-$${binding}.3" "atf-$${binding}-api.3"; \
done

# vim: syntax=make:noexpandtab:shiftwidth=8:softtabstop=8
1 change: 0 additions & 1 deletion atf-c++/detail/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

libatf_c___la_SOURCES += atf-c++/detail/application.cpp \
atf-c++/detail/application.hpp \
atf-c++/detail/auto_array.hpp \
Copy link
Member

Choose a reason for hiding this comment

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

this one lgtm

atf-c++/detail/env.cpp \
atf-c++/detail/env.hpp \
atf-c++/detail/exceptions.cpp \
Expand Down
4 changes: 0 additions & 4 deletions atf-c++/detail/test_helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@
{ \
set_md_var("descr", "Tests that the " hdrname " file can be " \
"included on its own, without any prerequisites"); \
const std::string cxx = atf::env::get("ATF_BUILD_CXX", ATF_BUILD_CXX); \
set_md_var("require.progs", cxx); \
} \
ATF_TEST_CASE_BODY(name) \
{ \
Expand All @@ -58,8 +56,6 @@
ATF_TEST_CASE_HEAD(name) \
{ \
set_md_var("descr", descr); \
const std::string cxx = atf::env::get("ATF_BUILD_CXX", ATF_BUILD_CXX); \
set_md_var("require.progs", cxx); \
} \
ATF_TEST_CASE_BODY(name) \
{ \
Expand Down
1 change: 1 addition & 0 deletions atf-c/defs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#define ATF_C_DEFS_H

#define ATF_DEFS_ATTRIBUTE_FORMAT_PRINTF(a, b) @ATTRIBUTE_FORMAT_PRINTF@
#define ATF_DEFS_ATTRIBUTE_NONNULL @ATTRIBUTE_NONNULL@
#define ATF_DEFS_ATTRIBUTE_NORETURN @ATTRIBUTE_NORETURN@
#define ATF_DEFS_ATTRIBUTE_UNUSED @ATTRIBUTE_UNUSED@

Expand Down
41 changes: 3 additions & 38 deletions atf-c/detail/env.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

#include "atf-c/detail/env.h"

#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif

#include <errno.h>
#include <stdlib.h>

Expand Down Expand Up @@ -65,50 +61,19 @@ atf_env_set(const char *name, const char *val)
{
atf_error_t err;

#if defined(HAVE_SETENV)
Copy link
Member

Choose a reason for hiding this comment

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

OK

if (setenv(name, val, 1) == -1)
err = atf_libc_error(errno, "Cannot set environment variable "
"'%s' to '%s'", name, val);
err = atf_libc_error(errno,
"Cannot set environment variable '%s' to '%s'", name, val);
else
err = atf_no_error();
#elif defined(HAVE_PUTENV)
char *buf;

err = atf_text_format(&buf, "%s=%s", name, val);
if (!atf_is_error(err)) {
if (putenv(buf) == -1)
err = atf_libc_error(errno, "Cannot set environment variable "
"'%s' to '%s'", name, val);
free(buf);
}
#else
# error "Don't know how to set an environment variable."
#endif

return err;
}

atf_error_t
atf_env_unset(const char *name)
{
atf_error_t err;

#if defined(HAVE_UNSETENV)
unsetenv(name);
err = atf_no_error();
#elif defined(HAVE_PUTENV)
char *buf;

err = atf_text_format(&buf, "%s=", name);
if (!atf_is_error(err)) {
if (putenv(buf) == -1)
err = atf_libc_error(errno, "Cannot unset environment variable"
" '%s'", name);
free(buf);
}
#else
# error "Don't know how to unset an environment variable."
#endif

return err;
return (atf_no_error());
}
2 changes: 2 additions & 0 deletions atf-c/detail/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

#include "config.h"

#include "atf-c/detail/process.h"

#include <sys/types.h>
Expand Down
20 changes: 5 additions & 15 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,17 @@ AM_PROG_CC_C_O
dnl The C compiler check automatically aborts if the compiler does not work.
dnl Nothing to do here.

AC_LANG(C++)
AC_USE_SYSTEM_EXTENSIONS

AC_PROG_CXX
AC_CACHE_CHECK([whether the C++ compiler works],
Copy link
Member

Choose a reason for hiding this comment

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

OK

[atf_cv_prog_cxx_works],
[AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[atf_cv_prog_cxx_works=yes],
[atf_cv_prog_cxx_works=no])
AC_LANG_POP])
if test "${atf_cv_prog_cxx_works}" = no; then
AC_MSG_ERROR([C++ compiler cannot create executables])
fi
AC_LANG_COMPILER(C++)
AC_PROG_CPP
Copy link
Member

Choose a reason for hiding this comment

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

OK. Is this where it belongs though, it seems the CXX and C++ bits should be together without CPP in the middle

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll have to run through it again, but the order for invoking the macros is a bit fragile (autoconf/automake whine a lot about not calling things in the right order).

AX_CXX_COMPILE_STDCXX(14, noext, mandatory)
Copy link
Member

Choose a reason for hiding this comment

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

OK


KYUA_DEVELOPER_MODE([C,C++])

dnl TODO(jmmv): Remove once the atf-*-api.3 symlinks are removed.
AC_PROG_LN_S

ATF_MODULE_APPLICATION
ATF_MODULE_DEFS
ATF_MODULE_ENV
ATF_MODULE_FS

ATF_RUNTIME_TOOL([ATF_BUILD_CC],
Expand Down
Loading