]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - Makefile.am
Suppress bogus free-nonheap-object warning in iniparse.cc
[cygwin-apps/setup.git] / Makefile.am
index 2a2c4fac69d13b0a52217675f14f785ec68db402..bf8b52ec8ea42e5ff9d4f248fe1391fa662f1688 100644 (file)
@@ -1,7 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 #
-# $Id$
-#
 # Copyright (c) 2000, Red Hat, Inc.
 # Copyright (c) 2002, Robert Collins
 #
@@ -21,101 +19,87 @@ SUBDIRS := @subdirs@ tests
 
 # We would like to use -Winline for C++ as well, but some STL code triggers
 # this warning. (Bug verified present in gcc-3.3)
-# -Wno-uninitialized added to deal with g++ 3.4.4's spurious STL warnings
-# (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22207)
-BASECXXFLAGS = -Wall -Wno-uninitialized -Wpointer-arith -Wcomments \
-               -Wcast-align -Wwrite-strings
-AM_CXXFLAGS = -Werror $(BASECXXFLAGS)
-AM_CFLAGS = $(AM_CXXFLAGS) -Wmissing-declarations -Winline \
-            -Wstrict-prototypes -Wmissing-prototypes
+BASECXXFLAGS = -Werror -Wall -Wpointer-arith -Wcomments \
+              -Wcast-align -Wwrite-strings -fno-builtin-sscanf \
+              -Wno-attributes
+AM_CXXFLAGS = $(BASECXXFLAGS) -std=gnu++11 ${$(*F)_CXXFLAGS}
+AM_CFLAGS = $(BASECXXFLAGS) -Wmissing-declarations -Winline \
+           -Wstrict-prototypes -Wmissing-prototypes
 AM_YFLAGS = -d
 AM_LFLAGS = -8
 WINDRES = @WINDRES@
-AM_CPPFLAGS = -DLZMA_API_STATIC -I$(srcdir)/libgetopt++/include
+AM_CPPFLAGS = -D__USE_MINGW_ANSI_STDIO=1 -DLZMA_API_STATIC\
+              -I$(srcdir)/libgetopt++/include \
+              $(ZLIB_CFLAGS) $(LZMA_CFLAGS) $(ZSTD_CFLAGS) $(LIBCRYPT_CFLAGS) $(LIBSOLV_CFLAGS)
 
-noinst_PROGRAMS = setup @INILINT@
+inilex_CXXFLAGS:=-Wno-sign-compare
+iniparse_CXXFLAGS:=-Wno-free-nonheap-object
 
-EXTRA_PROGRAMS = inilint
-## noinst_PROGRAMS +=inilint
+noinst_PROGRAMS = @SETUP@$(EXEEXT) inilint
 
 EXTRA_DIST = \
        CHANGES \
        CONTRIBUTORS \
        COPYING \
        bootstrap.sh \
-       check-na.bmp \
-       check-no.bmp \
-       check-yes.bmp \
-       choose-rtarrow.bmp \
-       choose-spin.bmp \
        cygwin.ico \
-       doconfigure \
-       libmd5-rfc/README \
-       libmd5-rfc/md5main.c \
+       cygwin-setup.ico \
+       cygwin-terminal.ico \
        setup.exe.manifest \
-       tree-minus.bmp \
-       tree-plus.bmp
+       tree-minus.ico \
+       tree-plus.ico
 
-# iniparse.h is generated from iniparse.yy via bison -d, so it needs to be
+# iniparse.hh is generated from iniparse.yy via bison -d, so it needs to be
 # included here for proper tracking (but not iniparse.cc, since automake
 # knows about that already)
 BUILT_SOURCES = \
        setup_version.c \
-       iniparse.h
+       iniparse.hh
 
 CLEANFILES = setup_version.c
 
-if MINGWTARGET
-inilint_extras = \
-       autoload.c \
-       mklink2.cc
-else
-inilint_extras =
-endif
-
 inilint_LDADD = \
-       libinilex.a libgetopt++/libgetopt++.la
+       libgetopt++/libgetopt++.la \
+       -lntdll -luuid
+
 inilint_SOURCES = \
        filemanip.cc \
        filemanip.h \
-       find.cc \
-       find.h \
-       FindVisitor.cc \
-       FindVisitor.h \
+       CliParseFeedback.cc \
+       CliParseFeedback.h \
        LogSingleton.cc \
        LogSingleton.h \
        IniDBBuilder.h \
        inilintmain.cc \
+       inilex.ll \
        iniparse.yy \
-       IniParseFeedback.cc \
-       IniParseFeedback.h \
-       io_stream.h \
        io_stream.cc \
-       io_stream_file.h \
+       io_stream.h \
        io_stream_file.cc \
-       IOStreamProvider.h \
+       io_stream_file.h \
        mkdir.cc \
        mkdir.h \
-       PackageSpecification.cc \
-       PackageSpecification.h \
+       mklink2.cc \
+       mklink2.h \
        PackageTrust.h \
-       csu_util/rfc1738.cc \
-       csu_util/rfc1738.h \
        String++.cc \
        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)
+       win32.cc \
+       win32.h
 
-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
-setup_SOURCES = \
+@SETUP@_LDADD = \
+       libgetopt++/libgetopt++.la \
+       $(LIBGCRYPT_LIBS) \
+       $(ZSTD_LIBS) \
+       $(LZMA_LIBS) \
+       $(BZ2_LIBS) \
+       $(ZLIB_LIBS) \
+       $(LIBSOLV_LIBS) -lregex \
+       -lshlwapi -lcomctl32 -lole32 -lpsapi -luuid -lntdll -lwininet -lws2_32 \
+       -lmingw32 -lssp
+@SETUP@_LDFLAGS = -mwindows -Wc,-static -static-libtool-libs
+@SETUP@_SOURCES = \
+       actionlist.h \
        AntiVirus.cc \
        AntiVirus.h \
        archive.cc \
@@ -123,9 +107,10 @@ setup_SOURCES = \
        archive_tar.cc \
        archive_tar.h \
        archive_tar_file.cc \
-       autoload.c \
        choose.cc \
        choose.h \
+       compactos.cc \
+       compactos.h \
        compress.cc \
        compress.h \
        compress_bz.cc \
@@ -134,6 +119,10 @@ setup_SOURCES = \
        compress_gz.h \
        compress_xz.cc \
        compress_xz.h \
+       compress_zstd.cc \
+       compress_zstd.h \
+       confirm.cc \
+       confirm.h \
        ConnectionSetting.cc \
        ConnectionSetting.h \
        ControlAdjuster.cc \
@@ -141,8 +130,6 @@ setup_SOURCES = \
        crypto.cc \
        crypto.h \
        cyg-pubkey.h \
-       cygpackage.cc \
-       cygpackage.h \
        desktop.cc \
        desktop.h \
        dialog.cc \
@@ -170,11 +157,9 @@ setup_SOURCES = \
        IniDBBuilder.h \
        IniDBBuilderPackage.cc \
        IniDBBuilderPackage.h \
+       inilex.ll \
        iniparse.yy \
-       IniParseFeedback.cc \
        IniParseFeedback.h \
-       IniParseFindVisitor.cc \
-       IniParseFindVisitor.h \
        install.cc \
        io_stream.cc \
        io_stream.h \
@@ -187,6 +172,10 @@ setup_SOURCES = \
        IOStreamProvider.h \
        KeysSetting.cc \
        KeysSetting.h \
+       libsolv.cc \
+       libsolv.h \
+       ListView.cc \
+       ListView.h \
        localdir.cc \
        localdir.h \
        LogFile.cc \
@@ -208,26 +197,20 @@ setup_SOURCES = \
        netio.h \
        nio-ie5.cc \
        nio-ie5.h \
-       nio-file.cc \
-       nio-file.h \
-       nio-ftp.cc \
-       nio-ftp.h \
-       nio-http.cc \
-       nio-http.h \
        package_db.cc \
        package_db.h \
+       package_depends.h \
+       package_depends.cc \
        package_meta.cc \
        package_meta.h \
        package_source.cc \
        package_source.h \
-       package_version.cc \
        package_version.h \
        PackageSpecification.cc \
        PackageSpecification.h \
        PackageTrust.h \
        PickCategoryLine.cc \
        PickCategoryLine.h \
-       PickLine.h \
        PickPackageLine.cc \
        PickPackageLine.h \
        PickView.cc \
@@ -237,6 +220,8 @@ setup_SOURCES = \
        postinstallresults.h \
        prereq.cc \
        prereq.h \
+       processlist.cc \
+       processlist.h \
        proppage.cc \
        proppage.h \
        propsheet.cc \
@@ -246,14 +231,12 @@ setup_SOURCES = \
        resource.h \
        root.cc \
        root.h \
-       ScanFindVisitor.cc \
-       ScanFindVisitor.h \
        script.cc \
        script.h \
        setup_version.h \
        setup_version.c \
-       simpsock.cc \
-       simpsock.h \
+       sha2.h \
+       sha2.c \
        site.cc \
        site.h \
        source.cc \
@@ -279,32 +262,80 @@ setup_SOURCES = \
        csu_util/rfc1738.cc \
        csu_util/rfc1738.h \
        csu_util/version_compare.cc \
-       csu_util/version_compare.h \
-       libmd5-rfc/md5.c \
-       libmd5-rfc/md5.h
+       csu_util/version_compare.h
 
-# autoload code does not optimize properly with gcc-4.x
-autoload.o: CFLAGS += -O0
+GITVER := $(shell cd $(srcdir) && git describe --match release_\* --abbrev=6 --dirty || echo "N/A")
+VER := $(subst release_,,$(GITVER))
+ARCH := @ARCH@
 
-VER := $(shell sed -ne 's/^\$$Revi[s]ion: *\([^ ]*\) *$$.*/\1/p' \
-               $(srcdir)/ChangeLog)
-
-setup_version.c : $(srcdir)/ChangeLog Makefile
-       (echo '#define VERSION_PREFIX "%%% setup-version"';\
-       echo 'static const char version_store[] = VERSION_PREFIX " '${VER}'";';\
-       echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp
+setup_version.c : Makefile
+       @echo "Setup version: " $(VER)
+       $(AM_V_GEN)(echo '#define VERSION_PREFIX "%%% setup-version"';\
+       echo 'static const char version_store[] = VERSION_PREFIX " '$(VER)'";';\
+       echo 'const char *setup_version = version_store + sizeof (VERSION_PREFIX);') > version.tmp && \
        mv version.tmp setup_version.c
 
+# rules for translation maintenance
+.PHONY: pot rc2po po2rc
+
+pot:
+       cd $(srcdir) && rc2po -P res/en/res.rc res.pot
+
+LINGUAS=fr
+
+rc2po:
+       cd $(srcdir) && \
+       for l in $(LINGUAS) ; do \
+               rc2po -t res/en/res.rc --charset=utf-8 res/$$l/res.rc po/$$l/ ; \
+       done
+
+po2rc:
+       cd $(srcdir) && \
+       for l in $(LINGUAS) ; do \
+               po2rc -t res/en/res.rc --charset-output=utf-8 $$(./langopts $$l) po/$$l/ res/$$l && \
+               d2u -q res/$$l/res.rc ; \
+       done
+
+# files included by res.rc
+res.o: setup.exe.manifest res/en/res.rc $(foreach l,$(LINGUAS),res/$l/res.rc)
+
 .rc.o:
-       $(WINDRES) --include-dir $(srcdir) -o $@ $<
+       $(AM_V_GEN)$(WINDRES) --codepage 65001 --include-dir $(srcdir) -o $@ $<
 
-# static const char version_store[] = VERSION_PREFIX " 2.686";
 setup-src:
-       @ver=setup-$$(sed -n 's/^static const char version_store.* VERSION_PREFIX " \([^"]*\)".*$$/\1/p' setup_version.c);\
-       cd ${srcdir};\
-       rm -f $$ver;\
-       ln -sf . $$ver;\
-       cvs status -R | sed -n "s%^ *Repository revision:.*/cvs/cygwin-apps/setup/\(.*\),v%$$ver/\1%p" |\
-       sort | tar -T - -cjf ${CURDIR}/$$ver-src.tar.bz2;\
-       echo $$ver-src.tar.bz2; exec rm -f $$ver
+       @ver=setup-$(VER);\
+       cd ${srcdir}; rm -f $$ver; ln -sf . $$ver;\
+       git ls-files | tar -T - -cJf ${CURDIR}/$$ver-src.tar.xz;\
+       echo $$ver-src.tar.xz; exec rm -f $$ver
+
+# optional: strip and compress executable
+.PHONY:        strip upx
+
+strip: all
+       $(OBJCOPY) --add-gnu-debuglink=/dev/null --only-keep-debug setup$(EXEEXT) setup.dbg
+       $(OBJCOPY) --strip-all setup$(EXEEXT)
+       $(OBJCOPY) --add-gnu-debuglink=setup.dbg setup$(EXEEXT) setup$(EXEEXT)
+
+CLEANFILES += setup.dbg
+
+upx:   strip
+       @if [ -e `which upx` ]; then\
+               upx --best --lzma setup$(EXEEXT) ;\
+       else \
+               echo "UPX doesn't seem to be installed, cannot compress setup$(EXEEXT)." ;\
+       fi
+
+release: upx
+       cp setup.dbg setup-${VER}.${ARCH}.dbg
+       cp setup${EXEEXT} setup-${VER}.${ARCH}${EXEEXT}
+
+UPLOAD_HOST=cygwin-admin@cygwin.com
+UPLOAD_PATH=/www/sourceware/htdocs/cygwin/setup
+SIGN_KEYS="--enable-dsa2 --personal-digest-preferences=sha256 -u 676041BA -u 1A698DE9E2E56300"
+
+upload: release
+       scp setup-${VER}.$(ARCH).exe setup-${VER}.$(ARCH).dbg ${UPLOAD_HOST}:${UPLOAD_PATH}
+       ssh ${UPLOAD_HOST} gpg --batch ${SIGN_KEYS} --detach-sign ${UPLOAD_PATH}/setup-${VER}.$(ARCH).exe
 
+clean-local:
+       rm -f setup*${EXEEXT} setup*.dbg
This page took 0.032642 seconds and 5 git commands to generate.