Blame configure.ac

Packit 6e6f77
#                                               -*- Autoconf -*-
Packit 6e6f77
# Process this file with autoconf to produce a configure script.
Packit 6e6f77
AC_PREREQ(2.59)
Packit 6e6f77
AC_INIT(icoutils, 0.32.3, frank.richter@gmail.com)
Packit 6e6f77
AC_CONFIG_MACRO_DIR([m4]) # doesn't seem to have any effect at the moment
Packit 6e6f77
AC_CONFIG_SRCDIR([icotool/icotool.h])
Packit 6e6f77
AC_CONFIG_HEADER([config.h])
Packit 6e6f77
AC_CONFIG_AUX_DIR([build-aux])
Packit 6e6f77
AM_INIT_AUTOMAKE
Packit 6e6f77
AM_MAINTAINER_MODE
Packit 6e6f77
Packit 6e6f77
# Stuff for the config.h.in file
Packit 6e6f77
AC_GNU_SOURCE
Packit 6e6f77
#AH_TEMPLATE([PKGUSERDIR], [User directory for program files])
Packit 6e6f77
Packit 6e6f77
# Checks for programs.
Packit 6e6f77
AC_PROG_CC
Packit 6e6f77
gl_EARLY
Packit 6e6f77
AC_PROG_LN_S
Packit 6e6f77
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
Packit 6e6f77
# AC_PROG_LIBTOOL
Packit 6e6f77
Packit 6e6f77
# Gnulib
Packit 6e6f77
gl_INIT
Packit 6e6f77
Packit 6e6f77
# --enable-werror option for developers.
Packit 6e6f77
AC_ARG_ENABLE([werror],
Packit 6e6f77
    [AS_HELP_STRING([--enable-werror],
Packit 6e6f77
                    [turn GCC warnings into errors (for developers)])],
Packit 6e6f77
    [case $enableval in
Packit 6e6f77
     yes|no) ;;
Packit 6e6f77
     *)      AC_MSG_ERROR([bad value $enableval for werror option]) ;;
Packit 6e6f77
     esac
Packit 6e6f77
     gcc_werror=$enableval],
Packit 6e6f77
    [gcc_werror=no]
Packit 6e6f77
)
Packit 6e6f77
if test "$gcc_werror" = "yes"; then
Packit 6e6f77
    gl_WARN_ADD([-Werror], [WERROR_CFLAGS])
Packit 6e6f77
    AC_SUBST([WERROR_CFLAGS])
Packit 6e6f77
fi
Packit 6e6f77
Packit 6e6f77
# $nw is the list of warnings we want to *disable*.  The nw warnings
Packit 6e6f77
# are complemented below.
Packit 6e6f77
nw=
Packit 6e6f77
nw="$nw -Wvla"                    # Allow variable length arrays.
Packit 6e6f77
nw="$nw -Wsuggest-attribute=pure" # Don't suggest function attributes.
Packit 6e6f77
nw="$nw -Wsuggest-attribute=const"
Packit 6e6f77
nw="$nw -Wsuggest-attribute=format"
Packit 6e6f77
nw="$nw -Wstrict-prototypes"      # Don't require prototypes for every function.
Packit 6e6f77
nw="$nw -Wmissing-prototypes"
Packit 6e6f77
nw="$nw -Wmissing-declarations"
Packit 6e6f77
nw="$nw -Wpacked"                 # Don't warn about packed structs.
Packit 6e6f77
nw="$nw -Wswitch-default"         # This warning is actively dangerous.
Packit 6e6f77
nw="$nw -Wunused-macros"          # Don't warn about defined but unused macros.
Packit 6e6f77
Packit 6e6f77
gl_MANYWARN_ALL_GCC([ws])
Packit 6e6f77
gl_MANYWARN_COMPLEMENT([ws], [$ws], $[nw])
Packit 6e6f77
for w in $ws; do
Packit 6e6f77
    gl_WARN_ADD([$w])
Packit 6e6f77
done
Packit 6e6f77
Packit 6e6f77
# Normally we disable warnings in $nw above.  However $nw only
Packit 6e6f77
# filters out exact matching warning strings from a list inside
Packit 6e6f77
# gnulib (see m4/manywarnings.m4).  So we need to explicitly list a
Packit 6e6f77
# few disabled warnings below.
Packit 6e6f77
Packit 6e6f77
# Allow unused function parameters.
Packit 6e6f77
gl_WARN_ADD([-Wno-unused-parameter])
Packit 6e6f77
Packit 6e6f77
AC_SUBST([WARN_CFLAGS])
Packit 6e6f77
Packit 6e6f77
# Gettext
Packit 6e6f77
AM_GNU_GETTEXT([external])
Packit 6e6f77
# AM_GNU_GETTEXT_VERSION(0.14.1)
Packit 6e6f77
Packit 6e6f77
# Checks for header files.
Packit 6e6f77
AC_HEADER_STDC
Packit 6e6f77
AC_HEADER_DIRENT
Packit 6e6f77
AC_HEADER_SYS_WAIT
Packit 6e6f77
AC_HEADER_TIME
Packit 6e6f77
#AC_CHECK_HEADERS([byteswap.h errno.h fcntl.h getopt.h limits.h sys/stat.h sys/time.h sys/types.h unistd.h])
Packit 6e6f77
Packit 6e6f77
# Checks for typedefs, structures, and compiler characteristics.
Packit 6e6f77
AC_C_INLINE
Packit 6e6f77
AC_C_CONST
Packit 6e6f77
AC_C_BIGENDIAN
Packit 6e6f77
#AC_TYPE_OFF_T
Packit 6e6f77
#AC_TYPE_SIZE_T
Packit 6e6f77
#AC_TYPE_MODE_T
Packit 6e6f77
AC_CHECK_TYPES([comparison_fn_t])
Packit 6e6f77
Packit 6e6f77
# Checks for library functions.
Packit 6e6f77
AC_FUNC_FORK
Packit 6e6f77
AC_CHECK_FUNCS([pow])
Packit 6e6f77
Packit 6e6f77
# Check for libpng
Packit 6e6f77
AC_CHECK_LIB(png, png_create_read_struct, [
Packit 6e6f77
AC_SUBST(PNG_LIBS, "-lpng -lz -lm")
Packit 6e6f77
], [
Packit 6e6f77
  AC_CHECK_LIB(png10, png_create_read_struct, [
Packit 6e6f77
  AC_SUBST(PNG_LIBS, "-lpng10 -lz -lm")
Packit 6e6f77
  ], [
Packit 6e6f77
    AC_CHECK_LIB(png12, png_create_read_struct, [
Packit 6e6f77
    AC_SUBST(PNG_LIBS, "-lpng12 -lz -lm")
Packit 6e6f77
    ], [
Packit 6e6f77
      AC_MSG_ERROR([cannot find required library png])
Packit 6e6f77
    ], [-lz -lm])
Packit 6e6f77
  ], [-lz -lm])
Packit 6e6f77
], [-lz -lm])
Packit 6e6f77
AC_CHECK_HEADERS([png.h libpng/png.h libpng10/png.h libpng12/png.h locale.h])
Packit 6e6f77
Packit 6e6f77
AC_CONFIG_FILES([Makefile
Packit 6e6f77
		 icoutils.spec
Packit 6e6f77
		 po/Makefile.in
Packit 6e6f77
		 lib/Makefile
Packit 6e6f77
		 common/Makefile
Packit 6e6f77
		 icotool/Makefile
Packit 6e6f77
		 wrestool/Makefile
Packit 6e6f77
		 extresso/Makefile])
Packit 6e6f77
AC_CONFIG_FILES([extresso/extresso], [chmod +x extresso/extresso])
Packit 6e6f77
AC_CONFIG_FILES([extresso/genresscript], [chmod +x extresso/genresscript])
Packit 6e6f77
AC_OUTPUT