~henrix/ubuntu/precise/open-vm-dkms/lp-1416003

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-10-23 15:32:00 UTC
  • mfrom: (1.1.2 upstream) (2.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20081023153200-gc1bfx89hj35c799
Tags: 2008.10.10-123053-2
* Correcting typo in dh_installinit call.
* Downgrading depends on module-assistant to recommends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
38
37
 
39
38
AC_INIT(
40
39
   [open-vm-tools],
41
 
   [2008.08.08-109361],
 
40
   [2008.10.10-123053],
42
41
   [open-vm-tools-devel@lists.sourceforge.net])
43
42
 
44
43
# In order to make this configure script auto-detect situations where
62
61
# helps autoconf verify that it really has found the source tree.
63
62
AC_CONFIG_SRCDIR([checkvm/checkvm.c])
64
63
 
 
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])
 
68
 
65
69
AC_CANONICAL_HOST
66
70
AC_CANONICAL_BUILD
67
71
 
78
82
      ;;
79
83
esac
80
84
 
81
 
# Kernel args
 
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])],
 
89
            [],
 
90
            [with_root_privileges=yes])
 
91
 
 
92
# Kernel arguments.
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])],
87
98
            [],
88
99
            [with_kernel_modules=yes])
89
100
 
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`])
95
106
 
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])
101
112
 
130
141
   fi
131
142
fi
132
143
 
133
 
# Arguments for disabling individual open-vm-tools features.
 
144
# Arguments for disabling individual open-vm-tools features or libraries.
134
145
AC_ARG_ENABLE(
135
146
   multimon,
136
147
   AS_HELP_STRING(
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"])
141
152
 
143
154
   unity,
144
155
   AS_HELP_STRING(
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"])
149
160
 
 
161
AC_ARG_WITH(
 
162
   gtk2,
 
163
   AS_HELP_STRING(
 
164
      [--without-gtk2],
 
165
      [compiles without Gtk 2.0 (falls back on Gtk 1.2)]),
 
166
   [with_gtk2="$withval"],
 
167
   [with_gtk2="yes"])
 
168
 
 
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
 
173
   enable_unity="no"
 
174
fi
 
175
 
150
176
AM_INIT_AUTOMAKE
151
177
 
152
178
###
169
195
###
170
196
### Programs
171
197
###
172
 
# Compiler and preprocessor
 
198
# C preprocessor and compiler.
173
199
AC_PROG_CPP
174
200
AC_PROG_CC
175
201
 
 
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++'.
 
204
AC_PROG_CXX
 
205
 
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.)
215
245
   AC_MSG_ERROR(
216
246
      [The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s).])
217
247
else
218
 
   LIBS="$LIBS $X_LIBS"
219
248
   CPPFLAGS="$CPPFLAGS $X_CFLAGS"
220
 
   COMMON_XLIBS="-lX11"
221
 
   COMMON_XLIBS="-lXext $COMMON_XLIBS"
 
249
   COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
 
250
 
 
251
   AC_CHECK_LIB(
 
252
      [Xext],
 
253
      [XeviQueryVersion],
 
254
      [COMMON_XLIBS="-lXext $COMMON_XLIBS"],
 
255
      [AC_MSG_ERROR(
 
256
         [libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s).])],
 
257
      [$COMMON_XLIBS])
222
258
 
223
259
   AC_CHECK_HEADER(
224
260
      [X11/extensions/extutil.h],
239
275
   fi
240
276
 
241
277
   AC_CHECK_LIB(
 
278
      [Xrender],
 
279
      [XRenderQueryVersion],
 
280
      [COMMON_XLIBS="-lXrender $COMMON_XLIBS"],
 
281
      [AC_MSG_ERROR(
 
282
         [libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s).])],
 
283
      [$COMMON_XLIBS])
 
284
 
 
285
   AC_CHECK_LIB(
242
286
      [Xrandr],
243
287
      [XRRQueryVersion],
244
 
      [COMMON_XLIBS="-lXrandr $COMMON_XLIBS"
245
 
       COMMON_XLIBS="-lXrender $COMMON_XLIBS"],
 
288
      [COMMON_XLIBS="-lXrandr $COMMON_XLIBS"],
246
289
      [AC_MSG_ERROR(
247
290
         [libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s).])],
248
 
      [-lXrender $COMMON_XLIBS])
 
291
      [$COMMON_XLIBS])
249
292
 
250
293
   AC_CHECK_LIB(
251
294
      [Xtst],
377
420
         [gtk_accel_group_add],
378
421
         [HAVE_GTK1="yes"],,
379
422
         [$CUSTOM_GTK_LIBS])
380
 
      AC_CHECK_LIB(
381
 
         [gtk-x11-2.0],
382
 
         [gtk_tree_view_new],
383
 
         [HAVE_GTK2="yes"],,
384
 
         [$CUSTOM_GTK_LIBS])
 
423
      if test "$with_gtk2" != "no"; then
 
424
         AC_CHECK_LIB(
 
425
            [gtk-x11-2.0],
 
426
            [gtk_tree_view_new],
 
427
            [HAVE_GTK2="yes"],,
 
428
            [$CUSTOM_GTK_LIBS])
 
429
      fi
385
430
   fi
386
431
 
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
391
 
         HAVE_GTK2="yes"
392
 
         AC_MSG_RESULT([yes])
393
 
      else
394
 
         AC_MSG_RESULT([no])
395
 
      fi
 
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
 
437
            HAVE_GTK2="yes"
 
438
            AC_MSG_RESULT([yes])
 
439
         else
 
440
            AC_MSG_RESULT([no])
 
441
         fi
 
442
     fi
396
443
 
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
420
467
      fi
421
468
 
422
469
      if test "$HAVE_GTK2" = "yes"; then
423
 
      # Gtk 2.0
 
470
         # Gtk 2.0
424
471
         GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"
425
472
         gtkPackageName="gtk+-2.0"
426
473
      elif test "$HAVE_GTK1" = "yes"; then
427
 
      # Gtk 1.2
 
474
         # Gtk 1.2
428
475
         gtkPackageName="gtk+"
429
476
 
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"
452
 
         fi
453
495
      # Otherwise, we have a problem.
454
496
      else
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.])
456
498
      fi
457
499
 
 
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
 
506
         AC_CHECK_LIB(
 
507
            [gdk-x11-2.0],
 
508
            [gdk_display_get_default_group],
 
509
            [HAVE_NEW_GTK2="yes"],
 
510
            [AC_MSG_ERROR(
 
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)])]
 
512
            [$GTK_LIBS])
 
513
      fi
 
514
 
 
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
 
518
         AC_CHECK_LIB(
 
519
            [gdk_pixbuf_xlib-2.0],
 
520
            [gdk_pixbuf_xlib_init],
 
521
            [GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0"],
 
522
            [AC_MSG_ERROR(
 
523
               [gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity).])],
 
524
            [$GTK_LIBS])
 
525
      fi
458
526
   else
459
527
      AC_MSG_ERROR([libgtk not found. Please install the gtk devel package(s).])
460
528
   fi
468
536
   [AC_MSG_ERROR(
469
537
      [libcrypt not found. Please install the libc/libcrypt devel package(s).])])
470
538
 
 
539
AC_CHECK_LIB(
 
540
   [notify],
 
541
   [notify_init],
 
542
   [HAVE_NOTIFY="yes"
 
543
    VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify"],
 
544
   [AC_MSG_WARN([libnotify not found; notification disabled])])
 
545
 
471
546
AC_CHECK_FUNCS(
472
547
   dlopen,
473
548
   ,
492
567
# PAM prefix
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)'])
498
573
 
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)])],
503
578
            [],
504
579
            [with_procps=yes])
505
580
else
523
598
 
524
599
        GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS"
525
600
        VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS"
526
 
 
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"
534
 
        else
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"
540
 
        fi
541
 
        ORIGINAL_CPPFLAGS="$CPPFLAGS"
542
 
        CPPFLAGS="$PROCPS_CPPFLAGS $CPPFLAGS"
543
 
        AC_CHECK_HEADER(
544
 
           [proc/sysinfo.h],
545
 
           [],
546
 
           [AC_MSG_ERROR(
547
 
              [libproc headers not found. Please configure without procps (using --without-procps) or install libproc devel package])])
548
 
        CPPFLAGS="$ORIGINAL_CPPFLAGS"
549
601
fi
550
602
 
551
603
if test "$with_procps" != "yes"; then
554
606
 
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)])],
558
610
            [],
559
611
            [with_dnet=yes])
560
612
 
588
640
 
589
641
AC_ARG_WITH([icu],
590
642
            [AS_HELP_STRING([--without-icu],
591
 
              [disable support for ICU])],
 
643
              [disables support for ICU])],
592
644
            [],
593
645
            [with_icu=yes])
594
646
 
602
654
                ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU"
603
655
                ICU_LIBS="`$ICU_CONFIG --ldflags`"
604
656
 
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
 
660
                # tests against icu.
608
661
                #
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
631
 
                AC_PROG_CXX
 
684
                AC_CHECK_TOOL(
 
685
                   [HAVE_CXX],
 
686
                   [$CXX])
 
687
                if test -z "$HAVE_CXX"; then   
 
688
                        AC_MSG_ERROR(
 
689
                           [No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler.])
 
690
                fi
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
828
887
   fi
 
888
   if test "$osVersion" -ge 206000; then
 
889
      MODULES="$MODULES vmxnet3"
 
890
   fi
829
891
   if test "$osVersion" -ge 206006; then
830
892
      MODULES="$MODULES vmsync"
831
893
   fi
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")
880
943
 
881
944
### Feature-specific flags / actions
882
945
# Combine where possible
927
990
AC_SUBST([GTK_LIBS])
928
991
AC_SUBST([DNET_CPPFLAGS])
929
992
AC_SUBST([DNET_LIBS])
930
 
AC_SUBST([PROCPS_CPPFLAGS])
931
993
AC_SUBST([PROCPS_LIBS])
932
994
AC_SUBST([ICU_CPPFLAGS])
933
995
AC_SUBST([ICU_LIBS])