diff options
Diffstat (limited to 'src/Makefile.am')
-rw-r--r-- | src/Makefile.am | 109 |
1 files changed, 68 insertions, 41 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 518a4c0..e201cee 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,37 +1,49 @@ # Makefile.am for libgpg-error. -# Copyright (C) 2003, 2004 g10 Code GmbH -# +# Copyright (C) 2003, 2004, 2014 g10 Code GmbH +# # This file is part of libgpg-error. -# +# # libgpg-error is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. -# +# # libgpg-error 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 Lesser General Public License for more details. -# +# # You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see <http://www.gnu.org/licenses/>. # We distribute the generated sources err-sources.h and err-codes.h, # because they are needed to build the po directory, and they don't -# depend on the configuration anyway. +# depend on the configuration anyway. if HAVE_W32CE_SYSTEM gpg_extra_headers = gpg-extra/errno.h extra_cppflags = -idirafter gpg-extra else -gpg_extra_headers = -extra_cppflags = +gpg_extra_headers = +extra_cppflags = endif localedir = $(datadir)/locale + bin_PROGRAMS = gpg-error + +if HAVE_W32_SYSTEM +noinst_PROGRAMS = gen-w32-lock-obj +else +noinst_PROGRAMS = gen-posix-lock-obj +endif + +# Distributed lock object definitions for cross compilation. +lock_obj_pub = \ + syscfg/lock-obj-pub.mingw32.h \ + syscfg/lock-obj-pub.arm-unknown-linux-androideabi.h + lib_LTLIBRARIES = libgpg-error.la include_HEADERS = gpg-error.h bin_SCRIPTS = gpg-error-config @@ -41,24 +53,24 @@ m4data_DATA = gpg-error.m4 EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ mkerrnos.awk errnos.in README \ mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \ - mkheader.awk gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \ + mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \ err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \ - gpg-error.def.in versioninfo.rc.in + gpg-error.def.in versioninfo.rc.in \ + $(lock_obj_pub) BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h \ - gpg-error.def extra-h.in mkw32errmap.map.c + gpg-error.def mkw32errmap.map.c -tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c +tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h mkw32errmap.map.c CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ gpg-error.h mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ - gpg-extra/errno.h extra-h.in $(tmp_files) + gpg-extra/errno.h mkheader $(tmp_files) lock-obj-pub.native.h if HAVE_W32_SYSTEM -arch_sources = w32-gettext.c - +arch_sources = w32-gettext.c w32-lock.c w32-lock-obj.h w32-thread.c RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS) LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) @@ -73,16 +85,17 @@ no_undefined = -no-undefined export_symbols = -export-symbols gpg-error.def install-def-file: gpg-error.def + -$(INSTALL) -d $(DESTDIR)$(libdir) $(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpg-error.def uninstall-def-file: -rm $(DESTDIR)$(libdir)/gpg-error.def libgpg_error_la_DEPENDENCIES = $(gpg_error_res) gpg-error.def -intllibs = +intllibs = else -arch_sources = +arch_sources = posix-lock.c posix-lock-obj.h posix-thread.c gpg_error_res = no_undefined = export_symbols = @@ -99,15 +112,16 @@ libgpg_error_la_LDFLAGS = -version-info \ $(no_undefined) $(export_symbols) libgpg_error_la_SOURCES = gpg-error.h gettext.h $(arch_sources) \ - init.c init.h strsource.c strerror.c code-to-errno.c code-from-errno.c + init.c init.h version.c lock.h thread.h \ + strsource.c strerror.c code-to-errno.c code-from-errno.c # Note that RCCOMPILE needs the same defines as ..._la_CPPFLAGS but # without the extra_cppflags because they may include am -idirafter # which is not supported by the RC compiler. libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) -libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) +libgpg_error_la_LIBADD = $(gpg_error_res) $(intllibs) $(LIBTHREAD) -gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c +gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags) gpg_error_LDADD = ./libgpg-error.la @LTLIBINTL@ @@ -138,7 +152,7 @@ code-to-errno.h: Makefile mkerrnos.awk errnos.in # It is correct to use $(CPP). We want the host's idea of the error codes. mkerrcodes.h: Makefile mkerrcodes.awk $(gpg_extra_headers) $(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@ - $(CPP) $(extra_cppflags) _$@ | grep GPG_ERR_ | \ + $(CPP) $(CPPFLAGS) $(extra_cppflags) _$@ | grep GPG_ERR_ | \ $(AWK) -f $(srcdir)/mkerrcodes.awk >$@ -rm _$@ @@ -185,24 +199,37 @@ errnos-sym.h: Makefile mkstrtable.awk errnos.in -v prefix=GPG_ERR_ -v namespace=errnos_ \ $(srcdir)/errnos.in >$@ -extra-h.in: Makefile w32-add.h w32ce-add.h - -rm extra-h.in -if HAVE_W32_SYSTEM - cat $(srcdir)/w32-add.h >>extra-h.in -endif -if HAVE_W32CE_SYSTEM - cat $(srcdir)/w32ce-add.h >>extra-h.in -endif - echo EOF >>extra-h.in - -gpg-error.h: Makefile mkheader.awk err-sources.h.in err-codes.h.in \ - errnos.in extra-h.in gpg-error.h.in - $(AWK) -f $(srcdir)/mkheader.awk \ - $(srcdir)/err-sources.h.in \ - $(srcdir)/err-codes.h.in \ - $(srcdir)/errnos.in \ - extra-h.in \ - $(srcdir)/gpg-error.h.in > $@ + +mkheader: mkheader.c Makefile + $(CC_FOR_BUILD) -g -O0 -I. -I$(srcdir) -o $@ $(srcdir)/mkheader.c + +parts_of_gpg_error_h = \ + gpg-error.h.in \ + err-sources.h.in \ + err-codes.h.in \ + errnos.in \ + w32-add.h \ + w32ce-add.h \ + $(lock_obj_pub) + +# If we are cross-compiling we better make sure that no stale native +# lock include file will be found by mkheader. +if CROSS_COMPILING +pre_mkheader_cmds = -rm lock-obj-pub.native.h 2>/dev/null +else +pre_mkheader_cmds = : +parts_of_gpg_error_h += ./lock-obj-pub.native.h + +lock-obj-pub.native.h: Makefile gen-posix-lock-obj posix-lock-obj.h + ./gen-posix-lock-obj >$@ +endif + +# We also depend on versioninfo.rc because that is build by +# config.status and thus has up-to-date version numbers. +gpg-error.h: Makefile mkheader $(parts_of_gpg_error_h) versioninfo.rc + $(pre_mkheader_cmds) + ./mkheader $(host_os) $(host_triplet) $(srcdir)/gpg-error.h.in \ + $(PACKAGE_VERSION) $(VERSION_NUMBER) >$@ install-data-local: |