Ticket #60959: openssh-8.1p1-xcode12.2pedantry.patch

File openssh-8.1p1-xcode12.2pedantry.patch, 9.8 KB (added by adpoliak, 3 years ago)

patch applied to clean configure script and its source to allow building under macOS Big Sur 11.1 / XCode 12.2

  • openssh-8.1p1/configure

    diff -ur a/openssh-8.1p1/configure b/openssh-8.1p1/configure
    a b  
    70007299/* end confdefs.h.  */
    70017300
     7301#include <stdlib.h>
    70027302#define testmacro foo
    70037303#define testmacro bar
    70047304int
    70057305main ()
     
    73727672  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    73737673/* end confdefs.h.  */
    73747674 #include <mach-o/dyld.h>
     7675#include <stdlib.h>
    73757676main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
    73767677                exit(0);
    73777678        else
     
    86818981  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    86828982/* end confdefs.h.  */
    86838983 #include <stdio.h>
     8984#include <stdlib.h>
    86848985int
    86858986main ()
    86868987{
     
    88329133
    88339134#include <libgen.h>
    88349135#include <string.h>
    8835 
     9136#include <stdlib.h>
    88369137int main(int argc, char **argv) {
    88379138    char *s, buf[32];
    88389139
     
    1020110502/* end confdefs.h.  */
    1020210503
    1020310504#include <sys/types.h>
     10505#include <stdlib.h>
    1020410506#include <dirent.h>
    1020510507int
    1020610508main ()
     
    1058710889                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1058810890/* end confdefs.h.  */
    1058910891 #include <histedit.h>
     10892#include <stdlib.h>
    1059010893int
    1059110894main ()
    1059210895{
     
    1174212045  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1174312046/* end confdefs.h.  */
    1174412047#include <stdio.h>
     12048         #include <stdlib.h>
    1174512049int
    1174612050main ()
    1174712051{
     
    1195012254  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1195112255/* end confdefs.h.  */
    1195212256 #include <stdio.h>
     12257                 #include <stdlib.h>
    1195312258int
    1195412259main ()
    1195512260{
     
    1199412300/* end confdefs.h.  */
    1199512301
    1199612302#include <sys/types.h>
     12303#include <stdlib.h>
     12304#include <string.h>
    1199712305#include <stdio.h>
    1199812306
    1199912307int
     
    1222512533
    1222612534#include <stdio.h>
    1222712535#include <sys/fcntl.h>
     12536#include <stdlib.h>
    1222812537#include <sys/types.h>
    1222912538#include <sys/wait.h>
    1223012539
     
    1229612605#include <sys/socket.h>
    1229712606#include <netdb.h>
    1229812607#include <errno.h>
     12608#include <stdlib.h>
    1229912609#include <netinet/in.h>
    1230012610
    1230112611#define TEST_PORT "2222"
     
    1238612696#include <stdio.h>
    1238712697#include <sys/socket.h>
    1238812698#include <netdb.h>
     12699#include <stdlib.h>
    1238912700#include <errno.h>
    1239012701#include <netinet/in.h>
    1239112702
     
    1247412785        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1247512786/* end confdefs.h.  */
    1247612787 #include <shadow.h>
     12788#include <stdlib.h>
    1247712789int
    1247812790main ()
    1247912791{
     
    1278813100/* end confdefs.h.  */
    1278913101
    1279013102        #include <stdio.h>
     13103        #include <stdlib.h>
    1279113104        #include <string.h>
    1279213105        #include <openssl/opensslv.h>
    1279313106        #include <openssl/crypto.h>
     
    1287113184  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1287213185/* end confdefs.h.  */
    1287313186
     13187        #include <stdlib.h>
    1287413188        #include <string.h>
    1287513189        #include <openssl/opensslv.h>
    1287613190        #include <openssl/crypto.h>
     
    1311113425/* end confdefs.h.  */
    1311213426
    1311313427        #include <string.h>
     13428        #include <stdlib.h>
    1311413429        #include <openssl/evp.h>
    1311513430
    1311613431int
     
    1314813463/* end confdefs.h.  */
    1314913464
    1315013465        #include <string.h>
     13466        #include <stdlib.h>
    1315113467        #include <openssl/evp.h>
    1315213468
    1315313469int
     
    1318713503/* end confdefs.h.  */
    1318813504
    1318913505        #include <string.h>
     13506        #include <stdlib.h>
    1319013507        #include <openssl/evp.h>
    1319113508
    1319213509int
     
    1323213549/* end confdefs.h.  */
    1323313550
    1323413551        #include <string.h>
     13552        #include <stdlib.h>
    1323513553        #include <openssl/evp.h>
    1323613554
    1323713555int
     
    1351613834        #include <openssl/ecdh.h>
    1351713835        #include <openssl/ecdsa.h>
    1351813836        #include <openssl/evp.h>
     13837        #include <stdlib.h>
    1351913838        #include <openssl/objects.h>
    1352013839        #include <openssl/opensslv.h>
    1352113840
     
    1376214081/* end confdefs.h.  */
    1376314082
    1376414083        #include <string.h>
     14084        #include <stdlib.h>
    1376514085        #include <openssl/rand.h>
    1376614086
    1376714087int
     
    1464514965/* end confdefs.h.  */
    1464614966
    1464714967#include <stdio.h>
     14968#include <stdlib.h>
    1464814969/* Why is this so damn hard? */
    1464914970#ifdef __GNUC__
    1465014971# undef __GNUC__
     
    1587216193
    1587316194#include <stdio.h>
    1587416195#include <string.h>
     16196#include <stdlib.h>
    1587516197#ifdef HAVE_SNPRINTF
    1587616198main()
    1587716199{
     
    1675717079
    1675817080#include <sys/types.h>
    1675917081#include <sys/socket.h>
     17082#include <stdlib.h>
    1676017083#include <sys/uio.h>
    1676117084
    1676217085int
     
    1689417217
    1689517218#include <sys/types.h>
    1689617219#include <sys/socket.h>
     17220#include <stdlib.h>
    1689717221#include <sys/uio.h>
    1689817222
    1689917223int
     
    1843018754
    1843118755#include <stdio.h>
    1843218756#include <string.h>
     18757#include <stdlib.h>
    1843318758#ifdef HAVE_PATHS_H
    1843418759#include <paths.h>
    1843518760#endif
     
    1881319138
    1881419139/* find out what STDPATH is */
    1881519140#include <stdio.h>
     19141#include <stdlib.h>
    1881619142#ifdef HAVE_PATHS_H
    1881719143# include <paths.h>
    1881819144#endif
  • openssh-8.1p1/configure.ac

    diff -ur a/openssh-8.1p1/configure.ac b/openssh-8.1p1/configure.ac
    a b  
    524525        AC_COMPILE_IFELSE(
    525526            [AC_LANG_PROGRAM([[
     527#include <stdlib.h>
    526528#define testmacro foo
    527529#define testmacro bar]],
    528530            [[ exit(0); ]])],
    529531            [ AC_MSG_RESULT([yes]) ],
     
    643645        use_pie=auto
    644646        AC_MSG_CHECKING([if we have working getaddrinfo])
    645647        AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <mach-o/dyld.h>
     648#include <stdlib.h>
    646649main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
    647650                exit(0);
    648651        else
     
    12041207esac
    12051208
    12061209AC_MSG_CHECKING([compiler and flags for sanity])
    1207 AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h> ]], [[ exit(0); ]])],
     1210AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <stdio.h>
     1211#include <stdlib.h> ]], [[ exit(0); ]])],
    12081212        [       AC_MSG_RESULT([yes]) ],
    12091213        [
    12101214                AC_MSG_RESULT([no])
     
    12281232                                [AC_LANG_SOURCE([[
    12291233#include <libgen.h>
    12301234#include <string.h>
    1231 
     1235#include <stdlib.h>
    12321236int main(int argc, char **argv) {
    12331237    char *s, buf[32];
    12341238
     
    14711475AC_RUN_IFELSE(
    14721476        [AC_LANG_PROGRAM([[
    14731477#include <sys/types.h>
     1478#include <stdlib.h>
    14741479#include <dirent.h>]],
    14751480        [[
    14761481        struct dirent d;
     
    15851590                )
    15861591                AC_MSG_CHECKING([if libedit version is compatible])
    15871592                AC_COMPILE_IFELSE(
    1588                     [AC_LANG_PROGRAM([[ #include <histedit.h> ]],
     1593                    [AC_LANG_PROGRAM([[ #include <histedit.h>
     1594#include <stdlib.h> ]],
    15891595                    [[
    15901596        int i = H_SETSIZE;
    15911597        el_init("", NULL, NULL, NULL);
     
    20332039
    20342040AC_MSG_CHECKING([for working fflush(NULL)])
    20352041AC_RUN_IFELSE(
    2036         [AC_LANG_PROGRAM([[#include <stdio.h>]], [[fflush(NULL); exit(0);]])],
     2042        [AC_LANG_PROGRAM([[#include <stdio.h>
     2043         #include <stdlib.h> ]], [[fflush(NULL); exit(0);]])],
    20372044        AC_MSG_RESULT([yes]),
    20382045        [AC_MSG_RESULT([no])
    20392046         AC_DEFINE([FFLUSH_NULL_BUG], [1],
     
    20692076if test "x$ac_cv_func_snprintf" = "xyes" ; then
    20702077        AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
    20712078        AC_RUN_IFELSE(
    2072                 [AC_LANG_PROGRAM([[ #include <stdio.h> ]],
     2079                [AC_LANG_PROGRAM([[ #include <stdio.h>
     2080                 #include <stdlib.h>
     2081                 ]],
    20732082                [[
    20742083        char b[5];
    20752084        snprintf(b,5,"123456789");
     
    20912100        AC_RUN_IFELSE(
    20922101                [AC_LANG_PROGRAM([[
    20932102#include <sys/types.h>
     2103#include <stdlib.h>
     2104#include <string.h>
    20942105#include <stdio.h>
    20952106                ]],
    20962107                [[
     
    22122223                [AC_LANG_PROGRAM([[
    22132224#include <stdio.h>
    22142225#include <sys/fcntl.h>
     2226#include <stdlib.h>
    22152227#include <sys/types.h>
    22162228#include <sys/wait.h>
    22172229                ]], [[
     
    22602272#include <sys/socket.h>
    22612273#include <netdb.h>
    22622274#include <errno.h>
     2275#include <stdlib.h>
    22632276#include <netinet/in.h>
    22642277
    22652278#define TEST_PORT "2222"
     
    23272340#include <stdio.h>
    23282341#include <sys/socket.h>
    23292342#include <netdb.h>
     2343#include <stdlib.h>
    23302344#include <errno.h>
    23312345#include <netinet/in.h>
    23322346
     
    23872401
    23882402if test "x$check_for_conflicting_getspnam" = "x1"; then
    23892403        AC_MSG_CHECKING([for conflicting getspnam in shadow.h])
    2390         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h> ]],
     2404        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include <shadow.h>
     2405#include <stdlib.h> ]],
    23912406                [[ exit(0); ]])],
    23922407                [
    23932408                        AC_MSG_RESULT([no])
     
    25622577        AC_RUN_IFELSE(
    25632578                [AC_LANG_PROGRAM([[
    25642579        #include <stdio.h>
     2580        #include <stdlib.h>
    25652581        #include <string.h>
    25662582        #include <openssl/opensslv.h>
    25672583        #include <openssl/crypto.h>
     
    26232639        AC_MSG_CHECKING([whether OpenSSL's headers match the library])
    26242640        AC_RUN_IFELSE(
    26252641                [AC_LANG_PROGRAM([[
     2642        #include <stdlib.h>
    26262643        #include <string.h>
    26272644        #include <openssl/opensslv.h>
    26282645        #include <openssl/crypto.h>
     
    27622779        AC_LINK_IFELSE(
    27632780                [AC_LANG_PROGRAM([[
    27642781        #include <string.h>
     2782        #include <stdlib.h>
    27652783        #include <openssl/evp.h>
    27662784                ]], [[
    27672785                exit(EVP_aes_192_cbc() == NULL || EVP_aes_256_cbc() == NULL);
     
    27812799        AC_LINK_IFELSE(
    27822800                [AC_LANG_PROGRAM([[
    27832801        #include <string.h>
     2802        #include <stdlib.h>
    27842803        #include <openssl/evp.h>
    27852804                ]], [[
    27862805                exit(EVP_aes_128_ctr() == NULL ||
     
    28022821        AC_LINK_IFELSE(
    28032822                [AC_LANG_PROGRAM([[
    28042823        #include <string.h>
     2824        #include <stdlib.h>
    28052825        #include <openssl/evp.h>
    28062826                ]], [[
    28072827                exit(EVP_aes_128_gcm() == NULL ||
     
    28292849        AC_LINK_IFELSE(
    28302850                [AC_LANG_PROGRAM([[
    28312851        #include <string.h>
     2852        #include <stdlib.h>
    28322853        #include <openssl/evp.h>
    28332854                ]], [[
    28342855                if(EVP_DigestUpdate(NULL, NULL,0))
     
    29272948        #include <openssl/ecdh.h>
    29282949        #include <openssl/ecdsa.h>
    29292950        #include <openssl/evp.h>
     2951        #include <stdlib.h>
    29302952        #include <openssl/objects.h>
    29312953        #include <openssl/opensslv.h>
    29322954                        ]],[[
     
    30153037        AC_RUN_IFELSE(
    30163038                [AC_LANG_PROGRAM([[
    30173039        #include <string.h>
     3040        #include <stdlib.h>
    30183041        #include <openssl/rand.h>
    30193042                ]], [[
    30203043                exit(RAND_status() == 1 ? 0 : 1);
     
    34453468        AC_RUN_IFELSE(
    34463469                [AC_LANG_PROGRAM([[
    34473470#include <stdio.h>
     3471#include <stdlib.h>
    34483472/* Why is this so damn hard? */
    34493473#ifdef __GNUC__
    34503474# undef __GNUC__
     
    39213945                [AC_LANG_SOURCE([[
    39223946#include <stdio.h>
    39233947#include <string.h>
     3948#include <stdlib.h>
    39243949#ifdef HAVE_SNPRINTF
    39253950main()
    39263951{
     
    40214046        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    40224047#include <sys/types.h>
    40234048#include <sys/socket.h>
     4049#include <stdlib.h>
    40244050#include <sys/uio.h>
    40254051                ]], [[
    40264052#ifdef msg_accrights
     
    40824108        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    40834109#include <sys/types.h>
    40844110#include <sys/socket.h>
     4111#include <stdlib.h>
    40854112#include <sys/uio.h>
    40864113                ]], [[
    40874114#ifdef msg_control
     
    45014528                [AC_LANG_PROGRAM([[
    45024529#include <stdio.h>
    45034530#include <string.h>
     4531#include <stdlib.h>
    45044532#ifdef HAVE_PATHS_H
    45054533#include <paths.h>
    45064534#endif
     
    47444772                        [AC_LANG_PROGRAM([[
    47454773/* find out what STDPATH is */
    47464774#include <stdio.h>
     4775#include <stdlib.h>
    47474776#ifdef HAVE_PATHS_H
    47484777# include <paths.h>
    47494778#endif