Skip to content

Commit

Permalink
Add build C macros and add them to --info
Browse files Browse the repository at this point in the history
Signed-off-by: Rong Tao <[email protected]>
  • Loading branch information
Rtoax committed Oct 14, 2024
1 parent 2a94b64 commit 2a5209d
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@ add_definitions("-DULPATCH_VERSION_PATCH=${ULPATCH_VERSION_PATCH}")
add_definitions("-DULPATCH_VERSION=\"${ULPATCH_VERSION}\"")
add_definitions("-DULPATCH_COMPILE_TIME=\"${ULPATCH_COMPILE_TIME}\"")
add_definitions("-DOS_PRETTY_NAME=\"${OS_PRETTY_NAME}\"")
if (BUILD_ULFTRACE)
add_definitions("-DBUILD_ULFTRACE=1")
endif()
if (BUILD_ULTASK)
add_definitions("-DBUILD_ULTASK=1")
endif()
if (BUILD_MAN)
add_definitions("-DBUILD_MAN=1")
endif()
if (BUILD_TESTING)
add_definitions("-DBUILD_TESTING=1")
endif()

add_compile_options(-MD)
add_compile_options(-Wall)
Expand Down
22 changes: 21 additions & 1 deletion src/utils/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void ulpatch_info(const char *progname)
printf(" GNUC(GCC): %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
printf(" GNU(GLibc): %d.%d\n", __GLIBC__, __GLIBC_MINOR__);
printf("\n");
printf("Support:\n");
printf("Support\n");
#if defined(HAVE_BINUTILS_BFD_H)
printf(" bfd yes\n");
#else
Expand All @@ -96,6 +96,26 @@ void ulpatch_info(const char *progname)
printf("\n");
printf("ULPatch\n");
printf(" ULP patch version: %d\n", ULPATCH_FILE_VERSION);
#ifdef BUILD_ULFTRACE
printf(" ulftrace yes\n");
#else
printf(" ulftrace no\n");
#endif
#ifdef BUILD_ULTASK
printf(" ultask yes\n");
#else
printf(" ultask no\n");
#endif
#ifdef BUILD_TESTING
printf(" testing yes\n");
#else
printf(" testing no\n");
#endif
#ifdef BUILD_MAN
printf(" man yes\n");
#else
printf(" man no\n");
#endif
printf("\n");
printf("Run\n");
printf(" Verbose %d\n", get_verbose());
Expand Down

0 comments on commit 2a5209d

Please sign in to comment.