From 2767a9a660d5f23e57cb82aaba12585061a6e942 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 4 Dec 2009 06:03:11 +0000 Subject: [PATCH] Mac client: update build scripts, XCode project for curl-7.19.7 and c-ares 1.7.0 svn path=/trunk/boinc/; revision=19780 --- checkin_notes | 12 ++ mac_build/HowToBuildBOINC_XCode.rtf | 24 +-- mac_build/boinc.xcodeproj/project.pbxproj | 42 ++--- mac_build/buildc-ares.sh | 18 +- mac_build/buildcurl.sh | 211 +++++++++++++++++++++- mac_build/setupForBOINC.sh | 12 +- 6 files changed, 267 insertions(+), 52 deletions(-) diff --git a/checkin_notes b/checkin_notes index a98386c399..6f91ee901f 100644 --- a/checkin_notes +++ b/checkin_notes @@ -9687,3 +9687,15 @@ David 3 Dec 2009 cpu_sched.cpp gui_rpc_server_ops.cpp work_fetch.cpp,h + +Charlie 3 Dec 2009 + - Mac client: update build scripts, XCode project for curl-7.19.7 and + c-ares 1.7.0. + + mac_build/ + HowToBuildBOINC_XCode.rtf + buildc-ares.sh + buildcurl.sh + setupForBOINC.sh + boinc.xcodeproj/ + project.pbxproj diff --git a/mac_build/HowToBuildBOINC_XCode.rtf b/mac_build/HowToBuildBOINC_XCode.rtf index ed030774e9..00b725a332 100644 --- a/mac_build/HowToBuildBOINC_XCode.rtf +++ b/mac_build/HowToBuildBOINC_XCode.rtf @@ -1,4 +1,4 @@ -{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf460 +{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540 {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 Courier;\f2\fnil\fcharset0 LucidaGrande; \f3\fswiss\fcharset0 ArialMT;\f4\fmodern\fcharset0 Courier-Oblique;} {\colortbl;\red255\green255\blue255;\red174\green0\blue0;\red0\green0\blue239;} @@ -14,10 +14,10 @@ \b0\fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc \cf0 Written by Charlie Fenton\ -Last updated 6/5/09\ +Last updated 12/3/09\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \cf0 \ -This document applies to BOINC version 6.8.0 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \ +This document applies to BOINC version 6.10.22 and later. It has instructions for building the BOINC Client and Manager for Macintosh OSX. Information for building science project applications to run under BOINC on Macintosh OSX can be found {\field{\*\fldinst{HYPERLINK "http://boinc.berkeley.edu/trac/wiki/BuildMacApp"}}{\fldrslt here}}. \ \ Note: the information in this document changes from time to time for different versions of BOINC. For any version of BOINC source files, the corresponding version of this document can be found in the source tree at:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural @@ -124,7 +124,7 @@ You also need to install Subversion itself. One place to get it is:\ \b0\fs24 \cf0 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.6.0, curl-7.19.4, and jpeg-6b. You can obtain these from the following URLs:\ +\cf0 BOINC depends on four third-party libraries: wxMac-2.8.10, c-ares-1.7.0, curl-7.19.7, and jpeg-6b. You can obtain these from the following URLs:\ \ wxMac-2.8.10 (needed only if you are building the BOINC Manager):\ {\field{\*\fldinst{HYPERLINK "http://www.wxwidgets.org"}}{\fldrslt @@ -136,19 +136,19 @@ wxMac-2.8.10 (needed only if you are building the BOINC Manager):\ \f1\fs26 \ \f0\fs24 \ -curl-7.19.4:\ +curl-7.19.7:\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f1\fs26 \cf0 {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se"}}{\fldrslt http://curl.haxx.se}}\ - {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se/download/curl-7.19.4.tar.gz"}}{\fldrslt http://curl.haxx.se/download/curl-7.19.4.tar.gz}}\ + {\field{\*\fldinst{HYPERLINK "http://curl.haxx.se/download/curl-7.19.7.tar.gz"}}{\fldrslt http://curl.haxx.se/download/curl-7.19.7.tar.gz}}\ \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\f0\fs24 \cf0 c-ares-1.6.0 (used by curl):\ +\f0\fs24 \cf0 c-ares-1.7.0 (used by curl):\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f1\fs26 \cf0 {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/}}\ - {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/c-ares-1.6.0.tar.gz"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/c-ares-1.6.0.tar.gz}}\ + {\field{\*\fldinst{HYPERLINK "http://daniel.haxx.se/projects/c-ares/c-ares-1.7.0.tar.gz"}}{\fldrslt http://daniel.haxx.se/projects/c-ares/c-ares-1.7.0.tar.gz}}\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \f0\fs24 \cf0 \ @@ -168,7 +168,7 @@ jpeg-6b (needed only if you are building the BOINC libboinc_graphics_api.a libr \f4\fs26 autoconf --version \f0\fs24 or \f4\fs26 automake --version -\f0\fs24 . Building curl-7.19.4 requires autoconf 2.59 and automake 1.9.3 or later. \ +\f0\fs24 . Building curl-7.19.7 requires autoconf 2.59 and automake 1.9.3 or later. \ \ Upgrades for autoconf and automake are available from www.gnu.org: \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural @@ -192,7 +192,7 @@ XCode installed these utilities in the \i0 \cf0 \ \pard\pardeftab720\sa260\ql\qnatural \cf0 All BOINC software for Power PC Macs must be built using MacOS10.3.9 SDK to assure backward compatibility with OS 10.3.9.\uc0\u8232 All 32-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.4.u SDK to allow cross-compiling.\u8232 All 64-bit BOINC software for Intel Macs must be built using GCC 4.0 and MacOS10.5 SDK.\ -These are not done by either the XCode projects which come with wxMac-2.8.10, nor the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.6.0, curl-7.19.4, or jpeg-6b. So be sure to use our special scripts to build these packages.\ +These are not done by either the XCode projects which come with wxMac-2.8.10, nor the AutoMake scripts supplied with wxMac-2.8.10, c-ares-1.7.0, curl-7.19.7, or jpeg-6b. So be sure to use our special scripts to build these packages.\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural \cf0 Building BOINC and the library packages on which it depends requires OS 10.5 and XCode 3.0 (or greater). \ \ @@ -202,8 +202,8 @@ These are not done by either the XCode projects which come with wxMac-2.8.10, no [2] Put the following 3 directories inside the BOINC_dev folder (omit any you don't need):\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural -\f1\fs26 \cf0 c-ares-1.6.0\ - curl-7.19.4\ +\f1\fs26 \cf0 c-ares-1.7.0\ + curl-7.19.7\ jpeg-6b\ wxMac-2.8.10\ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural diff --git a/mac_build/boinc.xcodeproj/project.pbxproj b/mac_build/boinc.xcodeproj/project.pbxproj index 2460547588..12cf7a07d1 100755 --- a/mac_build/boinc.xcodeproj/project.pbxproj +++ b/mac_build/boinc.xcodeproj/project.pbxproj @@ -3427,10 +3427,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -3452,10 +3452,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4082,10 +4082,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4421,7 +4421,7 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; "OTHER_CFLAGS[arch=x86_64]" = ( "-DMAC_OS_X_VERSION_MAX_ALLOWED=1050", "-D_THREAD_SAFE", @@ -4431,8 +4431,8 @@ ../clientgui/mac/config.h, ); OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4664,10 +4664,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4686,10 +4686,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", @@ -4978,10 +4978,10 @@ COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; DEPLOYMENT_POSTPROCESSING = YES; - HEADER_SEARCH_PATHS = "../../curl-7.19.4/include"; + HEADER_SEARCH_PATHS = "../../curl-7.19.7/include"; OTHER_LDFLAGS = ( - "../../curl-7.19.4/lib/.libs/libcurl.a", - "../../c-ares-1.6.0/.libs/libcares.a", + "../../curl-7.19.7/lib/.libs/libcurl.a", + "../../c-ares-1.7.0/.libs/libcares.a", "-lcrypto", "-lssl", "-lldap", diff --git a/mac_build/buildc-ares.sh b/mac_build/buildc-ares.sh index 9dd2cdb73f..58856a66c1 100644 --- a/mac_build/buildc-ares.sh +++ b/mac_build/buildc-ares.sh @@ -18,14 +18,14 @@ # along with BOINC. If not, see . # # -# Script to build Macintosh Universal Binary library of c-ares-1.6.0 for +# Script to build Macintosh Universal Binary library of c-ares-1.7.0 for # use in building BOINC. # # by Charlie Fenton 7/21/06 -# Updated 12/17/08 +# Updated 12/3/09 # -## In Terminal, CD to the c-ares-1.6.0 directory. -## cd [path]/c-ares-1.6.0/ +## In Terminal, CD to the c-ares-1.7.0 directory. +## cd [path]/c-ares-1.7.0/ ## then run this script: ## source [path]/buildc-ares.sh [ -clean ] [ -gcc33 ] ## @@ -56,7 +56,7 @@ fi fi if [ $AlreadyBuilt -ne 0 ]; then - echo "c-ares-1.6.0 already built" + echo "c-ares-1.7.0 already built" return 0 fi @@ -94,7 +94,7 @@ export LDFLAGS="-arch ppc -D_NONSTD_SOURCE -isystem /Developer/SDKs/MacOSX10.3.9 export CPPFLAGS="-arch ppc -D_NONSTD_SOURCE -isystem /Developer/SDKs/MacOSX10.3.9.sdk" export CFLAGS="-arch ppc -D_NONSTD_SOURCE -isystem /Developer/SDKs/MacOSX10.3.9.sdk" -# curl configure and make expect a path to _installed_ c-ares-1.6.0 +# curl configure and make expect a path to _installed_ c-ares-1.7.0 # so set a temporary install path that does not contain spaces. ./configure --enable-shared=NO prefix=/tmp/installed-c-ares --host=ppc if [ $? -ne 0 ]; then return 1; fi @@ -116,6 +116,8 @@ make clean make if [ $? -ne 0 ]; then return 1; fi +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ares_build.h ares_build_ppc.h mv -f .libs/libcares.a libcares_ppc.a make clean @@ -134,6 +136,8 @@ if [ $? -ne 0 ]; then return 1; fi make if [ $? -ne 0 ]; then return 1; fi +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ares_build.h ares_build_i386.h export CC="";export CXX="" export LDFLAGS="" @@ -170,6 +174,8 @@ if [ $? -ne 0 ]; then return 1; fi make if [ $? -ne 0 ]; then return 1; fi +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ares_build.h ares_build_x86_64.h export CC="";export CXX="" export LDFLAGS="" diff --git a/mac_build/buildcurl.sh b/mac_build/buildcurl.sh index dc61c4d793..e12157c7ae 100644 --- a/mac_build/buildcurl.sh +++ b/mac_build/buildcurl.sh @@ -18,14 +18,14 @@ # along with BOINC. If not, see . # # -# Script to build Macintosh Universal Binary library of curl-7.19.4 for +# Script to build Macintosh Universal Binary library of curl-7.19.7 for # use in building BOINC. # # by Charlie Fenton 7/21/06 -# Updated 3/3/09 +# Updated 12/3/09 # -## In Terminal, CD to the curl-7.19.4 directory. -## cd [path]/curl-7.19.4/ +## In Terminal, CD to the curl-7.19.7 directory. +## cd [path]/curl-7.19.7/ ## then run this script: ## source [path]/buildcurl.sh [ -clean ] [ -gcc33 ] ## @@ -56,7 +56,7 @@ fi fi if [ $AlreadyBuilt -ne 0 ]; then - echo "curl-7.19.4 already built" + echo "curl-7.19.7 already built" return 0 fi @@ -78,12 +78,200 @@ if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk/ ]; then return 1 fi +# Update to libcurl 7.19.7 (DNS Cache and Sync DNS patches) +# Patch lib/hostip.c +if [ ! -f lib/hostip.c.orig ]; then +cat >> /tmp/hostip_c_diff << ENDOFFILE +--- curl-7.19.7/lib/hostip.c Thu Nov 5 16:31:07 2009 ++++ moka5/lib/hostip.c Fri Nov 6 16:26:09 2009 +@@ -123,6 +123,10 @@ + static struct curl_hash hostname_cache; + static int host_cache_initialized; + ++#ifdef CURLDEBUG ++static int ndns = 0; ++#endif ++ + static void freednsentry(void *freethis); + + /* +@@ -232,14 +236,7 @@ + (struct hostcache_prune_data *) datap; + struct Curl_dns_entry *c = (struct Curl_dns_entry *) hc; + +- if((data->now - c->timestamp < data->cache_timeout) || +- c->inuse) { +- /* please don't remove */ +- return 0; +- } +- +- /* fine, remove */ +- return 1; ++ return (data->now - c->timestamp >= data->cache_timeout); + } + + /* +@@ -339,7 +336,6 @@ + size_t entry_len; + struct Curl_dns_entry *dns; + struct Curl_dns_entry *dns2; +- time_t now; + + /* Create an entry id, based upon the hostname and port */ + entry_id = create_hostcache_id(hostname, port); +@@ -357,23 +353,22 @@ + + dns->inuse = 0; /* init to not used */ + dns->addr = addr; /* this is the address(es) */ ++ time(&dns->timestamp); ++ if(dns->timestamp == 0) ++ dns->timestamp = 1; /* zero indicates that entry isn't in hash table */ + +- /* Store the resolved data in our DNS cache. This function may return a +- pointer to an existing struct already present in the hash, and it may +- return the same argument we pass in. Make no assumptions. */ ++ /* Store the resolved data in our DNS cache. */ + dns2 = Curl_hash_add(data->dns.hostcache, entry_id, entry_len+1, + (void *)dns); + if(!dns2) { +- /* Major badness, run away. */ + free(dns); + free(entry_id); + return NULL; + } +- time(&now); +- dns = dns2; + +- dns->timestamp = now; /* used now */ ++ dns = dns2; + dns->inuse++; /* mark entry as in-use */ ++ DEBUGF(ndns++); + + /* free the allocated entry_id again */ + free(entry_id); +@@ -436,6 +431,7 @@ + + if(dns) { + dns->inuse++; /* we use it! */ ++ DEBUGF(ndns++); + rc = CURLRESOLV_RESOLVED; + } + +@@ -688,6 +684,12 @@ + Curl_share_lock(data, CURL_LOCK_DATA_DNS, CURL_LOCK_ACCESS_SINGLE); + + dns->inuse--; ++ DEBUGF(ndns--); ++ /* only free if nobody is using AND it is not in hostcache (timestamp == 0) */ ++ if (dns->inuse == 0 && dns->timestamp == 0) { ++ Curl_freeaddrinfo(dns->addr); ++ free(dns); ++ } + + if(data->share) + Curl_share_unlock(data, CURL_LOCK_DATA_DNS); +@@ -700,11 +702,20 @@ + { + struct Curl_dns_entry *p = (struct Curl_dns_entry *) freethis; + +- if(p) { +- Curl_freeaddrinfo(p->addr); +- free(p); +- } ++ /* mark the entry as not in hostcache */ ++ p->timestamp = 0; ++ if (p->inuse == 0) { ++ Curl_freeaddrinfo(p->addr); ++ free(p); ++ } + } ++ ++#ifdef CURLDEBUG ++int curl_get_ndns(void) ++{ ++ return ndns; ++} ++#endif + + /* + * Curl_mk_dnscache() creates a new DNS cache and returns the handle for it. +ENDOFFILE + +patch -bfi /tmp/hostip_c_diff lib/hostip.c + +rm -f /tmp/hostip_c_diff +else + echo "hostip.c already patched" +fi + + +# Patch lib/hostip.h +if [ ! -f lib/hostip.h.orig ]; then +cat >> /tmp/hostip_h_diff << ENDOFFILE +--- curl-7.19.7/lib/hostip.h Thu Nov 5 16:31:07 2009 ++++ moka5/lib/hostip.h Fri Nov 6 16:21:20 2009 +@@ -121,6 +121,8 @@ + + struct Curl_dns_entry { + Curl_addrinfo *addr; ++ /* timestamp == 0 -- entry not in hostcache ++ timestamp != 0 -- entry is in hostcache */ + time_t timestamp; + long inuse; /* use-counter, make very sure you decrease this + when you're done using the address you received */ +ENDOFFILE +### ' (Fix syntax coloring for easier readability) + +patch -bfi /tmp/hostip_h_diff lib/hostip.h + +rm -f /tmp/hostip_h_diff +else + echo "hostip.h already patched" +fi + + +# Patch lib/hash.c +if [ ! -f lib/hash.c.orig ]; then +cat >> /tmp/hash_c_diff << ENDOFFILE +--- curl-7.19.7/lib/hash.c Thu Nov 5 16:31:07 2009 ++++ moka5/lib/hash.c Wed Nov 4 13:46:15 2009 +@@ -140,8 +140,8 @@ + + #define FETCH_LIST(x,y,z) x->table[x->hash_func(y, z, x->slots)] + +-/* Return the data in the hash. If there already was a match in the hash, +- that data is returned. */ ++/* Insert the data in the hash. If there already was a match in the hash, ++ that data is replaced. */ + void * + Curl_hash_add(struct curl_hash *h, void *key, size_t key_len, void *p) + { +@@ -152,8 +152,9 @@ + for (le = l->head; le; le = le->next) { + he = (struct curl_hash_element *) le->ptr; + if(h->comp_func(he->key, he->key_len, key, key_len)) { +- h->dtor(p); /* remove the NEW entry */ +- return he->ptr; /* return the EXISTING entry */ ++ Curl_llist_remove(l, le, (void *)h); ++ --h->size; ++ break; + } + } +ENDOFFILE + +patch -bfi /tmp/hash_c_diff lib/hash.c + +rm -f /tmp/hash_c_diff +else + echo "hash.c already patched" +fi + export PATH=/usr/local/bin:$PATH CURL_DIR=`pwd` -# curl configure and make expect a path to _installed_ c-ares-1.6.0 +# curl configure and make expect a path to _installed_ c-ares-1.7.0 # so temporarily install c-ares at a path that does not contain spaces. -cd ../c-ares-1.6.0 +cd ../c-ares-1.7.0 make install cd "${CURL_DIR}" @@ -117,6 +305,9 @@ export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.3.9.sdk -arch ppc" fi +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ../c-ares-1.7.0/ares_build_ppc.h /tmp/installed-c-ares/include/ares_build.h + ./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=ppc if [ $? -ne 0 ]; then return 1; fi @@ -139,6 +330,9 @@ export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" export SDKROOT="/Developer/SDKs/MacOSX10.4u.sdk" export MACOSX_DEPLOYMENT_TARGET=10.4 +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ../c-ares-1.7.0/ares_build_i386.h /tmp/installed-c-ares/include/ares_build.h + ./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=i386 if [ $? -ne 0 ]; then return 1; fi @@ -176,6 +370,9 @@ export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64" export SDKROOT="/Developer/SDKs/MacOSX10.5.sdk" export MACOSX_DEPLOYMENT_TARGET=10.5 +# c-ares configure creates a different ares_build.h file for each architecture +cp -f ../c-ares-1.7.0/ares_build_x86_64.h /tmp/installed-c-ares/include/ares_build.h + ./configure --enable-shared=NO --enable-ares=/tmp/installed-c-ares --host=x86_64 if [ $? -ne 0 ]; then return 1; fi diff --git a/mac_build/setupForBOINC.sh b/mac_build/setupForBOINC.sh index f7af6f0067..9d5e504560 100644 --- a/mac_build/setupForBOINC.sh +++ b/mac_build/setupForBOINC.sh @@ -19,10 +19,10 @@ # # # Master script to build Universal Binary libraries needed by BOINC: -# curl-7.19.4 with c-ares-1.6.0, jpeg-6b and wxMac-2.8.10 +# curl-7.19.7 with c-ares-1.7.0, jpeg-6b and wxMac-2.8.10 # # by Charlie Fenton 7/21/06 -# Updated 4/17/08 for curl-7.19.4, c-ares-1.6.0 and wxMac-2.8.10 and Unicode +# Updated 12/3/09 for curl-7.19.7, c-ares-1.7.0 and wxMac-2.8.10 and Unicode # # Download these three packages and place them in a common parent # directory with the BOINC source tree. @@ -48,24 +48,24 @@ SCRIPT_DIR=`pwd` echo "" echo "----------------------------------" -echo "------- BUILD C-ARES-1.6.0 -------" +echo "------- BUILD C-ARES-1.7.0 -------" echo "----------------------------------" echo "" -cd ../../c-ares-1.6.0/ +cd ../../c-ares-1.7.0/ if [ $? -ne 0 ]; then return 1; fi source "${SCRIPT_DIR}/buildc-ares.sh" ${doclean} if [ $? -ne 0 ]; then return 1; fi echo "" echo "----------------------------------" -echo "------- BUILD CURL-7.19.4 --------" +echo "------- BUILD CURL-7.19.7 --------" echo "----------------------------------" echo "" cd "${SCRIPT_DIR}" -cd ../../curl-7.19.4/ +cd ../../curl-7.19.7/ if [ $? -ne 0 ]; then return 1; fi source "${SCRIPT_DIR}/buildcurl.sh" ${doclean} if [ $? -ne 0 ]; then return 1; fi