Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configure and cmake mistakes/differences #11973

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CMake/Platforms/WindowsCache.cmake
Expand Up @@ -52,6 +52,7 @@ if(NOT UNIX)
set(HAVE_GETHOSTNAME 1)
set(HAVE_LIBZ 0)

set(HAVE_ARC4RANDOM 0)
bagder marked this conversation as resolved.
Show resolved Hide resolved
set(HAVE_ARPA_INET_H 0)
set(HAVE_FCNTL_H 1)
set(HAVE_IFADDRS_H 0)
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -1098,8 +1098,10 @@ elseif(HAVE_LIBSOCKET)
endif()

check_symbol_exists(fchmod "${CURL_INCLUDES}" HAVE_FCHMOD)
check_symbol_exists(fnmatch "${CURL_INCLUDES};fnmatch.h" HAVE_FNMATCH)
check_symbol_exists(basename "${CURL_INCLUDES};string.h" HAVE_BASENAME)
check_symbol_exists(socket "${CURL_INCLUDES}" HAVE_SOCKET)
check_symbol_exists(sched_yield "${CURL_INCLUDES};sched.h" HAVE_SCHED_YIELD)
check_symbol_exists(socketpair "${CURL_INCLUDES}" HAVE_SOCKETPAIR)
check_symbol_exists(recv "${CURL_INCLUDES}" HAVE_RECV)
check_symbol_exists(send "${CURL_INCLUDES}" HAVE_SEND)
Expand All @@ -1112,6 +1114,8 @@ check_symbol_exists(stricmp "${CURL_INCLUDES};string.h" HAVE_STRICMP)
check_symbol_exists(strcmpi "${CURL_INCLUDES};string.h" HAVE_STRCMPI)
check_symbol_exists(memrchr "${CURL_INCLUDES};string.h" HAVE_MEMRCHR)
check_symbol_exists(alarm "${CURL_INCLUDES}" HAVE_ALARM)
check_symbol_exists(arc4random "${CURL_INCLUDES};stdlib.h" HAVE_ARC4RANDOM)
check_symbol_exists(fcntl "${CURL_INCLUDES}" HAVE_FCNTL)
check_symbol_exists(getppid "${CURL_INCLUDES}" HAVE_GETPPID)
check_symbol_exists(utimes "${CURL_INCLUDES}" HAVE_UTIMES)

Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Expand Up @@ -3352,7 +3352,6 @@ AC_CHECK_HEADERS(
sys/select.h \
sys/socket.h \
sys/ioctl.h \
sys/uio.h \
unistd.h \
stdlib.h \
arpa/inet.h \
Expand Down Expand Up @@ -3536,7 +3535,6 @@ CURL_CHECK_FUNC_ALARM
CURL_CHECK_FUNC_BASENAME
CURL_CHECK_FUNC_CLOSESOCKET
CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
CURL_CHECK_FUNC_CONNECT
CURL_CHECK_FUNC_FCNTL
CURL_CHECK_FUNC_FREEADDRINFO
CURL_CHECK_FUNC_FSETXATTR
Expand Down Expand Up @@ -3588,7 +3586,6 @@ AC_CHECK_FUNCS([\
arc4random \
fchmod \
fnmatch \
fork \
fseeko \
geteuid \
getpass_r \
Expand Down
28 changes: 23 additions & 5 deletions lib/curl_config.h.cmake
Expand Up @@ -159,6 +159,9 @@
/* Define to 1 if you have the alarm function. */
#cmakedefine HAVE_ALARM 1

/* Define to 1 if you have the arc4random function. */
#cmakedefine HAVE_ARC4RANDOM 1

/* Define to 1 if you have the <arpa/inet.h> header file. */
#cmakedefine HAVE_ARPA_INET_H 1

Expand All @@ -168,6 +171,9 @@
/* Define to 1 if you have the `fchmod' function. */
#cmakedefine HAVE_FCHMOD 1

/* Define to 1 if you have the `fnmatch' function. */
#cmakedefine HAVE_FNMATCH 1

/* Define to 1 if you have the `basename' function. */
#cmakedefine HAVE_BASENAME 1

Expand Down Expand Up @@ -195,6 +201,12 @@
/* Define to 1 if you have the freeaddrinfo function. */
#cmakedefine HAVE_FREEADDRINFO 1

/* Define to 1 if you have the fseeko function. */
#cmakedefine HAVE_FSEEKO 1

/* Define to 1 if you have the _fseeki64 function. */
#cmakedefine HAVE__FSEEKI64 1

/* Define to 1 if you have the ftruncate function. */
#cmakedefine HAVE_FTRUNCATE 1

Expand Down Expand Up @@ -231,9 +243,6 @@
/* Define to 1 if you have the `getpass_r' function. */
#cmakedefine HAVE_GETPASS_R 1

/* Define to 1 if you have the `getppid' function. */
#cmakedefine HAVE_GETPPID 1

/* Define to 1 if you have the `getpeername' function. */
#cmakedefine HAVE_GETPEERNAME 1

Expand Down Expand Up @@ -418,9 +427,15 @@
/* Define to 1 if you have the select function. */
#cmakedefine HAVE_SELECT 1

/* Define to 1 if you have the sched_yield function. */
#cmakedefine HAVE_SCHED_YIELD 1

/* Define to 1 if you have the send function. */
#cmakedefine HAVE_SEND 1

/* Define to 1 if you have the sendmsg function. */
#cmakedefine HAVE_SENDMSG 1

/* Define to 1 if you have the 'fsetxattr' function. */
#cmakedefine HAVE_FSETXATTR 1

Expand Down Expand Up @@ -455,7 +470,7 @@
#cmakedefine HAVE_SIGSETJMP 1

/* Define to 1 if you have the `snprintf' function. */
#cmakedefine HAVE_SNPRINTF
#cmakedefine HAVE_SNPRINTF 1

/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
#cmakedefine HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
Expand Down Expand Up @@ -643,6 +658,9 @@ ${SIZEOF_OFF_T_CODE}
/* The size of `curl_off_t', as computed by sizeof. */
${SIZEOF_CURL_OFF_T_CODE}

/* The size of `curl_socket_t', as computed by sizeof. */
${SIZEOF_CURL_SOCKET_T_CODE}

/* The size of `size_t', as computed by sizeof. */
${SIZEOF_SIZE_T_CODE}

Expand Down Expand Up @@ -720,7 +738,7 @@ ${SIZEOF_TIME_T_CODE}
#cmakedefine USE_MSH3 1

/* if Unix domain sockets are enabled */
#cmakedefine USE_UNIX_SOCKETS
#cmakedefine USE_UNIX_SOCKETS 1

/* Define to 1 if you are building a Windows target with large file support. */
#cmakedefine USE_WIN32_LARGE_FILES 1
Expand Down
124 changes: 0 additions & 124 deletions m4/curl-functions.m4
Expand Up @@ -372,27 +372,6 @@ curl_includes_sys_types="\
])


dnl CURL_INCLUDES_SYS_UIO
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
dnl included when sys/uio.h is to be included.

AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
curl_includes_sys_uio="\
/* includes start */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
#endif
/* includes end */"
AC_CHECK_HEADERS(
sys/types.h sys/uio.h,
[], [], [$curl_includes_sys_uio])
])


dnl CURL_INCLUDES_SYS_XATTR
dnl -------------------------------------------------
dnl Set up variable with list of headers that must be
Expand Down Expand Up @@ -932,109 +911,6 @@ AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
fi
])


dnl CURL_CHECK_FUNC_CONNECT
dnl -------------------------------------------------
dnl Verify if connect is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable curl_disallow_connect, then
dnl HAVE_CONNECT will be defined.

AC_DEFUN([CURL_CHECK_FUNC_CONNECT], [
AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_BSDSOCKET])dnl
AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
#
tst_links_connect="unknown"
tst_proto_connect="unknown"
tst_compi_connect="unknown"
tst_allow_connect="unknown"
#
AC_MSG_CHECKING([if connect can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
$curl_includes_socket
]],[[
if(0 != connect(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_connect="yes"
],[
AC_MSG_RESULT([no])
tst_links_connect="no"
])
#
if test "$tst_links_connect" = "yes"; then
AC_MSG_CHECKING([if connect is prototyped])
AC_EGREP_CPP([connect],[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
$curl_includes_socket
],[
AC_MSG_RESULT([yes])
tst_proto_connect="yes"
],[
AC_MSG_RESULT([no])
tst_proto_connect="no"
])
fi
#
if test "$tst_proto_connect" = "yes"; then
AC_MSG_CHECKING([if connect is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$curl_includes_winsock2
$curl_includes_bsdsocket
$curl_includes_sys_socket
$curl_includes_socket
]],[[
if(0 != connect(0, 0, 0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_connect="yes"
],[
AC_MSG_RESULT([no])
tst_compi_connect="no"
])
fi
#
if test "$tst_compi_connect" = "yes"; then
AC_MSG_CHECKING([if connect usage allowed])
if test "x$curl_disallow_connect" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_connect="yes"
else
AC_MSG_RESULT([no])
tst_allow_connect="no"
fi
fi
#
AC_MSG_CHECKING([if connect might be used])
if test "$tst_links_connect" = "yes" &&
test "$tst_proto_connect" = "yes" &&
test "$tst_compi_connect" = "yes" &&
test "$tst_allow_connect" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1,
[Define to 1 if you have the connect function.])
curl_cv_func_connect="yes"
else
AC_MSG_RESULT([no])
curl_cv_func_connect="no"
fi
])


dnl CURL_CHECK_FUNC_FCNTL
dnl -------------------------------------------------
dnl Verify if fcntl is available, prototyped, and
Expand Down