24
24
# etc.), this script also accepts:
25
25
# $CUSTOM_GTK_CPPFLAGS - compile-time flags to find Gtk headers.
26
26
# $CUSTOM_GTK_LIBS - link-time flags to find and link the Gtk libraries.
27
# $CUSTOM_PROCPS_CPPFLAGS - compile-time flags to find procps headers
28
27
# $CUSTOM_PROCPS_LIBS - link-time flags to find and link the procps library.
29
28
# $CUSTOM_URIPARSER_CPPFLAGS - compile-time flags to find the uriparser headers
30
29
# $CUSTOM_URIPARSER_LIBS - link-time flags to find and link the uriparser library
62
61
# helps autoconf verify that it really has found the source tree.
63
62
AC_CONFIG_SRCDIR([checkvm/checkvm.c])
64
# Keep the top-level directory tidy by putting auxiliary build tools and local
65
# macros in separate subdirectories.
66
AC_CONFIG_AUX_DIR([config])
67
AC_CONFIG_MACRO_DIR([m4])
85
# Operational arguments.
86
AC_ARG_WITH([root-privileges],
87
[AS_HELP_STRING([--without-root-privileges],
88
[does not perform any operations that require root privileges])],
90
[with_root_privileges=yes])
82
93
# The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible
83
94
# to getOsVersion()
84
95
AC_ARG_WITH([kernel-modules],
85
96
[AS_HELP_STRING([--without-kernel-modules],
86
[Do not compile or install the kernel modules])],
97
[does not compile or install the kernel modules])],
88
99
[with_kernel_modules=yes])
90
101
AC_ARG_WITH([kernel-release],
91
102
[AS_HELP_STRING([--with-kernel-release],
92
[Specify the kernel release you want to build against])],
103
[specifies the kernel release you want to build against])],
93
104
[KERNEL_RELEASE="$withval"],
94
105
[KERNEL_RELEASE=`uname -r`])
96
107
AC_ARG_WITH([linuxdir],
97
108
[AS_HELP_STRING([--with-linuxdir],
98
[Specify the Linux directory you want to use])],
109
[specifies the Linux directory you want to use])],
99
110
[LINUXDIR="$withval"],
100
111
[LINUXDIR=/lib/modules/$KERNEL_RELEASE])
133
# Arguments for disabling individual open-vm-tools features.
144
# Arguments for disabling individual open-vm-tools features or libraries.
137
148
[--disable-multimon],
138
[Disables multimon, enabled by default]),
149
[disables multimon, enabled by default]),
139
150
[enable_multimon="$enableval"],
140
151
[enable_multimon="yes"])
145
156
[--disable-unity],
146
[Disables Unity, enabled by default]),
157
[disables Unity, enabled by default]),
147
158
[enable_unity="$enableval"],
148
159
[enable_unity="yes"])
165
[compiles without Gtk 2.0 (falls back on Gtk 1.2)]),
166
[with_gtk2="$withval"],
169
# If we're not going to use Gtk 2.0, disable Unity. It may be possible to
170
# get Unity working with Gtk 1.2 (it used to in the past), but that will
171
# require a great deal of work.
172
if test "$with_gtk2" != "yes"; then
172
# Compiler and preprocessor
198
# C preprocessor and compiler.
202
# C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an
203
# error if no C++ compiler was found; it'll just set the variable CXX to 'g++'.
176
206
# This allows features like per-target compiler flags. I.e., you can compile
177
207
# one copy of the same sources twice with different flags. (See lib/guestApp
178
208
# for an example.)
216
246
[The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s).])
219
248
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
221
COMMON_XLIBS="-lXext $COMMON_XLIBS"
249
COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
254
[COMMON_XLIBS="-lXext $COMMON_XLIBS"],
256
[libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s).])],
224
260
[X11/extensions/extutil.h],
279
[XRenderQueryVersion],
280
[COMMON_XLIBS="-lXrender $COMMON_XLIBS"],
282
[libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s).])],
243
287
[XRRQueryVersion],
244
[COMMON_XLIBS="-lXrandr $COMMON_XLIBS"
245
COMMON_XLIBS="-lXrender $COMMON_XLIBS"],
288
[COMMON_XLIBS="-lXrandr $COMMON_XLIBS"],
247
290
[libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s).])],
248
[-lXrender $COMMON_XLIBS])
377
420
[gtk_accel_group_add],
378
421
[HAVE_GTK1="yes"],,
379
422
[$CUSTOM_GTK_LIBS])
423
if test "$with_gtk2" != "no"; then
387
432
# Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well.
388
433
if test "$HAVE_PKG_CONFIG" = "yes"; then
389
AC_MSG_CHECKING([for Gtk+ 2.0 (via pkg-config)])
390
if pkg-config --exists gtk+-2.0; then
434
if test "$with_gtk2" != "no"; then
435
AC_MSG_CHECKING([for Gtk+ 2.0 (via pkg-config)])
436
if pkg-config --exists gtk+-2.0; then
397
444
AC_MSG_CHECKING([for Gtk+ 1.x (via pkg-config)])
398
445
# The latter half of the test is because pkg-config's fallback
422
469
if test "$HAVE_GTK2" = "yes"; then
424
471
GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"
425
472
gtkPackageName="gtk+-2.0"
426
473
elif test "$HAVE_GTK1" = "yes"; then
428
475
gtkPackageName="gtk+"
430
477
# Unity requires Gtk 2.0.
445
492
elif test "$HAVE_PKG_CONFIG" = "yes"; then
446
493
GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)"
447
494
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"
453
495
# Otherwise, we have a problem.
455
497
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.])
500
# Check for a sufficiently new installation of Gtk 2.0. This symbol is, at
501
# the time of writing, used in vmware-user. We must perform this check
502
# after GTK_LIBS has been set up. Note: we don't actually use the
503
# resultant HAVE_NEW_GTK2 variable; it's just set so that the default
504
# action, which will append gdk-x11-2.0 to LIBS, isn't taken.
505
if test "$HAVE_GTK2" == "yes"; then
508
[gdk_display_get_default_group],
509
[HAVE_NEW_GTK2="yes"],
511
[Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)])]
515
# Unity requires libgdk_pixbuf_xlib, which most systems don't seem to
516
# provide via "pkg-config --libs gtk+-2.0".
517
if test "$enable_unity" != "no"; then
519
[gdk_pixbuf_xlib-2.0],
520
[gdk_pixbuf_xlib_init],
521
[GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0"],
523
[gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity).])],
459
527
AC_MSG_ERROR([libgtk not found. Please install the gtk devel package(s).])
493
568
AC_ARG_WITH([pam-prefix],
494
569
[AS_HELP_STRING([--with-pam-prefix],
495
[specify where pam files go. Default is $(sysconfdir)])],
570
[specifies where pam files go. Default is $(sysconfdir)])],
496
571
[PAM_PREFIX="$withval"],
497
572
[PAM_PREFIX='$(sysconfdir)'])
499
574
if test "$os" = "linux"; then
500
575
AC_ARG_WITH([procps],
501
576
[AS_HELP_STRING([--without-procps],
502
[compile without libproc (disables support for meminfo)])],
577
[compiles without libproc (disables support for meminfo)])],
504
579
[with_procps=yes])
524
599
GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS"
525
600
VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS"
527
# On Debian, the 'libproc-dev' package does not contain the libproc
528
# shared object; it is provided in the 'procps' package. Having the
529
# 'procps' package installed without 'libproc-dev' would lead to
530
# compilation errors down the line, so to avoid that we explicitly
531
# check for one of the libproc headers that is consumed in the build.
532
if test -n "$CUSTOM_PROCPS_CPPFLAGS"; then
533
PROCPS_CPPFLAGS="$CUSTOM_PROCPS_CPPFLAGS"
535
# XXX: Unfortunately, the libproc devel package doesn't appear
536
# to ship with a configuration script or pkg-config manifest
537
# file, so there's no portable way to get the location of its
538
# headers. For now we default to /usr/include.
539
PROCPS_CPPFLAGS="-I/usr/include"
541
ORIGINAL_CPPFLAGS="$CPPFLAGS"
542
CPPFLAGS="$PROCPS_CPPFLAGS $CPPFLAGS"
547
[libproc headers not found. Please configure without procps (using --without-procps) or install libproc devel package])])
548
CPPFLAGS="$ORIGINAL_CPPFLAGS"
551
603
if test "$with_procps" != "yes"; then
555
607
AC_ARG_WITH([dnet],
556
608
[AS_HELP_STRING([--without-dnet],
557
[compile without libdnet (disables support for nicinfo)])],
609
[compiles without libdnet (disables support for nicinfo)])],
602
654
ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU"
603
655
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.
657
# The icu components are built with C++, so we need to ensure
658
# that the C++ linker actually exists, and use it when linking
659
# icu into our applications and when performing configuration
609
662
# XXX: Getting automake to choose between the C linker and the
610
663
# C++ linker depending on HAVE_ICU was a royal pain in the ass.
628
681
# http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html
629
682
# http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries
630
683
# http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support
687
if test -z "$HAVE_CXX"; then
689
[No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler.])
632
691
AC_LANG_PUSH([C++])
633
692
AC_CHECK_LIB([icuuc],
634
693
[ucasemap_utf8ToTitle_3_8],
826
885
MODULES="$MODULES vmblock vmci vmhgfs vsock"
827
886
buildHgfsmounter=yes
888
if test "$osVersion" -ge 206000; then
889
MODULES="$MODULES vmxnet3"
829
891
if test "$osVersion" -ge 206006; then
830
892
MODULES="$MODULES vmsync"
877
939
AM_CONDITIONAL(WITH_KERNEL_MODULES, test "$with_kernel_modules" = "yes")
878
940
AM_CONDITIONAL(PAMD, test -d /etc/pam.d)
879
941
AM_CONDITIONAL(ENABLE_UNITY, test "$enable_unity" = "yes")
942
AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes")
881
944
### Feature-specific flags / actions
882
945
# Combine where possible