Skip to content

Commit

Permalink
staging: usbip: userspace: add option to turn fortify on or off
Browse files Browse the repository at this point in the history
This comes handy when hacking with different cross
compilers, some of which may or may not have
_FORTIFY_SOURCE turned on by default. This patch
allows us to turn _FORTIFY_SOURCE on by specifying
--with-fortify option at configuration time (or
to turn it off by specifying --without-fortify).

If nothing is specified, default compiler behavior
is assumed.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ilija Hadzic authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent 328f7f8 commit 107fefd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/staging/usbip/userspace/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,22 @@ AC_ARG_WITH([usbids-dir],
[USBIDS_DIR=$withval], [USBIDS_DIR="/usr/share/hwdata/"])
AC_SUBST([USBIDS_DIR])

# use _FORTIFY_SOURCE
AC_MSG_CHECKING([whether to use fortify])
AC_ARG_WITH([fortify],
[AS_HELP_STRING([--with-fortify],
[use _FORTIFY_SROUCE option when compiling)])],
dnl [ACTION-IF-GIVEN]
[if test "$withval" = "yes"; then
AC_MSG_RESULT([yes])
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE -O"
else
AC_MSG_RESULT([no])
CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
fi
],
dnl [ACTION-IF-NOT-GIVEN]
[AC_MSG_RESULT([default])])

AC_CONFIG_FILES([Makefile libsrc/Makefile src/Makefile])
AC_OUTPUT

0 comments on commit 107fefd

Please sign in to comment.