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
|
# 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.11],[linux@codehelp.co.uk])
AC_CONFIG_AUX_DIR(.)
AC_PREFIX_DEFAULT(/usr)
AC_PREREQ(2.68)
AC_CONFIG_HEADERS([config.h])
AC_GNU_SOURCE
AC_CONFIG_MACRO_DIR([m4])
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)
AM_INIT_AUTOMAKE([dist-bzip2])
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
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 gdk-pixbuf-2.0])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
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}" ])
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"
LDFLAGS="$LDFLAGS -Wl,--no-add-needed"
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
|