This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH] setup: build enhancements
- From: "Yaakov (Cygwin/X)" <yselkowitz at users dot sourceforge dot net>
- To: cygwin-apps <cygwin-apps at cygwin dot com>
- Date: Tue, 10 Aug 2010 21:36:58 -0500
- Subject: [PATCH] setup: build enhancements
This patch for setup contains a few build-system enhancements:
* Bail out of configure if prereqs are missing. I decided to check for
headers instead of libs to avoid possible stdcall issues with the
latter. I'm not sure whether this will make such a difference with
"gcc-3 -mno-cygwin" (which IIUC is susceptible to find the native
versions' headers in /usr/include instead), but it will when proper
cross-compilers are out.
* Make doconfigure re-bootstrap if configure.in is newer than configure.
Otherwise once you configure, make will essentially autoreconf and run
configure a second time.
* Remove the special inilex.ll handling by solving the warning which
made it necessary. Probably requires a new-ish flex. If future
versions of flex or gcc don't get along with -Werror and can't be fixed
with flex %option's, an easier (and slightly faster) fix would be to
(similar to autoload.c handling):
inilex.o: CXXFLAGS += -Wno-unused-function
With the flex %option, inilex.o compiles with both gcc-mingw-3.4.4-999
and my mingw-gcc-4.5.1.
Yaakov
2010-08-10 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* configure.in: Check for prerequisites' headers.
* doconfigure: Run bootstrap.sh if configure.in is newer than
configure.
* Makefile.am: Remove libinilex.a library, instead...
(inilint_SOURCES): Add inilex.ll. (setup_SOURCES): Ditto.
* inilex.ll: Use option nounput to avoid "defined but not used"
warning from yyunput().
Index: configure.in
===================================================================
RCS file: /cvs/cygwin-apps/setup/configure.in,v
retrieving revision 2.25
diff -u -r2.25 configure.in
--- configure.in 30 Mar 2010 23:55:15 -0000 2.25
+++ configure.in 10 Aug 2010 21:40:12 -0000
@@ -70,6 +70,15 @@
string \
string.h )
+AC_CHECK_HEADER(zlib.h, , missing_deps="$missing_deps zlib")
+AC_CHECK_HEADER(bzlib.h, , missing_deps="$missing_deps libbz2")
+AC_CHECK_HEADER(lzma.h, , missing_deps="$missing_deps liblzma")
+AC_CHECK_HEADER(gcrypt.h, , missing_deps="$missing_deps libgcrypt")
+
+if test -n "$missing_deps"; then
+ AC_MSG_ERROR([missing prerequisites: $missing_deps])
+fi
+
prefix=`pwd`/inst; mkdir -p "$prefix"
exec_prefix=$prefix
ac_configure_args="$ac_configure_args --disable-shared"
Index: doconfigure
===================================================================
RCS file: /cvs/cygwin-apps/setup/doconfigure,v
retrieving revision 2.2
diff -u -r2.2 doconfigure
--- doconfigure 30 Mar 2010 23:55:15 -0000 2.2
+++ doconfigure 11 Aug 2010 01:10:57 -0000
@@ -4,7 +4,7 @@
DIR=`dirname "$0"`
# Autotool Bootstrap
-if [ ! -f "$DIR/configure" ]; then
+if [ ! -f "$DIR/configure" ] || [ "$DIR/configure.in" -nt "$DIR/configure" ]; then
echo -e "\033[32;1mRunning $DIR/bootstrap.sh\033[0m"
( cd "$DIR" && ./bootstrap.sh )
fi
Index: Makefile.am
===================================================================
RCS file: /cvs/cygwin-apps/setup/Makefile.am,v
retrieving revision 2.84
diff -u -r2.84 Makefile.am
--- Makefile.am 10 Aug 2010 20:38:00 -0000 2.84
+++ Makefile.am 11 Aug 2010 01:14:08 -0000
@@ -74,7 +74,7 @@
endif
inilint_LDADD = \
- libinilex.a libgetopt++/libgetopt++.la
+ libgetopt++/libgetopt++.la
inilint_SOURCES = \
filemanip.cc \
filemanip.h \
@@ -86,6 +86,7 @@
LogSingleton.h \
IniDBBuilder.h \
inilintmain.cc \
+ inilex.ll \
iniparse.yy \
IniParseFeedback.cc \
IniParseFeedback.h \
@@ -105,13 +106,7 @@
String++.h \
$(inilint_extras)
-# workaround to allow omitting -Werror on inilex.cc.
-noinst_LIBRARIES = libinilex.a
-libinilex_a_SOURCES = inilex.ll
-libinilex_a_CXXFLAGS = $(BASECXXFLAGS)
-
setup_LDADD = \
- libinilex.a \
libgetopt++/libgetopt++.la -lgcrypt -lgpg-error \
-lshlwapi -lcomctl32 -lole32 -lwsock32 -lnetapi32 -luuid -llzma -lbz2 -lz
setup_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
@@ -170,6 +165,7 @@
IniDBBuilder.h \
IniDBBuilderPackage.cc \
IniDBBuilderPackage.h \
+ inilex.ll \
iniparse.yy \
IniParseFeedback.cc \
IniParseFeedback.h \
Index: inilex.ll
===================================================================
RCS file: /cvs/cygwin-apps/setup/inilex.ll,v
retrieving revision 1.3
diff -u -r1.3 inilex.ll
--- inilex.ll 30 Jul 2010 14:02:34 -0000 1.3
+++ inilex.ll 11 Aug 2010 01:14:08 -0000
@@ -35,6 +35,7 @@
%}
/*%option debug */
+%option nounput
%option noyywrap
%option yylineno
%option never-interactive