+2006-03-11 Bruno Haible <bruno@clisp.org>
+
+ * lang-c: Put the -I flags before ${CFLAGS} ${CPPFLAGS}.
+ * lang-c++: Likewise.
+ * lang-objc: Likewise.
+
2006-03-11 Bruno Haible <bruno@clisp.org>
* format-python-1: Hide xgettext warnings.
top_builddir=..
tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${LTLIBINTL} \
+# Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h
+# is found in the build directory, regardless of -I options present in
+# ${CFLAGS} or ${CPPFLAGS}.
+${LIBTOOL} --quiet --mode=link ${CC} -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c ${LTLIBINTL} \
|| exit 1
tmpfiles="$tmpfiles prog.pot"
tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
# Compile in two steps from .cc to .o and from .o to 'prog'. This way,
# relinking is faster because doesn't need to redo the first step.
-${CXX} ${CXXFLAGS} ${CPPFLAGS} -c prog.cc -I.. -I../../gettext-runtime/libasprintf -I$top_srcdir/lib -I../intl \
+# Put the -I flags before ${CXXFLAGS} ${CPPFLAGS}, to make sure that libintl.h
+# is found in the build directory, regardless of -I options present in
+# ${CXXFLAGS} or ${CPPFLAGS}.
+${CXX} -I.. -I../../gettext-runtime/libasprintf -I$top_srcdir/lib -I../intl ${CXXFLAGS} ${CPPFLAGS} -c prog.cc \
|| exit 1
${LIBTOOL} --quiet --mode=link ${CXX} ${CXXFLAGS} ${LDFLAGS} -o prog prog.${OBJEXT} ../../gettext-runtime/libasprintf/libasprintf.la ../lib/libgettextlib.la ${LTLIBINTL} \
|| exit 1
top_builddir=..
tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${LTLIBINTL} \
+# Put the -I flags before ${CFLAGS} ${CPPFLAGS}, to make sure that libintl.h
+# is found in the build directory, regardless of -I options present in
+# ${CFLAGS} or ${CPPFLAGS}.
+${LIBTOOL} --quiet --mode=link ${CC} -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m ${LTLIBINTL} \
|| exit 1
tmpfiles="$tmpfiles prog.pot"