File: configure.ac

package info (click to toggle)
phat 0.2.3-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,952 kB
  • ctags: 371
  • sloc: sh: 8,477; ansic: 3,234; makefile: 190
file content (115 lines) | stat: -rw-r--r-- 2,829 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
# -*- autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT([phat/phatfanslider.c])

PHAT_VERSION=0.2.3
AC_SUBST(PHAT_VERSION)

AM_INIT_AUTOMAKE([phat],${PHAT_VERSION})
AC_PROG_LIBTOOL

# optimization and debugging checks
with_debug="no"
AC_ARG_ENABLE([debug], 
    [AC_HELP_STRING([--enable-debug],
        [enable debugging information, accepting a performance penalty (default is NO)])],
    [if test x$enable_debug = xyes; then with_debug=yes ; fi])

if test x$with_debug = xno; then
    CFLAGS="-O3"
    AC_DEFINE(DEBUG, 0, [[whether to display debugging output or not]])
else
    AC_DEFINE(DEBUG, 1, [[whether to display debugging output or not]])
fi

# standard autoconf checks
AC_PROG_CC
AC_PROG_CPP

##################################################
# Check for gtk+-2.0, preferably >= 2.4
##################################################
with_gtk2_4=no
PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.4.0], [with_gtk2_4=yes], [with_gtk2_4=no])

if test x$with_gtk2_4 = xyes; then
    AC_DEFINE(HAVE_GTK2_4, 1, [[do we have gtk+ >= 2.4 ?]])
else
    PKG_CHECK_MODULES(GTK, gtk+-2.0)
fi

##################################################
# Check for gtk-doc.
##################################################

AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])

if test "x$with_html_dir" = "x" ; then
  HTML_DIR='${datadir}/gtk-doc/html'
else
  HTML_DIR=$with_html_dir
fi

AC_SUBST(HTML_DIR)

gtk_doc_min_version=1.0
AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])
if pkg-config --atleast-version=$gtk_doc_min_version gtk-doc; then
  AC_MSG_RESULT(yes)
  GTKDOC=true
else
  AC_MSG_RESULT(no)
  GTKDOC=false
fi

# Let people disable the gtk-doc stuff.
AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)

if test x$enable_gtk_doc = xauto ; then
  if test x$GTKDOC = xtrue ; then
    enable_gtk_doc=yes
  else
    enable_gtk_doc=no 
  fi
fi

AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)


# set compilation flags
CFLAGS="$CFLAGS $GTK_CFLAGS -Wall -Werror"
LIBS="$LIBS $GTK_LIBS"

# print build summary
AC_CONFIG_COMMANDS_POST([
echo
echo
echo    "                   BUILD SUMMARY"
echo    "                   ============="
echo
echo -n "             Build type:     "
if test x$with_debug = xyes; then
    echo "debugging"
else
    echo "optimized"
fi
echo -n "             GTK+ Version:   "
if test x$with_gtk2_4 = xyes; then
    echo "2.4 or greater"
else
    echo "2.0 or 2.2 series"
fi
echo -n "             Build Docs:     "
if test x$enable_gtk_doc = xyes; then
    echo "yes"
else
    echo "no"
fi
echo
echo
])

AC_CONFIG_FILES([Makefile phat/Makefile demos/Makefile docs/Makefile phat.pc phat.spec])
AM_CONFIG_HEADER([phat/config.h])
AC_OUTPUT