[Development] configure qtbase on mac os

Chris Meyer cmeyer1969+qt at gmail.com
Mon Nov 7 20:44:56 CET 2011


On Sun, Nov 6, 2011 at 2:09 PM, Rohan McGovern <rohan.mcgovern at nokia.com> wrote:
> Chris Meyer said:
>> I'm configuring qtbase (Mac OS 10.6.8, Xcode 4.2, and qtbase/master)
>> using the following command:
>>
>> export QTDIR=/some/path/for/installation
>> ./configure -prefix $QTDIR -opensource -no-sql-mysql -qt-libpng
>> -qt-libjpeg -no-dbus -nomake examples -nomake demos
>>
>> After a while, I get an error that configure cannot determine
>> big-endian or little-endian.
>
> Hmm, do you get anything useful if you add -verbose to configure?

The following patch (namely adding the '-' argument to the strings
command) makes configure work on my machine. I'm not sure if it is a
suitable patch for every unix platform, though:

diff --git a/config.tests/unix/endian.test b/config.tests/unix/endian.test
index d0fb6ce..74a8732 100755
--- a/config.tests/unix/endian.test
+++ b/config.tests/unix/endian.test
@@ -31,10 +31,10 @@ else
     exit 2
 fi

-if strings $binary | grep LeastSignificantByteFirst >/dev/null 2>&1; then
+if strings - $binary | grep LeastSignificantByteFirst >/dev/null 2>&1; then
     [ "$VERBOSE" = "yes" ] && echo "    Found
'LeastSignificantByteFirst' in binary"
     ENDIAN="LITTLE"
-elif strings $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then
+elif strings - $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then
     [ "$VERBOSE" = "yes" ] && echo "    Found
'MostSignificantByteFirst' in binary"
     ENDIAN="BIG"
 fi

I don't know the history of the endian test; but it seems to make more
sense to use something direct like:

int num = 1;
if(*(char *)&num == 1)
{
    printf("Little-Endian\n");
}
else
{
    printf("Big-Endian\n");
}

(reference: http://stackoverflow.com/questions/1001307/detecting-endianness-programmatically-in-a-c-program)



More information about the Development mailing list