sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

getconf.sh (10717B)


      1 #!/bin/sh
      2 
      3 ifdef() {
      4 	printf 'static const struct var %s[] = {\n' "$1"
      5 	awk '{printf("#ifdef %s\n\t{\"%s\",\t%s},\n#endif\n", $2, $1, $2)}'
      6 	echo '};'
      7 }
      8 
      9 ifdef confstr_l << EOF
     10 PATH                           _CS_PATH
     11 POSIX_V7_ILP32_OFF32_CFLAGS    _CS_POSIX_V7_ILP32_OFF32_CFLAGS
     12 POSIX_V7_ILP32_OFF32_LDFLAGS   _CS_POSIX_V7_ILP32_OFF32_LDFLAGS
     13 POSIX_V7_ILP32_OFF32_LIBS      _CS_POSIX_V7_ILP32_OFF32_LIBS
     14 POSIX_V7_ILP32_OFFBIG_CFLAGS   _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS
     15 POSIX_V7_ILP32_OFFBIG_LDFLAGS  _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS
     16 POSIX_V7_ILP32_OFFBIG_LIBS     _CS_POSIX_V7_ILP32_OFFBIG_LIBS
     17 POSIX_V7_LP64_OFF64_CFLAGS     _CS_POSIX_V7_LP64_OFF64_CFLAGS
     18 POSIX_V7_LP64_OFF64_LDFLAGS    _CS_POSIX_V7_LP64_OFF64_LDFLAGS
     19 POSIX_V7_LP64_OFF64_LIBS       _CS_POSIX_V7_LP64_OFF64_LIBS
     20 POSIX_V7_LPBIG_OFFBIG_CFLAGS   _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS
     21 POSIX_V7_LPBIG_OFFBIG_LDFLAGS  _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS
     22 POSIX_V7_LPBIG_OFFBIG_LIBS     _CS_POSIX_V7_LPBIG_OFFBIG_LIBS
     23 POSIX_V7_THREADS_CFLAGS        _CS_POSIX_V7_THREADS_CFLAGS
     24 POSIX_V7_THREADS_LDFLAGS       _CS_POSIX_V7_THREADS_LDFLAGS
     25 POSIX_V7_WIDTH_RESTRICTED_ENVS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS
     26 V7_ENV                         _CS_V7_ENV
     27 EOF
     28 
     29 ifdef limits_l << EOF
     30 _POSIX_CLOCKRES_MIN                 _POSIX_CLOCKRES_MIN
     31 _POSIX_AIO_LISTIO_MAX               _POSIX_AIO_LISTIO_MAX
     32 _POSIX_AIO_MAX                      _POSIX_AIO_MAX
     33 _POSIX_ARG_MAX                      _POSIX_ARG_MAX
     34 _POSIX_CHILD_MAX                    _POSIX_CHILD_MAX
     35 _POSIX_DELAYTIMER_MAX               _POSIX_DELAYTIMER_MAX
     36 _POSIX_HOST_NAME_MAX                _POSIX_HOST_NAME_MAX
     37 _POSIX_LINK_MAX                     _POSIX_LINK_MAX
     38 _POSIX_LOGIN_NAME_MAX               _POSIX_LOGIN_NAME_MAX
     39 _POSIX_MAX_CANON                    _POSIX_MAX_CANON
     40 _POSIX_MAX_INPUT                    _POSIX_MAX_INPUT
     41 _POSIX_MQ_OPEN_MAX                  _POSIX_MQ_OPEN_MAX
     42 _POSIX_MQ_PRIO_MAX                  _POSIX_MQ_PRIO_MAX
     43 _POSIX_NAME_MAX                     _POSIX_NAME_MAX
     44 _POSIX_NGROUPS_MAX                  _POSIX_NGROUPS_MAX
     45 _POSIX_OPEN_MAX                     _POSIX_OPEN_MAX
     46 _POSIX_PATH_MAX                     _POSIX_PATH_MAX
     47 _POSIX_PIPE_BUF                     _POSIX_PIPE_BUF
     48 _POSIX_RE_DUP_MAX                   _POSIX_RE_DUP_MAX
     49 _POSIX_RTSIG_MAX                    _POSIX_RTSIG_MAX
     50 _POSIX_SEM_NSEMS_MAX                _POSIX_SEM_NSEMS_MAX
     51 _POSIX_SEM_VALUE_MAX                _POSIX_SEM_VALUE_MAX
     52 _POSIX_SIGQUEUE_MAX                 _POSIX_SIGQUEUE_MAX
     53 _POSIX_SSIZE_MAX                    _POSIX_SSIZE_MAX
     54 _POSIX_SS_REPL_MAX                  _POSIX_SS_REPL_MAX
     55 _POSIX_STREAM_MAX                   _POSIX_STREAM_MAX
     56 _POSIX_SYMLINK_MAX                  _POSIX_SYMLINK_MAX
     57 _POSIX_SYMLOOP_MAX                  _POSIX_SYMLOOP_MAX
     58 _POSIX_THREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
     59 _POSIX_THREAD_KEYS_MAX              _POSIX_THREAD_KEYS_MAX
     60 _POSIX_THREAD_THREADS_MAX           _POSIX_THREAD_THREADS_MAX
     61 _POSIX_TIMER_MAX                    _POSIX_TIMER_MAX
     62 _POSIX_TTY_NAME_MAX                 _POSIX_TTY_NAME_MAX
     63 _POSIX_TZNAME_MAX                   _POSIX_TZNAME_MAX
     64 _POSIX2_BC_BASE_MAX                 _POSIX2_BC_BASE_MAX
     65 _POSIX2_BC_DIM_MAX                  _POSIX2_BC_DIM_MAX
     66 _POSIX2_BC_SCALE_MAX                _POSIX2_BC_SCALE_MAX
     67 _POSIX2_BC_STRING_MAX               _POSIX2_BC_STRING_MAX
     68 _POSIX2_CHARCLASS_NAME_MAX          _POSIX2_CHARCLASS_NAME_MAX
     69 _POSIX2_COLL_WEIGHTS_MAX            _POSIX2_COLL_WEIGHTS_MAX
     70 _POSIX2_EXPR_NEST_MAX               _POSIX2_EXPR_NEST_MAX
     71 _POSIX2_LINE_MAX                    _POSIX2_LINE_MAX
     72 _POSIX2_RE_DUP_MAX                  _POSIX2_RE_DUP_MAX
     73 EOF
     74 
     75 ifdef sysconf_l << EOF
     76 AIO_LISTIO_MAX                    _SC_AIO_LISTIO_MAX
     77 AIO_MAX                           _SC_AIO_MAX
     78 AIO_PRIO_DELTA_MAX                _SC_AIO_PRIO_DELTA_MAX
     79 ARG_MAX                           _SC_ARG_MAX
     80 ATEXIT_MAX                        _SC_ATEXIT_MAX
     81 BC_BASE_MAX                       _SC_BC_BASE_MAX
     82 BC_DIM_MAX                        _SC_BC_DIM_MAX
     83 BC_SCALE_MAX                      _SC_BC_SCALE_MAX
     84 BC_STRING_MAX                     _SC_BC_STRING_MAX
     85 CHILD_MAX                         _SC_CHILD_MAX
     86 COLL_WEIGHTS_MAX                  _SC_COLL_WEIGHTS_MAX
     87 DELAYTIMER_MAX                    _SC_DELAYTIMER_MAX
     88 EXPR_NEST_MAX                     _SC_EXPR_NEST_MAX
     89 HOST_NAME_MAX                     _SC_HOST_NAME_MAX
     90 IOV_MAX                           _SC_IOV_MAX
     91 LINE_MAX                          _SC_LINE_MAX
     92 LOGIN_NAME_MAX                    _SC_LOGIN_NAME_MAX
     93 NGROUPS_MAX                       _SC_NGROUPS_MAX
     94 MQ_OPEN_MAX                       _SC_MQ_OPEN_MAX
     95 MQ_PRIO_MAX                       _SC_MQ_PRIO_MAX
     96 OPEN_MAX                          _SC_OPEN_MAX
     97 _POSIX_ADVISORY_INFO              _SC_ADVISORY_INFO
     98 _POSIX_BARRIERS                   _SC_BARRIERS
     99 _POSIX_ASYNCHRONOUS_IO            _SC_ASYNCHRONOUS_IO
    100 _POSIX_CLOCK_SELECTION            _SC_CLOCK_SELECTION
    101 _POSIX_CPUTIME                    _SC_CPUTIME
    102 _POSIX_FSYNC                      _SC_FSYNC
    103 _POSIX_IPV6                       _SC_IPV6
    104 _POSIX_JOB_CONTROL                _SC_JOB_CONTROL
    105 _POSIX_MAPPED_FILES               _SC_MAPPED_FILES
    106 _POSIX_MEMLOCK                    _SC_MEMLOCK
    107 _POSIX_MEMLOCK_RANGE              _SC_MEMLOCK_RANGE
    108 _POSIX_MEMORY_PROTECTION          _SC_MEMORY_PROTECTION
    109 _POSIX_MESSAGE_PASSING            _SC_MESSAGE_PASSING
    110 _POSIX_MONOTONIC_CLOCK            _SC_MONOTONIC_CLOCK
    111 _POSIX_PRIORITIZED_IO             _SC_PRIORITIZED_IO
    112 _POSIX_PRIORITY_SCHEDULING        _SC_PRIORITY_SCHEDULING
    113 _POSIX_RAW_SOCKETS                _SC_RAW_SOCKETS
    114 _POSIX_READER_WRITER_LOCKS        _SC_READER_WRITER_LOCKS
    115 _POSIX_REALTIME_SIGNALS           _SC_REALTIME_SIGNALS
    116 _POSIX_REGEXP                     _SC_REGEXP
    117 _POSIX_SAVED_IDS                  _SC_SAVED_IDS
    118 _POSIX_SEMAPHORES                 _SC_SEMAPHORES
    119 _POSIX_SHARED_MEMORY_OBJECTS      _SC_SHARED_MEMORY_OBJECTS
    120 _POSIX_SHELL                      _SC_SHELL
    121 _POSIX_SPAWN                      _SC_SPAWN
    122 _POSIX_SPIN_LOCKS                 _SC_SPIN_LOCKS
    123 _POSIX_SPORADIC_SERVER            _SC_SPORADIC_SERVER
    124 _POSIX_SS_REPL_MAX                _SC_SS_REPL_MAX
    125 _POSIX_SYNCHRONIZED_IO            _SC_SYNCHRONIZED_IO
    126 _POSIX_THREAD_ATTR_STACKADDR      _SC_THREAD_ATTR_STACKADDR
    127 _POSIX_THREAD_ATTR_STACKSIZE      _SC_THREAD_ATTR_STACKSIZE
    128 _POSIX_THREAD_CPUTIME             _SC_THREAD_CPUTIME
    129 _POSIX_THREAD_PRIO_INHERIT        _SC_THREAD_PRIO_INHERIT
    130 _POSIX_THREAD_PRIO_PROTECT        _SC_THREAD_PRIO_PROTECT
    131 _POSIX_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
    132 _POSIX_THREAD_PROCESS_SHARED      _SC_THREAD_PROCESS_SHARED
    133 _POSIX_THREAD_ROBUST_PRIO_INHERIT _SC_THREAD_ROBUST_PRIO_INHERIT
    134 _POSIX_THREAD_ROBUST_PRIO_PROTECT _SC_THREAD_ROBUST_PRIO_PROTECT
    135 _POSIX_THREAD_SAFE_FUNCTIONS      _SC_THREAD_SAFE_FUNCTIONS
    136 _POSIX_THREAD_SPORADIC_SERVER     _SC_THREAD_SPORADIC_SERVER
    137 _POSIX_THREADS                    _SC_THREADS
    138 _POSIX_TIMEOUTS                   _SC_TIMEOUTS
    139 _POSIX_TIMERS                     _SC_TIMERS
    140 _POSIX_TRACE                      _SC_TRACE
    141 _POSIX_TRACE_EVENT_FILTER         _SC_TRACE_EVENT_FILTER
    142 _POSIX_TRACE_EVENT_NAME_MAX       _SC_TRACE_EVENT_NAME_MAX
    143 _POSIX_TRACE_INHERIT              _SC_TRACE_INHERIT
    144 _POSIX_TRACE_LOG                  _SC_TRACE_LOG
    145 _POSIX_TRACE_NAME_MAX             _SC_TRACE_NAME_MAX
    146 _POSIX_TRACE_SYS_MAX              _SC_TRACE_SYS_MAX
    147 _POSIX_TRACE_USER_EVENT_MAX       _SC_TRACE_USER_EVENT_MAX
    148 _POSIX_TYPED_MEMORY_OBJECTS       _SC_TYPED_MEMORY_OBJECTS
    149 _POSIX_VERSION                    _SC_VERSION
    150 _POSIX_V7_ILP32_OFF32             _SC_V7_ILP32_OFF32
    151 _POSIX_V7_ILP32_OFFBIG            _SC_V7_ILP32_OFFBIG
    152 _POSIX_V7_LP64_OFF64              _SC_V7_LP64_OFF64
    153 _POSIX_V7_LPBIG_OFFBIG            _SC_V7_LPBIG_OFFBIG
    154 _POSIX2_C_BIND                    _SC_2_C_BIND
    155 _POSIX2_C_DEV                     _SC_2_C_DEV
    156 _POSIX2_CHAR_TERM                 _SC_2_CHAR_TERM
    157 _POSIX2_FORT_DEV                  _SC_2_FORT_DEV
    158 _POSIX2_FORT_RUN                  _SC_2_FORT_RUN
    159 _POSIX2_LOCALEDEF                 _SC_2_LOCALEDEF
    160 _POSIX2_PBS                       _SC_2_PBS
    161 _POSIX2_PBS_ACCOUNTING            _SC_2_PBS_ACCOUNTING
    162 _POSIX2_PBS_CHECKPOINT            _SC_2_PBS_CHECKPOINT
    163 _POSIX2_PBS_LOCATE                _SC_2_PBS_LOCATE
    164 _POSIX2_PBS_MESSAGE               _SC_2_PBS_MESSAGE
    165 _POSIX2_PBS_TRACK                 _SC_2_PBS_TRACK
    166 _POSIX2_SW_DEV                    _SC_2_SW_DEV
    167 _POSIX2_UPE                       _SC_2_UPE
    168 _POSIX2_VERSION                   _SC_2_VERSION
    169 PAGE_SIZE                         _SC_PAGE_SIZE
    170 PAGESIZE                          _SC_PAGESIZE
    171 PTHREAD_DESTRUCTOR_ITERATIONS     _SC_THREAD_DESTRUCTOR_ITERATIONS
    172 PTHREAD_KEYS_MAX                  _SC_THREAD_KEYS_MAX
    173 PTHREAD_STACK_MIN                 _SC_THREAD_STACK_MIN
    174 PTHREAD_THREADS_MAX               _SC_THREAD_THREADS_MAX
    175 RE_DUP_MAX                        _SC_RE_DUP_MAX
    176 RTSIG_MAX                         _SC_RTSIG_MAX
    177 SEM_NSEMS_MAX                     _SC_SEM_NSEMS_MAX
    178 SEM_VALUE_MAX                     _SC_SEM_VALUE_MAX
    179 SIGQUEUE_MAX                      _SC_SIGQUEUE_MAX
    180 STREAM_MAX                        _SC_STREAM_MAX
    181 SYMLOOP_MAX                       _SC_SYMLOOP_MAX
    182 TIMER_MAX                         _SC_TIMER_MAX
    183 TTY_NAME_MAX                      _SC_TTY_NAME_MAX
    184 TZNAME_MAX                        _SC_TZNAME_MAX
    185 _XOPEN_CRYPT                      _SC_XOPEN_CRYPT
    186 _XOPEN_ENH_I18N                   _SC_XOPEN_ENH_I18N
    187 _XOPEN_REALTIME                   _SC_XOPEN_REALTIME
    188 _XOPEN_REALTIME_THREADS           _SC_XOPEN_REALTIME_THREADS
    189 _XOPEN_SHM                        _SC_XOPEN_SHM
    190 _XOPEN_STREAMS                    _SC_XOPEN_STREAMS
    191 _XOPEN_UNIX                       _SC_XOPEN_UNIX
    192 _XOPEN_UUCP                       _SC_XOPEN_UUCP
    193 _XOPEN_VERSION                    _SC_XOPEN_VERSION
    194 EOF
    195 
    196 ifdef pathconf_l << EOF
    197 FILESIZEBITS                _PC_FILESIZEBITS
    198 LINK_MAX                    _PC_LINK_MAX
    199 MAX_CANON                   _PC_MAX_CANON
    200 MAX_INPUT                   _PC_MAX_INPUT
    201 NAME_MAX                    _PC_NAME_MAX
    202 PATH_MAX                    _PC_PATH_MAX
    203 PIPE_BUF                    _PC_PIPE_BUF
    204 POSIX2_SYMLINKS             _PC_2_SYMLINKS
    205 POSIX_ALLOC_SIZE_MIN        _PC_ALLOC_SIZE_MIN
    206 POSIX_REC_INCR_XFER_SIZE    _PC_REC_INCR_XFER_SIZE
    207 POSIX_REC_MAX_XFER_SIZE     _PC_REC_MAX_XFER_SIZE
    208 POSIX_REC_MIN_XFER_SIZE     _PC_REC_MIN_XFER_SIZE
    209 POSIX_REC_XFER_ALIGN        _PC_REC_XFER_ALIGN
    210 SYMLINK_MAX                 _PC_SYMLINK_MAX
    211 _POSIX_CHOWN_RESTRICTED     _PC_CHOWN_RESTRICTED
    212 _POSIX_NO_TRUNC             _PC_NO_TRUNC
    213 _POSIX_VDISABLE             _PC_VDISABLE
    214 _POSIX_ASYNC_IO             _PC_ASYNC_IO
    215 _POSIX_PRIO_IO              _PC_PRIO_IO
    216 _POSIX_SYNC_IO              _PC_SYNC_IO
    217 _POSIX_TIMESTAMP_RESOLUTION _PC_TIMESTAMP_RESOLUTION
    218 EOF