378
378
dnl ---------------------------------------------------------------------------
379
dnl CF_DISABLE_DESKTOP version: 2 updated: 2011/04/22 05:17:37
380
dnl ------------------
381
dnl Handle a configure option "--disable-desktop", which sets a shell
382
dnl variable $desktop_utils to a "#" if the feature is not wanted, or to an
383
dnl empty string if enabled. The variable is used to substitute in front of
384
dnl corresponding makefile-rules.
386
dnl It also tells the configure script to substitute the environment variable
387
dnl $DESKTOP_FLAGS, which can be used by external scripts to customize the
388
dnl invocation of desktop-file-util.
390
dnl $1 = program name
391
AC_DEFUN([CF_DISABLE_DESKTOP],[
392
# Comment-out the install-desktop rule if the desktop-utils are not found.
393
AC_MSG_CHECKING(if you want to install desktop files)
394
CF_ARG_OPTION(desktop,
395
[ --disable-desktop disable install of $1 desktop files],
396
[enable_desktop=$enableval],
397
[enable_desktop=$enableval],yes)
398
AC_MSG_RESULT($enable_desktop)
401
if test "$enable_desktop" = yes ; then
402
AC_CHECK_PROG(desktop_utils,desktop-file-install,yes,no)
405
test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#"
406
AC_SUBST(DESKTOP_FLAGS)
408
dnl ---------------------------------------------------------------------------
379
409
dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57
380
410
dnl ---------------
381
411
dnl You can always use "make -n" to see the actual options, but it's hard to
1717
1747
cf_rpath_list="/usr/lib /lib"
1718
1748
if test "$cf_ldd_prog" != no
1720
1752
AC_TRY_LINK([#include <stdio.h>],
1721
1753
[printf("Hello");],
1722
[cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
1754
[cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
1755
cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
1757
# If we passed the link-test, but get a "not found" on a given library,
1758
# this could be due to inept reconfiguration of gcc to make it only
1759
# partly honor /usr/local/lib (or whatever). Sometimes this behavior
1760
# is intentional, e.g., installing gcc in /usr/bin and suppressing the
1761
# /usr/local libraries.
1762
if test -n "$cf_rpath_oops"
1764
for cf_rpath_src in $cf_rpath_oops
1766
for cf_rpath_dir in \
1771
if test -f $cf_rpath_dir/lib/$cf_rpath_src
1773
CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src)
1774
LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
1725
1782
CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
2585
2642
CF_MSG_LOG([$1])
2587
2644
dnl ---------------------------------------------------------------------------
2645
dnl CF_WITH_APP_DEFAULTS version: 1 updated: 2011/04/21 18:12:37
2646
dnl --------------------
2647
dnl Handle configure option "--with-app-defaults", setting these shell
2649
dnl $appsdir is the option value, used for installing app-defaults files.
2650
dnl $no_appsdir is a "#" (comment) if "--without-app-defaults" is given.
2651
AC_DEFUN(CF_WITH_APP_DEFAULTS,[
2652
AC_MSG_CHECKING(for directory to install resource files)
2653
CF_WITH_PATH(app-defaults,
2654
[ --with-app-defaults=DIR directory in which to install resource files],
2655
[appsdir],[EPREFIX/lib/X11/app-defaults],
2656
['\$(exec_prefix)/lib/X11/app-defaults'])
2657
AC_MSG_RESULT($appsdir)
2661
test "$appsdir" = no && no_appsdir="#"
2662
AC_SUBST(no_appsdir)
2664
dnl ---------------------------------------------------------------------------
2665
dnl CF_WITH_DESKTOP_CATEGORY version: 1 updated: 2011/04/22 05:17:37
2666
dnl ------------------------
2667
dnl Taking into account the absence of standardization of desktop categories
2668
dnl take a look to see whether other applications on the current system are
2669
dnl assigned any/all of a set of suggested categories.
2671
dnl $1 = program name
2672
dnl $2 = case-pattern to match comparable desktop files to obtain category
2673
dnl This pattern may contain wildcards.
2674
dnl $3 = suggested categories, also a case-pattern but without wildcards,
2675
dnl since it doubles as a default value.
2677
dnl The macro tells the configure script to substitute the $DESKTOP_CATEGORY
2679
AC_DEFUN([CF_WITH_DESKTOP_CATEGORY],[
2680
AC_REQUIRE([CF_DISABLE_DESKTOP])
2682
if test -z "$desktop_utils"
2684
AC_MSG_CHECKING(for requested desktop-category)
2685
AC_ARG_WITH(desktop-category,
2686
[ --with-desktop-category=XXX one or more desktop catgories or auto],
2687
[cf_desktop_want=$withval],
2688
[cf_desktop_want=auto])
2689
AC_MSG_RESULT($cf_desktop_want)
2691
if test "$cf_desktop_want" = auto
2695
for cf_desktop_dir in \
2696
/usr/share/app-install \
2697
/usr/share/applications
2699
if test -d $cf_desktop_dir
2701
find $cf_desktop_dir -name '*.desktop' | \
2704
read cf_desktop_path
2705
test -z "$cf_desktop_path" && break
2706
cf_desktop_name=`basename $cf_desktop_path .desktop`
2707
case $cf_desktop_name in #(vi
2709
CF_VERBOSE(inspect $cf_desktop_path)
2710
egrep '^Categories=' $cf_desktop_path | \
2712
sed -e 's%^.*=%%' -e '/^$/d' >>conftest.1
2718
if test -s conftest.1
2724
read cf_desktop_this
2725
test -z "$cf_desktop_this" && break
2726
case $cf_desktop_this in #(vi
2727
Qt|GTK|KDE|GNOME) #(vi
2730
test "x$cf_desktop_last" != "x$cf_desktop_this" && echo $cf_desktop_this >>conftest.2
2733
cf_desktop_last=$cf_desktop_this
2735
cf_desktop_want=`cat conftest.2 | tr '\n' ';'`
2738
DESKTOP_CATEGORY=`echo "$cf_desktop_want" | sed -e 's/[[ ,]]/;/g'`
2739
CF_VERBOSE(resulting category=$DESKTOP_CATEGORY)
2740
AC_SUBST(DESKTOP_CATEGORY)
2743
dnl ---------------------------------------------------------------------------
2744
dnl CF_WITH_ICONDIR version: 1 updated: 2011/04/21 18:12:37
2746
dnl Handle configure option "--with-icondir", setting these shell
2748
dnl $icondir is the option value, used for installing icon/pixmap files.
2749
dnl $no_icondir is a "#" (comment) if "--without-icondir" is given.
2750
AC_DEFUN([CF_WITH_ICONDIR],[
2751
AC_MSG_CHECKING(for directory to install icons)
2752
CF_WITH_PATH(icondir,
2753
[ --with-icondir=DIR directory in which to install icons],
2754
[icondir],[EPREFIX/share/pixmaps],
2755
['\$(exec_prefix)/share/pixmaps'])
2756
AC_MSG_RESULT($icondir)
2760
test "$icondir" = no && no_icondir="#"
2761
AC_SUBST(no_icondir)
2763
dnl ---------------------------------------------------------------------------
2588
2764
dnl CF_WITH_IMAKE_CFLAGS version: 9 updated: 2010/05/26 05:38:42
2589
2765
dnl --------------------
2590
2766
dnl xterm and similar programs build more readily when propped up with imake's