Opened 5 years ago

Closed 5 years ago

#11579 closed defect (fixed)

configure sets -mmacosx-version-min=10.5 on 10.4

Reported by: lanurmi Owned by:
Priority: normal Milestone: 2.9.1
Component: wxOSX-Cocoa Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: no


The configure script creates a Makefile where -mmacosx-version-min=10.5 when run on 10.4. As far as I understand, this doesn't make sense.

Change History (5)

comment:1 Changed 5 years ago by vadz

Is sw_vers found on your system (according to configure)? And, if it is, what does sw_vers -productVersion return?

comment:2 Changed 5 years ago by lanurmi

Yes it is found by configure, and when manually run it returns "10.4.11".

The relevant code in configure is

        OSX_VERSION=`sw_vers -productVersion | grep 10.[0-9]`

which makes me really wonder what's the purpose of grep here, and what's the expected output. (It looks like the expected output is "10.4" for "10.4.11" input, but how could that possibly be achieved with grep?)

However, now that I looked at the configure script more carefully, the reason for -mmacosx-version-min=10.5 would appear to be very simple, i.e.

        # for OS X Cocoa, use 10.5 so we can get 64-bit compile on Snow Leopard

Not much to debug there, I just hope someone figures out what's the minimum supported Mac OS X version before wx 3.0 is finished.

comment:3 Changed 5 years ago by vadz

  • Milestone set to 2.9.1
  • Status changed from new to confirmed

The purpose of grep would be to select just one line in the program output but I have no idea why do we do it if there is only one line to begin with.

But the real source of the problem is the test in the next line which compares OSX_VERSION with 10.4. As in your case it's 10.4.11, the comparison fails.

Could you please test if the following patch


    diff --git a/ b/
    index a5674f7..4c93b62 100644
    a b elif test "x$wxUSE_MACOSX_VERSION_MIN" = "x"; then 
    12291229        AC_MSG_WARN([Assuming OS X 10.4, use --with-macosx-version-min to override.])
    12301230        OSX_VERSION="10.4"
    12311231    fi
    1232     if test "$wxUSE_OSX_CARBON" = 1 -o "x$OSX_VERSION" = "x10.4"; then
    1233         # otherwise configure stops on leopard for universal_binary
    1234         wxUSE_MACOSX_VERSION_MIN=10.4
    1235     else
    1236         # for OS X Cocoa, use 10.5 so we can get 64-bit compile on Snow Leopard
    1237         wxUSE_MACOSX_VERSION_MIN=10.5
    1238     fi
     1233    case "$OSX_VERSION" in
     1234        10.4* )
     1235            wxUSE_MACOSX_VERSION_MIN=10.4
     1236            ;;
     1238        * )
     1239            if test "$wxUSE_OSX_CARBON" = 1; then
     1240                # otherwise configure stops on leopard for universal_binary
     1241                wxUSE_MACOSX_VERSION_MIN=10.4
     1242            else
     1243                # for Cocoa, use 10.5 to be able to compile it in 64 bits too
     1244                wxUSE_MACOSX_VERSION_MIN=10.5
     1245            fi
     1246            ;;
     1247    esac

helps? You'll need to regenerate configure by running autoconf after applying it (or you can edit the corresponding part of configure manually if you're not afraid to look at its horrible code).


comment:4 Changed 5 years ago by lanurmi

Yes, your patch fixes the problem. Thanks.

I tried with ../configure --with-osx_cocoa --enable-debug, and now Makefile has -mmacosx-version-min=10.4, and the whole trunk compiles, too.

comment:5 Changed 5 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [62997]) Correct wxUSE_MACOSX_VERSION_MIN setting when running under OS X 10.4.

sw_vers outputs e.g. 10.4.11 under 10.4 so comparing its result with just 10.4
is wrong, match it against "10.4*" using case instead to ensure that 10.4.11
is indeed recognized as 10.4.

Closes #11579.

Note: See TracTickets for help on using tickets.