Permalink
Browse files

geanypy: check for C compiler flags before using them

Check for custom C compiler flags and only used them if available, not
to break build on a compiler that don't understand them.
  • Loading branch information...
1 parent 5b109ee commit 1c2cb01bf37527ab0084cdfa97f6d52fc8e76331 @b4n b4n committed Apr 13, 2014
Showing with 8 additions and 1 deletion.
  1. +7 −0 build/geanypy.m4
  2. +1 −1 geanypy/src/Makefile.am
View
@@ -17,6 +17,13 @@ AC_DEFUN([GP_CHECK_GEANYPY],
AC_DEFINE_UNQUOTED([GEANYPY_PYTHON_LIBRARY],
["$PYTHON_LIBRARY"],
[Location of Python library to dlopen()])
+
+ dnl check for C flags we wish to use
+ GEANYPY_CFLAGS=
+ for flag in -fno-strict-aliasing -Wno-write-strings; do
+ GP_CHECK_CFLAG([$flag], [GEANYPY_CFLAGS="${GEANYPY_CFLAGS} $flag"])
+ done
+ AC_SUBST([GEANYPY_CFLAGS])
])
GP_COMMIT_PLUGIN_STATUS([Geanypy])
AC_CONFIG_FILES([
View
@@ -8,7 +8,7 @@ geanypy_la_CPPFLAGS = @GEANY_CFLAGS@ @PYGTK_CFLAGS@ @PYTHON_CPPFLAGS@ \
-DGEANYPY_PYTHON_DIR="\"$(libdir)/geany/geanypy\"" \
-DGEANYPY_PLUGIN_DIR="\"$(datadir)/geany/geanypy/plugins\"" \
-UHAVE_CONFIG_H
-geanypy_la_CFLAGS = -fno-strict-aliasing -Wno-write-strings
+geanypy_la_CFLAGS = @GEANYPY_CFLAGS@
geanypy_la_LIBADD = @GEANY_LIBS@ @PYGTK_LIBS@ @PYTHON_LDFLAGS@ \
@PYTHON_EXTRA_LIBS@ @PYTHON_EXTRA_LDFLAGS@
geanypy_la_SOURCES = geanypy-app.c \

0 comments on commit 1c2cb01

Please sign in to comment.