aboutsummaryrefslogtreecommitdiffstats
path: root/src/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am78
1 files changed, 62 insertions, 16 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 6444c2c..8e2a319 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,10 +21,19 @@
# because they are needed to build the po directory, and they don't
# depend on the configuration anyway.
+
+if HAVE_W32CE_SYSTEM
+extra_headers = gpg-extra/errno.h
+extra_cppflags = -idirafter gpg-extra
+else
+extra_headers =
+extra_cppflags =
+endif
+
localedir = $(datadir)/locale
bin_PROGRAMS = gpg-error
lib_LTLIBRARIES = libgpg-error.la
-include_HEADERS = gpg-error.h
+nobase_include_HEADERS = gpg-error.h $(extra_headers)
bin_SCRIPTS = gpg-error-config
m4datadir = $(datadir)/aclocal
m4data_DATA = gpg-error.m4
@@ -33,25 +42,26 @@ 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 \
+ mkheader.awk gpg-error.h.in mkw32errmap.c w32ce-add.h \
err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
- gpg-error.def versioninfo.rc.in
+ gpg-error.def.in versioninfo.rc.in
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
+ err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-error.h \
+ gpg-error.def gpg-extra/errno.h extra-h.in
-tmp_files = _mkerrcodes.h
+tmp_files = _mkerrcodes.h _gpg-error.def.h mkw32errmap.tab.h
CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
- gpg-error.h mkerrcodes mkerrcodes.h \
- err-sources-sym.h err-codes-sym.h errnos-sym.h $(tmp_files)
-
+ gpg-error.h mkerrcodes mkerrcodes.h gpg-error.def mkw32errmap.tab.h \
+ err-sources-sym.h err-codes-sym.h errnos-sym.h gpg-extra/errno.h \
+ extra-h.in $(tmp_files)
if HAVE_W32_SYSTEM
arch_sources = w32-gettext.h w32-gettext.c
RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(libgpg_error_la_CPPFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
+ -DLOCALEDIR=\"$(localedir)\" $(AM_CPPFLAGS) $(CPPFLAGS)
LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
SUFFIXES = .rc .lo
@@ -63,7 +73,7 @@ gpg_error_res = versioninfo.lo
no_undefined = -no-undefined
export_symbols = -export-symbols $(srcdir)/gpg-error.def
-install-def-file:
+install-def-file: gpg-error.def
$(INSTALL) gpg-error.def $(DESTDIR)$(libdir)/gpg-error.def
uninstall-def-file:
@@ -92,11 +102,14 @@ libgpg_error_la_LDFLAGS = -version-info \
libgpg_error_la_SOURCES = gpg-error.h gettext.h $(arch_sources) \
init.c strsource.c strerror.c code-to-errno.c code-from-errno.c
-libgpg_error_la_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
+# 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)
gpg_error_SOURCES = strsource-sym.c strerror-sym.c gpg-error.c $(arch_sources)
-gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
+gpg_error_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" $(extra_cppflags)
gpg_error_LDADD = ./libgpg-error.la @LTLIBINTL@
err-sources.h: Makefile mkstrtable.awk err-sources.h.in
@@ -119,16 +132,41 @@ code-to-errno.h: Makefile mkerrnos.awk errnos.in
$(AWK) -f $(srcdir)/mkerrnos.awk $(srcdir)/errnos.in >$@
# It is correct to use $(CPP). We want the host's idea of the error codes.
-mkerrcodes.h: Makefile mkerrcodes.awk
+mkerrcodes.h: Makefile mkerrcodes.awk $(extra_headers)
$(AWK) -f $(srcdir)/mkerrcodes1.awk $(srcdir)/errnos.in >_$@
- $(CPP) _$@ | grep GPG_ERR_ | $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
+ $(CPP) $(extra_cppflags) _$@ | grep GPG_ERR_ | \
+ $(AWK) -f $(srcdir)/mkerrcodes.awk >$@
-rm _$@
+if HAVE_W32CE_SYSTEM
+# It is correct to use $(CPP). We want the host's idea of the error codes.
+mkw32errmap.tab.h: Makefile mkw32errmap.c
+ $(CPP) -DRESOLVE_MACROS $(srcdir)/mkw32errmap.c | \
+ grep '{&mkw32errmap_marker' >$@
+gpg-extra/errno.h: mkw32errmap
+ ./mkw32errmap > $@
+endif
+
+# We use CC proper for preprocessing thus we have to convince it that
+# the data is really to be preprocessed.
+gpg-error.def: Makefile gpg-error.def.in
+ cat $(srcdir)/gpg-error.def.in >[email protected]
+ $(CPP) $(DEFAULT_INCLUDES) $(INCLUDES) $(extra_cppflags) [email protected] | \
+ grep -v '^#' >$@
+
# It is correct to use $(CC_FOR_BUILD) here. We want to run the
# program at build time.
mkerrcodes: mkerrcodes.c mkerrcodes.h Makefile
$(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkerrcodes.c
+if HAVE_W32CE_SYSTEM
+# It is correct to use $(CC_FOR_BUILD) here. We want to run the
+# program at build time.
+mkw32errmap: mkw32errmap.c mkw32errmap.tab.h Makefile
+ $(CC_FOR_BUILD) -I. -I$(srcdir) -o $@ $(srcdir)/mkw32errmap.c
+endif
+
code-from-errno.h: mkerrcodes Makefile
./mkerrcodes | $(AWK) -f $(srcdir)/mkerrcodes2.awk >$@
@@ -137,10 +175,18 @@ errnos-sym.h: Makefile mkstrtable.awk errnos.in
-v prefix=GPG_ERR_ -v namespace=errnos_ \
$(srcdir)/errnos.in >$@
-gpg-error.h: Makefile mkheader.awk \
- err-sources.h.in err-codes.h.in errnos.in gpg-error.h.in
+extra-h.in: Makefile w32ce-add.h
+ -rm extra-h.in
+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 > $@