Skip to content

Commit

Permalink
Renamed autoconf macro ac-nta-net-size-t to ike-net-size-t
Browse files Browse the repository at this point in the history
Modified autoconf macro gcc-stack-protect to link instead of compile
  • Loading branch information
royhills committed Sep 13, 2024
1 parent 06ebda1 commit 311e43f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ AC_CHECK_FUNCS([malloc gethostbyname gettimeofday inet_ntoa memset select socket

dnl Determine type for 3rd arg to accept()
dnl This is normally socklen_t, but can sometimes be size_t or int.
AC_NTA_NET_SIZE_T
IKE_NET_SIZE_T

dnl Check if the Posix regular expression functions "regcomp" and "regexec"
dnl and the header file "regex.h" are present.
Expand Down
10 changes: 6 additions & 4 deletions m4/gcc-stack-protect.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
dnl
dnl Useful macros for autoconf to check for ssp-patched gcc
dnl 1.0 - September 2003 - Tiago Sousa <[email protected]>
dnl
dnl Modified by ffontaine pull request: use AC_LINK_IFELSE instead of
dnl AC_COMPILE_IFELSE because some systems may be missing the libssp library
dnl even though the compiler accepts the option.
dnl
dnl About ssp:
dnl GCC extension for protecting applications from stack-smashing attacks
dnl http://www.research.ibm.com/trl/projects/security/ssp/
Expand All @@ -23,7 +26,7 @@ AC_DEFUN([GCC_STACK_PROTECT_CC],[
AC_MSG_CHECKING([whether ${CC} accepts -fstack-protector])
ssp_old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[ssp_cc=no])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[ssp_cc=no])
echo $ssp_cc
if test "X$ssp_cc" = "Xno"; then
CFLAGS="$ssp_old_cflags"
Expand All @@ -39,7 +42,7 @@ AC_DEFUN([GCC_STACK_PROTECT_CXX],[
AC_MSG_CHECKING([whether ${CXX} accepts -fstack-protector])
ssp_old_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fstack-protector"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[ssp_cxx=no])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[ssp_cxx=no])
echo $ssp_cxx
if test "X$ssp_cxx" = "Xno"; then
CXXFLAGS="$ssp_old_cxxflags"
Expand All @@ -48,4 +51,3 @@ AC_DEFUN([GCC_STACK_PROTECT_CXX],[
fi
fi
])

4 changes: 2 additions & 2 deletions m4/ac-nta-net-size-t.m4 → m4/ike-net-size-t.m4
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dnl AC_NTA_NET_SIZE_T -- Determine type of 3rd argument to accept
dnl IKE_NET_SIZE_T -- Determine type of 3rd argument to accept
dnl
dnl This type is normally socklen_t but is sometimes size_t or int instead.
dnl We try, in order: socklen_t, int, size_t until we find one that compiles
dnl
AC_DEFUN([AC_NTA_NET_SIZE_T],
AC_DEFUN([IKE_NET_SIZE_T],
[AC_MSG_CHECKING([for socklen_t or equivalent using $CC])
ac_nta_net_size_t=no
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down

0 comments on commit 311e43f

Please sign in to comment.