File: configure.ac

package info (click to toggle)
lxhotkey 0.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 1,892 kB
  • ctags: 424
  • sloc: sh: 11,320; ansic: 3,273; makefile: 58
file content (126 lines) | stat: -rw-r--r-- 3,110 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
AC_PREREQ(2.53)
AC_INIT(lxhotkey, 0.1.0, http://lxde.org/)
AM_INIT_AUTOMAKE([-Wall foreign subdir-objects no-dist-gzip dist-xz])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])

# Support silent build rules. Disable by either passing --disable-silent-rules
# to configure or passing V=1 to make
AM_SILENT_RULES([yes])

# Force to dynamic
AC_DISABLE_STATIC

# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
IT_PROG_INTLTOOL([0.40.0], [no-xml])
AM_PROG_CC_C_O
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT

# International support
GETTEXT_PACKAGE=lxhotkey
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])

AM_GLIB_GNU_GETTEXT

# Generate po/LINGUAS for available PO files
rm -f $srcdir/po/LINGUAS
for po_file in `ls $srcdir/po/*.po | sort`;
do
    lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
    echo $lang >> $srcdir/po/LINGUAS
done

# Handle --enable-debug option
AC_ARG_ENABLE(debug,
    [AC_HELP_STRING([--enable-debug],
        [enable debug support @<:@default=no@:>@])],
    [enable_debug="${enableval}"],
    [enable_debug=no]
)
if test "$enable_debug" = "yes"; then
    # turn on debug and disable optimization
    CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
    case "$CC" in
    gcc*)
        CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration"
        ;;
    *)
        ;;
    esac
    dnl Be more strict on portability
    #CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
else
    # turn off glib debug checks
    CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
fi

dnl Test for required libraries
pkg_modules="libfm >= 1.2.0 x11"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)

dnl GTK+ stuff
AC_ARG_WITH(gtk,
    [AC_HELP_STRING([--with-gtk=VER],
        [build 'gtk' GUI, choose GTK+ version for build])
AC_HELP_STRING([--without-gtk],
        [disable 'gtk' GUI build @<:@default@:>@])],
    [ac_with_gtk="${withval}"],
    [ac_with_gtk=no]
)

if test x"$ac_with_gtk" != xno; then
  case "$ac_with_gtk" in
    3|3.*)
      pkg_modules="gtk+-3.0"
      ;;
    *)
      pkg_modules="gtk+-2.0 >= 2.18.0"
      ;;
  esac
  PKG_CHECK_MODULES(GTK, [$pkg_modules], [with_gtk=yes], [with_gtk=no])
fi
AM_CONDITIONAL(WITH_GTK, [test x$with_gtk = xyes])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)

dnl Test for libunistring for correct UTF-8 printf
AC_CHECK_LIB(unistring, ulc_fprintf)

dnl Supress extra linking
AC_MSG_CHECKING([whether $LD accepts --as-needed])
case `$LD --as-needed -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
    LDFLAGS="$LDFLAGS -Wl,--as-needed"
    AC_MSG_RESULT([yes])
    ;;
*)
    AC_MSG_RESULT([no])
    ;;
esac

dnl Fix invalid sysconfdir when --prefix=/usr
if test `eval "echo $sysconfdir"` = /usr/etc
then
    sysconfdir=/etc
fi

dnl Finish all
AC_CONFIG_FILES([
    Makefile
    lxhotkey.pc
    src/Makefile
    plugins/Makefile
    po/Makefile.in
    man/lxhotkey.1
])
AC_OUTPUT