"Fossies" - the Fresh Open Source Software Archive

Member "gparted-1.3.1/configure.ac" (19 Jul 2021, 13466 Bytes) of package /linux/misc/gparted-1.3.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.3.0_vs_1.3.1.

    1 AC_INIT([gparted],[1.3.1],[https://gitlab.gnome.org/GNOME/gparted/issues])
    2 AC_PREREQ([2.50])
    3 
    4 AC_CONFIG_SRCDIR([src/main.cc])
    5 AC_CONFIG_HEADERS([config.h])
    6 AC_CONFIG_MACRO_DIR([m4])
    7 
    8 AM_INIT_AUTOMAKE([1.9 subdir-objects])
    9 AM_MAINTAINER_MODE
   10 
   11 
   12 dnl======================
   13 dnl checks for programs
   14 dnl======================
   15 AC_PROG_CXX
   16 AC_PROG_CC
   17 AC_PROG_LIBTOOL
   18 AC_PROG_AWK
   19 dnl Check for pkg-config early to avoid splitting message when first used.
   20 PKG_CHECK_EXISTS
   21 
   22 
   23 dnl======================
   24 dnl Find graphical privilege escalation program
   25 dnl======================
   26 dnl Check for pkexec >= 0.102 for it's ability to run X11 apps.
   27 AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], false)
   28 PKEXEC_REQUIRED_VERSION='0.102'
   29 AC_MSG_CHECKING([for pkexec >= $PKEXEC_REQUIRED_VERSION])
   30 PKEXEC_REQUIRED_INT=`echo "$PKEXEC_REQUIRED_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
   31 PKEXEC_VERSION_OUTPUT=`pkexec --version 2> /dev/null` ||
   32     AC_MSG_RESULT([not found])
   33 if test "x$PKEXEC_VERSION_OUTPUT" != 'x'; then
   34     PKEXEC_FOUND_VERSION=`echo "$PKEXEC_VERSION_OUTPUT" | head -1 | cut -d' ' -f3`
   35     PKEXEC_FOUND_INT=`echo "$PKEXEC_FOUND_VERSION" | $AWK -F. '{print $1 * 10000 + $2}'`
   36     AC_MSG_RESULT([$PKEXEC_FOUND_VERSION found])
   37     if test "$PKEXEC_FOUND_INT" -ge "$PKEXEC_REQUIRED_INT"; then
   38         GKSUPROG='pkexec --disable-internal-agent'
   39         AC_SUBST([GKSUPROG])
   40         AM_CONDITIONAL([INSTALL_POLKIT_ACTIONS], true)
   41     fi
   42 fi
   43 
   44 dnl Check for alternative graphical privilege escalation programs.
   45 if test "x$GKSUPROG" = 'x'; then
   46     AC_CHECK_PROGS([GKSUPROG], [gksudo gksu kdesudo "xdg-su -c"], [])
   47 fi
   48 
   49 
   50 dnl======================
   51 dnl i18n stuff
   52 dnl======================
   53 GETTEXT_PACKAGE=gparted
   54 AC_SUBST([GETTEXT_PACKAGE])
   55 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE", [description])
   56 
   57 AM_GLIB_GNU_GETTEXT
   58 IT_PROG_INTLTOOL([0.36.0])
   59 
   60 
   61 dnl======================
   62 dnl checks for libs
   63 dnl======================
   64 AC_CHECK_LIB([uuid], [uuid_generate], [], AC_MSG_ERROR([*** libuuid not found.]))
   65 AC_CHECK_LIB([dl], [dlopen], [], AC_MSG_ERROR([*** libdl not found.]))
   66 AC_CHECK_LIB([parted], [ped_device_read], [], AC_MSG_ERROR([*** libparted not found.]))
   67 
   68 
   69 dnl Check for minimum required libparted version.
   70 dnl 1) Check using pkg-config.
   71 dnl    (Older distros tend to not provide pkg-config information for libparted).
   72 dnl 2) Check by linking and running a program to report libparted version directly.
   73 LIBPARTED_REQUIRED_VERSION='2.2'
   74 AC_MSG_CHECKING([for libparted >= $LIBPARTED_REQUIRED_VERSION (querying pkg-config)])
   75 LIBPARTED_REQUIRED_INT=`echo "$LIBPARTED_REQUIRED_VERSION" |
   76     $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
   77 dnl 1) Check using pkg-config.
   78 PKG_CHECK_EXISTS(
   79     [libparted],
   80     [LIBPARTED_FOUND_VERSION=`$PKG_CONFIG --modversion libparted`
   81      LIBPARTED_FOUND_INT=`echo "$LIBPARTED_FOUND_VERSION" |
   82         $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
   83      AC_MSG_RESULT([$LIBPARTED_FOUND_VERSION])
   84      test "$LIBPARTED_FOUND_INT" -ge "$LIBPARTED_REQUIRED_INT" ||
   85         AC_MSG_ERROR([*** libparted too old.  Require libparted >= $LIBPARTED_REQUIRED_VERSION but only found libparted $LIBPARTED_FOUND_VERSION.])
   86     ],
   87     [AC_MSG_RESULT([not found])
   88      dnl 2) Check by linking and running a program to report libparted version
   89      dnl    directly.
   90      AC_MSG_CHECKING([for libparted >= $LIBPARTED_REQUIRED_VERSION (querying libparted)])
   91      AC_RUN_IFELSE(
   92         [AC_LANG_SOURCE(
   93             [[
   94 #include <stdio.h>
   95 #include <stdlib.h>
   96 #include <parted/parted.h>
   97 
   98 int main()
   99 {
  100     const char *version = ped_get_version();
  101     if (version == NULL)
  102     {
  103         fprintf(stderr, "ERROR: ped_get_version() returned NULL\n");
  104         return EXIT_FAILURE;
  105     }
  106     printf("%s\n", version);
  107     return EXIT_SUCCESS;
  108 }
  109             ]]
  110         )],
  111         dnl Run test program again to cache libparted version.
  112         [LIBPARTED_FOUND_VERSION=`./conftest$EXEEXT`
  113          LIBPARTED_FOUND_INT=`echo "$LIBPARTED_FOUND_VERSION" |
  114             $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
  115          test "$LIBPARTED_FOUND_INT" -ge "$LIBPARTED_REQUIRED_INT" ||
  116             AC_MSG_ERROR([*** libparted too old.  Require libparted >= $LIBPARTED_REQUIRED_VERSION but only found libparted $LIBPARTED_FOUND_VERSION.])
  117         ],
  118         [AC_MSG_ERROR([*** Error querying libparted version.  Check config.log for details.])]
  119     )]
  120 )
  121 
  122 
  123 dnl Check for libparted 2.0 to 3.0 inclusive for a bug where loop table
  124 dnl creation doesn't delete old partitions.
  125 LIBPARTED_MIN_WANTED_VERSION='2.0'
  126 LIBPARTED_MAX_WANTED_VERSION='3.0'
  127 AC_MSG_CHECKING([for $LIBPARTED_MIN_WANTED_VERSION <= libparted <= $LIBPARTED_MAX_WANTED_VERSION (loop table creation doesn't delete old partitions)])
  128 LIBPARTED_MIN_WANTED_INT=`echo "$LIBPARTED_MIN_WANTED_VERSION" |
  129     $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
  130 LIBPARTED_MAX_WANTED_INT=`echo "$LIBPARTED_MAX_WANTED_VERSION" |
  131     $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
  132 if test "$LIBPARTED_MIN_WANTED_INT" -le "$LIBPARTED_FOUND_INT" -a \
  133         "$LIBPARTED_FOUND_INT" -le "$LIBPARTED_MAX_WANTED_INT"; then
  134     need_loop_delete_old_ptns_workaround=yes
  135     AC_DEFINE([ENABLE_LOOP_DELETE_OLD_PTNS_WORKAROUND], 1,
  136               [Define to 1 to enable deletion of old partitions before creating a loop table workaround])
  137     AC_MSG_RESULT([(cached) yes])
  138 else
  139     need_loop_delete_old_ptns_workaround=no
  140     AC_MSG_RESULT([(cached) no])
  141 fi
  142 
  143 
  144 dnl Check for ped_file_system_resize() function to determine the existence
  145 dnl of the API in the original parted library.  Available in parted <= 2.4.
  146 dnl
  147 dnl NOTE:
  148 dnl For AC_CHECK_LIB the default action-if-found ($3) includes extending
  149 dnl LIBS with the newly found library ($1) thus:
  150 dnl     LIBS="-l$1 $LIBS"
  151 dnl
  152 dnl As the default action-if-found is overridden, LIBS isn't extended so
  153 dnl saving and restoring LIBS isn't required.
  154 have_old_lp_fs_resize_api=no
  155 AC_CHECK_LIB(
  156     [parted], [ped_file_system_resize],
  157     [have_old_lp_fs_resize_api=yes]
  158 )
  159 
  160 
  161 dnl If not already found, check for ped_file_system_resize() function in
  162 dnl the parted-fs-resize library to determine the need to use the new
  163 dnl library.  Available in parted >= 3.1.
  164 have_new_lp_fs_resize_lib=no
  165 AS_IF(
  166     [test "x$have_old_lp_fs_resize_api" != xyes],
  167     [AC_CHECK_LIB(
  168         [parted-fs-resize], [ped_file_system_resize],
  169         [have_new_lp_fs_resize_lib=yes
  170          LIBS="-lparted-fs-resize $LIBS"
  171         ]
  172     )]
  173 )
  174 
  175 
  176 dnl Check for libparted >= 3.2 for online resize support.
  177 LIBPARTED_WANTED_VERSION='3.2'
  178 AC_MSG_CHECKING([for libparted >= $LIBPARTED_WANTED_VERSION (online resize)])
  179 LIBPARTED_WANTED_INT=`echo "$LIBPARTED_WANTED_VERSION" |
  180     $AWK -F. '{print $1 * 1000000 + $2 * 10000 + $3}'`
  181 if test "$LIBPARTED_FOUND_INT" -ge "$LIBPARTED_WANTED_INT"; then
  182     have_online_resize=yes
  183     AC_MSG_RESULT([(cached) yes])
  184 else
  185     have_online_resize=no
  186     AC_MSG_RESULT([(cached) no])
  187 fi
  188 
  189 
  190 dnl Check if have libparted fs resize capability
  191 if test [ ${have_old_lp_fs_resize_api} = yes -o ${have_new_lp_fs_resize_lib} = yes ]; then
  192     AC_DEFINE([HAVE_LIBPARTED_FS_RESIZE], [1], [Define to 1 if have libparted fs resize capability])
  193 fi
  194 
  195 
  196 dnl gthread
  197 PKG_CHECK_MODULES([GTHREAD], [gthread-2.0])
  198 AC_SUBST([GTHREAD_LIBS])
  199 AC_SUBST([GTHREAD_CFLAGS])
  200 
  201 dnl GTKMM
  202 PKG_CHECK_MODULES([GTKMM], [gtkmm-3.0 >= 3.4.0])
  203 AC_SUBST([GTKMM_LIBS])
  204 AC_SUBST([GTKMM_CFLAGS])
  205 
  206 
  207 dnl Check for glibmm minimum required version.
  208 PKG_CHECK_MODULES([GLIBMM], [glibmm-2.4 >= 2.32.0])
  209 
  210 
  211 need_cxx_compile_stdcxx_11=no
  212 dnl Check for glibmm >= 2.45.40 which requires C++11 compilation.
  213 AC_MSG_CHECKING([for glibmm >= 2.45.40 which requires C++11 compilation])
  214 PKG_CHECK_EXISTS(
  215     [glibmm-2.4 >= 2.45.40],
  216     [need_cxx_compile_stdcxx_11=yes
  217      AC_MSG_RESULT([yes])
  218     ],
  219     [AC_MSG_RESULT([no])]
  220 )
  221 dnl Check for libsigc++ >= 2.5.1 which requires C++11 compilation.
  222 AC_MSG_CHECKING([for libsigc++ >= 2.5.1 which requires C++11 compilation])
  223 PKG_CHECK_EXISTS(
  224     [sigc++-2.0 >= 2.5.1],
  225     [need_cxx_compile_stdcxx_11=yes
  226      AC_MSG_RESULT([yes])
  227     ],
  228     [AC_MSG_RESULT([no])]
  229 )
  230 dnl Check for gtkmm >= 3.18.0 which requires C++11 compilation.
  231 AC_MSG_CHECKING([for gtkmm >= 3.18.0 which requires C++11 compilation])
  232 PKG_CHECK_EXISTS(
  233     [gtkmm-3.0 >= 3.18.0],
  234     [need_cxx_compile_stdcxx_11=yes
  235      AC_MSG_RESULT([yes])
  236     ],
  237     [AC_MSG_RESULT([no])]
  238 )
  239 dnl Enable C++11 compilation only if required.
  240 if test "x$need_cxx_compile_stdcxx_11" = xyes; then
  241     AX_CXX_COMPILE_STDCXX_11()
  242 fi
  243 
  244 
  245 dnl Check for gtkmm >= 3.16 to determine availability of Gtk::Label::set_xalign().
  246 AC_MSG_CHECKING([for Gtk::Label::set_xalign() method])
  247 PKG_CHECK_EXISTS(
  248     [gtkmm-3.0 >= 3.16.0],
  249     [AC_DEFINE([HAVE_LABEL_SET_XALIGN], 1,
  250                [Define to 1 if gtkmm provides Gtk::Label::set_xalign() method.])
  251      AC_MSG_RESULT([yes])
  252     ],
  253     [AC_MSG_RESULT([no])]
  254 )
  255 
  256 
  257 dnl Check for gtkmm >= 3.22 to determine availability of Gtk::ScrolledWindow::set_propagate_natural_width().
  258 AC_MSG_CHECKING([for Gtk::ScrolledWindow::set_propagate_natural_width() method])
  259 PKG_CHECK_EXISTS(
  260     [gtkmm-3.0 >= 3.22.0],
  261     [AC_DEFINE([HAVE_SET_PROPAGATE_NATURAL_WIDTH], 1,
  262                [Define to 1 if gtkmm provides Gtk::ScrolledWindow::set_propagate_natural_width() method.])
  263      AC_MSG_RESULT([yes])
  264     ],
  265     [AC_MSG_RESULT([no])]
  266 )
  267 
  268 
  269 dnl Check for gtk+-3.0 >= 3.22 to determine availability of gtk_show_uri_on_window() function.
  270 AC_MSG_CHECKING([for gtk_show_uri_on_window() function])
  271 PKG_CHECK_EXISTS(
  272     [gtk+-3.0 >= 3.22.0],
  273     [AC_DEFINE([HAVE_GTK_SHOW_URI_ON_WINDOW], 1,
  274                [Define to 1 if gtk provides gtk_show_uri_on_window function.])
  275      AC_MSG_RESULT([yes])
  276     ],
  277     [AC_MSG_RESULT([no])]
  278 )
  279 
  280 
  281 dnl Definitions for building of and with gtest.  Gets flags for pthread via earlier
  282 dnl gthread package check.
  283 GTEST_CPPFLAGS="-DGTEST_HAS_PTHREAD=1"
  284 GTEST_CXXFLAGS="$GTHREAD_CFLAGS $GTKMM_CFLAGS"
  285 GTEST_LDFLAGS=
  286 GTEST_LIBS="$GTHREAD_LIBS $GTKMM_LIBS"
  287 AC_SUBST([GTEST_CPPFLAGS])
  288 AC_SUBST([GTEST_CXXFLAGS])
  289 AC_SUBST([GTEST_LDFLAGS])
  290 AC_SUBST([GTEST_LIBS])
  291 
  292 
  293 dnl======================
  294 dnl check whether to build documentation - gnome-doc-utils
  295 dnl======================
  296 AC_ARG_ENABLE(
  297     [doc],
  298     AS_HELP_STRING(
  299         [--disable-doc],
  300         dnl Autoconf quadrigraphs '@<:@' = '[' and '@:>@' = ']'
  301         [disable building help documentation @<:@default=enabled@:>@]),
  302     [enable_doc=$enableval],
  303     [enable_doc=yes]
  304 )
  305 
  306 AC_MSG_CHECKING([whether help documentation should be built])
  307 if test "x$enable_doc" = xyes; then
  308     AC_DEFINE([ENABLE_HELP_DOC], [1], [Define to 1 when help documentation is built])
  309     AC_MSG_RESULT([yes])
  310 else
  311     AC_MSG_RESULT([no])
  312 fi
  313 
  314 if test "x$enable_doc" = xyes; then
  315 dnl YELP_HELP_INIT has to start at column 0 for gnome-autogen.sh to detect it
  316 dnl and automatically required yelp.m4.
  317 YELP_HELP_INIT
  318 fi
  319 
  320 AM_CONDITIONAL([BUILD_HELP_DOC], [test "x$enable_doc" = xyes])
  321 
  322 
  323 dnl======================
  324 dnl check whether to use native libparted dmraid support
  325 dnl======================
  326 AC_ARG_ENABLE(
  327     [libparted_dmraid],
  328     AS_HELP_STRING(
  329         [--enable-libparted-dmraid],
  330         [use native libparted /dev/mapper dmraid support @<:@default=disabled@:>@]),
  331     [enable_libparted_dmraid=$enableval],
  332     [enable_libparted_dmraid=no]
  333 )
  334 
  335 AC_MSG_CHECKING([whether to use native libparted /dev/mapper dmraid support])
  336 if test "x$enable_libparted_dmraid" = xyes; then
  337     AC_DEFINE([USE_LIBPARTED_DMRAID], [1],
  338               [Define to 1 to use native libparted /dev/mapper dmraid support])
  339     AC_MSG_RESULT([yes])
  340 else
  341     AC_MSG_RESULT([no])
  342 fi
  343 
  344 
  345 dnl======================
  346 dnl check whether to enable online resize support
  347 dnl======================
  348 AC_ARG_ENABLE(
  349     [online-resize],
  350     AS_HELP_STRING(
  351         [--enable-online-resize],
  352         [enable online resize support @<:@default=auto@:>@]),
  353     [enable_online_resize=$enableval],
  354     [enable_online_resize=$have_online_resize]
  355 )
  356 
  357 AC_MSG_CHECKING([whether online resize support is enabled])
  358 if test "x$enable_online_resize" = xyes; then
  359     AC_DEFINE([ENABLE_ONLINE_RESIZE], [1], [Define to 1 if online resize is enabled])
  360     AC_MSG_RESULT([yes])
  361 else
  362     AC_MSG_RESULT([no])
  363 fi
  364 
  365 
  366 dnl Check whether to explicitly grant root access to the display.
  367 AC_ARG_ENABLE(
  368     [xhost-root],
  369     AS_HELP_STRING(
  370         [--enable-xhost-root],
  371         [enable explicitly granting root access to the display @<:@default=disabled@:>@]),
  372     [enable_xhost_root=$enableval],
  373     [enable_xhost_root=no]
  374 )
  375 
  376 AC_MSG_CHECKING([whether to explicitly grant root access to the display])
  377 if test "x$enable_xhost_root" = 'xyes'; then
  378     AC_MSG_RESULT([yes])
  379 else
  380     AC_MSG_RESULT([no])
  381 fi
  382 AC_SUBST([ENABLE_XHOST_ROOT], $enable_xhost_root)
  383 
  384 
  385 AC_CONFIG_FILES([
  386 Makefile
  387 data/Makefile
  388 data/icons/Makefile
  389 doc/Makefile
  390 help/Makefile
  391 include/Makefile
  392 lib/Makefile
  393 lib/gtest/Makefile
  394 src/Makefile
  395 po/Makefile.in
  396 tests/Makefile
  397 ])
  398 
  399 AC_OUTPUT
  400 
  401 
  402 dnl======================
  403 dnl Summary
  404 dnl======================
  405 
  406 echo ""
  407 echo "======================== Final configuration ==========================="
  408 echo "                         Installing into prefix  :  $prefix"
  409 echo ""
  410 echo "                      Build help documentation?  :  $enable_doc"
  411 echo ""
  412 echo "           Use native libparted dmraid support?  :  $enable_libparted_dmraid"
  413 echo ""
  414 echo "   Explicitly grant root access to the display?  :  $enable_xhost_root"
  415 echo ""
  416 echo "       --- Features Based On Libparted Version ---"
  417 echo "       Need delete old partitions before"
  418 echo "              creating a loop table workaround?  :  $need_loop_delete_old_ptns_workaround"
  419 echo "   Have old libparted file system resizing API?  :  $have_old_lp_fs_resize_api"
  420 echo "   Have new libparted file system resizing LIB?  :  $have_new_lp_fs_resize_lib"
  421 echo "                  Enable online resize support?  :  $enable_online_resize"
  422 echo ""
  423 echo " If all settings are OK, type make and then (as root) make install"
  424 echo "========================================================================"