Browse Source

Autofoo tweaks.

- Add AM_SILENT_RULES
- Add AC_USE_SYSTEM_EXTENSIONS
- Add EC_C_WARNINGS (gcc warning stuff)
- Add compile to MAINTAINERCLEANFILES
master
Kim Woelders 5 years ago
parent
commit
bdcb65bfce
  1. 7
      Makefile.am
  2. 7
      configure.ac
  3. 29
      m4/ec_warnflags.m4

7
Makefile.am

@ -1,6 +1,9 @@
AUTOMAKE_OPTIONS = foreign
MAINTAINERCLEANFILES = aclocal.m4 config.* configure depcomp install-sh missing \
ACLOCAL_AMFLAGS = -I m4
MAINTAINERCLEANFILES = aclocal.m4 config.* compile configure depcomp \
install-sh missing \
Makefile.in \
*~
@ -8,6 +11,6 @@ bin_PROGRAMS = e16keyedit
e16keyedit_SOURCES = ipc.c menus.c viewer.c e16keyedit.h
CPPFLAGS = -D DATADIR=\"$(datadir)\" $(GTK_CFLAGS)
CPPFLAGS = -D DATADIR=\"$(datadir)\" $(GTK_CFLAGS) $(CFLAGS_WARNINGS)
LDADD = $(GTK_LIBS) $(X_LIBS) -lX11

7
configure.ac

@ -5,9 +5,14 @@ m4_define([rpm_revision], m4_ifdef([pkg_revision], ["0.%(date '+%y%m%d')"], [1])
AC_INIT([e16-keyedit], [pkg_version], [enlightenment-devel@lists.sourceforge.net])
AM_INIT_AUTOMAKE([foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST(E_RPM_REVISION, [rpm_revision])
AC_USE_SYSTEM_EXTENSIONS
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
@ -43,6 +48,8 @@ AC_PATH_X
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)
EC_C_WARNINGS()
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES(Makefile e16-keyedit.spec)
AC_OUTPUT

29
m4/ec_warnflags.m4

@ -0,0 +1,29 @@
dnl Copyright (C) 2008 Kim Woelders
dnl This code is public domain and can be freely used or copied.
dnl Macro to set compiler warning flags in CFLAGS_WARNINGS
dnl Provides configure argument --enable-werror to stop compilation on warnings
dnl Usage: EC_C_WARNINGS([LANG])
dnl Set LANG to 'cpp' when compiling for C++
AC_DEFUN([EC_C_WARNINGS], [
define(ec_c_compile_cpp, ifelse([$1], [cpp], [yes], [no]))
AC_ARG_ENABLE(werror,
[ --enable-werror treat compiler warnings as errors @<:@default=no@:>@],,
enable_werror=no)
if test "x$GCC" = "xyes"; then
CFLAGS_WARNINGS="-W -Wall -Waggregate-return -Wcast-align -Wpointer-arith -Wshadow -Wwrite-strings"
ifelse(ec_c_compile_cpp, no, [
CFLAGS_WARNINGS="$CFLAGS_WARNINGS -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes"
],)
if test "x$enable_werror" = "xyes"; then
CFLAGS_WARNINGS="$CFLAGS_WARNINGS -Werror"
fi
fi
AC_SUBST(CFLAGS_WARNINGS)
])
Loading…
Cancel
Save