summaryrefslogtreecommitdiff
path: root/lib/Makefile.am
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2009-05-30 16:56:40 +0200
committerBruno Haible <bruno@clisp.org>2009-05-30 16:56:40 +0200
commit7b1da5a4bf287395e2ae49e70096b2b6ebd45728 (patch)
tree5359a5cf842262dfa84b14386a8f34e4fb493412 /lib/Makefile.am
parent10042d9fdacc26cdb20ae61fe71ae3af39fa4d33 (diff)
downloadlibunistring-7b1da5a4bf287395e2ae49e70096b2b6ebd45728.tar.gz
Produce a compiler independent <unistring/stdbool.h>.
Diffstat (limited to 'lib/Makefile.am')
-rw-r--r--lib/Makefile.am25
1 files changed, 18 insertions, 7 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 0e07e6b..5b322b9 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -60,16 +60,27 @@ nobase_nodist_include_HEADERS = \
unistring/stdbool.h \
unistring/stdint.h
+# Produce an unistring/stdbool.h that is not compiler dependent.
+# GCC >= 2.95 has <stdbool.h>.
+# AIX >= 5.3 has <stdbool.h>.
+# Solaris 10 and some HP-UX 11 versions have <stdbool.h> but it does not
+# necessarily work.
unistring/stdbool.h : $(STDBOOL_H)
@MKDIR_P@ unistring
rm -f $@-t $@
- if test -n '$(STDBOOL_H)'; then \
- cp stdbool.h $@-t; \
- else \
- { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
- echo '#include <stdbool.h>'; \
- } > $@-t; \
- fi
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo '#if !defined _GL_STDBOOL_H'; \
+ if test -f /usr/include/stdbool.h; then \
+ echo '#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) || defined _AIX'; \
+ else \
+ echo '#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))'; \
+ fi; \
+ echo '#include <stdbool.h>'; \
+ echo '#else'; \
+ cat $(srcdir)/stdbool.mini.h; \
+ echo '#endif'; \
+ echo '#endif'; \
+ } > $@-t
mv $@-t $@
BUILT_SOURCES += unistring/stdbool.h
MOSTLYCLEANFILES += unistring/stdbool.h-t