Thanks Yang, and Toby. Both methods work fine. 
I ended up using the single pass method. I had to do the following changes:
Changed the contents of include/curl/curlbuild.h to
#ifdef __LP64__
#include "curlbuild64.h"
#else
#include "curlbuild32.h"
#endif

where curlbuild64.h and curlbuild32.h were created by running configure 
separately for x86_64 and i386 architecture. Also, applied the following patch: 
diff -Naur curl-7.19.4-old/lib/config.h curl-7.19.4/lib/config.h
--- curl-7.19.4-old/lib/config.h        2009-04-30 15:37:28.000000000 -0700
+++ curl-7.19.4/lib/config.h    2009-04-30 15:20:10.000000000 -0700
@@ -848,19 +848,35 @@
 #define SIZEOF_INT 4

 /* The size of `long', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_LONG 8
+#else /* !__LP64__ */
+#define SIZEOF_LONG 4
+#endif /* __LP64__ */

 /* The size of `off_t', as computed by sizeof. */
 #define SIZEOF_OFF_T 8

 /* The size of `size_t', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_SIZE_T 8
+#else /* !__LP64__ */
+#define SIZEOF_SIZE_T 4
+#endif /* __LP64__ */

 /* The size of `time_t', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_TIME_T 8
+#else /* !__LP64__ */
+#define SIZEOF_TIME_T 4
+#endif /* __LP64__ */

 /* The size of `void*', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_VOIDP 8
+#else /* !__LP64__ */
+#define SIZEOF_VOIDP 4
+#endif /* __LP64__ */

 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
diff -Naur curl-7.19.4-old/src/config.h curl-7.19.4/src/config.h
--- curl-7.19.4-old/src/config.h        2009-04-30 15:37:18.000000000 -0700
+++ curl-7.19.4/src/config.h    2009-04-30 15:19:58.000000000 -0700
@@ -848,19 +848,39 @@
 #define SIZEOF_INT 4

 /* The size of `long', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_LONG 8
+#else /* !__LP64__ */
+#define SIZEOF_LONG 4
+#endif /* __LP64__ */
+

 /* The size of `off_t', as computed by sizeof. */
 #define SIZEOF_OFF_T 8

 /* The size of `size_t', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_SIZE_T 8
+#else /* !__LP64__ */
+#define SIZEOF_SIZE_T 4
+#endif /* __LP64__ */
+

 /* The size of `time_t', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_TIME_T 8
+#else /* !__LP64__ */
+#define SIZEOF_TIME_T 4
+#endif /* __LP64__ */
+

 /* The size of `void*', as computed by sizeof. */
+#ifdef __LP64__
 #define SIZEOF_VOIDP 8
+#else /* !__LP64__ */
+#define SIZEOF_VOIDP 4
+#endif /* __LP64__ */
+

 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1


--- On Fri, 5/1/09, Toby Peterson <[email protected]> wrote:

> From: Toby Peterson <[email protected]>
> Subject: Re: fat binary for Mac OSX 10.5.X
> To: [email protected], "libcurl development" 
> <[email protected]>
> Date: Friday, May 1, 2009, 2:19 AM
> On Apr 30, 2009, at 11:44 AM, john blair wrote:
> 
> > I am trying to build a fat binary(for i386 and x86_64)
> for curl-7.19.4. I tried building it with
> >    --disable-dependency-tracking \
> >    CFLAGS="-arch i386 -arch x86_64" \
> >    LDFLAGS="-arch i386 -arch x86_64"
> > 
> > but got
> > ../include/curl/curlrules.h:134: error: size of array
> ‘__curl_rule_01__’ is negative
> > 
> > 
> > I have successfully built a fat binary for curl
> 7.18.2. Has any one tried building it with 7.19.4?
> 
> If you're trying to do a single-pass universal build,
> you need to edit the following files:
> 
> include/curl/curlbuild.h
> lib/config.h
> src/config.h
> 
> Fix the following defines and it should work correctly:
> 
> CURL_SIZEOF_LONG
> SIZEOF_LONG
> SIZEOF_SIZE_T
> SIZEOF_TIME_T
> SIZEOF_VOID_P
> 
> If you want to see why this is necessary, just run the
> configure script for each individual arch and compare the
> results.
> 
> Not sure why it worked for you on 7.18.4. If I had to
> guess, I'd think that a newer macro is generating that
> error in 7.19.x, but your 7.18.4 build was still broken (for
> one architecture or the other, depending on the answers the
> configure script got).
> 
> - Toby



Reply via email to