SF.net SVN: geany-plugins:[1990] trunk/geany-plugins
colombanw at users.sourceforge.net
colombanw at xxxxx
Mon Mar 14 19:11:16 UTC 2011
Revision: 1990
http://geany-plugins.svn.sourceforge.net/geany-plugins/?rev=1990&view=rev
Author: colombanw
Date: 2011-03-14 19:11:16 +0000 (Mon, 14 Mar 2011)
Log Message:
-----------
Add a default set of CFLAGS to the Autotools build system
Modified Paths:
--------------
trunk/geany-plugins/build/vars.build.mk
trunk/geany-plugins/configure.ac
Added Paths:
-----------
trunk/geany-plugins/build/cflags.m4
Added: trunk/geany-plugins/build/cflags.m4
===================================================================
--- trunk/geany-plugins/build/cflags.m4 (rev 0)
+++ trunk/geany-plugins/build/cflags.m4 2011-03-14 19:11:16 UTC (rev 1990)
@@ -0,0 +1,50 @@
+dnl _GP_CHECK_CFLAG_(FLAG, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl Checks whether the C compiler understands FLAG
+AC_DEFUN([_GP_CHECK_CFLAG_],
+[
+ gp_check_cflag_CFLAGS="$CFLAGS"
+ CFLAGS="$1"
+ AC_LANG([C])
+ AC_MSG_CHECKING([whether the C compiler understands $CFLAGS])
+ AC_COMPILE_IFELSE([
+int main(void) {
+ return 0;
+}
+],
+ [AC_MSG_RESULT([yes])
+ $2],
+ [AC_MSG_RESULT([no])
+ $3])
+ CFLAGS="$gp_check_cflag_CFLAGS"
+])
+
+dnl GP_CHECK_CFLAGS
+dnl Checks for default Geany-Plugis CFLAGS and defines GP_CFLAGS
+AC_DEFUN([GP_CHECK_CFLAGS],
+[
+ AC_ARG_ENABLE([extra-c-warnings],
+ AS_HELP_STRING([--disable-extra-c-warnings],
+ [Disable extra C Compiler warnings]),
+ [enable_extra_c_warnings=$enableval],
+ [enable_extra_c_warnings=yes])
+
+ GP_CFLAGS=
+ AS_IF([test "x$enable_extra_c_warnings" != xno],
+ [
+ enable_extra_c_warnings=yes
+ for flag in -Wall \
+ -Wimplicit-function-declaration \
+ -Wmissing-parameter-type \
+ -Wold-style-declaration \
+ -Wpointer-arith \
+ -Wshadow \
+ -Wundef \
+ -Wwrite-strings
+ do
+ _GP_CHECK_CFLAG_([$flag], [AS_VAR_APPEND([GP_CFLAGS], [" $flag"])])
+ done
+ ])
+ AC_SUBST([GP_CFLAGS])
+ GP_STATUS_BUILD_FEATURE_ADD([Extra C compiler warnings],
+ [$enable_extra_c_warnings])
+])
Modified: trunk/geany-plugins/build/vars.build.mk
===================================================================
--- trunk/geany-plugins/build/vars.build.mk 2011-03-14 19:10:52 UTC (rev 1989)
+++ trunk/geany-plugins/build/vars.build.mk 2011-03-14 19:11:16 UTC (rev 1990)
@@ -6,7 +6,8 @@
-DPKGDATADIR=\""$(pkgdatadir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DPKGLIBDIR=\""$(pkglibdir)"\" \
- $(GEANY_CFLAGS)
+ $(GEANY_CFLAGS) \
+ $(GP_CFLAGS)
AM_LDFLAGS = -module -avoid-version
Modified: trunk/geany-plugins/configure.ac
===================================================================
--- trunk/geany-plugins/configure.ac 2011-03-14 19:10:52 UTC (rev 1989)
+++ trunk/geany-plugins/configure.ac 2011-03-14 19:11:16 UTC (rev 1990)
@@ -21,6 +21,7 @@
GP_CHECK_GEANY(0.20)
GP_CHECK_UNITTESTS(0.9.4)
GP_CHECK_CPPCHECK
+GP_CHECK_CFLAGS
dnl plugin checks
GP_CHECK_ADDONS
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Plugins-Commits
mailing list