1
################################################################################
2
### Copyright 2007 VMware, Inc. All rights reserved.
4
### Configure script for building the VMware OSS Tools.
7
### This program is free software; you can redistribute it and/or modify
8
### it under the terms of version 2 of the GNU General Public License as
9
### published by the Free Software Foundation.
11
### This program is distributed in the hope that it will be useful,
12
### but WITHOUT ANY WARRANTY; without even the implied warranty of
13
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
### GNU General Public License for more details.
16
### You should have received a copy of the GNU General Public License
17
### along with this program; if not, write to the Free Software
18
### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
################################################################################
21
################################################################################
22
# In addition to the usual environment variables and command line
23
# arguments that a configure script usually takes (CFLAGS, LDFLAGS,
24
# etc.), this script also accepts variables of the form:
26
# CUSTOM_LIB_CPPFLAGS: compile-time flags for LIB
27
# CUSTOM_LIB_LIBS: link-time flags for LIB
28
# RPCGENFLAGS: extra flags to pass to rpcgen
30
# The following libraries are currently tested: DNET, FUSE, GLIB2, GMODULE,
31
# GOBJECT, GTHREAD, GTK, GTKMM, ICU, LIBPNG, PAM, PROCPS, URIPARSER, ZLIB
33
# For the procps library: you can provide the name of the procps library on
34
# your system by defining CUSTOM_PROCPS_NAME. By default the configure script
35
# will try both "-lproc" and "-lproc-3.2.7".
36
################################################################################
46
[open-vm-tools-devel@lists.sourceforge.net])
48
# In order to make this configure script auto-detect situations where
49
# people have a 32-bit userland running with a 64-bit kernel, we try to ask
50
# the compiler (assumedly gcc) for its default Target:.
51
# We have to set up $TEST_CC manually, since AC_PROG_CC hasn't yet been run (and can't be until AC_CANONICAL_HOST & AC_CANONICAL_BUILD are run)
52
# The purpose of all this is to set up $host_alias/$build_alias in a more
53
# intelligent way than config.guess currently does.
54
TEST_CC="$CC_FOR_BUILD"
55
test -z "$TEST_CC" && TEST_CC="$HOST_CC"
56
test -z "$TEST_CC" && TEST_CC="$CC"
57
if test -n "$TEST_CC" -a -z "$host_alias"; then
58
host_alias="`$TEST_CC -dumpmachine`"
59
if test -z "$build_alias" -a -n "$host_alias"; then
60
build_alias="$host_alias"
65
# checkvm/checkvm.c has no special significance - we just need to pass in a file that
66
# helps autoconf verify that it really has found the source tree.
67
AC_CONFIG_SRCDIR([checkvm/checkvm.c])
69
# Keep the top-level directory tidy by putting auxiliary build tools and local
70
# macros in separate subdirectories.
71
AC_CONFIG_AUX_DIR([config])
72
AC_CONFIG_MACRO_DIR([m4])
77
# Quote the regular expressions
86
AC_MSG_ERROR([Unknown architecture.])
90
# Operational arguments.
91
AC_ARG_WITH([root-privileges],
92
[AS_HELP_STRING([--without-root-privileges],
93
[does not perform any operations that require root privileges])],
95
[with_root_privileges=yes])
98
# The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible
100
AC_ARG_WITH([kernel-modules],
101
[AS_HELP_STRING([--without-kernel-modules],
102
[does not compile or install the kernel modules])],
104
[with_kernel_modules=yes])
106
AC_ARG_WITH([kernel-release],
107
[AS_HELP_STRING([--with-kernel-release],
108
[specifies the kernel release you want to build against])],
109
[KERNEL_RELEASE="$withval"],
110
[KERNEL_RELEASE=`uname -r`])
112
AC_ARG_WITH([linuxdir],
113
[AS_HELP_STRING([--with-linuxdir],
114
[specifies the Linux directory you want to use])],
115
[LINUXDIR="$withval"],
116
[LINUXDIR=/lib/modules/$KERNEL_RELEASE])
118
# Turn the uname output into something we can run comparisons on.
120
major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`"
121
minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`"
122
micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`"
123
printf '%02d%02d%03d' $major_version $minor_version $micro_version
137
AC_MSG_WARN([This is an untested and unsupported Operating System. Proceed at your own peril.])
140
osVersion="`getOsVersion`"
142
if test "$with_kernel_modules" = "yes"; then
145
if test "$osVersion" -lt 206009; then
146
AC_MSG_ERROR([Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers.])
148
if test ! -d "$LINUXDIR/kernel/"; then
149
AC_MSG_ERROR([$LINUXDIR/kernel does not exist])
151
LINUXINCLUDE="$LINUXDIR/build/include"
152
if test ! -d "$LINUXINCLUDE"; then
153
AC_MSG_ERROR([Can't find include dir under $LINUXDIR])
158
freebsd_sysdir=/usr/src/sys
159
if test -n "$SYSDIR"; then
160
freebsd_sysdir="$SYSDIR"
162
if test ! -f "$freebsd_sysdir/conf/kmod.mk"; then
163
AC_MSG_ERROR([FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules.])
169
# Arguments for disabling individual open-vm-tools features or libraries.
173
[--disable-multimon],
174
[disables multimon, enabled by default]),
175
[enable_multimon="$enableval"],
176
[enable_multimon="yes"])
182
[compiles without Gtk 2.0]),
183
[with_gtk2="$withval"],
190
[compiles without Gtkmm, sigc++, and related libs]),
191
[with_gtkmm="$withval"],
198
[disables generation of API documentation; by default, docs are built if doxygen is available.]),
199
[enable_docs="$enableval"],
206
[disable compilation of test code.]),
207
[enable_tests="$enableval"],
208
[enable_tests="auto"])
215
# These need to be declared after initialization.
217
# Some of our macro call-sites require changes to
218
# CPPFLAGS/CFLAGS/LDFLAGS. In such places, we save the original value
219
# of CPPFLAGS/CFLAGS/LDFLAGS before the macro call and restore it when
220
# the call is done. We must perform this save at each macro site,
221
# because CPPFLAGS/CFLAGS/LDFLAGS may change over the course of
224
# CPPFLAGS is intended for preprocessor options (-D and -I mainly)
225
# CFLAGS is intended for compiler options (-O, -f, -W, and so forth)
227
CPPFLAGS="$CPPFLAGS -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS"
232
# C preprocessor and compiler.
236
# C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an
237
# error if no C++ compiler was found; it'll just set the variable CXX to 'g++'.
240
# This allows features like per-target compiler flags. I.e., you can compile
241
# one copy of the same sources twice with different flags. (See lib/guestApp
245
# Needed for the various install and uninstall hooks.
251
# Needed for creating the archives in lib/ and the shared libraries.
253
if test "$ac_cv_prog_AR" = false; then
254
AC_MSG_ERROR([The 'ar' utility was not found. Please put ar on the path.])
257
# We use pkg-config to set up the cflags and libs for gtk.
264
if test "$GCC" != "yes"; then
265
AC_MSG_ERROR([Only GCC is currently supported. Please put gcc in the path.])
275
# Check for libintl.h. When configuring using "--without-x", /usr/local/include
276
# may not be added to the include path, so code that use glib's i18n functions
277
# would fail to compile because it can't find libintl.h.
279
AC_CHECK_HEADER([libintl.h],
283
if test "$have_libintl" = "no"; then
284
unset ac_cv_header_libintl_h
285
CPPFLAGS="$CPPFLAGS -I/usr/local/include"
286
AC_CHECK_HEADER([libintl.h],
288
[AC_MSG_ERROR([libintl.h not found. Make sure you have the gettext headers installed.])],
293
# Check for glib 2.6.0 or greater.
295
AC_VMW_CHECK_LIB([glib-2.0],
303
[AC_MSG_ERROR([glib >= 2.6.0 is required.])])
304
AC_VMW_CHECK_LIB([gmodule-2.0],
312
[AC_MSG_ERROR([gmodule >= 2.6.0 is required.])])
313
AC_VMW_CHECK_LIB([gobject-2.0],
321
[AC_MSG_ERROR([gobject >= 2.6.0 is required.])])
322
AC_VMW_CHECK_LIB([gthread-2.0],
330
[AC_MSG_ERROR([glib >= 2.6.0 is required.])])
331
AC_CHECK_PROG([have_genmarshal],
336
if test "$have_genmarshal" != "yes"; then
337
AC_MSG_ERROR([glib-genmarshal is required; make sure it's available in your path.])
341
# Parts of our Linux code require more recent version of glib
343
if test "$os" = "linux"; then
344
AC_VMW_CHECK_LIB([glib-2.0],
351
[have_glib_2_14=yes],
352
[AC_MSG_WARN([glib is not recent enough, some features will be disabled.])])
358
AC_VMW_CHECK_LIB([fuse],
367
AC_MSG_WARN([Fuse is missing, vmblock-fuse will be disabled.])])
373
[AS_HELP_STRING([--without-pam],
374
[compiles without PAM support.])],
378
if test "$with_pam" = "yes"; then
379
AC_VMW_DEFAULT_FLAGS([PAM])
380
AC_VMW_CHECK_LIB([pam],
385
[security/pam_appl.h],
387
[PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM"],
388
[AC_VMW_LIB_ERROR([PAM], [pam])])
392
# Check for CUnit and disable test code if not available.
394
if test "$enable_tests" = "auto" -o "$enable_tests" = "yes"; then
395
AC_VMW_DEFAULT_FLAGS([CUNIT])
396
AC_VMW_CHECK_LIB([cunit],
402
[CU_initialize_registry],
405
if test "$have_cunit" = "no"; then
406
if test "$enable_tests" = "yes"; then
407
AC_VMW_LIB_ERROR([CUNIT], [cunit])
409
AC_MSG_WARN([CUnit not found, tests won't be compiled.])
414
# If the user explicitly disables X11, then don't try to detect the X-related libraries
415
if test "$have_x" = "disabled"; then
417
elif test "$have_x" != "yes"; then
419
[The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s).])
421
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
422
COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
427
[COMMON_XLIBS="-lXext $COMMON_XLIBS"],
429
[libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s).])],
433
[X11/extensions/extutil.h],
436
[X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x).])],
437
[#include <X11/Xlib.h>
438
#include <X11/Xproto.h>])
440
if test "$enable_multimon" != "no"; then
443
[XineramaQueryVersion],
444
[COMMON_XLIBS="-lXinerama $COMMON_XLIBS"],
446
[libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s).])],
453
[COMMON_XLIBS="-lXi $COMMON_XLIBS"],
455
[libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s).])],
460
[XRenderQueryVersion],
461
[COMMON_XLIBS="-lXrender $COMMON_XLIBS"],
463
[libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s).])],
469
[COMMON_XLIBS="-lXrandr $COMMON_XLIBS"],
471
[libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s).])],
476
[XTestQueryExtension],
477
[COMMON_XLIBS="-lXtst $COMMON_XLIBS"],
479
[libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s).])],
485
[XSM_LIBS="-lSM -lICE" && have_xsm_lib="yes"],
489
AC_CHECK_HEADERS([X11/SM/SMlib.h X11/ICE/ICElib.h],
490
[have_xsm_header="yes"],
493
if test "$have_xsm_lib" = "yes" -a "$have_xsm_header" = "yes"; then
499
[XCompositeQueryExtension],
500
[XCOMPOSITE_LIBS="-lXcomposite"],
501
[have_xcomposite="no"]
503
AC_CHECK_HEADERS([X11/extensions/Xcomposite.h],
505
[have_xcomposite="no"],
507
if test "$have_xcomposite" != "no"; then
508
have_xcomposite="yes"
511
# Check whether we have gtk+ 2.0.
512
if test "$with_gtk2" != "no"; then
513
# gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently
514
# needed by vmware-user.
515
AC_VMW_CHECK_LIB([gtk-x11-2.0],
521
[gdk_display_get_default_group],
522
[GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"],
523
[AC_MSG_ERROR([Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package.])])
527
# Check for gtkmm 2.4.0 or greater.
530
if test "$with_gtkmm" != "no"; then
531
CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS"
532
AC_VMW_CHECK_LIBXX([gtkmm-2.4],
539
[GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"],
540
[AC_MSG_ERROR([gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm.])])
542
fi # End of checks for X libraries
549
[libcrypt not found. Please install the libc/libcrypt devel package(s).])])
557
[VIX_LIBADD="$VIX_LIBADD -ldl"
558
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -ldl"],
560
[dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor.])])])
562
AC_CHECK_FUNCS([ecvt])
563
AC_CHECK_FUNCS([fcvt])
565
if test "$os" = "freebsd" -a "$osVersion" -ge 600000; then
568
[pthread_mutex_init],
571
[Unable to locate required threading library libthr.])])
575
[pthread_mutex_init],
576
[THREAD_LIB=-lpthread],
578
[libpthread not found. Please install the libc/libpthread devel package(s).])])
582
AC_ARG_WITH([pam-prefix],
583
[AS_HELP_STRING([--with-pam-prefix],
584
[specifies where pam files go. Default is $(sysconfdir)])],
585
[PAM_PREFIX="$withval"],
586
[PAM_PREFIX='$(sysconfdir)'])
588
if test "$os" = "linux"; then
589
AC_ARG_WITH([procps],
590
[AS_HELP_STRING([--without-procps],
591
[compiles without libproc (disables support for meminfo)])],
598
if test "$with_procps" = "yes"; then
599
if test -z "$CUSTOM_PROCPS_NAME"; then
600
CUSTOM_PROCPS_NAME=proc
603
# XXX: no pkg-config and no procps-config means we need to
604
# hard-code a sensible default.
605
if test -z "$CUSTOM_PROCPS_LIBS"; then
606
CUSTOM_PROCPS_LIBS="-L/lib"
609
# Some distros provide libproc-${version}.so only, others provide the
610
# libproc.so symlink. Try both to see what sticks (but only try the 3.2.7
611
# and 3.2.8 versions - adding every possible version here would be a mess).
613
# Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if
617
AC_VMW_CHECK_LIB([$CUSTOM_PROCPS_NAME],
629
if test "$have_procps" = "no"; then
630
AC_VMW_CHECK_LIB([proc-3.2.8],
643
if test "$have_procps" = "no"; then
644
AC_VMW_CHECK_LIB([proc-3.2.7],
652
[AC_MSG_ERROR([libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])])
656
if test "$with_procps" != "yes"; then
657
AC_DEFINE([NO_PROCPS], 1, [Define to 1 if building without procps.])
661
[AS_HELP_STRING([--without-dnet],
662
[compiles without libdnet (disables support for nicinfo)])],
667
if test "$with_dnet" = "yes"; then
668
# On Debian, dnet is installed via the libdumbnet package. We need to
669
# detect this so that our source files include dumbnet.h instead of
670
# dnet.h, which is part of a different package altogether.
671
AC_VMW_CHECK_LIB([dumbnet],
679
AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.])],
682
if test $have_dnet = "no"; then
683
AC_VMW_CHECK_LIB([dnet],
694
if test $have_dnet = "no"; then
696
[dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net])
700
if test "$with_dnet" != "yes"; then
701
AC_DEFINE([NO_DNET], 1, [Define to 1 if building without libdnet.])
705
[AS_HELP_STRING([--without-icu],
706
[disables support for ICU])],
710
if test "$have_x" = "yes" -o "$with_icu" = "yes"; then
711
AC_CHECK_TOOL([have_cxx], [$CXX], [no])
712
if test "$have_cxx" = "no"; then
713
AC_MSG_ERROR([C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu).])
717
if test "$with_icu" = "yes"; then
718
AC_VMW_CHECK_LIBXX([icuuc],
725
[ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU"],
726
[AC_MSG_ERROR([ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org])])
727
# Check whether we have ICU >= 3.8.
729
AC_MSG_CHECKING([for ucasemap_utf8ToTitle in ICU])
730
ORIGINAL_CPPFLAGS="$CPPFLAGS"
731
CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS"
732
AC_TRY_COMPILE([#include <unicode/ucasemap.h>],
734
(void) &ucasemap_utf8ToTitle;
738
ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38"
741
[AC_MSG_RESULT([no])])
742
CPPFLAGS="$ORIGINAL_CPPFLAGS"
745
# Easier to give all modules the ICU defines/includes...
746
CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS"
748
CPPFLAGS="$CPPFLAGS -DNO_ICU"
754
[ AC_MSG_ERROR([rpcgen not found. Please install the libc devel package.]) ])
760
AC_CHECK_HEADERS([crypt.h])
761
AC_CHECK_HEADERS([inttypes.h])
762
AC_CHECK_HEADERS([stdint.h])
763
AC_CHECK_HEADERS([stdlib.h])
764
AC_CHECK_HEADERS([wchar.h])
765
AC_CHECK_HEADERS([sys/inttypes.h])
766
AC_CHECK_HEADERS([sys/io.h])
767
AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD
768
AC_CHECK_HEADERS([sys/sysinfo.h])
769
AC_CHECK_HEADERS([sys/types.h])
770
AC_CHECK_HEADERS([sys/user.h],
774
#ifdef HAVE_SYS_PARAM_H
775
# include <sys/param.h>
778
AC_CHECK_HEADERS([sys/vfs.h])
779
AC_CHECK_HEADERS([syslimits.h])
780
AC_CHECK_HEADERS([unwind.h])
784
[HAVE_WCHAR_H="yes"],
787
if test "$os" = "linux"; then
788
# Make sure kernel-headers package is installed.
792
[AC_MSG_ERROR(linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package.)])
795
if test "$enable_multimon" != "no"; then
797
[X11/extensions/panoramiXproto.h],
800
[panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s).])],
802
#include <X11/Xmd.h>])
806
if test "$os" = "linux"; then
809
[bsdPrintfWrappers=yes],
814
### Typdefs, structs, and compiler quarks.
824
AC_CHECK_MEMBERS([struct stat.st_rdev])
830
### Specific features and OS/arch flags / actions
833
### General flags / actions
834
CFLAGS="$CFLAGS -Wall"
835
CFLAGS="$CFLAGS -Werror"
837
# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
838
for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
839
-Wno-unknown-pragmas -Wno-uninitialized; do
840
AC_MSG_CHECKING([for GCC flag $TEST_CFLAG])
841
ORIGINAL_CFLAGS="$CFLAGS"
842
CFLAGS="$CFLAGS $TEST_CFLAG"
849
[NEW_CFLAG=" $TEST_CFLAG"
852
CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG"
854
CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS"
857
# -fvisibility is used by "core service" plugins, but not required.
858
ORIGINAL_CFLAGS="$CFLAGS"
859
CFLAGS="$CFLAGS -fvisibility=hidden"
860
AC_MSG_CHECKING([for GCC flag -fvisibility])
863
[PLUGIN_CPPFLAGS="-fvisibility=hidden -DGCC_EXPLICIT_EXPORT";
866
CFLAGS="$ORIGINAL_CFLAGS"
868
# Detect "unused-but-set-variable" gcc warning and disable it.
869
ORIGINAL_CFLAGS="$CFLAGS"
870
CFLAGS="$CFLAGS -Wno-unused-but-set-variable"
871
AC_MSG_CHECKING([for GCC flag -Wno-unused-but-set-variable])
874
[ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -Wno-unused-but-set-variable";
877
CFLAGS="$ORIGINAL_CFLAGS"
882
INCLUDE_DIR="`cd $srcdir; pwd`/lib/include"
883
BLD_INCLUDE_DIR="$BUILDDIR/lib/include"
884
CPPFLAGS="-I$INCLUDE_DIR -I$BLD_INCLUDE_DIR $CPPFLAGS"
890
if test "$enable_docs" = "yes"; then
891
AC_CHECK_PROG([have_doxygen],
895
if test "$have_doxygen" = "no"; then
896
AC_MSG_WARN([doxygen not found; API documentation will not be generated.])
898
AC_PATH_PROG([DOT], [dot], [])
899
if test "$DOT" = ""; then
908
AC_PATH_PROG([MSCGEN],
911
if test "$MSCGEN" != "no"; then
912
MSCGEN_DIR="`dirname $MSCGEN`"
916
AC_SUBST([MSCGEN_DIR])
921
### OS/arch-specific flags / actions
930
if test "$have_glib_2_14" = "yes"; then
931
CPPFLAGS="$CPPFLAGS -DHAVE_GLIB_REGEX"
934
if test "$os" = "linux"; then
935
MODULES_DIR="$LINUXDIR/kernel/"
937
CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
938
CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
939
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
940
CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE"
941
CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE"
943
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrt"
945
MODULES="$MODULES vmsync vmci vsock"
946
MODULES="$MODULES vmxnet vmhgfs"
947
if test "$osVersion" -lt 300000; then
948
MODULES="$MODULES vmblock vmsync"
954
if test "$os" = "freebsd"; then
955
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm"
956
MODULES_DIR="/boot/modules"
958
if test "$osVersion" -ge 302000; then
959
MODULES="$MODULES vmmemctl"
961
if test "$osVersion" -ge 409000; then
962
MODULES="$MODULES vmxnet"
964
if test "$osVersion" -ge 600000; then
965
MODULES="$MODULES vmblock vmhgfs"
969
if test "$with_kernel_modules" = "yes"; then
970
echo "****************************************************************"
971
echo " You are building FreeBSD kernel modules. Make sure you use "
972
echo " 'make' to build open-vm-tools, and not GNU make ('gmake'). "
973
echo "****************************************************************"
977
if test "$os" = "solaris"; then
978
LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
979
LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
981
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lsocket"
982
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lnsl"
983
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lresolv"
984
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrpcsvc"
986
# Setup defines to identify the OS version.
987
if test "$osVersion" -eq 509000; then
988
CPPFLAGS="$CPPFLAGS -DSOL9"
990
if test "$osVersion" -eq 510000; then
991
CPPFLAGS="$CPPFLAGS -DSOL10"
993
if test "$osVersion" -eq 511000; then
994
CPPFLAGS="$CPPFLAGS -DSOL11"
997
MODULES="$MODULES vmxnet vmmemctl"
999
# HGFS and vmblock need Solaris 10 at least.
1000
if test "$osVersion" -ge 510000; then
1001
MODULES="$MODULES vmhgfs vmblock"
1004
# vmxnet3 is built on Solaris 10 / 11 only if GLDv3 is installed.
1005
if test "$osVersion" -gt 510000; then
1008
[MODULES="$MODULES vmxnet3"],
1009
[AC_MSG_WARN([GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled.])])
1012
if test "$with_kernel_modules" = "yes"; then
1013
echo "****************************************************************"
1014
echo " You are building Solaris kernel modules. Make sure you use "
1015
echo " GNU make to build open-vm-tools. "
1016
echo "****************************************************************"
1020
AM_CONDITIONAL(BUILD_HGFSMOUNTER, test "$buildHgfsmounter" = "yes")
1021
AM_CONDITIONAL(LINUX, test "$os" = "linux")
1022
AM_CONDITIONAL(SOLARIS, test "$os" = "solaris")
1023
AM_CONDITIONAL(FREEBSD, test "$os" = "freebsd")
1024
AM_CONDITIONAL(FREEBSD_CUSTOM_SYSDIR, test "$os" = "freebsd" -a -n "$SYSDIR")
1025
AM_CONDITIONAL(THIRTY_TWO_BIT_USERSPACE, test "$userSpaceBitness" = "32")
1026
AM_CONDITIONAL(HAVE_X11, test "$have_x" = "yes")
1027
AM_CONDITIONAL(HAVE_ICU, test "$with_icu" = "yes")
1028
AM_CONDITIONAL(WITH_KERNEL_MODULES, test "$with_kernel_modules" = "yes")
1029
AM_CONDITIONAL(HAVE_XSM, test "$have_xsm" = "yes")
1030
AM_CONDITIONAL(HAVE_XCOMPOSITE, test "$have_xcomposite" = "yes")
1031
AM_CONDITIONAL(ENABLE_TESTS, test "$have_cunit" = "yes")
1032
AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes")
1033
AM_CONDITIONAL(HAVE_DNET, test "$have_dnet" = "yes")
1034
AM_CONDITIONAL(HAVE_DOXYGEN, test "$have_doxygen" = "yes")
1035
AM_CONDITIONAL(HAVE_FUSE, test "$have_fuse" = "yes")
1036
AM_CONDITIONAL(HAVE_GNU_LD, test "$with_gnu_ld" = "yes")
1037
AM_CONDITIONAL(HAVE_GTKMM, test "$have_x" = "yes" -a "$with_gtkmm" = "yes")
1038
AM_CONDITIONAL(HAVE_PAM, test "$with_pam" = "yes")
1039
AM_CONDITIONAL(USE_SLASH_PROC, test "os" = "linux" -a "$have_glib_2_14" = "yes")
1040
AM_CONDITIONAL(USE_PRINTF_WRAPPERS, test "$bsdPrintfWrappers" = "yes")
1042
if test "$have_xsm" != "yes"; then
1043
AC_DEFINE([NO_XSM], 1, [])
1046
if test "$have_xcomposite" != "yes"; then
1047
AC_DEFINE([NO_XCOMPOSITE])
1050
### Feature-specific flags / actions
1051
# Combine where possible
1053
# If control reaches this point and multimon is still enabled, then we know
1054
# all of the tests for required components have passed and it's safe to allow
1055
# multimon. Otherwise, it should be disabled.
1056
if test "$enable_multimon" = "no"; then
1057
# XXX: For consistency, change this to ENABLE_MULTIMON. This will require
1058
# some additional code cleanup.
1059
AC_DEFINE([NO_MULTIMON], 1, [Define to 1 if building without multimon support.])
1062
LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS"
1063
if test "$HAVE_CRYPT" = "yes"; then
1064
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt"
1065
VIX_LIBADD="$VIX_LIBADD -lcrypt"
1069
LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $THREAD_LIB"
1070
VIX_LIBADD="$VIX_LIBADD $THREAD_LIB"
1072
### Core Services definitions.
1074
HGFS_LIBS="$BUILDDIR/libhgfs/libhgfs.la"
1076
VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS"
1077
VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS"
1079
PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS"
1080
PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version"
1082
# In Solaris, the XDR-related functions are not in libc like in Linux and
1083
# FreeBSD, so binaries need to be linked to some extra libraries.
1085
if test "$os" = "solaris"; then
1086
XDR_LIBS="-lnsl -lrpcsvc"
1089
# Installation directories for core services plugins.
1090
TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests
1091
COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common
1092
VMSVC_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmsvc
1093
VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr
1095
# General definitions
1096
INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh'
1097
RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh'
1101
AC_SUBST([HGFS_LIBS])
1102
AC_SUBST([TOOLS_VERSION])
1103
AC_SUBST([TARGET_OS])
1104
AC_SUBST([KERNEL_RELEASE])
1105
AC_SUBST([LINUXINCLUDE])
1106
AC_SUBST([MODULES_OS])
1107
AC_SUBST([MODULES_DIR])
1109
AC_SUBST([COMMON_XLIBS])
1110
AC_SUBST([XSM_LIBS])
1111
AC_SUBST([XCOMPOSITE_LIBS])
1112
AC_SUBST([PAM_PREFIX])
1113
AC_SUBST([PLUGIN_CPPFLAGS])
1114
AC_SUBST([PLUGIN_LDFLAGS])
1115
AC_SUBST([VMTOOLS_CPPFLAGS])
1116
AC_SUBST([VMTOOLS_LIBS])
1117
AC_SUBST([RPCGENFLAGS])
1118
AC_SUBST([XDR_LIBS])
1119
AC_SUBST([TEST_PLUGIN_INSTALLDIR])
1120
AC_SUBST([COMMON_PLUGIN_INSTALLDIR])
1121
AC_SUBST([VMSVC_PLUGIN_INSTALLDIR])
1122
AC_SUBST([VMUSR_PLUGIN_INSTALLDIR])
1123
if test "$os" = "freebsd" -a -n "$SYSDIR"; then
1124
# If SYSDIR is not defined, AC_SUBST expands to nothing, so we need something
1125
# inside this block.
1129
AC_SUBST([INSTVMSG])
1130
AC_SUBST([RPCGEN_WRAPPER])
1134
AC_SUBST([LIB_AUTH_CPPFLAGS])
1135
AC_SUBST([LIB_IMPERSONATE_CPPFLAGS])
1136
AC_SUBST([LIB_USER_CPPFLAGS])
1137
AC_SUBST([LIBVMTOOLS_LIBADD])
1141
AC_SUBST([VIX_LIBADD])
1144
### Create the Makefiles
1149
lib/appUtil/Makefile \
1151
lib/backdoor/Makefile \
1153
lib/dynxdr/Makefile \
1156
lib/foundryMsg/Makefile \
1157
lib/glibUtils/Makefile \
1158
lib/guestApp/Makefile \
1159
lib/guestRpc/Makefile \
1161
lib/hgfsBd/Makefile \
1162
lib/hgfsHelper/Makefile \
1163
lib/hgfsServer/Makefile \
1164
lib/hgfsServerManagerGuest/Makefile \
1165
lib/hgfsServerPolicyGuest/Makefile \
1166
lib/impersonate/Makefile \
1168
lib/message/Makefile \
1170
lib/netUtil/Makefile \
1171
lib/panic/Makefile \
1172
lib/panicDefault/Makefile \
1173
lib/printer/Makefile \
1174
lib/procMgr/Makefile \
1175
lib/rpcChannel/Makefile \
1176
lib/rpcIn/Makefile \
1177
lib/rpcOut/Makefile \
1178
lib/rpcVmx/Makefile \
1179
lib/slashProc/Makefile \
1180
lib/string/Makefile \
1181
lib/stubs/Makefile \
1182
lib/syncDriver/Makefile \
1183
lib/system/Makefile \
1184
lib/unicode/Makefile \
1186
lib/vmCheck/Makefile \
1187
lib/vmSignal/Makefile \
1188
lib/wiper/Makefile \
1191
services/vmtoolsd/Makefile \
1192
services/plugins/Makefile \
1193
services/plugins/desktopEvents/Makefile \
1194
services/plugins/dndcp/Makefile \
1195
services/plugins/guestInfo/Makefile \
1196
services/plugins/guestInfo/getlib/Makefile \
1197
services/plugins/hgfsServer/Makefile \
1198
services/plugins/powerOps/Makefile \
1199
services/plugins/resolutionSet/Makefile \
1200
services/plugins/timeSync/Makefile \
1201
services/plugins/vix/Makefile \
1202
services/plugins/vmbackup/Makefile \
1203
vmware-user-suid-wrapper/Makefile \
1205
hgfsclient/Makefile \
1206
hgfsmounter/Makefile \
1209
libguestlib/Makefile \
1210
libguestlib/vmguestlib.pc \
1212
libvmtools/Makefile \
1215
vmblock-fuse/Makefile \
1216
vmblockmounter/Makefile \
1218
tests/vmrpcdbg/Makefile \
1219
tests/testDebug/Makefile \
1220
tests/testPlugin/Makefile \
1221
tests/testVmblock/Makefile \
1225
scripts/build/rpcgen_wrapper.sh \