82
# The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible
84
AC_ARG_WITH([kernel-modules],
85
[AS_HELP_STRING([--without-kernel-modules],
86
[Do not compile or install the kernel modules])],
88
[with_kernel_modules=yes])
90
AC_ARG_WITH([kernel-release],
91
[AS_HELP_STRING([--with-kernel-release],
92
[Specify the kernel release you want to build against])],
93
[KERNEL_RELEASE="$withval"],
94
[KERNEL_RELEASE=`uname -r`])
96
AC_ARG_WITH([linuxdir],
97
[AS_HELP_STRING([--with-linuxdir],
98
[Specify the Linux directory you want to use])],
99
[LINUXDIR="$withval"],
100
[LINUXDIR=/lib/modules/$KERNEL_RELEASE])
77
102
# Turn the uname output into something we can run comparisons on.
79
major_version="`uname -r | cut -f1 -d. | cut -f1 -d-`"
80
minor_version="`uname -r | cut -f2 -d. | cut -f1 -d-`"
81
micro_version="`uname -r | cut -f3 -d. | cut -f1 -d-`"
104
major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`"
105
minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`"
106
micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`"
82
107
printf '%02d%02d%03d' $major_version $minor_version $micro_version
99
124
osVersion="`getOsVersion`"
125
if test "$os" = "linux"; then
126
if test "$with_kernel_modules" = "yes"; then
127
if test ! -d "$LINUXDIR/kernel/"; then
128
AC_MSG_ERROR([$LINUXDIR/kernel does not exist])
133
# Arguments for disabling individual open-vm-tools features.
104
137
[--disable-multimon],
105
138
[Disables multimon, enabled by default]),
106
[MULTIMON_ENABLED="$enableval"],
107
[MULTIMON_ENABLED="yes"])
139
[enable_multimon="$enableval"],
140
[enable_multimon="yes"])
146
[Disables Unity, enabled by default]),
147
[enable_unity="$enableval"],
148
[enable_unity="yes"])
189
255
[libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s).])],
258
# If we're building with support for Unity, we'll need a few additional
260
if test "$enable_unity" != "no"; then
262
# Unity needs the X11 Screen Saver extension library. It should be
263
# in the same place as the X11 libraries, so no need for any fancy
267
[XScreenSaverQueryExtension],
268
[COMMON_XLIBS="-lXss $COMMON_XLIBS"],
270
[libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package.])],
273
# Check for the uriparser library and headers. The upstream uriparser
274
# doesn't appear to ship with either a pkg-config file or a
275
# uriparser-config binary, so we'll look for it the old-fashioned
278
# Note that we look for uriFreeQueryListA because it's a relatively
279
# new symbol that our code needs (it isn't present in the uriparser
280
# that shipped with Ubuntu Hardy).
281
ORIGINAL_LDFLAGS="$LDFLAGS"
282
LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS"
286
[if test -n "$CUSTOM_URIPARSER_LIBS"; then
287
URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS"
289
URIPARSER_LIBS="-luriparser"
292
[uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package.])])
293
LDFLAGS="$ORIGINAL_LDFLAGS"
295
if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then
296
URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS"
298
# XXX: No pkg-config and no uriparser-config means we need to
299
# hard-code a sensible default.
300
URIPARSER_CPPFLAGS="-I/usr/include/uriparser"
302
ORIGINAL_CPPFLAGS="$CPPFLAGS"
303
CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS"
308
[uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package])])
309
CPPFLAGS="$ORIGINAL_CPPFLAGS"
311
# Check for libpng using pkg-config, or barring that, using
313
if test "$HAVE_PKG_CONFIG" = "yes"; then
314
AC_MSG_CHECKING([for libpng (via pkg-config)])
315
if pkg-config --exists libpng12; then
316
LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`"
317
LIBPNG_LIBS="`pkg-config --libs libpng12`"
327
if test "$LIBPNG_CONFIG" != "no"; then
328
LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`"
329
LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`"
332
if test -z "$LIBPNG_CPPFLAGS"; then
334
[libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package])
337
# Check for the zlib library and headers. Like uriparser, there
338
# isn't a pkg-config or zlib-config file.
339
ORIGINAL_LDFLAGS="$LDFLAGS"
340
LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS"
344
[if test -n "$CUSTOM_ZLIB_LIBS"; then
345
ZLIB_LIBS="$CUSTOM_ZLIB_LIBS"
350
[zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package.])])
351
LDFLAGS="$ORIGINAL_LDFLAGS"
353
if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then
354
ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS"
356
# XXX: No pkg-config and no zlib-config means we need to
357
# hard-code a sensible default.
358
ZLIB_CPPFLAGS="-I/usr/include"
360
ORIGINAL_CPPFLAGS="$CPPFLAGS"
361
CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS"
366
[zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package])])
367
CPPFLAGS="$ORIGINAL_CPPFLAGS"
368
fi # End of library checks for Unity.
192
370
if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then
193
371
# Check to see if we have some version of GTK. gtk_accel_group_add
194
372
# is a random function that is present in Gtk 1.2 but not Gtk
262
445
elif test "$HAVE_PKG_CONFIG" = "yes"; then
263
446
GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)"
264
447
GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)"
448
# Unity requires libgdk_pixbuf_xlib, which most systems don't seem to
449
# provide via "pkg-config --libs gtk+-2.0".
450
if test "$enable_unity" != "no"; then
451
GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0"
265
453
# Otherwise, we have a problem.
267
455
AC_MSG_ERROR([pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations.])
410
602
ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU"
411
603
ICU_LIBS="`$ICU_CONFIG --ldflags`"
605
# The icu components are built with C++, so we need to use the
606
# C++ linker when linking icu into our applications and when
607
# performing configuration tests against icu.
609
# XXX: Getting automake to choose between the C linker and the
610
# C++ linker depending on HAVE_ICU was a royal pain in the ass.
611
# The classic way to do this is to define an optional source
612
# file for a program with an extension of .cxx, using
613
# nodist_EXTRA_fooprogram_SOURCES. This causes automake's
614
# linker detection algorithm to see a C++ source file and
615
# automatically set up the C++ linker and link line for us.
616
# Unfortunately, said linker detection doesn't obey
617
# conditionals, which means that it'd always pick the C++
618
# linker, regardless of the value of HAVE_ICU. Instead, we are
619
# forced to manually set the correct linker in fooprogram_LINK.
620
# However, since none of our programs actually contain C++
621
# code, automake doesn't make the CXXLINK variable (which
622
# contains the linker as well as all link flags) available to
623
# us, so we must hard-code the entire link line into
624
# fooprogram_LINK. Not exactly a futureproof solution...
626
# Additional references on this problem:
627
# http://sources.redhat.com/ml/automake/1999-10/msg00101.html
628
# http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html
629
# http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries
630
# http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support
413
633
AC_CHECK_LIB([icuuc],
414
634
[ucasemap_utf8ToTitle_3_8],
415
635
[have_ICU_38="yes"],,
418
639
if test "$have_ICU_38" = "yes"; then
419
640
ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38"
608
834
if test "$os" = "freebsd"; then
609
835
MODULES_DIR="/boot/modules"
611
if test "$osVersion" -gt 302000; then
837
if test "$osVersion" -ge 302000; then
612
838
MODULES="$MODULES vmmemctl"
614
if test "$osVersion" -gt 409000; then
840
if test "$osVersion" -ge 409000; then
615
841
MODULES="$MODULES vmxnet"
617
if test "$osVersion" -gt 600000; then
618
MODULES="$MODULES vmhgfs vmblock"
843
if test "$osVersion" -ge 600000; then
844
MODULES="$MODULES vmblock vmhgfs"
619
845
buildHgfsmounter=yes
627
853
GUESTD_LDADD="$GUESTD_LDADD -lsocket"
628
854
GUESTD_LDADD="$GUESTD_LDADD -lnsl"
855
GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc"
630
857
VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/"
631
858
VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext"
632
859
VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11"
633
860
VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket"
634
861
VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl"
862
VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc"
636
864
# uname -r on Solaris 10 reports "5.10"
637
865
if test "$osVersion" -ge 510000; then
645
873
AM_CONDITIONAL(FREEBSD, test "$os" = "freebsd")
646
874
AM_CONDITIONAL(THIRTY_TWO_BIT_USERSPACE, test "$userSpaceBitness" = "32")
647
875
AM_CONDITIONAL(HAVE_X11, test "$have_x" = "yes")
648
AM_CONDITIONAL(NO_ICU, test "$with_icu" = "yes")
876
AM_CONDITIONAL(HAVE_ICU, test "$with_icu" = "yes")
877
AM_CONDITIONAL(WITH_KERNEL_MODULES, test "$with_kernel_modules" = "yes")
649
878
AM_CONDITIONAL(PAMD, test -d /etc/pam.d)
879
AM_CONDITIONAL(ENABLE_UNITY, test "$enable_unity" = "yes")
651
881
### Feature-specific flags / actions
652
882
# Combine where possible
654
# If control reaches this point and multimon is still enabled, then we know all of the
655
# tests for required components have passed and it's safe to allow multimon.
656
# Otherwise, it should be disabled.
657
if test "$MULTIMON_ENABLED" = "no"; then
884
# If control reaches this point and multimon is still enabled, then we know
885
# all of the tests for required components have passed and it's safe to allow
886
# multimon. Otherwise, it should be disabled.
887
if test "$enable_multimon" = "no"; then
888
# XXX: For consistency, change this to ENABLE_MULTIMON. This will require
889
# some additional code cleanup.
658
890
AC_DEFINE([NO_MULTIMON], 1, [Define to 1 if building without multimon support.])