aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_info.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2013-07-04 15:23:06 +0200
committerBjörn-Egil Dahlberg <[email protected]>2013-07-11 18:41:43 +0200
commit14c0a18a9970f2287bbb09c46bee0c33358e3fc9 (patch)
tree1628c69b00844228b811d7d65bf02d95707fe2fa /erts/emulator/beam/erl_bif_info.c
parent193639fde33e135cc390f1df13076e5632fdd43c (diff)
downloadotp-14c0a18a9970f2287bbb09c46bee0c33358e3fc9.tar.gz
otp-14c0a18a9970f2287bbb09c46bee0c33358e3fc9.tar.bz2
otp-14c0a18a9970f2287bbb09c46bee0c33358e3fc9.zip
erts: Add cflags, ldflags and config.h into executable
Diffstat (limited to 'erts/emulator/beam/erl_bif_info.c')
-rwxr-xr-xerts/emulator/beam/erl_bif_info.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_bif_info.c b/erts/emulator/beam/erl_bif_info.c
index e4fbd21c0e..a43eee6420 100755
--- a/erts/emulator/beam/erl_bif_info.c
+++ b/erts/emulator/beam/erl_bif_info.c
@@ -30,6 +30,7 @@
#include "bif.h"
#include "big.h"
#include "erl_version.h"
+#include "erl_compile_flags.h"
#include "erl_db_util.h"
#include "erl_message.h"
#include "erl_binary.h"
@@ -2610,6 +2611,26 @@ BIF_RETTYPE system_info_1(BIF_ALIST_1)
BIF_RET(am_true);
}
#endif
+ else if (ERTS_IS_ATOM_STR("compile_info",BIF_ARG_1)) {
+ Eterm *hp = HAlloc(BIF_P, 3*3+3*2); /* three two tuples +
+ three list elems */
+ Eterm res = NIL;
+ Eterm *lhp = HAlloc(BIF_P, 2*(strlen(erts_build_flags_CONFIG_H)+
+ strlen(erts_build_flags_CFLAGS)+
+ strlen(erts_build_flags_LDFLAGS)));
+
+ res = CONS(hp+9,TUPLE2(hp, am_config_h,
+ buf_to_intlist(&lhp, erts_build_flags_CONFIG_H,
+ strlen(erts_build_flags_CONFIG_H), NIL)),res);
+ res = CONS(hp+11,TUPLE2(hp+3, am_cflags,
+ buf_to_intlist(&lhp, erts_build_flags_CFLAGS,
+ strlen(erts_build_flags_CFLAGS), NIL)),res);
+ res = CONS(hp+13,TUPLE2(hp+6, am_ldflags,
+ buf_to_intlist(&lhp, erts_build_flags_LDFLAGS,
+ strlen(erts_build_flags_LDFLAGS), NIL)),res);
+
+ BIF_RET(res);
+ }
BIF_ERROR(BIF_P, BADARG);
}