diff --git a/configure.ac b/configure.ac index e8a84c15..02d03d8c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,443 +1,443 @@ # configure.ac for GPG4Win # Copyright (C) 2005, 2006, 2007, 2008, 2010 g10 Code GmbH # # This file is part of GPG4Win # # GPG4Win is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # GPG4Win is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # (Process this file with autoconf to produce a configure script.) AC_PREREQ(2.59) min_automake_version="1.9.3" # To build a release you need to create a tag with the version number # (git tag -s gpg4win-2.x.y) and run "./autogen.sh --force". Please # bump the version number immediately after the release and do another # commit and push so that the git magic is able to work. m4_define([my_version], [3.1.6]) # Below is m4 magic to extract and compute the git revision number, # the decimalized short revision number, a beta version string and a # flag indicating a development version (my_isgit). The latter works # by requiring the final tag in the repository. m4_define([git_revision], m4_esyscmd([git rev-parse --short HEAD | tr -d '\n\r'])) m4_define([git_revision_dec], m4_esyscmd_s([echo $((0x$(echo ]git_revision[|head -c 4)))])) m4_define([git_betastring], m4_esyscmd_s([git describe --tags --match 'gpg4win-[0-9].*.*[0-9]' \ --long | awk -F- '$3!=0{print"-beta"$3}'])) m4_define([my_isgit],m4_if(git_betastring,[],[no],[yes])) m4_define([my_full_version],[my_version[]git_betastring]) AC_INIT([gpg4win],[my_full_version],[gpg4win-devel@wald.intevation.org]) # Remember to update these version numbers also in the NEWS file. MANUALVERSION_EINSTEIGER="2.0.2" MANUALDATE_EINSTEIGER="30. Mai 2006" MANUALVERSION_DURCHBLICKER="2.0.2" MANUALDATE_DURCHBLICKER="30. Mai 2006" MANUALVERSION_NOVICES="1.0.0" MANUALDATE_NOVICES="Nov. 30, 2006" MANUALVERSION_ADVANCED="0.0.0" MANUALDATE_ADVANCED="Nov. 30, 2006" COMPENDIUM_VERSION_DE="4.0.1" COMPENDIUM_DATE_DE="3. April 2018" COMPENDIUMINPROGRESS_DE="zuletzt geringfügig korrigiert am 3. April 2018" COMPENDIUM_VERSION_EN="3.0.0" COMPENDIUM_DATE_EN="30th November 2016" COMPENDIUMINPROGRESS_EN="last minor changes from 30th November 2016" MANUALINPROGRESS_DE=m4_if(my_isgit,[yes],["~und evtl. seitdem weiter bearbeitet"]) MANUALINPROGRESS_EN=m4_if(my_isgit,[yes],["~and may have been further edited"]) PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION GIT_REVISION=git_revision GIT_REVISION_DEC=git_revision_dec AC_CONFIG_SRCDIR(src/config.nsi.in) AC_CONFIG_MACRO_DIR(m4) AM_INIT_AUTOMAKE([tar-ustar]) AM_MAINTAINER_MODE AC_CANONICAL_HOST AM_CONFIG_HEADER(config.h) # Language support AM_PO_SUBDIRS AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_SUBST(MANUALVERSION_EINSTEIGER) AC_SUBST(MANUALDATE_EINSTEIGER) AC_SUBST(MANUALVERSION_DURCHBLICKER) AC_SUBST(MANUALDATE_DURCHBLICKER) AC_SUBST(MANUALINPROGRESS_DE) AC_SUBST(MANUALVERSION_NOVICES) AC_SUBST(MANUALDATE_NOVICES) AC_SUBST(MANUALVERSION_ADVANCED) AC_SUBST(MANUALDATE_ADVANCED) AC_SUBST(MANUALINPROGRESS_EN) AC_SUBST(COMPENDIUM_VERSION_DE) AC_SUBST(COMPENDIUM_DATE_DE) AC_SUBST(COMPENDIUMINPROGRESS_DE) AC_SUBST(COMPENDIUM_VERSION_EN) AC_SUBST(COMPENDIUM_DATE_EN) AC_SUBST(COMPENDIUMINPROGRESS_EN) if echo "${PACKAGE_VERSION}" | egrep 'svn|rc|beta|git' >/dev/null ; then IS_BETA_BUILD=yes else IS_BETA_BUILD=no fi AC_SUBST(IS_BETA_BUILD) # Generate extended version information. Note, that for NSIS use we # must not translate the dots to commas in the BUILD_FILEVERSION. BUILD_TIMESTAMP=`date --iso-8601=minutes` BUILD_ISODATE=`date --iso-8601` changequote(,)dnl BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'` changequote([,])dnl BUILD_FILEVERSION="${BUILD_FILEVERSION}${GIT_REVISION_DEC}" AC_SUBST(BUILD_TIMESTAMP) AC_SUBST(BUILD_ISODATE) AC_SUBST(BUILD_FILEVERSION) # To test the manuals using an actual web server, the preview target # may be used in doc/manuals. The default is my (wk) test environment # but may be overriden using another preview variable. PREVIEWHOST is # expected to be the target for an rsync command. if test -z "$PREVIEWHOST" ; then PREVIEWHOST="vigenere:/var/www/all/preview.gpg4win.org/htdocs/" fi AC_SUBST(PREVIEWHOST) # The final release is copied to an archive server. The default # location may be changed by setting the RELEASEHOST envvar. if test -z "$RELEASEHOST" ; then RELEASEHOST="vigenere:tarballs/gpg4win" if test "${IS_BETA_BUILD}" = yes ; then RELEASEHOST="${RELEASEHOST}/Beta" fi fi AC_SUBST(RELEASEHOST) # Substitutions to set generated files in a Emacs buffer to read-only. AC_SUBST(emacs_local_vars_begin, ['Local Variables:']) AC_SUBST(emacs_local_vars_read_only, ['buffer-read-only: t']) AC_SUBST(emacs_local_vars_end, ['End:']) # For development of this package it is useful to build without # creating the source installer (takes a long time). This option may # be used to suppress creation of the source installer. AC_ARG_ENABLE(source-installer, AC_HELP_STRING([--disable-source-installer], [Do not create the Source installer]), build_source_installer=$enableval, build_source_installer=yes) AM_CONDITIONAL(BUILD_SOURCE_INSTALLER, test "$build_source_installer" = yes) # You can build a light version of the installer in addition to the # regular version. This one does not contain the manuals. AC_ARG_ENABLE(light-installer, AC_HELP_STRING([--disable-light-installer], [Do not create the light version of the installer]), build_light_installer=$enableval, build_light_installer=no) AM_CONDITIONAL(BUILD_LIGHT_INSTALLER, test "$build_light_installer" = yes) # You can build a vanilla version of the installer, featuring only # GnuPG, a pinentry and GPGME, in addition to the regular version. # This one does not contain the manuals. AC_ARG_ENABLE(vanilla-installer, AC_HELP_STRING([--disable-vanilla-installer], [Do not create the vanilla version of the installer]), build_vanilla_installer=$enableval, build_vanilla_installer=no) AM_CONDITIONAL(BUILD_VANILLA_INSTALLER, test "$build_vanilla_installer" = yes) # If you want to build only the light or vanilla installer, you may # disable building of the full installer. AC_ARG_ENABLE(full-installer, AC_HELP_STRING([--disable-full-installer], [Do not create the full version of the installer]), build_full_installer=$enableval, build_full_installer=yes) AM_CONDITIONAL(BUILD_FULL_INSTALLER, test "$build_full_installer" = yes) # For development it is often faster to build without manuals. AC_ARG_ENABLE(manuals, AC_HELP_STRING([--disable-manuals], [Do not build the manuals (for debugging)]), build_manuals=$enableval, build_manuals=yes) AM_CONDITIONAL(BUILD_MANUALS, test "$build_manuals" = yes) # Additionaly enable building gpgex for another host AC_ARG_WITH([additional-gpgex-host], AC_HELP_STRING([--with-additional-gpgex-host=HOST], [Additionaly build gpgex for this host]), [if test "$withval" = yes; then AC_MSG_FAILURE( [--with-additional-gpgex-host was given, but no host specified]) else gpgex_host=$withval fi ], gpgex_host=no) if test "$gpgex_host" != no; then GPGEX_ADD_HOST="$gpgex_host" fi AC_SUBST(GPGEX_ADD_HOST) AC_ARG_ENABLE(fast-makensis, AC_HELP_STRING([--enable-fast-makensis], [Use a less efficient compressor to speed up building]), use_fast_makensis=$enableval, use_fast_makensis=no) if test "$use_fast_makensis" = yes; then EXTRA_MAKENSIS_FLAGS="${EXTRA_MAKENSIS_FLAGS} -DDISABLE_LZMA=1" fi AC_SUBST(EXTRA_MAKENSIS_FLAGS) # Required tools. AC_PROG_CC AC_PROG_CPP AC_PROG_RANLIB AC_CHECK_TOOL(AR, ar, :) AC_CHECK_TOOLS(STRIP, strip) AC_CHECK_TOOLS(DLLTOOL, dlltool) AC_CHECK_PROGS(MAKE, make) AC_CHECK_PROGS(UNZIP, unzip) AC_CHECK_PROGS(TAR, tar) AC_CHECK_PROGS(MKDIR, mkdir) AC_CHECK_PROGS(CP, cp) AC_CHECK_PROGS(RM, rm) AC_CHECK_PROGS(STOW, stow) AC_CHECK_PROGS(MAKENSIS, makensis) AC_CHECK_PROGS(ZCAT, zcat) AC_CHECK_PROGS(TEXI2DVI, texi2dvi) AC_CHECK_PROGS(DVIPDF, dvipdf) AC_CHECK_PROGS(CONVERT, convert) AC_CHECK_PROGS(SHA1SUM, sha1sum) AC_CHECK_PROGS(MSGFMT, msgfmt) AC_CHECK_PROGS(GITLOG_TO_CHANGELOG, gitlog-to-changelog, [build-aux/gitlog-to-changelog]) AC_CHECK_PROGS(BUILD_CC, gcc cc) AC_PROG_INSTALL if test -n "$GPGEX_ADD_HOST"; then AC_CHECK_TOOLS(STRIP_EX, ${GPGEX_ADD_HOST}-strip) fi if test -z "$GPG4WIN_PARALLEL"; then JOBS=$(nproc 2>/dev/null || echo 1) GPG4WIN_PARALLEL=-j$JOBS AC_MSG_NOTICE([Using autodetected $JOBS make jobs. You can override this by setting GPG4WIN_PARALLEL.]) fi AC_SUBST(GPG4WIN_PARALLEL) missing_tools= for i in DLLTOOL MAKE UNZIP TAR MKDIR CP RM STOW MAKENSIS ZCAT TEXI2DVI \ DVIPDF CONVERT SHA1SUM MSGFMT BUILD_CC; do eval tmp='$'$i if test -z "$tmp"; then missing_tools="$missing_tools `echo $i | tr 'A-Z' 'a-z'`" fi done # Additional runtime libraries from mingw. GPG4WIN_RUNTIME_LIBRARY(libgcc_s_sjlj-1) GPG4WIN_RUNTIME_LIBRARY(libstdc++-6) GPG4WIN_RUNTIME_LIBRARY(libwinpthread-1) AC_CHECK_PROGS(GLIB_GENMARSHAL, glib-genmarshal) AC_CHECK_PROGS(GLIB_COMPILE_SCHEMAS, glib-compile-schemas) AC_CHECK_PROGS(GLIB_COMPILE_RESOURCES, glib-compile-resources) AC_CHECK_PROGS(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource) missing_opt_tools= for i in GLIB_GENMARSHAL GLIB_COMPILE_SCHEMAS GLIB_COMPILE_RESOURCES \ GDK_PIXBUF_CSOURCE; do eval tmp='$'$i if test -z "$tmp"; then missing_opt_tools="$missing_opt_tools `echo $i | tr 'A-Z' 'a-z'`" fi done # Optional tools. AC_CHECK_PROGS(WGET, wget) # Packages. gpg4win_dup_sources="" GPG4WIN_SPKG([zlib]) GPG4WIN_BPKG_GTK([pkgconfig]) GPG4WIN_SPKG([libffi], [pkgconfig]) GPG4WIN_SPKG([glib], [libiconv gettext pkgconfig libffi zlib]) GPG4WIN_BPKG_GTK_DEV([atk], [glib pkgconfig]) GPG4WIN_BPKG_GTK_DEV([pango], [glib pkgconfig]) GPG4WIN_BPKG_GTK_DEV([cairo], [glib pkgconfig]) GPG4WIN_BPKG_GTK_DEV([expat]) GPG4WIN_BPKG_GTK_DEV([freetype], [pkgconfig zlib]) GPG4WIN_BPKG_GTK_DEV([fontconfig], [pkgconfig zlib expat]) GPG4WIN_SPKG([gdk-pixbuf], [glib]) GPG4WIN_SPKG([gtk+], [libiconv gettext pkgconfig atk pango dnl glib gdk-pixbuf cairo]) GPG4WIN_SPKG([libpng], [pkgconfig]) GPG4WIN_SPKG([bzip2]) GPG4WIN_SPKG([libgpg-error], [libiconv gettext]) GPG4WIN_SPKG([libassuan], [libgpg-error w32pth]) GPG4WIN_SPKG([scute], [libgpg-error libassuan]) GPG4WIN_SPKG([pinentry], [qtbase libiconv gtk+]) -GPG4WIN_SPKG([gpgme], [libgpg-error glib qtbase]) +GPG4WIN_SPKG([gpgme], [libgpg-error libassuan glib qtbase]) GPG4WIN_SPKG([gpgol], [gpgme libassuan]) GPG4WIN_SPKG([gpgex], [libassuan]) GPG4WIN_SPKG([paperkey]) GPG4WIN_SPKG([gpa], [libiconv gettext zlib gtk+ libpng glib gpgme]) GPG4WIN_SPKG([w32pth]) GPG4WIN_SPKG([libiconv]) GPG4WIN_SPKG([gettext], [libiconv]) # Packages needed for gpgex GPG4WIN_SPKGEX([libgpg-error]) GPG4WIN_SPKGEX([libassuan], [libgpg-error]) GPG4WIN_SPKGEX([gpgex], [libassuan]) GPG4WIN_SPKGEX([gpgme], [libgpg-error libassuan]) GPG4WIN_SPKGEX([gpgol], [gpgme]) GPG4WIN_IPKG([compendium]) # The GnuPG Package. GPG4WIN_BPKG_BINSRC([gnupg-w32]) # See the script kde-l10n.sh how this package is created. GPG4WIN_BPKG_BINSRC([kde-l10n]) # Qt related stuff. GPG4WIN_SPKG([qtbase], [libpng]) GPG4WIN_SPKG([qttools], [qtbase]) GPG4WIN_SPKG([qttranslations], [qtsvg qttools qtwinextras]) GPG4WIN_SPKG([qtwinextras], [qtbase]) GPG4WIN_SPKG([qtsvg], [qtbase]) GPG4WIN_SPKG([boost], [expat zlib bzip2]) GPG4WIN_KDEPKG([breeze-icons], [extra-cmake-modules qtbase]) GPG4WIN_KDEPKG([kleopatra], [gnupg-w32 breeze-icons kxmlgui libkleo kde-l10n kitemmodels qttranslations]) GPG4WIN_KDEPKG([extra-cmake-modules]) GPG4WIN_KDEPKG([kconfig], [qtbase qttools extra-cmake-modules]) GPG4WIN_KDEPKG([ki18n], [qtbase gettext qttools extra-cmake-modules]) GPG4WIN_KDEPKG([kwidgetsaddons], [kconfig qttools qtbase]) GPG4WIN_KDEPKG([kcompletion], [kwidgetsaddons]) GPG4WIN_KDEPKG([kwindowsystem], [qtbase qtwinextras]) GPG4WIN_KDEPKG([kcoreaddons], [qtbase qttools]) GPG4WIN_KDEPKG([kcodecs], [qtbase qttools]) GPG4WIN_KDEPKG([kguiaddons], [qtbase qttools]) GPG4WIN_KDEPKG([kmime], [kcodecs]) GPG4WIN_KDEPKG([kconfigwidgets], [kwidgetsaddons kguiaddons ki18n kcodecs kconfig]) GPG4WIN_KDEPKG([kitemviews], [qtbase qttools]) GPG4WIN_KDEPKG([kitemmodels], [qtbase qttools]) GPG4WIN_KDEPKG([karchive], [qtbase qttools extra-cmake-modules]) GPG4WIN_KDEPKG([kcrash], [kwindowsystem kcoreaddons]) GPG4WIN_KDEPKG([kiconthemes], [qtsvg kconfigwidgets karchive]) GPG4WIN_KDEPKG([kxmlgui], [kiconthemes kconfigwidgets kitemviews]) GPG4WIN_KDEPKG([libkleo], [kmime kwidgetsaddons kwindowsystem kcompletion kconfig gpgme]) GPG4WIN_KDEPKG([gpg4win-tools], [libkleo gpgme]) GPG4WIN_FINALIZE # Throw an error if required tools are missing if test -n "$missing_tools"; then for i in $missing_tools; do AC_MSG_NOTICE([$i is missing]) done AC_MSG_ERROR([[ *** *** Required tools not found. Please consult the above messages *** and install them before running configure again. ***]]) fi # Throw an error if any duplicate source packages have been found if test -n "$gpg4win_dup_sources"; then tmp= for i in $gpg4win_dup_sources; do tmp="$tmp $i" done tmp2=" You might remove them with:" for i in $gpg4win_rm_candidates; do if ! grep -q $(basename $i) packages/packages.current; then tmp2="$tmp2 rm $i" fi done AC_MSG_ERROR([Packages with more that one source version:$tmp$tmp2]) fi # Finalize. AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(packages/Makefile src/Makefile po/Makefile.in) AC_CONFIG_FILES(po/build-cc) AC_CONFIG_FILES(src/config.nsi src/gpg4win.mk) AC_CONFIG_FILES(doc/Makefile) AC_CONFIG_FILES(doc/logo/Makefile) AC_CONFIG_FILES(doc/manual/Makefile doc/manual/version.tex) AC_CONFIG_FILES(src/toolchain.cmake) AC_OUTPUT # Throw a warning if optional tools are missing if test -n "$missing_opt_tools"; then AC_MSG_WARN([[ *** *** Some tools not found. They may or may not be needed depending on *** the packages you want to include. For example GLIB and GTK+ *** require certain tools; you may need to install a recent version of *** GLIB and GTK+ on the build machine to allow for cross-compiling. ***]]) for i in $missing_opt_tools; do AC_MSG_NOTICE([$i is missing]) done fi echo -n " $PACKAGE_NAME-$PACKAGE_VERSION prepared for make Revision: ${GIT_REVISION} (${GIT_REVISION_DEC}) 32bit platform: $host 64bit platform: ${GPGEX_ADD_HOST} " if test -n "$JOBS"; then echo " make jobs: ${JOBS}" else echo "" fi diff --git a/m4/gpg4win.m4 b/m4/gpg4win.m4 index ec8ece2b..ede88f45 100644 --- a/m4/gpg4win.m4 +++ b/m4/gpg4win.m4 @@ -1,812 +1,832 @@ dnl gpg4win.m4 - macros to configure gpg4win. dnl Copyright (C) 2005, 2009 g10 Code GmbH dnl dnl This file is part of GPG4Win. dnl dnl GPG4Win is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl GPG4Win is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, dnl MA 02110-1301, USA # GPG4WIN_DEFINE SYMBOL # A poor man's version of AC_DEFINE_UNQUOTED for NSIS. AC_DEFUN([GPG4WIN_DEFINE], [ eval $1=\"\!define $1 1\" AC_SUBST($1) ]) # GPG4WIN_BASH # Gpg4Win needs bash. This macro checks for it. AC_DEFUN([GPG4WIN_BASH], [ AC_MSG_CHECKING([for Bash]) _bash=$BASH_VERSION if test -z "$_bash"; then _bash=no fi AC_MSG_RESULT($_bash) if test $_bash = no; then AC_MSG_ERROR("this configure script requires Bash") fi ]) # GPG4WIN_PACKAGES # Determines the path to the source and binary packages. # Default is the "packages" directory in the source directory. # The path is stored in the shell variable gpg4win_packages. AC_DEFUN([GPG4WIN_PACKAGES], [ AC_MSG_CHECKING(for packages directory) _gpg4win_packages_default=packages AC_ARG_WITH([packages], AS_HELP_STRING([--with-packages=DIR], [source and binary packages [[packages]]]), gpg4win_packages=$withval) AS_IF([test -z $gpg4win_packages], [gpg4win_packages=$_gpg4win_packages_default]) AS_IF([test `echo $gpg4win_packages | head -c 1` != /], [gpg4win_packages=`pwd`/$gpg4win_packages]) AC_SUBST(gpg4win_packages) AC_MSG_RESULT($gpg4win_packages) # Set auto-detection. FIXME: This should accept a comma-separated # list of packages that will be autodetected. _gpg4win_auto_detection=yes AC_ARG_ENABLE([packages], AS_HELP_STRING([--enable-packages], [enable auto-detection [[yes]]]), _gpg4win_auto_detection=$enableval) ]) # Should be called early. AC_DEFUN([GPG4WIN_INIT], [ # We call this here so its options appear before the per-package options. AC_REQUIRE([GPG4WIN_PACKAGES]) ]) # GPG4WIN_FIND([FILE],[PATTERN],[ZIP|TAR],[DIR],[IF-FOUND],[IF-NOT-FOUND]) # Search for package file FILE in DIR. If DIR is empty, yes or maybe, # look in default directory. If DIR is not maybe, abort if not found. # The package file name is provided in gpg4win_val and the version in # gpg4win_version. AC_DEFUN([GPG4WIN_FIND], [ AC_REQUIRE([GPG4WIN_BASH]) AC_REQUIRE([GPG4WIN_PACKAGES]) gpg4win_val= gpg4win_version= AC_MSG_CHECKING(for package $1) _gpg4win_critical=no _gpg4win_file= _gpg4win_dir=$4 # If --enable-pkg-foo was specified, make success critical. AS_IF([test x$_gpg4win_dir != xmaybe], [_gpg4win_critical=yes]) # Only check if critical or auto detection is requested. AS_IF([test $_gpg4win_auto_detection = yes -o $_gpg4win_critical = yes], [AS_IF([test -z "$_gpg4win_dir" -o "$_gpg4win_dir" = yes -o "$_gpg4win_dir" = maybe], [_gpg4win_dir=$gpg4win_packages]) # Install pattern. AS_IF([test -z "$2"], [_gpg4win_pat='$1-\([[0-9]].*\)'], [_gpg4win_pat="$2"]) # Frob pattern. Regex party! [_gpg4win_glob=`echo "$_gpg4win_pat" | sed -e 's/\\\\(\(.*\)\\\\)/\1/'`] [_gpg4win_glob=`echo "$_gpg4win_glob" | sed -e 's/\\.\\*/*/'`] # Make non-matching globs expand to nothing. shopt -s nullglob _gpg4win_format=both AS_IF([test ! -z "$3"], _gpg4win_format="$3") AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tar.xz` _gpg4win_suffix=.tar.xz]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tar.bz2` _gpg4win_suffix=.tar.bz2]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tbz2` _gpg4win_suffix=.tbz2]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tbz` _gpg4win_suffix=.tbz]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tar.gz` _gpg4win_suffix=.tar.gz]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.tgz` _gpg4win_suffix=.tgz]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != tar], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.zip` _gpg4win_suffix=.zip]) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_format != tar -a $_gpg4win_format != zip], [_gpg4win_file=`echo ${_gpg4win_dir}/${_gpg4win_glob}.exe` _gpg4win_suffix=.exe]) shopt -u nullglob]) AS_IF([test -z "$_gpg4win_file"], AC_MSG_RESULT(no), AS_IF([test `echo $_gpg4win_file | head -c 1` != /], [_gpg4win_file=`pwd`/$_gpg4win_file]) AC_MSG_RESULT($_gpg4win_file)) AS_IF([test -z "$_gpg4win_file" -a $_gpg4win_critical = yes], AC_MSG_ERROR(could not find sources for $1 in $_gpg4win_dir)) # Test for duplicate. _gpg4win_found= for _gpg4win_f in $_gpg4win_file; do AS_IF([test "$_gpg4win_found" = yes], [AC_MSG_WARN(found more than one sources for $1 in $_gpg4win_dir) gpg4win_dup_sources="$gpg4win_dup_sources $1"; gpg4win_rm_candidates="$gpg4win_rm_candidates $_gpg4win_file"]) _gpg4win_found=yes done AS_IF([test ! -z "$_gpg4win_file"], [gpg4win_val="$_gpg4win_file" [gpg4win_version=`echo "$gpg4win_val" | sed -e "s,^.*/${_gpg4win_pat}${_gpg4win_suffix}$,\1,"`] [$5]], [$6]) ]) AC_DEFUN([GPG4WIN_CHECK_EXDEPS], [ AC_REQUIRE([GPG4WIN_CHECK_DEPS]) AC_MSG_CHECKING([additional host build list]) gpg4win_build_ex_list=`echo $_gpg4win_ex_deps | tsort` # Remove newlines. gpg4win_build_ex_list=`echo $gpg4win_build_ex_list` AC_MSG_RESULT($gpg4win_build_ex_list) AC_SUBST(gpg4win_build_ex_list) # Check each dependency. _gpg4win_not_found= _gpg4win_d= _gpg4win_p= for _gpg4win_p in $_gpg4win_ex_deps; do AS_IF([test -z $_gpg4win_d], [_gpg4win_d=$_gpg4win_p], [ _gpg4win_found= for _gpg4win_i in $_gpg4win_pkgs; do AS_IF([test $_gpg4win_d = $_gpg4win_i], _gpg4win_found=yes break) done AS_IF([test -z $_gpg4win_found], AC_MSG_WARN(could not find ex variant of package $_gpg4win_d required by package $_gpg4win_p) _gpg4win_not_found=yes) _gpg4win_d= ]) done AS_IF([test ! -z "$_gpg4win_not_found"], AC_MSG_ERROR([could not find some required packages])) ]) AC_DEFUN([GPG4WIN_CHECK_DEPS], [ AC_MSG_CHECKING(build list) gpg4win_build_list=`echo $_gpg4win_deps | tsort` # Remove newlines. gpg4win_build_list=`echo $gpg4win_build_list` AC_MSG_RESULT($gpg4win_build_list) AC_SUBST(gpg4win_build_list) # Check each dependency. _gpg4win_not_found= _gpg4win_d= _gpg4win_p= for _gpg4win_p in $_gpg4win_deps; do AS_IF([test -z $_gpg4win_d], [_gpg4win_d=$_gpg4win_p], [ _gpg4win_found= for _gpg4win_i in $_gpg4win_pkgs; do AS_IF([test $_gpg4win_d = $_gpg4win_i], _gpg4win_found=yes break) done AS_IF([test -z $_gpg4win_found], AC_MSG_WARN(could not find package $_gpg4win_d required by package $_gpg4win_p) _gpg4win_not_found=yes) _gpg4win_d= ]) done AS_IF([test ! -z "$_gpg4win_not_found"], AC_MSG_ERROR([could not find some required packages])) ]) AC_DEFUN([GPG4WIN_FINALIZE], [ AC_REQUIRE([GPG4WIN_CHECK_EXDEPS]) _gpg4win_debug=no AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [enable debugging [[no]]]), _gpg4win_debug=$enableval) AS_IF([test "${_gpg4win_debug}" != no], GPG4WIN_DEFINE(GPG4WIN_DEBUG)) ]) # GPG4WIN_IPKG([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the internal package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_IPKG], [ AC_REQUIRE([GPG4WIN_INIT]) AC_MSG_CHECKING([for internal package $1]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include internal package $1]), _gpg4win_pkg=$enableval, _gpg4win_pkg=yes) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AC_MSG_RESULT($_gpg4win_pkg) AS_IF([test "$_gpg4win_pkg" != no], _gpg4win_pkgs="$_gpg4win_pkgs $1" GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_SPKG([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the source package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_SPKG], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_spkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1,,, $_gpg4win_pkg, _gpg4win_spkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_spkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_spkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_spkg" != no], _gpg4win_pkgs="$_gpg4win_pkgs $1" GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_SPKGEX([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the source package PKG to be additionally built # for the host provided as additional-gpgex-host AC_DEFUN([GPG4WIN_SPKGEX], [ - GPG4WIN_SPKG([$1],[$2],[$3],[$4]) + AC_REQUIRE([GPG4WIN_INIT]) + _gpg4win_pkg=maybe + AC_ARG_ENABLE([pkg-$1], + AS_HELP_STRING([--enable-pkg-$1[=DIR]], + [include package $1]), + _gpg4win_pkg=$enableval) + _gpg4win_spkg=no + _gpg4win_version= + AS_IF([test "$_gpg4win_pkg" != no], + [GPG4WIN_FIND($1,,, $_gpg4win_pkg, + _gpg4win_spkg=$gpg4win_val + _gpg4win_version=$gpg4win_version)]) + # At this point, _gpg4win_spkg is no, or the actual package source file. + + # gpg4win_pkg_PKGNAME=FILENAME_OF_SOURCE + gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_spkg + AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) + + # gpg4win_pkg_PKGNAME_version=VERSION + gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version + AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) AS_IF([test ! -z "$GPGEX_ADD_HOST"], # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_ex_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_ex_deps) gpg4win_ex_pkgs="$gpg4win_ex_pkgs $1" GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])_EX) # Record dependencies. Also enter every package as node. _gpg4win_ex_deps="$_gpg4win_ex_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_ex_deps="$_gpg4win_ex_deps $_gpg4win_i $1" done) ) ]) # GPG4WIN_KDEPKG([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the source package PKG to be additionally built # for the host provided as additional-gpgex-host AC_DEFUN([GPG4WIN_KDEPKG], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_kdepkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1,,, $_gpg4win_pkg, _gpg4win_kdepkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # gpg4win_pkg_PKGNAME=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_kdepkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_kdepkg" != no], _gpg4win_pkgs="$_gpg4win_pkgs $1" GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_GNUWIN32([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the gnuwin32 package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_BPKG_GNUWIN32], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1-bin, [$1-\(.*\)-bin],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_bpkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_bpkg" != "no" ], GPG4WIN_FIND($1-lib, [$1-\(.*\)-lib],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find development package for package $1)) # gpg4win_pkg_PKGNAME_dev=FILENAME_OF_BINARY_DEVEL gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_dev=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_dev) GPG4WIN_FIND($1-src, [$1-\(.*\)-src],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1)) # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src) # FIXME: Add a version consistency check here. All three packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs $1" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_GNUWIN32_LIB([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the gnuwin32 package PKG. This is a static only library version. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_BPKG_GNUWIN32_LIB], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1-lib, [$1-\(.*\)-lib],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_bpkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) AS_IF([test "$_gpg4win_bpkg" != no], GPG4WIN_FIND($1-src, [$1-\(.*\)-src],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1)) # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src) # FIXME: Add a version consistency check here. All two packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs $1" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_GTK([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the Gtk binary package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_BPKG_GTK], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1,,zip, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_bpkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_bpkg" != no], [GPG4WIN_FIND($1,,tar, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1))] # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src) # FIXME: Add a version consistency check here. All three packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs $1" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_GTK_DEV([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the Gtk library package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_BPKG_GTK_DEV], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1,,zip, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_bpkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_bpkg" != no], [GPG4WIN_FIND($1-dev,,, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find development package for package $1))] # gpg4win_pkg_PKGNAME_dev=FILENAME_OF_BINARY_DEVEL gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_dev=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_dev) [GPG4WIN_FIND($1,,tar, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1))] # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src) # FIXME: Add a version consistency check here. All three packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs $1" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_GNU([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up the source package PKG. # It is provided in gpg4win_val. AC_DEFUN([GPG4WIN_BPKG_GNU], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [ # For some shameful reason, the gettext package is actually called # gettext-runtime! AS_IF([test $1 = gettext], [GPG4WIN_FIND($1-runtime,,zip, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)], [GPG4WIN_FIND($1,,zip, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) ]) # At this point, _gpg4win_bpkg is no, or the actual package source file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_bpkg" != no], [GPG4WIN_FIND($1,,tar, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1))] # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[-+],[__])[]_src) # FIXME: Add a version consistency check here. All two packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs $1" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps $1 $1" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i $1" done) [$3], [$4]) ]) # GPG4WIN_BPKG_BINSRC([PKG],[DEPENDS],[IF-FOUND],[IF-NOT-FOUND]) # Set up package PKG which is expected to be delivered as two ZIP files # with a "-(src|source)" and a "-(bin|noinstaller)" suffix. AC_DEFUN([GPG4WIN_BPKG_BINSRC], [ AC_REQUIRE([GPG4WIN_INIT]) _gpg4win_pkg=maybe AC_ARG_ENABLE([pkg-$1], AS_HELP_STRING([--enable-pkg-$1[=DIR]], [include package $1]), _gpg4win_pkg=$enableval) _gpg4win_bpkg=no _gpg4win_version= AS_IF([test "$_gpg4win_pkg" != no], [GPG4WIN_FIND($1-bin, [$1-\(.*\)-bin],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) AS_IF([test "$_gpg4win_pkg" != no -a "$_gpg4win_bpkg" = no], [GPG4WIN_FIND($1-noinstaller, [$1-\(.*\)-noinstaller],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val _gpg4win_version=$gpg4win_version)]) # At this point, _gpg4win_bpkg is no, or the actual package binary file. # gpg4win_pkg_PKGNAME=FILENAME_OF_BINARY gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])) # gpg4win_pkg_PKGNAME_version=VERSION gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_version=$_gpg4win_version AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_version) # gpg4win_pkg_PKGNAME_deps=DEPS gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps="$2" AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_deps) AS_IF([test "$_gpg4win_bpkg" != no], tmp_binsrc=yes GPG4WIN_FIND($1-src, [$1-\(.*\)-src],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, tmp_binsrc=no) if test $tmp_binsrc = no ; then GPG4WIN_FIND($1-source, [$1-\(.*\)-source],, $_gpg4win_pkg, _gpg4win_bpkg=$gpg4win_val, AC_MSG_ERROR(can not find sources for package $1)) fi # gpg4win_pkg_PKGNAME_src=FILENAME_OF_SOURCE gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_src=$_gpg4win_bpkg AC_SUBST(gpg4win_pkg_[]m4_translit([$1],[A-Z+-],[a-z__])[]_src) # FIXME: Add a version consistency check here. Both packages # must match! GPG4WIN_DEFINE(HAVE_PKG_[]m4_translit([$1],[a-z+-],[A-Z__])) _gpg4win_pkgs="$_gpg4win_pkgs []m4_translit([$1],[A-Z],[a-z])" # Record dependencies. Also enter every package as node. _gpg4win_deps="$_gpg4win_deps []m4_translit([$1],[A-Z],[a-z]) []m4_translit([$1],[A-Z],[a-z])" AS_IF([test ! -z "$2"], for _gpg4win_i in $2; do _gpg4win_deps="$_gpg4win_deps $_gpg4win_i []m4_translit([$1],[A-Z],[a-z])" done) [$3], [$4]) ]) # Add a runtime library argument 1 should be the dll # name without the .dll suffix AC_DEFUN([GPG4WIN_RUNTIME_LIBRARY], [ dll_path="no" AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1-dll[=FILE]], [include FILE as runtime dependency for the installer.]), [dll_path=$withval]) if test "$dll_path" = "no"; then changequote(,) gcc_major_minor=$($CC --version \ | awk 'NR==1 {split($NF,a,"."); print a[1] "." a[2]}') gcc_major_minor_alt=$($CC --version | cut -d " " -f 3 \ | awk 'NR==1 {split($NF,a,"."); print a[1] "." a[2]}') changequote([,]) guesses="/usr/lib/gcc/$host/$gcc_major_minor/$1.dll /usr/$host/lib/$1.dll /usr/lib/gcc/$host/${gcc_major_minor}-win32/$1.dll /usr/lib/gcc/$host/${gcc_major_minor_alt}-win32/$1.dll /usr/lib/gcc/$host/${gcc_major_minor_alt}/$1.dll" for file in $guesses; do if test -r "$file"; then dll_path="$file" break fi done fi if test "$dll_path" = "no"; then AC_MSG_ERROR(can not find the runtime library $1.dll in the default locations. Use the --with-$1 option to set the path directly. ) fi AC_MSG_NOTICE(Using $dll_path to provide $1) $CP "$dll_path" src/$1.dll-x $STRIP src/$1.dll-x ])