-
Notifications
You must be signed in to change notification settings - Fork 47
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
base: master
Are you sure you want to change the base?
Build cleanup #85
Changes from all commits
4854ee5
20b4177
6a87825
43f768c
7e06447
e6488d4
b3f2769
732040d
de512c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,6 @@ | |
|
||
libatf_c___la_SOURCES += atf-c++/detail/application.cpp \ | ||
atf-c++/detail/application.hpp \ | ||
atf-c++/detail/auto_array.hpp \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
||
|
@@ -65,50 +61,19 @@ atf_env_set(const char *name, const char *val) | |
{ | ||
atf_error_t err; | ||
|
||
#if defined(HAVE_SETENV) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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()); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK