[PATCH 4/5] posix: Install <semaphore.h> only if not provided

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Mar 9 12:18:35 UTC 2015


---
 cpukit/configure.ac        | 3 +++
 cpukit/posix/Makefile.am   | 2 ++
 cpukit/posix/preinstall.am | 3 ++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/cpukit/configure.ac b/cpukit/configure.ac
index 2b16964..0058082 100644
--- a/cpukit/configure.ac
+++ b/cpukit/configure.ac
@@ -136,6 +136,9 @@ AC_CHECK_HEADERS([tar.h errno.h sched.h sys/cdefs.h sys/queue.h],,
 AS_IF([test -n "$rtems_missing_header"],
   AC_MSG_ERROR([Missing required header $rtems_missing_header])])
 
+AC_CHECK_HEADERS([semaphore.h])
+AM_CONDITIONAL([HAVE_SEMAPHORE_H],[test x"$ac_cv_header_semaphore_h" = x"yes"])
+
 ## error out if libc doesn't provide stdint.h
 AS_IF([test x"${ac_cv_header_stdint_h}" != xyes],
 [AC_MSG_ERROR([Required header stdint.h not found])])
diff --git a/cpukit/posix/Makefile.am b/cpukit/posix/Makefile.am
index 9d6fd48..8ffd4e6 100644
--- a/cpukit/posix/Makefile.am
+++ b/cpukit/posix/Makefile.am
@@ -25,7 +25,9 @@ if HAS_PTHREADS
 # include
 include_HEADERS = include/aio.h
 include_HEADERS += include/mqueue.h
+if !HAVE_SEMAPHORE_H
 include_HEADERS += include/semaphore.h
+endif
 
 # include/rtems/posix
 include_rtems_posix_HEADERS += include/rtems/posix/aio_misc.h
diff --git a/cpukit/posix/preinstall.am b/cpukit/posix/preinstall.am
index 6e3f2a2..64a8c6b 100644
--- a/cpukit/posix/preinstall.am
+++ b/cpukit/posix/preinstall.am
@@ -52,10 +52,11 @@ $(PROJECT_INCLUDE)/mqueue.h: include/mqueue.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/mqueue.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/mqueue.h
 
+if !HAVE_SEMAPHORE_H
 $(PROJECT_INCLUDE)/semaphore.h: include/semaphore.h $(PROJECT_INCLUDE)/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/semaphore.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/semaphore.h
-
+endif
 $(PROJECT_INCLUDE)/rtems/posix/aio_misc.h: include/rtems/posix/aio_misc.h $(PROJECT_INCLUDE)/rtems/posix/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/posix/aio_misc.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/posix/aio_misc.h
-- 
1.8.4.5




More information about the devel mailing list