Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#633 closed defect (fixed)

configure script fails to detect Mac OS X Server as Mac OS X platform

Reported by: urbanek@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

The configure script is detecting whether a system is Mac OS X with
configure@3547:

productName=/usr/bin/sw_vers -productName
if test "$productName" = "Mac OS X" ; then

_macosx=yes

else

_macosx=no

However, sw_vers returns "Mac OS X Server" on Mac OS X Server machines and thus won't pass the test.

Suggested fix:

if /usr/bin/sw_vers -productName|grep 'Mac OS X'; then

_macosx=yes

else

_macosx=no

Change History (3)

comment:1 by diego@…, 17 years ago

Status: newassigned

Does replacing the offending line with

if test "$productName" = "Mac OS X*" ; then

work as well?

comment:2 by urbanek@…, 17 years ago

No, because "test" doesn't use patterns (so it would be looking litelally for a string ending with the star
character) so it wouldn't match, either.

If you prefer the same syntax, the following
if test "$productName" = "Mac OS X" -o "$productName" = "Mac OS X Server" ; then

works as well. I was just thinking that the grep way would be safer in case Apple decides to change the
product string by adding something,

comment:3 by diego@…, 17 years ago

Resolution: fixed
Status: assignedclosed

Fix committed.

Note: See TracTickets for help on using tickets.