Skip to content

Commit

Permalink
configure: add --enable-(cflags,cppflags,ldflags) options
Browse files Browse the repository at this point in the history
These allow setting any compiler/linker options without there having
to be specific options for configure for each compiler option.

Signed-off-by: Quentin Armitage <[email protected]>
  • Loading branch information
pqarmitage committed Jul 16, 2024
1 parent a532757 commit 9b107a0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,13 @@ AC_ARG_WITH([systemdsystemunitdir],
[with_systemdsystemunitdir=auto])
AC_ARG_WITH([dbus-data-dir],
[AS_HELP_STRING([--with-dbus-data-dir=DIR], [Directory for Dbus interface files])])
AC_ARG_ENABLE([cflags],
[AS_HELP_STRING([--enable-cflags=flags], [additional CFLAGS])])
AC_ARG_ENABLE([cppflags],
[AS_HELP_STRING([--enable-cppflags=flags], [additional CPPFLAGS])])
AC_ARG_ENABLE([ldflags],
[AS_HELP_STRING([--enable-ldflags=flags], [additional LDFLAGS])])
# Set the kernel headers path
if test -n "$kernel_src_path"; then
Expand Down Expand Up @@ -434,6 +441,11 @@ KA_CFLAGS="-g $CFLAGS"
KA_LDFLAGS=$LDFLAGS
KA_LIBS=$LDLIBS
# Set any additional compiler flags
AS_IF([test -n "$enable_cflags" -a "$enable_cflags" != no], [add_to_var([KA_CFLAGS], ["$enable_cflags"])])
AS_IF([test -n "$enable_cppflags" -a "$enable_cppflags" != no], [add_to_var([KA_CPPFLAGS], ["$enable_cppflags"])])
AS_IF([test -n "$enable_ldflags" -a "$enable_ldflags" != no], [add_to_var([KA_LDFLAGS], ["$enable_ldflags"])])
# For reporting GCC bugs, uncomment the next two lines
#KA_CPPFLAGS="$KA_CPPFLAGS -v -save-temps"
#KA_CFLAGS="$KA_CFLAGS -v -save-temps"
Expand Down

0 comments on commit 9b107a0

Please sign in to comment.