//===--- glibc.modulemap.gyb ----------------------------------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// /// This is a semi-complete modulemap that maps glibc's headers in a roughly /// similar way to the Darwin SDK modulemap. We do not take care to list every /// single header which may be included by a particular submodule, so there can /// still be issues if imported into the same context as one in which someone /// included those headers directly. /// /// It's not named just Glibc so that it doesn't conflict in the event of a /// future official glibc modulemap. module SwiftGlibc [system] { % if CMAKE_SDK in ["LINUX", "FREEBSD", "CYGWIN"]: link "pthread" // FIXME: util contains rarely used functions and not usually needed. Unfortunately // link directive doesn't work in the submodule yet. link "util" % end % if CMAKE_SDK != "FREEBSD" and CMAKE_SDK != "HAIKU": link "dl" % end % if CMAKE_SDK == "HAIKU": link "network" link "bsd" link "execinfo" % end // C standard library module C { % if CMAKE_SDK in ["LINUX", "CYGWIN"]: module features { % if CMAKE_SDK == "LINUX": header "${GLIBC_INCLUDE_PATH}/stdc-predef.h" % end header "${GLIBC_INCLUDE_PATH}/features.h" export * } % end % if CMAKE_SDK in ["LINUX", "FREEBSD", "CYGWIN", "HAIKU"]: module complex { header "${GLIBC_INCLUDE_PATH}/complex.h" export * } % end % if CMAKE_SDK in ["LINUX", "CYGWIN"]: module pty { header "${GLIBC_INCLUDE_PATH}/pty.h" export * } module utmp { header "${GLIBC_INCLUDE_PATH}/utmp.h" export * } % end % if CMAKE_SDK == "FREEBSD": module pty { header "${GLIBC_INCLUDE_PATH}/libutil.h" export * } module utmp { header "${GLIBC_INCLUDE_PATH}/utmpx.h" export * } % end % if CMAKE_SDK == "HAIKU": module pty { header "${GLIBC_INCLUDE_PATH}/../bsd/pty.h" export * } % end module ctype { header "${GLIBC_INCLUDE_PATH}/ctype.h" export * } module errno { header "${GLIBC_INCLUDE_PATH}/errno.h" export * } module fenv { header "${GLIBC_INCLUDE_PATH}/fenv.h" export * } // note: supplied by compiler // module float { // header "${GLIBC_INCLUDE_PATH}/float.h" // export * // } module inttypes { header "${GLIBC_INCLUDE_PATH}/inttypes.h" export * } // note: potentially supplied by compiler // module iso646 { // header "${GLIBC_INCLUDE_PATH}/iso646.h" // export * // } // module limits { // header "${GLIBC_INCLUDE_PATH}/limits.h" // export * // } module locale { header "${GLIBC_INCLUDE_PATH}/locale.h" export * } module math { % if CMAKE_SDK == "LINUX": link "m" % end header "${GLIBC_INCLUDE_PATH}/math.h" export * } % if CMAKE_SDK != "WASI": module setjmp { header "${GLIBC_INCLUDE_PATH}/setjmp.h" export * } % end module signal { header "${GLIBC_INCLUDE_PATH}/signal.h" export * } // note: supplied by the compiler // module stdarg { // header "${GLIBC_INCLUDE_PATH}/stdarg.h" // export * // } // module stdbool { // header "${GLIBC_INCLUDE_PATH}/stdbool.h" // export * // } // module stddef { // header "${GLIBC_INCLUDE_PATH}/stddef.h" // export * // } // module stdint { // header "${GLIBC_INCLUDE_PATH}/stdint.h" // export * // } module stdio { header "${GLIBC_INCLUDE_PATH}/stdio.h" export * } module stdlib { header "${GLIBC_INCLUDE_PATH}/stdlib.h" export * export stddef } module string { header "${GLIBC_INCLUDE_PATH}/string.h" export * } // note: supplied by the compiler // explicit module tgmath { // header "${GLIBC_INCLUDE_PATH}/tgmath.h" // export * // } module time { header "${GLIBC_INCLUDE_PATH}/time.h" export * } } // POSIX module POSIX { % if CMAKE_SDK in ["LINUX", "CYGWIN"]: module wait { header "${GLIBC_INCLUDE_PATH}/wait.h" export * } % end % if CMAKE_SDK in ["LINUX", "FREEBSD"]: module aio { header "${GLIBC_INCLUDE_PATH}/aio.h" export * } module cpio { header "${GLIBC_INCLUDE_PATH}/cpio.h" export * } module fmtmsg { header "${GLIBC_INCLUDE_PATH}/fmtmsg.h" export * } module nl_types { header "${GLIBC_INCLUDE_PATH}/nl_types.h" export * } module ulimit { header "${GLIBC_INCLUDE_PATH}/ulimit.h" export * } % end % if CMAKE_SDK in ["LINUX", "FREEBSD", "CYGWIN"]: module ftw { header "${GLIBC_INCLUDE_PATH}/ftw.h" export * } module glob { header "${GLIBC_INCLUDE_PATH}/glob.h" export * } module iconv { header "${GLIBC_INCLUDE_PATH}/iconv.h" export * } module langinfo { header "${GLIBC_INCLUDE_PATH}/langinfo.h" export * } module monetary { header "${GLIBC_INCLUDE_PATH}/monetary.h" export * } module netdb { header "${GLIBC_INCLUDE_PATH}/netdb.h" export * } module ifaddrs { header "${GLIBC_INCLUDE_PATH}/ifaddrs.h" export * } module search { header "${GLIBC_INCLUDE_PATH}/search.h" export * } module spawn { header "${GLIBC_INCLUDE_PATH}/spawn.h" export * } module syslog { header "${GLIBC_INCLUDE_PATH}/syslog.h" export * } module tar { header "${GLIBC_INCLUDE_PATH}/tar.h" export * } module utmpx { header "${GLIBC_INCLUDE_PATH}/utmpx.h" export * } module wordexp { header "${GLIBC_INCLUDE_PATH}/wordexp.h" export * } % end % if CMAKE_SDK == "HAIKU": module ftw { header "${GLIBC_INCLUDE_PATH}/ftw.h" export * } module glob { header "${GLIBC_INCLUDE_PATH}/glob.h" export * } module iconv { header "${GLIBC_INCLUDE_PATH}/../iconv.h" export * } module langinfo { header "${GLIBC_INCLUDE_PATH}/langinfo.h" export * } module monetary { header "${GLIBC_INCLUDE_PATH}/monetary.h" export * } module netdb { header "${GLIBC_INCLUDE_PATH}/netdb.h" export * } module ifaddrs { header "${GLIBC_INCLUDE_PATH}/../bsd/ifaddrs.h" export * } module search { header "${GLIBC_INCLUDE_PATH}/search.h" export * } module syslog { header "${GLIBC_INCLUDE_PATH}/syslog.h" export * } module tar { header "${GLIBC_INCLUDE_PATH}/tar.h" export * } % end module arpa { module inet { header "${GLIBC_INCLUDE_PATH}/arpa/inet.h" export * } export * } module dirent { header "${GLIBC_INCLUDE_PATH}/dirent.h" export * } % if CMAKE_SDK != "WASI": module dl { header "${GLIBC_INCLUDE_PATH}/link.h" export * } module dlfcn { header "${GLIBC_INCLUDE_PATH}/dlfcn.h" export * } % end module fcntl { header "${GLIBC_INCLUDE_PATH}/fcntl.h" export * } module fnmatch { header "${GLIBC_INCLUDE_PATH}/fnmatch.h" export * } % if CMAKE_SDK != "WASI": module grp { header "${GLIBC_INCLUDE_PATH}/grp.h" export * } % end module ioctl { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ioctl.h" export * } module libgen { header "${GLIBC_INCLUDE_PATH}/libgen.h" export * } % if CMAKE_SDK != "WASI": module net { module if { header "${GLIBC_INCLUDE_PATH}/net/if.h" export * } } % end module netinet { module in { header "${GLIBC_INCLUDE_PATH}/netinet/in.h" export * exclude header "${GLIBC_INCLUDE_PATH}/netinet6/in6.h" } module tcp { header "${GLIBC_INCLUDE_PATH}/netinet/tcp.h" export * } } module poll { header "${GLIBC_INCLUDE_PATH}/poll.h" export * } % if CMAKE_SDK != "WASI": module pthread { header "${GLIBC_INCLUDE_PATH}/pthread.h" export * } % end module pwd { header "${GLIBC_INCLUDE_PATH}/pwd.h" export * } module regex { header "${GLIBC_INCLUDE_PATH}/regex.h" export * } module sched { header "${GLIBC_INCLUDE_PATH}/sched.h" export * } module semaphore { header "${GLIBC_INCLUDE_PATH}/semaphore.h" export * } module strings { header "${GLIBC_INCLUDE_PATH}/strings.h" export * } module sys { export * % if CMAKE_SDK in ["LINUX", "FREEBSD", "CYGWIN", "HAIKU"]: module file { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/file.h" export * } module sem { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sem.h" export * } % if CMAKE_SDK != "HAIKU": module shm { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/shm.h" export * } module inotify { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/inotify.h" export * } % end module statvfs { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/statvfs.h" export * } % end % if CMAKE_SDK != "WASI": module ipc { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ipc.h" export * } % end module mman { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/mman.h" export * } % if CMAKE_SDK != "WASI": module msg { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/msg.h" export * } % end module resource { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/resource.h" export * } module select { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/select.h" export * } % if CMAKE_SDK != "FREEBSD" and CMAKE_SDK != "HAIKU" and CMAKE_SDK != "WASI": module sendfile { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sendfile.h" export * } % end module socket { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/socket.h" export * } module stat { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/stat.h" export * } module time { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/time.h" export * } module times { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/times.h" export * } module types { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/types.h" export * } % if CMAKE_SDK in ["FREEBSD"]: module event { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/event.h" export * } % end module uio { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/uio.h" export * } module un { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/un.h" export * } % if CMAKE_SDK in ["LINUX"]: module user { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/user.h" export * } % end module utsname { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/utsname.h" export * } % if CMAKE_SDK != "WASI": module wait { header "${GLIBC_ARCH_INCLUDE_PATH}/sys/wait.h" export * } } % end % if CMAKE_SDK in ["LINUX", "FREEBSD"]: module sysexits { header "${GLIBC_INCLUDE_PATH}/sysexits.h" export * } % end % if CMAKE_SDK != "WASI": module termios { header "${GLIBC_INCLUDE_PATH}/termios.h" export * } % end module unistd { header "${GLIBC_INCLUDE_PATH}/unistd.h" export * } % if CMAKE_SDK != "WASI": module utime { header "${GLIBC_INCLUDE_PATH}/utime.h" export * } } % end } % if CMAKE_SDK != "WASI": module CUUID [system] { header "${GLIBC_INCLUDE_PATH}/uuid/uuid.h" link "uuid" export * } % end