apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: Mac OS X Universal builds and APR
Date Sat, 24 Oct 2009 12:36:46 GMT
On Sat, Oct 24, 2009 at 8:16 AM, Barry Scott <barry@barrys-emacs.org> wrote:
>
> On 22 Oct 2009, at 20:47, Barry Scott wrote:
>
>>
>> On 20 Oct 2009, at 22:30, Jeff Trawick wrote:
>>
>>> On Tue, Oct 20, 2009 at 4:54 PM, Barry Scott <barry@barrys-emacs.org>
>>> wrote:
>>>>
>>>> On 20 Oct 2009, at 04:18, Branko Čibej wrote:
>>>>
>>>>> Barry Scott wrote:
>>>>>>
>>>>>> I think the problem is that configure is used to find out things
that
>>>>>> change arch to arch
>>>>>> like void * size rather then using preprocessor detection of those
>>>>>> things.
>>>>>
>>>>> I wonder, how do you detect the size of void* with the preprocessor in
>>>>> C? The preprocessor doesn't understand sizeof.
>>>>
>>>> You detect that its a build on mac os x and then use the CPU feature
>>>> macros
>>>> that the compiler defines to choose 4 or 8. You end up writing code like
>>>> this:
>>>>
>>>> #ifdef __APPLE__
>>>> #ifdef __x86_64__
>>>> its Mac intel 64
>>>> #endif
>>>> etc...
>
>
> I have build subversion and apr twice for i386 and x86_64.
> Then I'm writting scripts to merge the two trees of build files
> into a single FAT binary kit with FAT libs and header files.
>
> The binary code can be handled this way. But the headers
> cannot as some are different. I'm going to have to do something
> like:
>
> copy i386 version of apr.h to i386-apr.h
> copy x86_64 version of apr.h to x86_64.apr.h
>
> create a wrapper apr.h
>
> #ifdef __LP64__
> #include "x86_64-apr.h"
> #else
> #include "i386-apr.h"
> #endif
>
> Below is details of the diffs I see.
>
> Here is a diff between building for i386 and x86_64.
>
> diff -u
> /usr/local/svn-1.6.6-i386-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apu.h
> /usr/local/svn-1.6.6-x86_64-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apu.h
> ---
> /usr/local/svn-1.6.6-i386-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apu.h
>       2009-10-24 12:54:18.000000000 +0100
> +++
> /usr/local/svn-1.6.6-x86_64-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apu.h
>   2009-10-24 12:54:26.000000000 +0100
> @@ -100,7 +100,7 @@
>  #define APU_HAVE_SQLITE2       0
>  #define APU_HAVE_ORACLE        0
>  #define APU_HAVE_FREETDS       0
> -#define APU_HAVE_ODBC          0
> +#define APU_HAVE_ODBC          1
>
>  #define APU_HAVE_APR_ICONV     0
>  #define APU_HAVE_ICONV         1
>
> It seems that ODBC is not in both i386 and x86_64.

Just curious: is that Apple-delivered ODBC, that they chose not to
deliver in both architectures, or some third-party ODBC that configure
found on your system?


>
> diff -u
> /usr/local/svn-1.6.6-i386-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apr.h
> /usr/local/svn-1.6.6-x86_64-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apr.h
> ---
> /usr/local/svn-1.6.6-i386-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apr.h
>       2009-10-24 12:54:17.000000000 +0100
> +++
> /usr/local/svn-1.6.6-x86_64-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad-pad/./include/apr-1/apr.h
>   2009-10-24 12:54:25.000000000 +0100
> @@ -239,7 +239,7 @@
>  #define APR_HAS_UNICODE_FS        0
>  #define APR_HAS_PROC_INVOKED      0
>  #define APR_HAS_USER              1
> -#define APR_HAS_LARGE_FILES       1
> +#define APR_HAS_LARGE_FILES       0

>
> Most of the diff here can be avoided by using stdint.h as far as I can see.
> Only one I'm not sure of is APR_HAS_LARGE_FILES. Is that set based on
> 64bit or not?

APR_HAS_LARGE_FILES unfortunately (?) does not simply mean you can use
files larger than 2GB.  It effectively means that APR is using LFS
flags in a 32-bit build to support large files.

You can always use large files in a 64-bit build.

(big shrug on the stdint.h comment)

--/--

I don't know how others feel, but I think a helper script could be
bundled with APR to combine the multiple builds, and maybe even run
the two separate builds to start with.  It probably wouldn't be
completely generic, but might be useful as-is or at least as an
example to all those APR-on-OS X packagers out there ;)

Mime
View raw message