File: configure.in

package info (click to toggle)
deb-gview 0.2.2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,020 kB
  • ctags: 186
  • sloc: sh: 9,232; ansic: 2,481; makefile: 69
file content (164 lines) | stat: -rw-r--r-- 4,876 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# This is free software, licensed under the GNU Public License V2.
# See the file COPYING for details.

dnl ******************************
dnl Initialise
dnl ******************************

AC_INIT([deb-gview],[0.2.2],[linux@codehelp.co.uk])

AC_PREFIX_DEFAULT(/usr)
AC_PREREQ(2.61)
AC_CONFIG_HEADERS([config.h])
AC_GNU_SOURCE

VERSION=AC_PACKAGE_VERSION
PACKAGE=AC_PACKAGE_NAME
REPORT_BUG="linux@codehelp.co.uk"
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)

AM_PROG_LIBTOOL
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AC_ISC_POSIX
AC_PROG_CC

AC_HEADER_STDC
AC_C_CONST
IT_PROG_INTLTOOL
INTLTOOLIZE=${INTLTOOLIZE:-intltoolize}

AC_CHECK_FUNCS([ memchr strchr strtoul ])

AC_CHECK_HEADERS([ fcntl.h libintl.h archive.h libintl.h \
    stdlib.h unistd.h ar.h archive_entry.h string.h ])

AC_CHECK_LIB([archive], [archive_read_open],, [AC_MSG_ERROR([
  libarchive is required to build deb-gview. Please
  install the libarchive-dev package.
])])

AC_CHECK_LIB([z], [gzopen],, [AC_MSG_ERROR([
    zlib or zlib1g is required to build deb-gview. Please
    install the zlib1-dev or zlib1g-dev package.
])])

AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T

GETTEXT_PACKAGE="deb-gview"
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [deb-gview])

dnl Languages which your application supports
AM_GLIB_GNU_GETTEXT

PKG_CHECK_MODULES(PACKAGE, [gtk+-2.0 glib-2.0 >= 2.16.1 gio-2.0])
AC_SUBST(PACKAGE_CFLAGS)
dnl Just pick the libs we need from the pkgconfig line.
PACKAGE_LIBS="-lgtk-x11-2.0 -latk-1.0 -lgobject-2.0 -lglib-2.0 -lgio-2.0"
AC_SUBST(PACKAGE_LIBS)

PKG_CHECK_MODULES(GNOME, [libgnomeui-2.0])
AC_CHECK_LIB(gnomeui-2, gnome_program_init, ,
  [AC_MSG_ERROR([libgnomeui2 found but missing gnome_program_init])])
AC_SUBST(GNOME_CFLAGS)
GNOME_LIBS="-lgnomeui-2"
AC_SUBST(GNOME_LIBS)

PACKAGE_DATA_DIR="$prefix/share/$PACKAGE"
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "$PACKAGE_DATA_DIR",
    [package data directory for gnome])
AC_SUBST(PACKAGE_DATA_DIR)
PACKAGE_MENU_DIR="$prefix/share/$PACKAGE"
AC_DEFINE_UNQUOTED(PACKAGE_MENU_DIR, "$PACKAGE_MENU_DIR",
    [package menu directory for gnome])
AC_SUBST(PACKAGE_MENU_DIR)
PACKAGE_PIXMAP_DIR="$prefix/share/pixmaps"
AC_DEFINE_UNQUOTED(PACKAGE_PIXMAP_DIR, "$PACKAGE_PIXMAP_DIR",
    [package pixmap directory for gnome])
AC_SUBST(PACKAGE_PIXMAP_DIR)

dnl *************************************
dnl Extra warnings
dnl *************************************
AC_MSG_CHECKING(what extra warning flags to pass to the C compiler)
if test ${GCC}x = yesx; then
  warnFLAGS=
  CFLAGS="${CFLAGS} -g2 -Wall"
  AC_ARG_ENABLE(error-on-warning,
        [  --disable-error-on-warning
                          disable treating compile warnings as errors],
        [case "${enableval}" in
        yes) warnFLAGS="${warnFLAGS} -Werror" ;;
        no)  ;;
        *) AC_MSG_ERROR(bad value ${enableval} for --enable-error-on-warning) ;;
        esac],
        [  warnFLAGS="${warnFLAGS} -Werror" ])
  GCC_VERSION=`${CC} -dumpversion`
  if test `echo ${GCC_VERSION} | cut -d. -f1` -ge 3; then
     # This is gcc >= 3.x.x
     if test `echo ${GCC_VERSION} | cut -d. -f2` -ge 4; then
        # This is gcc >= 3.4.x
        warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement"
     else if test `echo ${GCC_VERSION} | cut -d. -f1` -ge 4; then
        # This is gcc == 4.x.x
        warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement -Wno-pointer-sign"
        fi
     fi
  fi
  CFLAGS="${CFLAGS} ${warnFLAGS}"
else
  warnFLAGS=
fi
AC_MSG_RESULT($warnFLAGS)
AC_SUBST(warnFLAGS)

set_compile_warnings=no

AC_ARG_ENABLE(compile-warnings,
              [  --enable-compile-warnings
                          Enable verbose compiler warnings],
              set_compile_warnings=yes)

if test "$GCC" = "yes" -a "$set_compile_warnings" != "no"; then
        warnFLAGS="$warnFLAGS -Wcast-align -Wsign-compare \
 -Wmissing-prototypes -Wmissing-declarations -Werror \
 -Wmissing-include-dirs -Winline -Wnested-externs \
 -Wpointer-arith -Wmissing-field-initializers"
fi

case "$host" in
    *bsd*)
        AC_DEFINE(TTYPrompt, "/dev/cua[<0..n>]", [Define verbose tty device])
    ;;
    *)
        AC_DEFINE(TTYPrompt, "/dev/tty[<0..n>]", [Define verbose tty device])
    ;;
esac

dnl *************************************
dnl Promote warnings to errors
dnl *************************************
dnl (already done) enable_werror=no

AC_ARG_ENABLE(compile-werror,
          [  --enable-compile-werror
                          Causes all warnings to be treated as errors in GCC],
          enable_werror=yes)
if test "x$GCC" = "xyes" -a "x$enable_wall" = "xyes"; then
    CFLAGS="$CFLAGS -Wall -Werror -Wmissing-prototypes"
    CXXFLAGS="$CXXFLAGS -Wall -Werror"
fi

AC_CONFIG_FILES([
    Makefile
    po/Makefile.in
    src/Makefile
    desktop/deb-gview.desktop.in
    desktop/Makefile
])
AC_OUTPUT