Add MacOS X version next to the Darwin version in version outputs.

svn path=/trunk/; revision=23418
This commit is contained in:
Stephen Fisher 2007-11-10 00:57:41 +00:00
parent 6f1740aa6c
commit 432aa1788a
3 changed files with 40 additions and 8 deletions

View File

@ -321,7 +321,8 @@ tshark_LDADD = \
$(plugin_ldadd) \
@PCRE_LIBS@ \
@GLIB_LIBS@ -lm \
@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@ \
@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @ADNS_LIBS@ @KRB5_LIBS@ \
@FRAMEWORKS@ \
@LIBICONV@ \
@LIBGCRYPT_LIBS@ \
@LIBGNUTLS_LIBS@
@ -376,7 +377,7 @@ dumpcap_LDADD = \
wiretap/libwiretap.la \
@INET_NTOP_LO@ \
@GLIB_LIBS@ \
@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ \
@PCAP_LIBS@ @SOCKET_LIBS@ @NSL_LIBS@ @FRAMEWORKS@ \
@LIBGCRYPT_LIBS@
# Common headers

View File

@ -360,9 +360,9 @@ AC_SUBST(LDFLAGS_SHAREDLIB)
case "$host_os" in
darwin*)
AC_MSG_CHECKING(whether we can build with Core Foundation and Launch Services)
AC_MSG_CHECKING(whether we can build with Core Foundation Launch Services and CoreServices)
ac_save_LIBS="$LIBS"
ac_frameworks="-framework ApplicationServices -framework CoreFoundation"
ac_frameworks="-framework ApplicationServices -framework CoreFoundation -framework CoreServices"
LIBS="$LIBS $ac_frameworks"
AC_TRY_LINK(
[
@ -370,20 +370,24 @@ darwin*)
# include <CoreFoundation/CFString.h>
# include <CoreFoundation/CFURL.h>
# include <ApplicationServices/ApplicationServices.h>
# include <CoreServices/CoreServices.h>
],
[
CFStringRef url_CFString;
CFURLRef url_CFURL;
OSStatus status;
long os_version;
url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
status = LSOpenCFURLRef(url_CFURL, NULL);
Gestalt(gestaltSystemVersion, &os_version);
],
ac_cv_can_use_cf_and_ls=yes,
ac_cv_can_use_cf_and_ls=no,
ac_cv_can_use_osx_frameworks=yes,
ac_cv_can_use_osx_frameworks=no,
[echo $ac_n "cross compiling; assumed OK... $ac_c"])
if test "$ac_cv_can_use_cf_and_ls" = yes ; then
if test "$ac_cv_can_use_osx_frameworks" = yes ; then
AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
FRAMEWORKS="$ac_frameworks"
AC_MSG_RESULT(yes)

View File

@ -73,7 +73,11 @@
#ifdef HAVE_LIBSMI
#include <smi.h>
#endif
#ifdef HAVE_OS_X_FRAMEWORKS
#include <CoreServices/CoreServices.h>
#endif
#ifdef SVNVERSION
const char *wireshark_svnversion = " (" SVNVERSION ")";
#else
@ -256,6 +260,9 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
#elif defined(HAVE_SYS_UTSNAME_H)
struct utsname name;
#endif
#if HAVE_OS_X_FRAMEWORKS
long macosx_ver, macosx_major_ver, macosx_minor_ver, macosx_bugfix_ver;
#endif
g_string_append(str, "on ");
@ -408,6 +415,26 @@ get_runtime_version_info(GString *str, void (*additional_info)(GString *))
* thing.
*/
g_string_sprintfa(str, "%s %s", name.sysname, name.release);
#ifdef HAVE_OS_X_FRAMEWORKS
Gestalt(gestaltSystemVersion, &macosx_ver);
/* The following functions are only available in MacOS 10.4+ */
if(macosx_ver >= 0x1040) {
Gestalt(gestaltSystemVersionMajor, &macosx_major_ver);
Gestalt(gestaltSystemVersionMinor, &macosx_minor_ver);
Gestalt(gestaltSystemVersionBugFix, &macosx_bugfix_ver);
g_string_sprintfa(str, " (MacOS %ld.%ld.%ld)",
macosx_major_ver,
macosx_minor_ver,
macosx_bugfix_ver);
} else {
g_string_sprintfa(str, " (MacOS X < 10.4 [%lx])",
macosx_ver);
/* See Apple's Gestalt Manager Reference for meanings
* of the macosx_ver values. */
}
#endif /* HAVE_OS_X_FRAMEWORKS */
}
#else
g_string_append(str, "an unknown OS");