diff --git a/CMakeLists.txt b/CMakeLists.txt index 48d61f5..0e0d0c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,247 +1,70 @@ project(system_cmds) +add_compile_definitions( + PRIVATE +) + add_compile_options( -nostdinc -fPIC -fblocks ) -add_darling_executable(ac ac.tproj/ac.c) -add_darling_executable(accton accton.tproj/accton.c) -add_darling_executable(arch arch.tproj/arch.c) -target_link_libraries(arch CoreFoundation) -add_darling_executable(at - at.tproj/at.c - at.tproj/panic.c - at.tproj/parsetime.c - at.tproj/perm.c -) -target_compile_definitions(at PRIVATE - -DDAEMON_UID=1 - -DDAEMON_GID=1 - -DDEFAULT_AT_QUEUE='a' - -DDEFAULT_BATCH_QUEUE='b' - -DPERM_PATH="/usr/lib/cron" -) -add_darling_executable(atrun atrun.tproj/atrun.c) -target_include_directories(atrun PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/at.tproj) -target_compile_definitions(atrun PRIVATE - -DDAEMON_UID=1 - -DDAEMON_GID=1 -) - -# Disable until we have remote_cmds (rpc_yppasswd) -#add_darling_executable(chkpasswd -# chkpasswd.tproj/file_passwd.c -# chkpasswd.tproj/nis_passwd.c # rpcsvc/yp_prot.h -# chkpasswd.tproj/od_passwd.c -# chkpasswd.tproj/pam_passwd.c -# chkpasswd.tproj/passwd.c -# chkpasswd.tproj/stringops.c -#) -#target_link_libraries(chkpasswd pam.2) -#add_darling_executable(chpass _PWSCAN_WARN -# chpass.tproj/chpass.c -# chpass.tproj/edit.c -# chpass.tproj/field.c -# chpass.tproj/open_directory.c -# chpass.tproj/pw_copy.c -# chpass.tproj/table.c -# chpass.tproj/util.c -#) -#target_include_directories(chpass PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/pwd_mkdb.tproj) -add_darling_executable(dmesg dmesg.tproj/dmesg.c) -add_darling_executable(dynamic_pager dynamic_pager.tproj/dynamic_pager.c) -#add_darling_executable(fs_usage fs_usage.tproj/fs_usage.c) -#target_compile_options(fs_usage PRIVATE -include dispatch/dispatch.h) -#target_link_libraries(fs_usage util) # FIXME: Also needs ktrace -#add_darling_executable(gcore compression.h -# gcore.tproj/corefile.c -# gcore.tproj/dyld.c -# gcore.tproj/dyld_shared_cache.c -# gcore.tproj/main.c -# gcore.tproj/sparse.c -# gcore.tproj/threads.c -# gcore.tproj/utils.c -# gcore.tproj/vanilla.c -# gcore.tproj/vm.c -#) -add_darling_executable(getconf getconf.tproj/confstr.c getconf.tproj/getconf.c getconf.tproj/limits.c getconf.tproj/pathconf.c getconf.tproj/progenv.c getconf.tproj/sysconf.c) -add_darling_executable(getty - getty.tproj/chat.c - getty.tproj/init.c - getty.tproj/main.c - getty.tproj/subr.c -) -add_darling_executable(hostinfo hostinfo.tproj/hostinfo.c) -#add_darling_executable(iostat iostat.tproj/iostat.c) # Needs IOKit -#target_compile_options(iostat PRIVATE -include errno.h) -#add_darling_executable(latency latency.tproj/latency.c) ktrace -#target_link_libraries(latency ncurses util) -add_darling_executable(login-exe - login.tproj/login.c - login.tproj/login_audit.c -) -set_target_properties(login-exe PROPERTIES OUTPUT_NAME "login") -target_link_libraries(login-exe pam.2 bsm.0) -target_compile_definitions(login-exe PRIVATE USE_PAM USE_BSM_AUDIT) -#add_darling_executable(lskq lskq.tproj/lskq.c) error: incomplete definition of type 'struct kevent_extinfo' -add_darling_executable(lsmp - lsmp.tproj/lsmp.c - lsmp.tproj/port_details.c - lsmp.tproj/task_details.c) -#add_darling_executable(memory_pressure memory_pressure.tproj/memory_pressure.c) libdispatch -add_darling_executable(mkfile mkfile.tproj/mkfile.c) -add_darling_executable(newgrp newgrp.tproj/newgrp.c) -add_darling_executable(nologin nologin.tproj/nologin.c) -#add_darling_executable(nvram nvram.tproj/nvram.c) -#target_compile_options(nvram PRIVATE -include errno.h) -#target_link_libraries(nvram CoreFoundation) -#add_darling_executable(passwd # Disabled until we have remote_cmds (yppasswd) -# passwd.tproj/file_passwd.c -# passwd.tproj/nis_passwd.c rpcsvc/yp_prot.h -# passwd.tproj/od_passwd.c open directory problems -# passwd.tproj/pam_passwd.c -# passwd.tproj/passwd.c -#) -#target_link_libraries(passwd pam.2) -add_darling_executable(purge purge.tproj/purge.c) -add_darling_executable(pwd_mkdb - pwd_mkdb.tproj/pw_scan.c - pwd_mkdb.tproj/pwd_mkdb.c -) -target_compile_definitions(pwd_mkdb PRIVATE _PW_NAME_LEN=MAXLOGNAME _PW_YPTOKEN="__YP!") -add_darling_executable(reboot reboot.tproj/reboot.c) -add_darling_executable(sa - sa.tproj/db.c - sa.tproj/main.c - sa.tproj/pdb.c - sa.tproj/usrdb.c -) -target_compile_definitions(sa PRIVATE AHZV1=64) -#add_darling_executable(sc_usage sc_usage.tproj/sc_usage.c) kernel debug -#add_darling_executable(shutdown shutdown.tproj/shutdown.c) IOKit, libbsm -add_darling_executable(sync sync.tproj/sync.c) -add_darling_executable(sysctl sysctl.tproj/sysctl.c) -#add_darling_executable(taskpolicy taskpolicy.tproj/taskpolicy.c) POSIX_SPAWN_PROC_CLAMP_NONE -#add_darling_executable(trace trace.tproj/trace.c) -#target_link_libraries(trace util) -add_darling_executable(vifs vifs.tproj/vifs.c) -add_darling_executable(vipw - vipw.tproj/pw_util.c - vipw.tproj/vipw.c -) -add_darling_executable(vm_stat vm_stat.tproj/vm_stat.c) -add_darling_executable(wait4path wait4path/wait4path.c) -add_darling_executable(zdump zdump.tproj/zdump.c) -add_darling_executable(zic - zic.tproj/ialloc.c - zic.tproj/scheck.c - zic.tproj/zic.c -) -#add_darling_executable(zprint zprint.tproj/zprint.c) IOKit - -install(TARGETS wait4path sync DESTINATION libexec/darling/bin) - -install(TARGETS at arch vm_stat getconf lsmp hostinfo login-exe DESTINATION libexec/darling/usr/bin) - -install(TARGETS zic ac vipw vifs sysctl zdump pwd_mkdb mkfile accton sa purge sysctl - DESTINATION libexec/darling/usr/sbin) - -install(TARGETS nologin reboot dynamic_pager dmesg DESTINATION libexec/darling/sbin) - -install(TARGETS getty atrun DESTINATION libexec/darling/usr/libexec - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_READ - WORLD_EXECUTE WORLD_READ -) - -install(FILES pagesize.tproj/pagesize.sh DESTINATION libexec/darling/usr/bin - RENAME pagesize - PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ - GROUP_EXECUTE GROUP_READ - WORLD_EXECUTE WORLD_READ -) - -InstallSymlink(arch ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/machine) -InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atq) -InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atrm) -InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/batch) -InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chfn) -InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chsh) -InstallSymlink(reboot ${CMAKE_INSTALL_PREFIX}/libexec/darling/sbin/halt) - -#install(FILES chkpasswd.tproj/chkpasswd.pam DESTINATION libexec/darling/etc/pam.d RENAME chkpasswd) -install(FILES passwd.tproj/passwd.pam DESTINATION libexec/darling/etc/pam.d RENAME passwd) -install(DIRECTORY login.tproj/pam.d DESTINATION libexec/darling/etc) - -install(FILES atrun.tproj/com.apple.atrun.plist DESTINATION libexec/darling/System/Library/LaunchDaemons) - -install(FILES - arch.tproj/arch.1 - arch.tproj/machine.1 - at.tproj/at.1 - chpass.tproj/chpass.1 - fs_usage.tproj/fs_usage.1 - gcore.tproj/gcore.1 - getconf.tproj/getconf.1 - latency.tproj/latency.1 - login.tproj/login.1 - lskq.tproj/lskq.1 - lsmp.tproj/lsmp.1 - memory_pressure.tproj/memory_pressure.1 - newgrp.tproj/newgrp.1 - pagesize.tproj/pagesize.1 - passwd.tproj/passwd.1 - sc_usage.tproj/sc_usage.1 - trace.tproj/trace.1 - vm_stat.tproj/vm_stat.1 - wait4path/wait4path.1 - zprint.tproj/zprint.1 - - DESTINATION libexec/darling/usr/share/man/man1 -) -InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atq.1) -InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atrm.1) -InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/batch.1) -InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chfn.1) -InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chsh.1) - -install(FILES - getty.tproj/gettytab.5 - getty.tproj/ttys.5 - nologin.tproj/nologin.5 - sysctl.tproj/sysctl.conf.5 - - DESTINATION libexec/darling/usr/share/man/man5 -) - -install(FILES - ac.tproj/ac.8 - accton.tproj/accton.8 - atrun.tproj/atrun.8 - chkpasswd.tproj/chkpasswd.8 - dmesg.tproj/dmesg.8 - dynamic_pager.tproj/dynamic_pager.8 - getty.tproj/getty.8 - hostinfo.tproj/hostinfo.8 - iostat.tproj/iostat.8 - mkfile.tproj/mkfile.8 - nologin.tproj/nologin.8 - nvram.tproj/nvram.8 - purge.tproj/purge.8 - pwd_mkdb.tproj/pwd_mkdb.8 - reboot.tproj/reboot.8 - sa.tproj/sa.8 - shutdown.tproj/shutdown.8 - sync.tproj/sync.8 - sysctl.tproj/sysctl.8 - taskpolicy.tproj/taskpolicy.8 - vifs.tproj/vifs.8 - vipw.tproj/vipw.8 - zdump.tproj/zdump.8 - zic.tproj/zic.8 - - DESTINATION libexec/darling/usr/share/man/man8 -) -InstallSymlink(reboot.8 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man8/halt.8) +add_subdirectory(ac.tproj) +add_subdirectory(accton.tproj) +add_subdirectory(arch.tproj) +add_subdirectory(at.tproj) +add_subdirectory(atrun.tproj) +#add_subdirectory(chkpasswd.tproj) # missing `rpcsvc/yppasswd.h` +add_subdirectory(chpass.tproj) # compiles, but it's broken because OpenDirectory is just a stub +add_subdirectory(cpuctl.tproj) +add_subdirectory(dmesg.tproj) +add_subdirectory(dynamic_pager.tproj) +#add_subdirectory(fs_usage.tproj) # missing ktrace stuff +add_subdirectory(gcore.tproj) +add_subdirectory(getconf.tproj) +add_subdirectory(getty.tproj) +add_subdirectory(hostinfo.tproj) +add_subdirectory(iosim.tproj) +add_subdirectory(iostat.tproj) +add_subdirectory(kpgo.tproj) +add_subdirectory(latency.tproj) +add_subdirectory(login.tproj) +# missing EVFILT_NW_CHANNEL definition +# it *is* defined in the new libdispatch sources, and it seems like it *should* be defined in sys/event.h, +# but it's not (yes, even after updating kernel sources). for now, just don't build this. +# it's just a developer utility anyways +#add_subdirectory(lskq.tproj) +add_subdirectory(lsmp.tproj) +add_subdirectory(ltop.tproj) +add_subdirectory(mean.tproj) +add_subdirectory(memory_pressure.tproj) +add_subdirectory(mkfile.tproj) +add_subdirectory(mslutil) +add_subdirectory(newgrp.tproj) +add_subdirectory(nologin.tproj) +add_subdirectory(nvram.tproj) +add_subdirectory(pagesize.tproj) +#add_subdirectory(passwd.tproj) # missing `rpcsvc/yppasswd.h` +add_subdirectory(proc_uuid_policy.tproj) +add_subdirectory(purge.tproj) +add_subdirectory(pwd_mkdb.tproj) +add_subdirectory(reboot.tproj) +add_subdirectory(sa.tproj) +add_subdirectory(sc_usage.tproj) +add_subdirectory(shutdown.tproj) +add_subdirectory(stackshot.tproj) +add_subdirectory(sync.tproj) +add_subdirectory(sysctl.tproj) +add_subdirectory(taskpolicy.tproj) +add_subdirectory(trace.tproj) +add_subdirectory(vifs.tproj) +add_subdirectory(vipw.tproj) +add_subdirectory(vm_purgeable_stat.tproj) +add_subdirectory(vm_stat.tproj) +add_subdirectory(wait4path) +add_subdirectory(wordexp-helper.tproj) +add_subdirectory(zdump.tproj) +add_subdirectory(zic.tproj) +add_subdirectory(zlog.tproj) +add_subdirectory(zprint.tproj) diff --git a/ac.tproj/CMakeLists.txt b/ac.tproj/CMakeLists.txt new file mode 100644 index 0000000..0af7026 --- /dev/null +++ b/ac.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-ac) + +add_darling_executable(ac + ac.c +) + +install(TARGETS ac DESTINATION libexec/darling/usr/sbin) + +install(FILES ac.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/accton.tproj/CMakeLists.txt b/accton.tproj/CMakeLists.txt new file mode 100644 index 0000000..98b301f --- /dev/null +++ b/accton.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-accton) + +add_darling_executable(accton + accton.c +) + +install(TARGETS accton DESTINATION libexec/darling/usr/sbin) + +install(FILES accton.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/arch.tproj/CMakeLists.txt b/arch.tproj/CMakeLists.txt new file mode 100644 index 0000000..5ab80ce --- /dev/null +++ b/arch.tproj/CMakeLists.txt @@ -0,0 +1,15 @@ +project(system_cmds-arch) + +add_darling_executable(arch + arch.c +) + +target_link_libraries(arch + CoreFoundation +) + +install(TARGETS arch DESTINATION libexec/darling/usr/bin) + +install(FILES arch.1 machine.1 DESTINATION libexec/darling/usr/share/man/man1) + +InstallSymlink(arch ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/machine) diff --git a/at.tproj/CMakeLists.txt b/at.tproj/CMakeLists.txt new file mode 100644 index 0000000..6f39883 --- /dev/null +++ b/at.tproj/CMakeLists.txt @@ -0,0 +1,30 @@ +project(system_cmds-at) + +add_compile_definitions( + DAEMON_UID=1 + DAEMON_GID=1 + DEFAULT_AT_QUEUE='a' + DEFAULT_BATCH_QUEUE='b' + PERM_PATH="/usr/lib/cron/" +) + +add_darling_executable(at + at.c + panic.c + parsetime.c + perm.c +) + +install(TARGETS at DESTINATION libexec/darling/usr/bin) + +install(FILES at.1 DESTINATION libexec/darling/usr/share/man/man1) + +InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atq) +InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/atrm) +InstallSymlink(at ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/batch) + +InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atq.1) +InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/atrm.1) +InstallSymlink(at.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/batch.1) + +InstallSymlink("../../var/at" "${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/lib/cron") diff --git a/atrun.tproj/CMakeLists.txt b/atrun.tproj/CMakeLists.txt new file mode 100644 index 0000000..42165e6 --- /dev/null +++ b/atrun.tproj/CMakeLists.txt @@ -0,0 +1,20 @@ +project(system_cmds-atrun) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/../at.tproj +) + +add_compile_definitions( + DAEMON_UID=1 + DAEMON_GID=1 +) + +add_darling_executable(atrun + atrun.c +) + +install(TARGETS atrun DESTINATION libexec/darling/usr/libexec) + +install(FILES atrun.8 DESTINATION libexec/darling/usr/share/man/man8) + +install(FILES com.apple.atrun.plist DESTINATION libexec/darling/System/Library/LaunchDaemons) diff --git a/chkpasswd.tproj/CMakeLists.txt b/chkpasswd.tproj/CMakeLists.txt new file mode 100644 index 0000000..d4b4313 --- /dev/null +++ b/chkpasswd.tproj/CMakeLists.txt @@ -0,0 +1,18 @@ +project(system_cmds-chkpasswd) + +add_darling_executable(chkpasswd + file_passwd.c + nis_passwd.c + od_passwd.c + pam_passwd.c + passwd.c + stringops.c +) + +target_link_libraries(chkpasswd + pam.2 + CoreFoundation + OpenDirectory +) + +install(FILES chkpasswd.pam DESTINATION libexec/darling/etc/pam.d RENAME chkpasswd) diff --git a/chpass.tproj/CMakeLists.txt b/chpass.tproj/CMakeLists.txt new file mode 100644 index 0000000..686d436 --- /dev/null +++ b/chpass.tproj/CMakeLists.txt @@ -0,0 +1,37 @@ +project(system_cmds-chpass) + +include_directories( + ../vipw.tproj +) + +add_compile_definitions( + OPEN_DIRECTORY +) + +add_darling_executable(chpass + chpass.c + edit.c + field.c + open_directory.c + pw_copy.c + table.c + util.c + + # not in Xcode build files but apparently necessary + ../vipw.tproj/pw_util.c +) + +target_link_libraries(chpass + CoreFoundation + OpenDirectory +) + +install(TARGETS chpass DESTINATION libexec/darling/usr/bin) + +InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chfn) +InstallSymlink(chpass ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/bin/chsh) + +install(FILES chpass.1 DESTINATION libexec/darling/usr/share/man/man1) + +InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chfn.1) +InstallSymlink(chpass.1 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man1/chsh.1) diff --git a/cpuctl.tproj/CMakeLists.txt b/cpuctl.tproj/CMakeLists.txt new file mode 100644 index 0000000..351a4c1 --- /dev/null +++ b/cpuctl.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-cpuctl) + +add_darling_executable(cpuctl + cpuctl.c +) + +install(TARGETS cpuctl DESTINATION libexec/darling/usr/bin) + +install(FILES cpuctl.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/dmesg.tproj/CMakeLists.txt b/dmesg.tproj/CMakeLists.txt new file mode 100644 index 0000000..0bdcd55 --- /dev/null +++ b/dmesg.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-dmesg) + +add_darling_executable(dmesg + dmesg.c +) + +install(TARGETS dmesg DESTINATION libexec/darling/sbin) + +install(FILES dmesg.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/dynamic_pager.tproj/CMakeLists.txt b/dynamic_pager.tproj/CMakeLists.txt new file mode 100644 index 0000000..34a3bfb --- /dev/null +++ b/dynamic_pager.tproj/CMakeLists.txt @@ -0,0 +1,20 @@ +project(system_cmds-dynamic_pager) + +add_compile_definitions( + NO_DIRECT_RPC +) + +add_darling_executable(dynamic_pager + dynamic_pager.c +) + +target_link_libraries(dynamic_pager + SystemConfiguration + CoreFoundation +) + +install(TARGETS dynamic_pager DESTINATION libexec/darling/sbin) + +install(FILES dynamic_pager.8 DESTINATION libexec/darling/usr/share/man/man8) + +#install(FILES com.apple.dynamic_pager.plist DESTINATION libexec/darling/System/Library/LaunchDaemons) diff --git a/fs_usage.tproj/CMakeLists.txt b/fs_usage.tproj/CMakeLists.txt new file mode 100644 index 0000000..37decf7 --- /dev/null +++ b/fs_usage.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-fs_usage) + +add_darling_executable(fs_usage + fs_usage.c +) + +target_link_libraries(fs_usage + ktrace + util +) + +install(TARGETS fs_usage DESTINATION libexec/darling/usr/bin) + +install(FILES fs_usage.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/gcore.tproj/CMakeLists.txt b/gcore.tproj/CMakeLists.txt new file mode 100644 index 0000000..4f49ee5 --- /dev/null +++ b/gcore.tproj/CMakeLists.txt @@ -0,0 +1,23 @@ +project(system_cmds-gcore) + +add_darling_executable(gcore + convert.c + corefile.c + dyld_shared_cache.c + dyld.c + main.c + sparse.c + threads.c + utils.c + vanilla.c + vm.c +) + +target_link_libraries(gcore + util + compression +) + +install(TARGETS gcore DESTINATION libexec/darling/usr/bin) + +install(FILES gcore.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/gen/getconf.tproj/confstr.c b/gen/getconf.tproj/confstr.c new file mode 100644 index 0000000..9a88ff5 --- /dev/null +++ b/gen/getconf.tproj/confstr.c @@ -0,0 +1,205 @@ +/* + * Copyright is disclaimed as to the contents of this file. + * + * $FreeBSD: src/usr.bin/getconf/confstr.gperf,v 1.5 2003/08/22 17:32:07 markm Exp $ + */ + +#include + +#include +#include + +#include "getconf.h" + +/* + * Override gperf's built-in external scope. + */ +static const struct map *in_word_set(const char *str); + +/* + * The Standard seems a bit ambiguous over whether the POSIX_V6_* + * are specified with or without a leading underscore, so we just + * use both. + */ +struct map { const char *name; int key; int valid; }; +static const struct map wordlist[] = { +#ifdef _CS_PATH + { "PATH", _CS_PATH, 1 }, +#else + { "PATH", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS + { "POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS, 1 }, +#else + { "POSIX_V6_ILP32_OFF32_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS + { "POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, 1 }, +#else + { "POSIX_V6_ILP32_OFF32_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS + { "POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS, 1 }, +#else + { "POSIX_V6_ILP32_OFF32_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS + { "POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, 1 }, +#else + { "POSIX_V6_ILP32_OFFBIG_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS + { "POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, 1 }, +#else + { "POSIX_V6_ILP32_OFFBIG_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS + { "POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS, 1 }, +#else + { "POSIX_V6_ILP32_OFFBIG_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS + { "POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS, 1 }, +#else + { "POSIX_V6_LP64_OFF64_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS + { "POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS, 1 }, +#else + { "POSIX_V6_LP64_OFF64_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS + { "POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS, 1 }, +#else + { "POSIX_V6_LP64_OFF64_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS + { "POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, 1 }, +#else + { "POSIX_V6_LPBIG_OFFBIG_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS + { "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, 1 }, +#else + { "POSIX_V6_LPBIG_OFFBIG_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS + { "POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, 1 }, +#else + { "POSIX_V6_LPBIG_OFFBIG_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS + { "POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS, 1 }, +#else + { "POSIX_V6_WIDTH_RESTRICTED_ENVS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_CFLAGS + { "_POSIX_V6_ILP32_OFF32_CFLAGS", _CS_POSIX_V6_ILP32_OFF32_CFLAGS, 1 }, +#else + { "_POSIX_V6_ILP32_OFF32_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LDFLAGS + { "_POSIX_V6_ILP32_OFF32_LDFLAGS", _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, 1 }, +#else + { "_POSIX_V6_ILP32_OFF32_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFF32_LIBS + { "_POSIX_V6_ILP32_OFF32_LIBS", _CS_POSIX_V6_ILP32_OFF32_LIBS, 1 }, +#else + { "_POSIX_V6_ILP32_OFF32_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS + { "_POSIX_V6_ILP32_OFFBIG_CFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, 1 }, +#else + { "_POSIX_V6_ILP32_OFFBIG_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS + { "_POSIX_V6_ILP32_OFFBIG_LDFLAGS", _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, 1 }, +#else + { "_POSIX_V6_ILP32_OFFBIG_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_ILP32_OFFBIG_LIBS + { "_POSIX_V6_ILP32_OFFBIG_LIBS", _CS_POSIX_V6_ILP32_OFFBIG_LIBS, 1 }, +#else + { "_POSIX_V6_ILP32_OFFBIG_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_CFLAGS + { "_POSIX_V6_LP64_OFF64_CFLAGS", _CS_POSIX_V6_LP64_OFF64_CFLAGS, 1 }, +#else + { "_POSIX_V6_LP64_OFF64_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LDFLAGS + { "_POSIX_V6_LP64_OFF64_LDFLAGS", _CS_POSIX_V6_LP64_OFF64_LDFLAGS, 1 }, +#else + { "_POSIX_V6_LP64_OFF64_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LP64_OFF64_LIBS + { "_POSIX_V6_LP64_OFF64_LIBS", _CS_POSIX_V6_LP64_OFF64_LIBS, 1 }, +#else + { "_POSIX_V6_LP64_OFF64_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS + { "_POSIX_V6_LPBIG_OFFBIG_CFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, 1 }, +#else + { "_POSIX_V6_LPBIG_OFFBIG_CFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS + { "_POSIX_V6_LPBIG_OFFBIG_LDFLAGS", _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, 1 }, +#else + { "_POSIX_V6_LPBIG_OFFBIG_LDFLAGS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_LPBIG_OFFBIG_LIBS + { "_POSIX_V6_LPBIG_OFFBIG_LIBS", _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, 1 }, +#else + { "_POSIX_V6_LPBIG_OFFBIG_LIBS", 0, 0 }, +#endif +#ifdef _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS + { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS, 1 }, +#else + { "_POSIX_V6_WIDTH_RESTRICTED_ENVS", 0, 0 }, +#endif +#ifdef _CS_DARWIN_USER_DIR + { "DARWIN_USER_DIR", _CS_DARWIN_USER_DIR, 1 }, +#else + { "DARWIN_USER_DIR", 0, 0 }, +#endif +#ifdef _CS_DARWIN_USER_TEMP_DIR + { "DARWIN_USER_TEMP_DIR", _CS_DARWIN_USER_TEMP_DIR, 1 }, +#else + { "DARWIN_USER_TEMP_DIR", 0, 0 }, +#endif +#ifdef _CS_DARWIN_USER_CACHE_DIR + { "DARWIN_USER_CACHE_DIR", _CS_DARWIN_USER_CACHE_DIR, 1 }, +#else + { "DARWIN_USER_CACHE_DIR", 0, 0 }, +#endif + { NULL, 0, 0 } +}; +#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1) +static const struct map * +in_word_set(const char *word) +{ + const struct map *mp; + + for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) { + if (strcmp(word, mp->name) == 0) + return (mp); + } + return (NULL); +} + +int +find_confstr(const char *name, int *key) +{ + const struct map *rv; + + rv = in_word_set(name); + if (rv != NULL) { + if (rv->valid) { + *key = rv->key; + return 1; + } + return -1; + } + return 0; +} diff --git a/gen/getconf.tproj/limits.c b/gen/getconf.tproj/limits.c new file mode 100644 index 0000000..0033721 --- /dev/null +++ b/gen/getconf.tproj/limits.c @@ -0,0 +1,474 @@ +/* + * Copyright is disclaimed as to the contents of this file. + * + * $FreeBSD: src/usr.bin/getconf/limits.gperf,v 1.2 2003/08/22 17:32:07 markm Exp $ + */ + +#include + +#include +#include +#ifdef APPLE_GETCONF_UNDERSCORE +#include +#endif /* APPLE_GETCONF_UNDERSCORE */ + +#include "getconf.h" + +/* + * Override gperf's built-in external scope. + */ +static const struct map *in_word_set(const char *str); + +struct map { const char *name; intmax_t value; int valid; }; +static const struct map wordlist[] = { +#ifdef _POSIX_AIO_LISTIO_MAX + { "_POSIX_AIO_LISTIO_MAX", _POSIX_AIO_LISTIO_MAX, 1 }, +#else + { "_POSIX_AIO_LISTIO_MAX", 0, 0 }, +#endif +#ifdef _POSIX_AIO_MAX + { "_POSIX_AIO_MAX", _POSIX_AIO_MAX, 1 }, +#else + { "_POSIX_AIO_MAX", 0, 0 }, +#endif +#ifdef _POSIX_ARG_MAX + { "_POSIX_ARG_MAX", _POSIX_ARG_MAX, 1 }, +#else + { "_POSIX_ARG_MAX", 0, 0 }, +#endif +#ifdef _POSIX_CHILD_MAX + { "_POSIX_CHILD_MAX", _POSIX_CHILD_MAX, 1 }, +#else + { "_POSIX_CHILD_MAX", 0, 0 }, +#endif +#ifdef _POSIX_CLOCKRES_MIN + { "_POSIX_CLOCKRES_MIN", _POSIX_CLOCKRES_MIN, 1 }, +#else + { "_POSIX_CLOCKRES_MIN", 0, 0 }, +#endif +#ifdef _POSIX_DELAYTIMER_MAX + { "_POSIX_DELAYTIMER_MAX", _POSIX_DELAYTIMER_MAX, 1 }, +#else + { "_POSIX_DELAYTIMER_MAX", 0, 0 }, +#endif +#ifdef _POSIX_HOST_NAME_MAX + { "_POSIX_HOST_NAME_MAX", _POSIX_HOST_NAME_MAX, 1 }, +#else + { "_POSIX_HOST_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_LINK_MAX + { "_POSIX_LINK_MAX", _POSIX_LINK_MAX, 1 }, +#else + { "_POSIX_LINK_MAX", 0, 0 }, +#endif +#ifdef _POSIX_LOGIN_NAME_MAX + { "_POSIX_LOGIN_NAME_MAX", _POSIX_LOGIN_NAME_MAX, 1 }, +#else + { "_POSIX_LOGIN_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_MAX_CANON + { "_POSIX_MAX_CANON", _POSIX_MAX_CANON, 1 }, +#else + { "_POSIX_MAX_CANON", 0, 0 }, +#endif +#ifdef _POSIX_MAX_INPUT + { "_POSIX_MAX_INPUT", _POSIX_MAX_INPUT, 1 }, +#else + { "_POSIX_MAX_INPUT", 0, 0 }, +#endif +#ifdef _POSIX_MQ_OPEN_MAX + { "_POSIX_MQ_OPEN_MAX", _POSIX_MQ_OPEN_MAX, 1 }, +#else + { "_POSIX_MQ_OPEN_MAX", 0, 0 }, +#endif +#ifdef _POSIX_MQ_PRIO_MAX + { "_POSIX_MQ_PRIO_MAX", _POSIX_MQ_PRIO_MAX, 1 }, +#else + { "_POSIX_MQ_PRIO_MAX", 0, 0 }, +#endif +#ifdef _POSIX_NAME_MAX + { "_POSIX_NAME_MAX", _POSIX_NAME_MAX, 1 }, +#else + { "_POSIX_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_NGROUPS_MAX + { "_POSIX_NGROUPS_MAX", _POSIX_NGROUPS_MAX, 1 }, +#else + { "_POSIX_NGROUPS_MAX", 0, 0 }, +#endif +#ifdef _POSIX_OPEN_MAX + { "_POSIX_OPEN_MAX", _POSIX_OPEN_MAX, 1 }, +#else + { "_POSIX_OPEN_MAX", 0, 0 }, +#endif +#ifdef _POSIX_PATH_MAX + { "_POSIX_PATH_MAX", _POSIX_PATH_MAX, 1 }, +#else + { "_POSIX_PATH_MAX", 0, 0 }, +#endif +#ifdef _POSIX_PIPE_BUF + { "_POSIX_PIPE_BUF", _POSIX_PIPE_BUF, 1 }, +#else + { "_POSIX_PIPE_BUF", 0, 0 }, +#endif +#ifdef _POSIX_RE_DUP_MAX + { "_POSIX_RE_DUP_MAX", _POSIX_RE_DUP_MAX, 1 }, +#else + { "_POSIX_RE_DUP_MAX", 0, 0 }, +#endif +#ifdef _POSIX_RTSIG_MAX + { "_POSIX_RTSIG_MAX", _POSIX_RTSIG_MAX, 1 }, +#else + { "_POSIX_RTSIG_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SEM_NSEMS_MAX + { "_POSIX_SEM_NSEMS_MAX", _POSIX_SEM_NSEMS_MAX, 1 }, +#else + { "_POSIX_SEM_NSEMS_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SEM_VALUE_MAX + { "_POSIX_SEM_VALUE_MAX", _POSIX_SEM_VALUE_MAX, 1 }, +#else + { "_POSIX_SEM_VALUE_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SIGQUEUE_MAX + { "_POSIX_SIGQUEUE_MAX", _POSIX_SIGQUEUE_MAX, 1 }, +#else + { "_POSIX_SIGQUEUE_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SSIZE_MAX + { "_POSIX_SSIZE_MAX", _POSIX_SSIZE_MAX, 1 }, +#else + { "_POSIX_SSIZE_MAX", 0, 0 }, +#endif +#ifdef _POSIX_STREAM_MAX + { "_POSIX_STREAM_MAX", _POSIX_STREAM_MAX, 1 }, +#else + { "_POSIX_STREAM_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SS_REPL_MAX + { "_POSIX_SS_REPL_MAX", _POSIX_SS_REPL_MAX, 1 }, +#else + { "_POSIX_SS_REPL_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SYMLINK_MAX + { "_POSIX_SYMLINK_MAX", _POSIX_SYMLINK_MAX, 1 }, +#else + { "_POSIX_SYMLINK_MAX", 0, 0 }, +#endif +#ifdef _POSIX_SYMLOOP_MAX + { "_POSIX_SYMLOOP_MAX", _POSIX_SYMLOOP_MAX, 1 }, +#else + { "_POSIX_SYMLOOP_MAX", 0, 0 }, +#endif +#ifdef _POSIX_THREAD_DESTRUCTOR_ITERATIONS + { "_POSIX_THREAD_DESTRUCTOR_ITERATIONS", _POSIX_THREAD_DESTRUCTOR_ITERATIONS, 1 }, +#else + { "_POSIX_THREAD_DESTRUCTOR_ITERATIONS", 0, 0 }, +#endif +#ifdef _POSIX_THREAD_KEYS_MAX + { "_POSIX_THREAD_KEYS_MAX", _POSIX_THREAD_KEYS_MAX, 1 }, +#else + { "_POSIX_THREAD_KEYS_MAX", 0, 0 }, +#endif +#ifdef _POSIX_THREAD_THREADS_MAX + { "_POSIX_THREAD_THREADS_MAX", _POSIX_THREAD_THREADS_MAX, 1 }, +#else + { "_POSIX_THREAD_THREADS_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TIMER_MAX + { "_POSIX_TIMER_MAX", _POSIX_TIMER_MAX, 1 }, +#else + { "_POSIX_TIMER_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TRACE_EVENT_NAME_MAX + { "_POSIX_TRACE_EVENT_NAME_MAX", _POSIX_TRACE_EVENT_NAME_MAX, 1 }, +#else + { "_POSIX_TRACE_EVENT_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TRACE_NAME_MAX + { "_POSIX_TRACE_NAME_MAX", _POSIX_TRACE_NAME_MAX, 1 }, +#else + { "_POSIX_TRACE_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TRACE_SYS_MAX + { "_POSIX_TRACE_SYS_MAX", _POSIX_TRACE_SYS_MAX, 1 }, +#else + { "_POSIX_TRACE_SYS_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TRACE_USER_EVENT_MAX + { "_POSIX_TRACE_USER_EVENT_MAX", _POSIX_TRACE_USER_EVENT_MAX, 1 }, +#else + { "_POSIX_TRACE_USER_EVENT_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TTY_NAME_MAX + { "_POSIX_TTY_NAME_MAX", _POSIX_TTY_NAME_MAX, 1 }, +#else + { "_POSIX_TTY_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX_TZNAME_MAX + { "_POSIX_TZNAME_MAX", _POSIX_TZNAME_MAX, 1 }, +#else + { "_POSIX_TZNAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_BC_BASE_MAX + { "_POSIX2_BC_BASE_MAX", _POSIX2_BC_BASE_MAX, 1 }, +#else + { "_POSIX2_BC_BASE_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_BC_DIM_MAX + { "_POSIX2_BC_DIM_MAX", _POSIX2_BC_DIM_MAX, 1 }, +#else + { "_POSIX2_BC_DIM_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_BC_SCALE_MAX + { "_POSIX2_BC_SCALE_MAX", _POSIX2_BC_SCALE_MAX, 1 }, +#else + { "_POSIX2_BC_SCALE_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_BC_STRING_MAX + { "_POSIX2_BC_STRING_MAX", _POSIX2_BC_STRING_MAX, 1 }, +#else + { "_POSIX2_BC_STRING_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_CHARCLASS_NAME_MAX + { "_POSIX2_CHARCLASS_NAME_MAX", _POSIX2_CHARCLASS_NAME_MAX, 1 }, +#else + { "_POSIX2_CHARCLASS_NAME_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_COLL_WEIGHTS_MAX + { "_POSIX2_COLL_WEIGHTS_MAX", _POSIX2_COLL_WEIGHTS_MAX, 1 }, +#else + { "_POSIX2_COLL_WEIGHTS_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_EXPR_NEST_MAX + { "_POSIX2_EXPR_NEST_MAX", _POSIX2_EXPR_NEST_MAX, 1 }, +#else + { "_POSIX2_EXPR_NEST_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_LINE_MAX + { "_POSIX2_LINE_MAX", _POSIX2_LINE_MAX, 1 }, +#else + { "_POSIX2_LINE_MAX", 0, 0 }, +#endif +#ifdef _POSIX2_RE_DUP_MAX + { "_POSIX2_RE_DUP_MAX", _POSIX2_RE_DUP_MAX, 1 }, +#else + { "_POSIX2_RE_DUP_MAX", 0, 0 }, +#endif +#ifdef _XOPEN_IOV_MAX + { "_XOPEN_IOV_MAX", _XOPEN_IOV_MAX, 1 }, +#else + { "_XOPEN_IOV_MAX", 0, 0 }, +#endif +#ifdef _XOPEN_NAME_MAX + { "_XOPEN_NAME_MAX", _XOPEN_NAME_MAX, 1 }, +#else + { "_XOPEN_NAME_MAX", 0, 0 }, +#endif +#ifdef _XOPEN_PATH_MAX + { "_XOPEN_PATH_MAX", _XOPEN_PATH_MAX, 1 }, +#else + { "_XOPEN_PATH_MAX", 0, 0 }, +#endif +#ifdef CHAR_BIT + { "CHAR_BIT", CHAR_BIT, 1 }, +#else + { "CHAR_BIT", 0, 0 }, +#endif +#ifdef CHAR_MAX + { "CHAR_MAX", CHAR_MAX, 1 }, +#else + { "CHAR_MAX", 0, 0 }, +#endif +#ifdef CHAR_MIN + { "CHAR_MIN", CHAR_MIN, 1 }, +#else + { "CHAR_MIN", 0, 0 }, +#endif +#ifdef INT_MAX + { "INT_MAX", INT_MAX, 1 }, +#else + { "INT_MAX", 0, 0 }, +#endif +#ifdef INT_MIN + { "INT_MIN", INT_MIN, 1 }, +#else + { "INT_MIN", 0, 0 }, +#endif +#ifdef LLONG_MIN + { "LLONG_MIN", LLONG_MIN, 1 }, +#else + { "LLONG_MIN", 0, 0 }, +#endif +#ifdef LLONG_MAX + { "LLONG_MAX", LLONG_MAX, 1 }, +#else + { "LLONG_MAX", 0, 0 }, +#endif +#ifdef LONG_BIT + { "LONG_BIT", LONG_BIT, 1 }, +#else + { "LONG_BIT", 0, 0 }, +#endif +#ifdef LONG_MAX + { "LONG_MAX", LONG_MAX, 1 }, +#else + { "LONG_MAX", 0, 0 }, +#endif +#ifdef LONG_MIN + { "LONG_MIN", LONG_MIN, 1 }, +#else + { "LONG_MIN", 0, 0 }, +#endif +#ifdef MB_LEN_MAX + { "MB_LEN_MAX", MB_LEN_MAX, 1 }, +#else + { "MB_LEN_MAX", 0, 0 }, +#endif +#ifdef SCHAR_MAX + { "SCHAR_MAX", SCHAR_MAX, 1 }, +#else + { "SCHAR_MAX", 0, 0 }, +#endif +#ifdef SCHAR_MIN + { "SCHAR_MIN", SCHAR_MIN, 1 }, +#else + { "SCHAR_MIN", 0, 0 }, +#endif +#ifdef SHRT_MAX + { "SHRT_MAX", SHRT_MAX, 1 }, +#else + { "SHRT_MAX", 0, 0 }, +#endif +#ifdef SHRT_MIN + { "SHRT_MIN", SHRT_MIN, 1 }, +#else + { "SHRT_MIN", 0, 0 }, +#endif +#ifdef SSIZE_MAX + { "SSIZE_MAX", SSIZE_MAX, 1 }, +#else + { "SSIZE_MAX", 0, 0 }, +#endif +#ifdef UCHAR_MAX + { "UCHAR_MAX", UCHAR_MAX, 1 }, +#else + { "UCHAR_MAX", 0, 0 }, +#endif +#ifdef UINT_MAX + { "UINT_MAX", UINT_MAX, 1 }, +#else + { "UINT_MAX", 0, 0 }, +#endif +#ifdef ULLONG_MAX + { "ULLONG_MAX", ULLONG_MAX, 1 }, +#else + { "ULLONG_MAX", 0, 0 }, +#endif +#ifdef ULONG_MAX + { "ULONG_MAX", ULONG_MAX, 1 }, +#else + { "ULONG_MAX", 0, 0 }, +#endif +#ifdef USHRT_MAX + { "USHRT_MAX", USHRT_MAX, 1 }, +#else + { "USHRT_MAX", 0, 0 }, +#endif +#ifdef WORD_BIT + { "WORD_BIT", WORD_BIT, 1 }, +#else + { "WORD_BIT", 0, 0 }, +#endif +#ifdef CHARCLASS_NAME_MAX + { "CHARCLASS_NAME_MAX", CHARCLASS_NAME_MAX, 1 }, +#else + { "CHARCLASS_NAME_MAX", 0, 0 }, +#endif +#ifdef NL_ARGMAX + { "NL_ARGMAX", NL_ARGMAX, 1 }, +#else + { "NL_ARGMAX", 0, 0 }, +#endif +#ifdef NL_LANGMAX + { "ML_LANGMAX", NL_LANGMAX, 1 }, +#else + { "ML_LANGMAX", 0, 0 }, +#endif +#ifdef NL_MSGMAX + { "NL_MSGMAX", NL_MSGMAX, 1 }, +#else + { "NL_MSGMAX", 0, 0 }, +#endif +#ifdef NL_NMAX + { "NL_NMAX", NL_NMAX, 1 }, +#else + { "NL_NMAX", 0, 0 }, +#endif +#ifdef NL_SETMAX + { "NL_SETMAX", NL_SETMAX, 1 }, +#else + { "NL_SETMAX", 0, 0 }, +#endif +#ifdef NL_TEXTMAX + { "NL_TEXTMAX", NL_TEXTMAX, 1 }, +#else + { "NL_TEXTMAX", 0, 0 }, +#endif +#ifdef NZERO + { "NZERO", NZERO, 1 }, +#else + { "NZERO", 0, 0 }, +#endif + { NULL, 0, 0 } +}; +#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1) +static const struct map * +in_word_set(const char *word) +{ + const struct map *mp; + + for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) { + if (strcmp(word, mp->name) == 0) + return (mp); + } + return (NULL); +} + +int +find_limit(const char *name, intmax_t *value) +{ + const struct map *rv; +#ifdef APPLE_GETCONF_UNDERSCORE + char *alt; +#endif /* APPLE_GETCONF_UNDERSCORE */ + + rv = in_word_set(name); + if (rv != NULL) { + if (rv->valid) { + *value = rv->value; + return 1; + } + return -1; + } +#ifdef APPLE_GETCONF_UNDERSCORE + if(*name == '_') + alt = (char *)name + 1; + else { + if((alt = (char *)alloca(strlen(name) + 2)) == NULL) + return 0; + *alt = '_'; + strcpy(alt + 1, name); + } + rv = in_word_set(alt); + if (rv != NULL) { + if (rv->valid) { + *value = rv->value; + return 1; + } + return -1; + } +#endif /* APPLE_GETCONF_UNDERSCORE */ + return 0; +} diff --git a/gen/getconf.tproj/pathconf.c b/gen/getconf.tproj/pathconf.c new file mode 100644 index 0000000..57ed3c5 --- /dev/null +++ b/gen/getconf.tproj/pathconf.c @@ -0,0 +1,204 @@ +/* + * Copyright is disclaimed as to the contents of this file. + * + * $FreeBSD: src/usr.bin/getconf/pathconf.gperf,v 1.4 2003/08/22 17:32:07 markm Exp $ + */ + +#include + +#include +#include +#ifdef APPLE_GETCONF_UNDERSCORE +#include +#endif /* APPLE_GETCONF_UNDERSCORE */ + +#include "getconf.h" + +/* + * Override gperf's built-in external scope. + */ +static const struct map *in_word_set(const char *str); + +struct map { const char *name; int key; int valid; }; +static const struct map wordlist[] = { +#ifdef _PC_FILESIZEBITS + { "FILESIZEBITS", _PC_FILESIZEBITS, 1 }, +#else + { "FILESIZEBITS", 0, 0 }, +#endif +#ifdef _PC_LINK_MAX + { "LINK_MAX", _PC_LINK_MAX, 1 }, +#else + { "LINK_MAX", 0, 0 }, +#endif +#ifdef _PC_MAX_CANON + { "MAX_CANON", _PC_MAX_CANON, 1 }, +#else + { "MAX_CANON", 0, 0 }, +#endif +#ifdef _PC_MAX_INPUT + { "MAX_INPUT", _PC_MAX_INPUT, 1 }, +#else + { "MAX_INPUT", 0, 0 }, +#endif +#ifdef _PC_NAME_MAX + { "NAME_MAX", _PC_NAME_MAX, 1 }, +#else + { "NAME_MAX", 0, 0 }, +#endif +#ifdef _PC_PATH_MAX + { "PATH_MAX", _PC_PATH_MAX, 1 }, +#else + { "PATH_MAX", 0, 0 }, +#endif +#ifdef _PC_PIPE_BUF + { "PIPE_BUF", _PC_PIPE_BUF, 1 }, +#else + { "PIPE_BUF", 0, 0 }, +#endif +#ifdef _PC_ALLOC_SIZE_MIN + { "POSIX_ALLOC_SIZE_MIN", _PC_ALLOC_SIZE_MIN, 1 }, +#else + { "POSIX_ALLOC_SIZE_MIN", 0, 0 }, +#endif +#ifdef _PC_REC_INCR_XFER_SIZE + { "POSIX_REC_INCR_XFER_SIZE", _PC_REC_INCR_XFER_SIZE, 1 }, +#else + { "POSIX_REC_INCR_XFER_SIZE", 0, 0 }, +#endif +#ifdef _PC_REC_MAX_XFER_SIZE + { "POSIX_REC_MAX_XFER_SIZE", _PC_REC_MAX_XFER_SIZE, 1 }, +#else + { "POSIX_REC_MAX_XFER_SIZE", 0, 0 }, +#endif +#ifdef _PC_REC_MIN_XFER_SIZE + { "POSIX_REC_MIN_XFER_SIZE", _PC_REC_MIN_XFER_SIZE, 1 }, +#else + { "POSIX_REC_MIN_XFER_SIZE", 0, 0 }, +#endif +#ifdef _PC_REC_XFER_ALIGN + { "POSIX_REC_XFER_ALIGN", _PC_REC_XFER_ALIGN, 1 }, +#else + { "POSIX_REC_XFER_ALIGN", 0, 0 }, +#endif +#ifdef _PC_2_SYMLINKS + { "POSIX2_SYMLINKS", _PC_2_SYMLINKS, 1 }, +#else + { "POSIX2_SYMLINKS", 0, 0 }, +#endif +#ifdef _PC_SYMLINK_MAX + { "SYMLINK_MAX", _PC_SYMLINK_MAX, 1 }, +#else + { "SYMLINK_MAX", 0, 0 }, +#endif +#ifdef _PC_ACL_EXTENDED + { "TRUSTEDBSD_ACL_EXTENDED", _PC_ACL_EXTENDED, 1 }, +#else + { "TRUSTEDBSD_ACL_EXTENDED", 0, 0 }, +#endif +#ifdef _PC_ACL_PATH_MAX + { "TRUSTEDBSD_ACL_PATH_MAX", _PC_ACL_PATH_MAX, 1 }, +#else + { "TRUSTEDBSD_ACL_PATH_MAX", 0, 0 }, +#endif +#ifdef _PC_CAP_PRESENT + { "TRUSTEDBSD_CAP_PRESENT", _PC_CAP_PRESENT, 1 }, +#else + { "TRUSTEDBSD_CAP_PRESENT", 0, 0 }, +#endif +#ifdef _PC_INF_PRESENT + { "TRUSTEDBSD_INF_PRESENT", _PC_INF_PRESENT, 1 }, +#else + { "TRUSTEDBSD_INF_PRESENT", 0, 0 }, +#endif +#ifdef _PC_MAC_PRESENT + { "TRUSTEDBSD_MAC_PRESENT", _PC_MAC_PRESENT, 1 }, +#else + { "TRUSTEDBSD_MAC_PRESENT", 0, 0 }, +#endif +#ifdef _PC_ASYNC_IO + { "_POSIX_ASYNC_IO", _PC_ASYNC_IO, 1 }, +#else + { "_POSIX_ASYNC_IO", 0, 0 }, +#endif +#ifdef _PC_CHOWN_RESTRICTED + { "_POSIX_CHOWN_RESTRICTED", _PC_CHOWN_RESTRICTED, 1 }, +#else + { "_POSIX_CHOWN_RESTRICTED", 0, 0 }, +#endif +#ifdef _PC_NO_TRUNC + { "_POSIX_NO_TRUNC", _PC_NO_TRUNC, 1 }, +#else + { "_POSIX_NO_TRUNC", 0, 0 }, +#endif +#ifdef _PC_PATH_MAX + { "_POSIX_PATH_MAX", _PC_PATH_MAX, 1 }, +#else + { "_POSIX_PATH_MAX", 0, 0 }, +#endif +#ifdef _PC_PRIO_IO + { "_POSIX_PRIO_IO", _PC_PRIO_IO, 1 }, +#else + { "_POSIX_PRIO_IO", 0, 0 }, +#endif +#ifdef _PC_SYNC_IO + { "_POSIX_SYNC_IO", _PC_SYNC_IO, 1 }, +#else + { "_POSIX_SYNC_IO", 0, 0 }, +#endif +#ifdef _PC_VDISABLE + { "_POSIX_VDISABLE", _PC_VDISABLE, 1 }, +#else + { "_POSIX_VDISABLE", 0, 0 }, +#endif + { NULL, 0, 0 } +}; +#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1) +static const struct map * +in_word_set(const char *word) +{ + const struct map *mp; + + for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) { + if (strcmp(word, mp->name) == 0) + return (mp); + } + return (NULL); +} + +int +find_pathconf(const char *name, int *key) +{ + const struct map *rv; +#ifdef APPLE_GETCONF_UNDERSCORE + char *alt; +#endif /* APPLE_GETCONF_UNDERSCORE */ + + rv = in_word_set(name); + if (rv != NULL) { + if (rv->valid) { + *key = rv->key; + return 1; + } + return -1; + } +#ifdef APPLE_GETCONF_UNDERSCORE + if(*name == '_') + alt = (char *)name + 1; + else { + if((alt = (char *)alloca(strlen(name) + 2)) == NULL) + return 0; + *alt = '_'; + strcpy(alt + 1, name); + } + rv = in_word_set(alt); + if (rv != NULL) { + if (rv->valid) { + *key = rv->key; + return 1; + } + return -1; + } +#endif /* APPLE_GETCONF_UNDERSCORE */ + return 0; +} diff --git a/gen/getconf.tproj/progenv.c b/gen/getconf.tproj/progenv.c new file mode 100644 index 0000000..6dcf471 --- /dev/null +++ b/gen/getconf.tproj/progenv.c @@ -0,0 +1,114 @@ +/* + * Copyright is disclaimed as to the contents of this file. + * + * $FreeBSD: src/usr.bin/getconf/progenv.gperf,v 1.2 2003/08/22 17:32:07 markm Exp $ + */ + +#include + +#include +#include + +#include "getconf.h" + +/* + * Override gperf's built-in external scope. + */ +static const struct map *in_word_set(const char *str); + +/* + * The Standard seems a bit ambiguous over whether the POSIX_V6_* + * are specified with or without a leading underscore, so we just + * use both. + */ +/* + * The alt_path member gives the path containing another `getconf' + * executable which was compiled using the specified programming + * environment. If it is NULL, the current executable is good enough. + * If we ever support multiple environments, this table will need to + * be updated. (We cheat here and define the supported environments + * statically.) + */ +#if defined(__alpha__) || defined(__sparc64__) +#define have_LP64_OFF64 NULL +#elif defined(__APPLE__) +#define have_LP64_OFF64 NULL +#define have_LPBIG_OFFBIG NULL +#endif + +#if defined(__i386__) || defined(__powerpc__) || defined(__x86_64__) +#define have_ILP32_OFFBIG NULL +#endif + +struct map { const char *name; const char *alt_path; int valid; }; +static const struct map wordlist[] = { +#ifdef notdef + { "POSIX_V6_ILP32_OFF32", notdef, 1 }, +#else + { "POSIX_V6_ILP32_OFF32", 0, 0 }, +#endif +#ifdef have_ILP32_OFFBIG + { "POSIX_V6_ILP32_OFFBIG", have_ILP32_OFFBIG, 1 }, +#else + { "POSIX_V6_ILP32_OFFBIG", 0, 0 }, +#endif +#ifdef have_LP64_OFF64 + { "POSIX_V6_LP64_OFF64", have_LP64_OFF64, 1 }, +#else + { "POSIX_V6_LP64_OFF64", 0, 0 }, +#endif +#ifdef have_LPBIG_OFFBIG + { "POSIX_V6_LPBIG_OFFBIG", have_LPBIG_OFFBIG, 1 }, +#else + { "POSIX_V6_LPBIG_OFFBIG", 0, 0 }, +#endif +#ifdef notdef + { "_POSIX_V6_ILP32_OFF32", notdef, 1 }, +#else + { "_POSIX_V6_ILP32_OFF32", 0, 0 }, +#endif +#ifdef have_ILP32_OFFBIG + { "_POSIX_V6_ILP32_OFFBIG", have_ILP32_OFFBIG, 1 }, +#else + { "_POSIX_V6_ILP32_OFFBIG", 0, 0 }, +#endif +#ifdef have_LP64_OFF64 + { "_POSIX_V6_LP64_OFF64", have_LP64_OFF64, 1 }, +#else + { "_POSIX_V6_LP64_OFF64", 0, 0 }, +#endif +#ifdef have_LPBIG_OFFBIG + { "_POSIX_V6_LPBIG_OFFBIG", have_LPBIG_OFFBIG, 1 }, +#else + { "_POSIX_V6_LPBIG_OFFBIG", 0, 0 }, +#endif + { NULL, 0, 0 } +}; +#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1) +static const struct map * +in_word_set(const char *word) +{ + const struct map *mp; + + for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) { + if (strcmp(word, mp->name) == 0) + return (mp); + } + return (NULL); +} + +int +find_progenv(const char *name, const char **alt_path) +{ + const struct map *rv; + + rv = in_word_set(name); + if (rv != NULL) { + if (rv->valid) { + *alt_path = rv->alt_path; + return 1; + } + return -1; + } + return 0; +} diff --git a/gen/getconf.tproj/sysconf.c b/gen/getconf.tproj/sysconf.c new file mode 100644 index 0000000..1c1ff61 --- /dev/null +++ b/gen/getconf.tproj/sysconf.c @@ -0,0 +1,699 @@ +/* + * Copyright is disclaimed as to the contents of this file. + * + * $FreeBSD: src/usr.bin/getconf/sysconf.gperf,v 1.5 2003/08/22 17:32:07 markm Exp $ + */ + +#include + +#include +#include +#ifdef APPLE_GETCONF_UNDERSCORE +#include +#endif /* APPLE_GETCONF_UNDERSCORE */ + +#include "getconf.h" + +/* + * Override gperf's built-in external scope. + */ +static const struct map *in_word_set(const char *str); + +struct map { const char *name; int key; int valid; }; +static const struct map wordlist[] = { +#ifdef _SC_AIO_LISTIO_MAX + { "AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX, 1 }, +#else + { "AIO_LISTIO_MAX", 0, 0 }, +#endif +#ifdef _SC_AIO_MAX + { "AIO_MAX", _SC_AIO_MAX, 1 }, +#else + { "AIO_MAX", 0, 0 }, +#endif +#ifdef _SC_AIO_PRIO_DELTA_MAX + { "AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX, 1 }, +#else + { "AIO_PRIO_DELTA_MAX", 0, 0 }, +#endif +#ifdef _SC_ARG_MAX + { "ARG_MAX", _SC_ARG_MAX, 1 }, +#else + { "ARG_MAX", 0, 0 }, +#endif +#ifdef _SC_ATEXIT_MAX + { "ATEXIT_MAX", _SC_ATEXIT_MAX, 1 }, +#else + { "ATEXIT_MAX", 0, 0 }, +#endif +#ifdef _SC_BC_BASE_MAX + { "BC_BASE_MAX", _SC_BC_BASE_MAX, 1 }, +#else + { "BC_BASE_MAX", 0, 0 }, +#endif +#ifdef _SC_BC_DIM_MAX + { "BC_DIM_MAX", _SC_BC_DIM_MAX, 1 }, +#else + { "BC_DIM_MAX", 0, 0 }, +#endif +#ifdef _SC_BC_SCALE_MAX + { "BC_SCALE_MAX", _SC_BC_SCALE_MAX, 1 }, +#else + { "BC_SCALE_MAX", 0, 0 }, +#endif +#ifdef _SC_BC_STRING_MAX + { "BC_STRING_MAX", _SC_BC_STRING_MAX, 1 }, +#else + { "BC_STRING_MAX", 0, 0 }, +#endif +#ifdef _SC_CHILD_MAX + { "CHILD_MAX", _SC_CHILD_MAX, 1 }, +#else + { "CHILD_MAX", 0, 0 }, +#endif +#ifdef _SC_CLK_TCK + { "CLK_TCK", _SC_CLK_TCK, 1 }, +#else + { "CLK_TCK", 0, 0 }, +#endif +#ifdef _SC_COLL_WEIGHTS_MAX + { "COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX, 1 }, +#else + { "COLL_WEIGHTS_MAX", 0, 0 }, +#endif +#ifdef _SC_DELAYTIMER_MAX + { "DELAYTIMER_MAX", _SC_DELAYTIMER_MAX, 1 }, +#else + { "DELAYTIMER_MAX", 0, 0 }, +#endif +#ifdef _SC_EXPR_NEST_MAX + { "EXPR_NEST_MAX", _SC_EXPR_NEST_MAX, 1 }, +#else + { "EXPR_NEST_MAX", 0, 0 }, +#endif +#ifdef _SC_GETGR_R_SIZE_MAX + { "GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX, 1 }, +#else + { "GETGR_R_SIZE_MAX", 0, 0 }, +#endif +#ifdef _SC_GETPW_R_SIZE_MAX + { "GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX, 1 }, +#else + { "GETPW_R_SIZE_MAX", 0, 0 }, +#endif +#ifdef _SC_HOST_NAME_MAX + { "HOST_NAME_MAX", _SC_HOST_NAME_MAX, 1 }, +#else + { "HOST_NAME_MAX", 0, 0 }, +#endif +#ifdef _SC_IOV_MAX + { "IOV_MAX", _SC_IOV_MAX, 1 }, +#else + { "IOV_MAX", 0, 0 }, +#endif +#ifdef _SC_LINE_MAX + { "LINE_MAX", _SC_LINE_MAX, 1 }, +#else + { "LINE_MAX", 0, 0 }, +#endif +#ifdef _SC_LOGIN_NAME_MAX + { "LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX, 1 }, +#else + { "LOGIN_NAME_MAX", 0, 0 }, +#endif +#ifdef _SC_MQ_OPEN_MAX + { "MQ_OPEN_MAX", _SC_MQ_OPEN_MAX, 1 }, +#else + { "MQ_OPEN_MAX", 0, 0 }, +#endif +#ifdef _SC_MQ_PRIO_MAX + { "MQ_PRIO_MAX", _SC_MQ_PRIO_MAX, 1 }, +#else + { "MQ_PRIO_MAX", 0, 0 }, +#endif +#ifdef _SC_NGROUPS_MAX + { "NGROUPS_MAX", _SC_NGROUPS_MAX, 1 }, +#else + { "NGROUPS_MAX", 0, 0 }, +#endif +#ifdef _SC_NPROCESSORS_CONF + { "NPROCESSORS_CONF", _SC_NPROCESSORS_CONF, 1 }, +#else + { "NPROCESSORS_CONF", 0, 0 }, +#endif +#ifdef _SC_NPROCESSORS_ONLN + { "NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN, 1 }, +#else + { "NPROCESSORS_ONLN", 0, 0 }, +#endif +#ifdef _SC_OPEN_MAX + { "OPEN_MAX", _SC_OPEN_MAX, 1 }, +#else + { "OPEN_MAX", 0, 0 }, +#endif +#ifdef _SC_PAGESIZE + { "PAGESIZE", _SC_PAGESIZE, 1 }, +#else + { "PAGESIZE", 0, 0 }, +#endif +#ifdef _SC_PAGESIZE + { "PAGE_SIZE", _SC_PAGESIZE, 1 }, +#else + { "PAGE_SIZE", 0, 0 }, +#endif +#ifdef _SC_PASS_MAX + { "PASS_MAX", _SC_PASS_MAX, 1 }, +#else + { "PASS_MAX", 0, 0 }, +#endif +#ifdef _SC_THREAD_DESTRUCTOR_ITERATIONS + { "PTHREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS, 1 }, +#else + { "PTHREAD_DESTRUCTOR_ITERATIONS", 0, 0 }, +#endif +#ifdef _SC_THREAD_KEYS_MAX + { "PTHREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX, 1 }, +#else + { "PTHREAD_KEYS_MAX", 0, 0 }, +#endif +#ifdef _SC_THREAD_STACK_MIN + { "PTHREAD_STACK_MIN", _SC_THREAD_STACK_MIN, 1 }, +#else + { "PTHREAD_STACK_MIN", 0, 0 }, +#endif +#ifdef _SC_THREAD_THREADS_MAX + { "PTHREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX, 1 }, +#else + { "PTHREAD_THREADS_MAX", 0, 0 }, +#endif +#ifdef _SC_RE_DUP_MAX + { "RE_DUP_MAX", _SC_RE_DUP_MAX, 1 }, +#else + { "RE_DUP_MAX", 0, 0 }, +#endif +#ifdef _SC_RTSIG_MAX + { "RTSIG_MAX", _SC_RTSIG_MAX, 1 }, +#else + { "RTSIG_MAX", 0, 0 }, +#endif +#ifdef _SC_SEM_NSEMS_MAX + { "SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX, 1 }, +#else + { "SEM_NSEMS_MAX", 0, 0 }, +#endif +#ifdef _SC_SEM_VALUE_MAX + { "SEM_VALUE_MAX", _SC_SEM_VALUE_MAX, 1 }, +#else + { "SEM_VALUE_MAX", 0, 0 }, +#endif +#ifdef _SC_SIGQUEUE_MAX + { "SIGQUEUE_MAX", _SC_SIGQUEUE_MAX, 1 }, +#else + { "SIGQUEUE_MAX", 0, 0 }, +#endif +#ifdef _SC_STREAM_MAX + { "STREAM_MAX", _SC_STREAM_MAX, 1 }, +#else + { "STREAM_MAX", 0, 0 }, +#endif +#ifdef _SC_SYMLOOP_MAX + { "SYMLOOP_MAX", _SC_SYMLOOP_MAX, 1 }, +#else + { "SYMLOOP_MAX", 0, 0 }, +#endif +#ifdef _SC_TIMER_MAX + { "TIMER_MAX", _SC_TIMER_MAX, 1 }, +#else + { "TIMER_MAX", 0, 0 }, +#endif +#ifdef _SC_TTY_NAME_MAX + { "TTY_NAME_MAX", _SC_TTY_NAME_MAX, 1 }, +#else + { "TTY_NAME_MAX", 0, 0 }, +#endif +#ifdef _SC_TZNAME_MAX + { "TZNAME_MAX", _SC_TZNAME_MAX, 1 }, +#else + { "TZNAME_MAX", 0, 0 }, +#endif +#ifdef _SC_2_CHAR_TERM + { "_POSIX2_CHAR_TERM", _SC_2_CHAR_TERM, 1 }, +#else + { "_POSIX2_CHAR_TERM", 0, 0 }, +#endif +#ifdef _SC_2_C_BIND + { "_POSIX2_C_BIND", _SC_2_C_BIND, 1 }, +#else + { "_POSIX2_C_BIND", 0, 0 }, +#endif +#ifdef _SC_2_C_DEV + { "_POSIX2_C_DEV", _SC_2_C_DEV, 1 }, +#else + { "_POSIX2_C_DEV", 0, 0 }, +#endif +#ifdef _SC_2_C_VERSION + { "_POSIX2_C_VERSION", _SC_2_C_VERSION, 1 }, +#else + { "_POSIX2_C_VERSION", 0, 0 }, +#endif +#ifdef _SC_2_FORT_DEV + { "_POSIX2_FORT_DEV", _SC_2_FORT_DEV, 1 }, +#else + { "_POSIX2_FORT_DEV", 0, 0 }, +#endif +#ifdef _SC_2_FORT_RUN + { "_POSIX2_FORT_RUN", _SC_2_FORT_RUN, 1 }, +#else + { "_POSIX2_FORT_RUN", 0, 0 }, +#endif +#ifdef _SC_2_LOCALEDEF + { "_POSIX2_LOCALEDEF", _SC_2_LOCALEDEF, 1 }, +#else + { "_POSIX2_LOCALEDEF", 0, 0 }, +#endif +#ifdef _SC_PBS + { "_POSIX2_PBS", _SC_PBS, 1 }, +#else + { "_POSIX2_PBS", 0, 0 }, +#endif +#ifdef _SC_PBS_ACCOUNTING + { "_POSIX2_PBS_ACCOUNTING", _SC_PBS_ACCOUNTING, 1 }, +#else + { "_POSIX2_PBS_ACCOUNTING", 0, 0 }, +#endif +#ifdef _SC_PBS_CHECKPOINT + { "_POSIX2_PBS_CHECKPOINT", _SC_PBS_CHECKPOINT, 1 }, +#else + { "_POSIX2_PBS_CHECKPOINT", 0, 0 }, +#endif +#ifdef _SC_PBS_LOCATE + { "_POSIX2_PBS_LOCATE", _SC_PBS_LOCATE, 1 }, +#else + { "_POSIX2_PBS_LOCATE", 0, 0 }, +#endif +#ifdef _SC_PBS_MESSAGE + { "_POSIX2_PBS_MESSAGE", _SC_PBS_MESSAGE, 1 }, +#else + { "_POSIX2_PBS_MESSAGE", 0, 0 }, +#endif +#ifdef _SC_PBS_TRACK + { "_POSIX2_PBS_TRACK", _SC_PBS_TRACK, 1 }, +#else + { "_POSIX2_PBS_TRACK", 0, 0 }, +#endif +#ifdef _SC_2_SW_DEV + { "_POSIX2_SW_DEV", _SC_2_SW_DEV, 1 }, +#else + { "_POSIX2_SW_DEV", 0, 0 }, +#endif +#ifdef _SC_2_UPE + { "_POSIX2_UPE", _SC_2_UPE, 1 }, +#else + { "_POSIX2_UPE", 0, 0 }, +#endif +#ifdef _SC_2_VERSION + { "_POSIX2_VERSION", _SC_2_VERSION, 1 }, +#else + { "_POSIX2_VERSION", 0, 0 }, +#endif +#ifdef _SC_ADVISORY_INFO + { "_POSIX_ADVISORY_INFO", _SC_ADVISORY_INFO, 1 }, +#else + { "_POSIX_ADVISORY_INFO", 0, 0 }, +#endif +#ifdef _SC_ASYNCHRONOUS_IO + { "_POSIX_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO, 1 }, +#else + { "_POSIX_ASYNCHRONOUS_IO", 0, 0 }, +#endif +#ifdef _SC_BARRIERS + { "_POSIX_BARRIERS", _SC_BARRIERS, 1 }, +#else + { "_POSIX_BARRIERS", 0, 0 }, +#endif +#ifdef _SC_CLOCK_SELECTION + { "_POSIX_CLOCK_SELECTION", _SC_CLOCK_SELECTION, 1 }, +#else + { "_POSIX_CLOCK_SELECTION", 0, 0 }, +#endif +#ifdef _SC_CPUTIME + { "_POSIX_CPUTIME", _SC_CPUTIME, 1 }, +#else + { "_POSIX_CPUTIME", 0, 0 }, +#endif +#ifdef _SC_FILE_LOCKING + { "_POSIX_FILE_LOCKING", _SC_FILE_LOCKING, 1 }, +#else + { "_POSIX_FILE_LOCKING", 0, 0 }, +#endif +#ifdef _SC_FSYNC + { "_POSIX_FSYNC", _SC_FSYNC, 1 }, +#else + { "_POSIX_FSYNC", 0, 0 }, +#endif +#ifdef _SC_IPV6 + { "_POSIX_IPV6", _SC_IPV6, 1 }, +#else + { "_POSIX_IPV6", 0, 0 }, +#endif +#ifdef _SC_JOB_CONTROL + { "_POSIX_JOB_CONTROL", _SC_JOB_CONTROL, 1 }, +#else + { "_POSIX_JOB_CONTROL", 0, 0 }, +#endif +#ifdef _SC_MAPPED_FILES + { "_POSIX_MAPPED_FILES", _SC_MAPPED_FILES, 1 }, +#else + { "_POSIX_MAPPED_FILES", 0, 0 }, +#endif +#ifdef _SC_MEMLOCK + { "_POSIX_MEMLOCK", _SC_MEMLOCK, 1 }, +#else + { "_POSIX_MEMLOCK", 0, 0 }, +#endif +#ifdef _SC_MEMLOCK_RANGE + { "_POSIX_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE, 1 }, +#else + { "_POSIX_MEMLOCK_RANGE", 0, 0 }, +#endif +#ifdef _SC_MEMORY_PROTECTION + { "_POSIX_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION, 1 }, +#else + { "_POSIX_MEMORY_PROTECTION", 0, 0 }, +#endif +#ifdef _SC_MESSAGE_PASSING + { "_POSIX_MESSAGE_PASSING", _SC_MESSAGE_PASSING, 1 }, +#else + { "_POSIX_MESSAGE_PASSING", 0, 0 }, +#endif +#ifdef _SC_MONOTONIC_CLOCK + { "_POSIX_MONOTONIC_CLOCK", _SC_MONOTONIC_CLOCK, 1 }, +#else + { "_POSIX_MONOTONIC_CLOCK", 0, 0 }, +#endif +#ifdef _SC_PRIORITIZED_IO + { "_POSIX_PRIORITIZED_IO", _SC_PRIORITIZED_IO, 1 }, +#else + { "_POSIX_PRIORITIZED_IO", 0, 0 }, +#endif +#ifdef _SC_PRIORITY_SCHEDULING + { "_POSIX_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING, 1 }, +#else + { "_POSIX_PRIORITY_SCHEDULING", 0, 0 }, +#endif +#ifdef _SC_RAW_SOCKETS + { "_POSIX_RAW_SOCKETS", _SC_RAW_SOCKETS, 1 }, +#else + { "_POSIX_RAW_SOCKETS", 0, 0 }, +#endif +#ifdef _SC_READER_WRITER_LOCKS + { "_POSIX_READER_WRITER_LOCKS", _SC_READER_WRITER_LOCKS, 1 }, +#else + { "_POSIX_READER_WRITER_LOCKS", 0, 0 }, +#endif +#ifdef _SC_REALTIME_SIGNALS + { "_POSIX_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS, 1 }, +#else + { "_POSIX_REALTIME_SIGNALS", 0, 0 }, +#endif +#ifdef _SC_REGEXP + { "_POSIX_REGEXP", _SC_REGEXP, 1 }, +#else + { "_POSIX_REGEXP", 0, 0 }, +#endif +#ifdef _SC_SAVED_IDS + { "_POSIX_SAVED_IDS", _SC_SAVED_IDS, 1 }, +#else + { "_POSIX_SAVED_IDS", 0, 0 }, +#endif +#ifdef _SC_SEMAPHORES + { "_POSIX_SEMAPHORES", _SC_SEMAPHORES, 1 }, +#else + { "_POSIX_SEMAPHORES", 0, 0 }, +#endif +#ifdef _SC_SHARED_MEMORY_OBJECTS + { "_POSIX_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS, 1 }, +#else + { "_POSIX_SHARED_MEMORY_OBJECTS", 0, 0 }, +#endif +#ifdef _SC_SHELL + { "_POSIX_SHELL", _SC_SHELL, 1 }, +#else + { "_POSIX_SHELL", 0, 0 }, +#endif +#ifdef _SC_SPAWN + { "_POSIX_SPAWN", _SC_SPAWN, 1 }, +#else + { "_POSIX_SPAWN", 0, 0 }, +#endif +#ifdef _SC_SPIN_LOCKS + { "_POSIX_SPIN_LOCKS", _SC_SPIN_LOCKS, 1 }, +#else + { "_POSIX_SPIN_LOCKS", 0, 0 }, +#endif +#ifdef _SC_SPORADIC_SERVER + { "_POSIX_SPORADIC_SERVER", _SC_SPORADIC_SERVER, 1 }, +#else + { "_POSIX_SPORADIC_SERVER", 0, 0 }, +#endif +#ifdef _SC_SS_REPL_MAX + { "_POSIX_SS_REPL_MAX", _SC_SS_REPL_MAX, 1 }, +#else + { "_POSIX_SS_REPL_MAX", 0, 0 }, +#endif +#ifdef _SC_SYNCHRONIZED_IO + { "_POSIX_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO, 1 }, +#else + { "_POSIX_SYNCHRONIZED_IO", 0, 0 }, +#endif +#ifdef _SC_THREADS + { "_POSIX_THREADS", _SC_THREADS, 1 }, +#else + { "_POSIX_THREADS", 0, 0 }, +#endif +#ifdef _SC_THREAD_ATTR_STACKADDR + { "_POSIX_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR, 1 }, +#else + { "_POSIX_THREAD_ATTR_STACKADDR", 0, 0 }, +#endif +#ifdef _SC_THREAD_ATTR_STACKSIZE + { "_POSIX_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE, 1 }, +#else + { "_POSIX_THREAD_ATTR_STACKSIZE", 0, 0 }, +#endif +#ifdef _SC_THREAD_CPUTIME + { "_POSIX_THREAD_CPUTIME", _SC_THREAD_CPUTIME, 1 }, +#else + { "_POSIX_THREAD_CPUTIME", 0, 0 }, +#endif +#ifdef _SC_THREAD_PRIORITY_SCHEDULING + { "_POSIX_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING, 1 }, +#else + { "_POSIX_THREAD_PRIORITY_SCHEDULING", 0, 0 }, +#endif +#ifdef _SC_THREAD_PRIO_INHERIT + { "_POSIX_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT, 1 }, +#else + { "_POSIX_THREAD_PRIO_INHERIT", 0, 0 }, +#endif +#ifdef _SC_THREAD_PRIO_PROTECT + { "_POSIX_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT, 1 }, +#else + { "_POSIX_THREAD_PRIO_PROTECT", 0, 0 }, +#endif +#ifdef _SC_THREAD_PROCESS_SHARED + { "_POSIX_THREAD_PROCESS_SHARED", _SC_THREAD_PROCESS_SHARED, 1 }, +#else + { "_POSIX_THREAD_PROCESS_SHARED", 0, 0 }, +#endif +#ifdef _SC_THREAD_SAFE_FUNCTIONS + { "_POSIX_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS, 1 }, +#else + { "_POSIX_THREAD_SAFE_FUNCTIONS", 0, 0 }, +#endif +#ifdef _SC_THREAD_SPORADIC_SERVER + { "_POSIX_THREAD_SPORADIC_SERVER", _SC_THREAD_SPORADIC_SERVER, 1 }, +#else + { "_POSIX_THREAD_SPORADIC_SERVER", 0, 0 }, +#endif +#ifdef _SC_TIMEOUTS + { "_POSIX_TIMEOUTS", _SC_TIMEOUTS, 1 }, +#else + { "_POSIX_TIMEOUTS", 0, 0 }, +#endif +#ifdef _SC_TIMERS + { "_POSIX_TIMERS", _SC_TIMERS, 1 }, +#else + { "_POSIX_TIMERS", 0, 0 }, +#endif +#ifdef _SC_TRACE + { "_POSIX_TRACE", _SC_TRACE, 1 }, +#else + { "_POSIX_TRACE", 0, 0 }, +#endif +#ifdef _SC_TRACE_EVENT_FILTER + { "_POSIX_TRACE_EVENT_FILTER", _SC_TRACE_EVENT_FILTER, 1 }, +#else + { "_POSIX_TRACE_EVENT_FILTER", 0, 0 }, +#endif +#ifdef _SC_TRACE_EVENT_NAME_MAX + { "_POSIX_TRACE_EVENT_NAME_MAX", _SC_TRACE_EVENT_NAME_MAX, 1 }, +#else + { "_POSIX_TRACE_EVENT_NAME_MAX", 0, 0 }, +#endif +#ifdef _SC_TRACE_INHERIT + { "_POSIX_TRACE_INHERIT", _SC_TRACE_INHERIT, 1 }, +#else + { "_POSIX_TRACE_INHERIT", 0, 0 }, +#endif +#ifdef _SC_TRACE_LOG + { "_POSIX_TRACE_LOG", _SC_TRACE_LOG, 1 }, +#else + { "_POSIX_TRACE_LOG", 0, 0 }, +#endif +#ifdef _SC_TRACE_NAME_MAX + { "_POSIX_TRACE_NAME_MAX", _SC_TRACE_NAME_MAX, 1 }, +#else + { "_POSIX_TRACE_NAME_MAX", 0, 0 }, +#endif +#ifdef _SC_TRACE_SYS_MAX + { "_POSIX_TRACE_SYS_MAX", _SC_TRACE_SYS_MAX, 1 }, +#else + { "_POSIX_TRACE_SYS_MAX", 0, 0 }, +#endif +#ifdef _SC_TRACE_USER_EVENT_MAX + { "_POSIX_TRACE_USER_EVENT_MAX", _SC_TRACE_USER_EVENT_MAX, 1 }, +#else + { "_POSIX_TRACE_USER_EVENT_MAX", 0, 0 }, +#endif +#ifdef _SC_TYPED_MEMORY_OBJECTS + { "_POSIX_TYPED_MEMORY_OBJECTS", _SC_TYPED_MEMORY_OBJECTS, 1 }, +#else + { "_POSIX_TYPED_MEMORY_OBJECTS", 0, 0 }, +#endif +#ifdef _SC_V6_ILP32_OFF32 + { "_POSIX_V6_ILP32_OFF32", _SC_V6_ILP32_OFF32, 1 }, +#else + { "_POSIX_V6_ILP32_OFF32", 0, 0 }, +#endif +#ifdef _SC_V6_ILP32_OFFBIG + { "_POSIX_V6_ILP32_OFFBIG", _SC_V6_ILP32_OFFBIG, 1 }, +#else + { "_POSIX_V6_ILP32_OFFBIG", 0, 0 }, +#endif +#ifdef _SC_V6_LP64_OFF64 + { "_POSIX_V6_LP64_OFF64", _SC_V6_LP64_OFF64, 1 }, +#else + { "_POSIX_V6_LP64_OFF64", 0, 0 }, +#endif +#ifdef _SC_V6_LPBIG_OFFBIG + { "_POSIX_V6_LPBIG_OFFBIG", _SC_V6_LPBIG_OFFBIG, 1 }, +#else + { "_POSIX_V6_LPBIG_OFFBIG", 0, 0 }, +#endif +#ifdef _SC_VERSION + { "_POSIX_VERSION", _SC_VERSION, 1 }, +#else + { "_POSIX_VERSION", 0, 0 }, +#endif +#ifdef _SC_XOPEN_CRYPT + { "_XOPEN_CRYPT", _SC_XOPEN_CRYPT, 1 }, +#else + { "_XOPEN_CRYPT", 0, 0 }, +#endif +#ifdef _SC_XOPEN_ENH_I18N + { "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N, 1 }, +#else + { "_XOPEN_ENH_I18N", 0, 0 }, +#endif +#ifdef _SC_XOPEN_LEGACY + { "_XOPEN_LEGACY", _SC_XOPEN_LEGACY, 1 }, +#else + { "_XOPEN_LEGACY", 0, 0 }, +#endif +#ifdef _SC_XOPEN_REALTIME + { "_XOPEN_REALTIME", _SC_XOPEN_REALTIME, 1 }, +#else + { "_XOPEN_REALTIME", 0, 0 }, +#endif +#ifdef _SC_XOPEN_REALTIME_THREADS + { "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS, 1 }, +#else + { "_XOPEN_REALTIME_THREADS", 0, 0 }, +#endif +#ifdef _SC_XOPEN_SHM + { "_XOPEN_SHM", _SC_XOPEN_SHM, 1 }, +#else + { "_XOPEN_SHM", 0, 0 }, +#endif +#ifdef _SC_XOPEN_STREAMS + { "_XOPEN_STREAMS", _SC_XOPEN_STREAMS, 1 }, +#else + { "_XOPEN_STREAMS", 0, 0 }, +#endif +#ifdef _SC_XOPEN_UNIX + { "_XOPEN_UNIX", _SC_XOPEN_UNIX, 1 }, +#else + { "_XOPEN_UNIX", 0, 0 }, +#endif +#ifdef _SC_XOPEN_VERSION + { "_XOPEN_VERSION", _SC_XOPEN_VERSION, 1 }, +#else + { "_XOPEN_VERSION", 0, 0 }, +#endif +#ifdef _SC_XCU_VERSION + { "_XOPEN_XCU_VERSION", _SC_XCU_VERSION, 1 }, +#else + { "_XOPEN_XCU_VERSION", 0, 0 }, +#endif + { NULL, 0, 0 } +}; +#define NWORDS (sizeof(wordlist)/sizeof(wordlist[0]) - 1) +static const struct map * +in_word_set(const char *word) +{ + const struct map *mp; + + for (mp = wordlist; mp < &wordlist[NWORDS]; mp++) { + if (strcmp(word, mp->name) == 0) + return (mp); + } + return (NULL); +} + +int +find_sysconf(const char *name, int *key) +{ + const struct map *rv; +#ifdef APPLE_GETCONF_UNDERSCORE + char *alt; +#endif /* APPLE_GETCONF_UNDERSCORE */ + + rv = in_word_set(name); + if (rv != NULL) { + if (rv->valid) { + *key = rv->key; + return 1; + } + return -1; + } +#ifdef APPLE_GETCONF_UNDERSCORE + if(*name == '_') + alt = (char *)name + 1; + else { + if((alt = (char *)alloca(strlen(name) + 2)) == NULL) + return 0; + *alt = '_'; + strcpy(alt + 1, name); + } + rv = in_word_set(alt); + if (rv != NULL) { + if (rv->valid) { + *key = rv->key; + return 1; + } + return -1; + } +#endif /* APPLE_GETCONF_UNDERSCORE */ + return 0; +} diff --git a/gen/wait4path/x86_64/Info.plist b/gen/wait4path/x86_64/Info.plist new file mode 100644 index 0000000..679b4ba --- /dev/null +++ b/gen/wait4path/x86_64/Info.plist @@ -0,0 +1,42 @@ + + + + + CFBundleDisplayName + Darwin Filesystem Path Waiter + CFBundleExecutable + wait4path + CFBundleIdentifier + com.apple.system_cmds.wait4path + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + wait4path + CFBundleShortVersionString + 1.0.0 + CFBundleVersion + 854.40.2 + DTCompiler + Darling Clang + DTPlatformName + macosx + DTPlatformVersion + 10.15 + DTSDKBuild + + DTSDKName + Darling 10.15 + DTXcode + + DTXcodeBuild + + DarwinBuilderBuild + 1A1 + DarwinBuilderVersion + 10.15.6 + DarwinVariant + RELEASE + NSHumanReadableCopyright + Copyright 2015 Apple Inc. All rights reserved. + + diff --git a/gen/wait4path/x86_64/darwin_version.c b/gen/wait4path/x86_64/darwin_version.c new file mode 100644 index 0000000..c1fca87 --- /dev/null +++ b/gen/wait4path/x86_64/darwin_version.c @@ -0,0 +1,11 @@ +__attribute__((__used__)) const unsigned long __darwin_builder_version = 10150; +__attribute__((__used__)) const unsigned long __darwin_builder_build = 0x1A1; +__attribute__((__used__)) const char *__darwin_build_inc_version = "854.40.2"; +__attribute__((__used__)) const char *__darwin_version_string = "Darwin Filesystem Path Waiter Version 1.0.0: Wed Aug 19 15:14:43 EDT 2020; ariel:wait4path/wait4path/RELEASE_X86_64"; +__attribute__((__used__)) const char *__darwin_variant = "RELEASE"; +__attribute__((__used__)) const char *__darwin_version_string_heywhat = "@(#)VERSION:Darwin Filesystem Path Waiter Version 1.0.0: Wed Aug 19 15:14:43 EDT 2020; ariel:wait4path/wait4path/RELEASE_X86_64"; +__attribute__((__used__)) const char *__darwin_debug_binary = "/Users/ariel/git/darling/src/external/system_cmds/gen/wait4path/wait4path"; +__attribute__((__used__)) +__attribute__((__section__("__TEXT,__info_plist"))) +static const char __darwin_info_plist[] = " CFBundleDisplayName Darwin Filesystem Path Waiter CFBundleExecutable wait4path CFBundleIdentifier com.apple.system_cmds.wait4path CFBundleInfoDictionaryVersion 6.0 CFBundleName wait4path CFBundleShortVersionString 1.0.0 CFBundleVersion 854.40.2 DTCompiler Darling Clang DTPlatformName macosx DTPlatformVersion 10.15 DTSDKBuild DTSDKName Darling 10.15 DTXcode DTXcodeBuild DarwinBuilderBuild 1A1 DarwinBuilderVersion 10.15.6 DarwinVariant RELEASE NSHumanReadableCopyright Copyright 2015 Apple Inc. All rights reserved."; + diff --git a/gen/wait4path/x86_64/darwin_version.h b/gen/wait4path/x86_64/darwin_version.h new file mode 100644 index 0000000..0ee8183 --- /dev/null +++ b/gen/wait4path/x86_64/darwin_version.h @@ -0,0 +1,10 @@ +#ifndef __DARWIN_VERSION_H__ +#define __DARWIN_VERSION_H__ +const unsigned long __darwin_builder_version; +const unsigned long __darwin_builder_build; +const char *__darwin_build_inc_version; +const char *__darwin_version_string; +const char *__darwin_variant; +const char *__darwin_debug_binary; +#endif // __DARWIN_VERSION_H__ + diff --git a/getconf.tproj/CMakeLists.txt b/getconf.tproj/CMakeLists.txt new file mode 100644 index 0000000..a161b23 --- /dev/null +++ b/getconf.tproj/CMakeLists.txt @@ -0,0 +1,24 @@ +project(system_cmds-getconf) + +add_compile_definitions( + APPLE_GETCONF_UNDERSCORE + APPLE_GETCONF_SPEC +) + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_darling_executable(getconf + getconf.c + + ../gen/getconf.tproj/confstr.c + ../gen/getconf.tproj/limits.c + ../gen/getconf.tproj/pathconf.c + ../gen/getconf.tproj/progenv.c + ../gen/getconf.tproj/sysconf.c +) + +install(TARGETS getconf DESTINATION libexec/darling/usr/bin) + +install(FILES getconf.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/getty.tproj/CMakeLists.txt b/getty.tproj/CMakeLists.txt new file mode 100644 index 0000000..e351adf --- /dev/null +++ b/getty.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-getty) + +add_darling_executable(getty + chat.c + init.c + main.c + subr.c +) + +install(TARGETS getty DESTINATION libexec/darling/usr/libexec) + +install(FILES getty.8 DESTINATION libexec/darling/usr/share/man/man8) + +install(FILES gettytab.5 ttys.5 DESTINATION libexec/darling/usr/share/man/man5) diff --git a/hostinfo.tproj/CMakeLists.txt b/hostinfo.tproj/CMakeLists.txt new file mode 100644 index 0000000..9d10295 --- /dev/null +++ b/hostinfo.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-hostinfo) + +add_darling_executable(hostinfo + hostinfo.c +) + +install(TARGETS hostinfo DESTINATION libexec/darling/usr/bin) + +install(FILES hostinfo.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/iosim.tproj/CMakeLists.txt b/iosim.tproj/CMakeLists.txt new file mode 100644 index 0000000..0a0241f --- /dev/null +++ b/iosim.tproj/CMakeLists.txt @@ -0,0 +1,19 @@ +project(system_cmds-iosim) + +include_directories( + ../at.tproj +) + +add_darling_executable(iosim + iosim.c +) + +target_link_libraries(iosim + IOKit + CoreFoundation + util +) + +install(TARGETS iosim DESTINATION libexec/darling/usr/bin) + +install(FILES iosim.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/iosim.tproj/iosim.c b/iosim.tproj/iosim.c index 3fde5d1..e64d0f8 100644 --- a/iosim.tproj/iosim.c +++ b/iosim.tproj/iosim.c @@ -15,7 +15,9 @@ #include #include #include +#ifndef DARLING // in Darling, we already have panic declared through in `mach/mach.h`, included as a dependency of one of those headers above #include "panic.h" +#endif #include #define IO_MODE_SEQ 0 diff --git a/iostat.tproj/CMakeLists.txt b/iostat.tproj/CMakeLists.txt new file mode 100644 index 0000000..d723c13 --- /dev/null +++ b/iostat.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-iostat) + +add_darling_executable(iostat + iostat.c +) + +target_link_libraries(iostat + IOKit + CoreFoundation +) + +install(TARGETS iostat DESTINATION libexec/darling/usr/sbin) + +install(FILES iostat.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/kpgo.tproj/CMakeLists.txt b/kpgo.tproj/CMakeLists.txt new file mode 100644 index 0000000..2bdb111 --- /dev/null +++ b/kpgo.tproj/CMakeLists.txt @@ -0,0 +1,7 @@ +project(system_cmds-kpgo) + +add_darling_executable(kpgo + kpgo.c +) + +install(TARGETS kpgo DESTINATION libexec/darling/usr/bin) diff --git a/latency.tproj/CMakeLists.txt b/latency.tproj/CMakeLists.txt new file mode 100644 index 0000000..8f9b274 --- /dev/null +++ b/latency.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-latency) + +add_darling_executable(latency + latency.c +) + +target_link_libraries(latency + ncurses + util +) + +install(TARGETS latency DESTINATION libexec/darling/usr/bin) + +install(FILES latency.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/login.tproj/CMakeLists.txt b/login.tproj/CMakeLists.txt new file mode 100644 index 0000000..b7ceba9 --- /dev/null +++ b/login.tproj/CMakeLists.txt @@ -0,0 +1,24 @@ +project(system_cmds-login) + +add_compile_definitions( + USE_PAM + USE_BSM_AUDIT +) + +add_darling_executable(login-exe + login.c + login_audit.c +) + +set_target_properties(login-exe PROPERTIES OUTPUT_NAME "login") + +target_link_libraries(login-exe + bsm.0 + pam.2 +) + +install(TARGETS login-exe DESTINATION libexec/darling/usr/bin) + +install(FILES login.1 DESTINATION libexec/darling/usr/share/man/man1) + +install(DIRECTORY login.tproj/pam.d DESTINATION libexec/darling/etc) diff --git a/lskq.tproj/CMakeLists.txt b/lskq.tproj/CMakeLists.txt new file mode 100644 index 0000000..81e5e61 --- /dev/null +++ b/lskq.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-lskq) + +add_darling_executable(lskq + lskq.c +) + +install(TARGETS lskq DESTINATION libexec/darling/usr/bin) + +install(FILES lskq.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/lsmp.tproj/CMakeLists.txt b/lsmp.tproj/CMakeLists.txt new file mode 100644 index 0000000..9f58b61 --- /dev/null +++ b/lsmp.tproj/CMakeLists.txt @@ -0,0 +1,15 @@ +project(system_cmds-lsmp) + +add_darling_executable(lsmp + lsmp.c + port_details.c + task_details.c +) + +target_link_libraries(lsmp + util +) + +install(TARGETS lsmp DESTINATION libexec/darling/usr/bin) + +install(FILES lsmp.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/ltop.tproj/CMakeLists.txt b/ltop.tproj/CMakeLists.txt new file mode 100644 index 0000000..aa95acb --- /dev/null +++ b/ltop.tproj/CMakeLists.txt @@ -0,0 +1,13 @@ +project(system_cmds-ltop) + +add_darling_executable(ltop + ltop.c +) + +target_link_libraries(ltop + util +) + +install(TARGETS ltop DESTINATION libexec/darling/usr/bin) + +install(FILES ltop.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/mean.tproj/CMakeLists.txt b/mean.tproj/CMakeLists.txt new file mode 100644 index 0000000..2fa6ff3 --- /dev/null +++ b/mean.tproj/CMakeLists.txt @@ -0,0 +1,11 @@ +project(system_cmds-mean) + +add_darling_executable(mean + mean.c +) + +target_link_libraries(mean + util +) + +install(TARGETS mean DESTINATION libexec/darling/usr/bin) diff --git a/memory_pressure.tproj/CMakeLists.txt b/memory_pressure.tproj/CMakeLists.txt new file mode 100644 index 0000000..3b229df --- /dev/null +++ b/memory_pressure.tproj/CMakeLists.txt @@ -0,0 +1,13 @@ +project(system_cmds-memory_pressure) + +add_darling_executable(memory_pressure + memory_pressure.c +) + +target_link_libraries(memory_pressure + util +) + +install(TARGETS memory_pressure DESTINATION libexec/darling/usr/bin) + +install(FILES memory_pressure.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/mkfile.tproj/CMakeLists.txt b/mkfile.tproj/CMakeLists.txt new file mode 100644 index 0000000..e901ad5 --- /dev/null +++ b/mkfile.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-mkfile) + +add_darling_executable(mkfile + mkfile.c +) + +install(TARGETS mkfile DESTINATION libexec/darling/usr/sbin) + +install(FILES mkfile.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/mslutil/CMakeLists.txt b/mslutil/CMakeLists.txt new file mode 100644 index 0000000..adbdd1f --- /dev/null +++ b/mslutil/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-mslutil) + +add_darling_executable(mslutil + mslutil.c +) + +install(TARGETS mslutil DESTINATION libexec/darling/usr/bin) + +install(FILES mslutil.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/newgrp.tproj/CMakeLists.txt b/newgrp.tproj/CMakeLists.txt new file mode 100644 index 0000000..9fe7978 --- /dev/null +++ b/newgrp.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-newgrp) + +add_darling_executable(newgrp + newgrp.c +) + +install(TARGETS newgrp DESTINATION libexec/darling/usr/bin) + +install(FILES newgrp.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/nologin.tproj/CMakeLists.txt b/nologin.tproj/CMakeLists.txt new file mode 100644 index 0000000..65b806f --- /dev/null +++ b/nologin.tproj/CMakeLists.txt @@ -0,0 +1,11 @@ +project(system_cmds-nologin) + +add_darling_executable(nologin + nologin.c +) + +install(TARGETS nologin DESTINATION libexec/darling/sbin) + +install(FILES nologin.8 DESTINATION libexec/darling/usr/share/man/man8) + +install(FILES nologin.5 DESTINATION libexec/darling/usr/share/man/man5) diff --git a/nvram.tproj/CMakeLists.txt b/nvram.tproj/CMakeLists.txt new file mode 100644 index 0000000..6586b65 --- /dev/null +++ b/nvram.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-nvram) + +add_darling_executable(nvram + nvram.c +) + +target_link_libraries(nvram + IOKit + CoreFoundation +) + +install(TARGETS nvram DESTINATION libexec/darling/usr/sbin) + +install(FILES nvram.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/pagesize.tproj/CMakeLists.txt b/pagesize.tproj/CMakeLists.txt new file mode 100644 index 0000000..c5c3c7e --- /dev/null +++ b/pagesize.tproj/CMakeLists.txt @@ -0,0 +1,5 @@ +project(system_cmds-pagesize) + +install(PROGRAMS pagesize.sh DESTINATION libexec/darling/usr/bin RENAME pagesize) + +install(FILES pagesize.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/passwd.tproj/CMakeLists.txt b/passwd.tproj/CMakeLists.txt new file mode 100644 index 0000000..6d57d8e --- /dev/null +++ b/passwd.tproj/CMakeLists.txt @@ -0,0 +1,15 @@ +project(system_cmds-passwd) + +add_darling_executable(passwd + file_passwd.c + nis_passwd.c + od_passwd.c + pam_passwd.c + passwd.c +) + +install(TARGETS passwd DESTINATION libexec/darling/usr/bin) + +install(FILES passwd.1 DESTINATION libexec/darling/usr/share/man/man1) + +install(FILES passwd.pam DESTINATION libexec/darling/private/etc/pam.d/passwd) diff --git a/proc_uuid_policy.tproj/CMakeLists.txt b/proc_uuid_policy.tproj/CMakeLists.txt new file mode 100644 index 0000000..d224e12 --- /dev/null +++ b/proc_uuid_policy.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-proc_uuid_policy) + +add_darling_executable(proc_uuid_policy + proc_uuid_policy.c +) + +install(TARGETS proc_uuid_policy DESTINATION libexec/darling/usr/bin) + +install(FILES proc_uuid_policy.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/purge.tproj/CMakeLists.txt b/purge.tproj/CMakeLists.txt new file mode 100644 index 0000000..d2d499b --- /dev/null +++ b/purge.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-purge) + +add_darling_executable(purge + purge.c +) + +install(TARGETS purge DESTINATION libexec/darling/usr/sbin) + +install(FILES purge.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/pwd_mkdb.tproj/CMakeLists.txt b/pwd_mkdb.tproj/CMakeLists.txt new file mode 100644 index 0000000..8ec036f --- /dev/null +++ b/pwd_mkdb.tproj/CMakeLists.txt @@ -0,0 +1,15 @@ +project(system_cmds-pwd_mkdb) + +add_compile_definitions( + _PW_NAME_LEN=MAXLOGNAME + _PW_YPTOKEN="__YP!" +) + +add_darling_executable(pwd_mkdb + pw_scan.c + pwd_mkdb.c +) + +install(TARGETS pwd_mkdb DESTINATION libexec/darling/usr/sbin) + +install(FILES pwd_mkdb.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/reboot.tproj/CMakeLists.txt b/reboot.tproj/CMakeLists.txt new file mode 100644 index 0000000..6a894d3 --- /dev/null +++ b/reboot.tproj/CMakeLists.txt @@ -0,0 +1,21 @@ +project(system_cmds-reboot) + +mig(kextmanager.defs) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} +) + +add_darling_executable(reboot + reboot.c + + ${CMAKE_CURRENT_BINARY_DIR}/kextmanagerUser.c +) + +install(TARGETS reboot DESTINATION libexec/darling/sbin) + +InstallSymlink(reboot ${CMAKE_INSTALL_PREFIX}/libexec/darling/sbin/halt) + +install(FILES reboot.8 DESTINATION libexec/darling/usr/share/man/man8) + +InstallSymlink(reboot.8 ${CMAKE_INSTALL_PREFIX}/libexec/darling/usr/share/man/man8/halt.8) diff --git a/sa.tproj/CMakeLists.txt b/sa.tproj/CMakeLists.txt new file mode 100644 index 0000000..af4b927 --- /dev/null +++ b/sa.tproj/CMakeLists.txt @@ -0,0 +1,16 @@ +project(system_cmds-sa) + +add_compile_definitions( + AHZV1=64 +) + +add_darling_executable(sa + db.c + main.c + pdb.c + usrdb.c +) + +install(TARGETS sa DESTINATION libexec/darling/usr/sbin) + +install(FILES sa.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/sc_usage.tproj/CMakeLists.txt b/sc_usage.tproj/CMakeLists.txt new file mode 100644 index 0000000..998bd72 --- /dev/null +++ b/sc_usage.tproj/CMakeLists.txt @@ -0,0 +1,14 @@ +project(system_cmds-sc_usage) + +add_darling_executable(sc_usage + sc_usage.c +) + +target_link_libraries(sc_usage + util + ncurses +) + +install(TARGETS sc_usage DESTINATION libexec/darling/usr/bin) + +install(FILES sc_usage.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/shutdown.tproj/CMakeLists.txt b/shutdown.tproj/CMakeLists.txt new file mode 100644 index 0000000..21aa378 --- /dev/null +++ b/shutdown.tproj/CMakeLists.txt @@ -0,0 +1,22 @@ +project(system_cmds-shutdown) + +mig(kextmanager.defs) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} +) + +add_darling_executable(shutdown + shutdown.c + + ${CMAKE_CURRENT_BINARY_DIR}/kextmanagerUser.c +) + +target_link_libraries(shutdown + bsm.0 + IOKit +) + +install(TARGETS shutdown DESTINATION libexec/darling/sbin) + +install(FILES shutdown.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/stackshot.tproj/CMakeLists.txt b/stackshot.tproj/CMakeLists.txt new file mode 100644 index 0000000..ec04f63 --- /dev/null +++ b/stackshot.tproj/CMakeLists.txt @@ -0,0 +1,7 @@ +project(system_cmds-stackshot) + +add_darling_executable(stackshot + stackshot.c +) + +install(TARGETS stackshot DESTINATION libexec/darling/usr/bin) diff --git a/sync.tproj/CMakeLists.txt b/sync.tproj/CMakeLists.txt new file mode 100644 index 0000000..a046fa9 --- /dev/null +++ b/sync.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-sync) + +add_darling_executable(sync + sync.c +) + +install(TARGETS sync DESTINATION libexec/darling/bin) + +install(FILES sync.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/sysctl.tproj/CMakeLists.txt b/sysctl.tproj/CMakeLists.txt new file mode 100644 index 0000000..29dd432 --- /dev/null +++ b/sysctl.tproj/CMakeLists.txt @@ -0,0 +1,11 @@ +project(system_cmds-sysctl) + +add_darling_executable(sysctl + sysctl.c +) + +install(TARGETS sysctl DESTINATION libexec/darling/usr/sbin) + +install(FILES sysctl.8 DESTINATION libexec/darling/usr/share/man/man8) + +install(FILES sysctl.conf.5 DESTINATION libexec/darling/usr/share/man/man5) diff --git a/taskpolicy.tproj/CMakeLists.txt b/taskpolicy.tproj/CMakeLists.txt new file mode 100644 index 0000000..3ed1505 --- /dev/null +++ b/taskpolicy.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-taskpolicy) + +add_darling_executable(taskpolicy + taskpolicy.c +) + +install(TARGETS taskpolicy DESTINATION libexec/darling/usr/sbin) + +install(FILES taskpolicy.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/trace.tproj/CMakeLists.txt b/trace.tproj/CMakeLists.txt new file mode 100644 index 0000000..c8420a7 --- /dev/null +++ b/trace.tproj/CMakeLists.txt @@ -0,0 +1,13 @@ +project(system_cmds-trace) + +add_darling_executable(trace + trace.c +) + +target_link_libraries(trace + util +) + +install(TARGETS trace DESTINATION libexec/darling/usr/bin) + +install(FILES trace.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/vifs.tproj/CMakeLists.txt b/vifs.tproj/CMakeLists.txt new file mode 100644 index 0000000..e0d9ad1 --- /dev/null +++ b/vifs.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-vifs) + +add_darling_executable(vifs + vifs.c +) + +install(TARGETS trace DESTINATION libexec/darling/usr/sbin) + +install(FILES vifs.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/vipw.tproj/CMakeLists.txt b/vipw.tproj/CMakeLists.txt new file mode 100644 index 0000000..c7f10ee --- /dev/null +++ b/vipw.tproj/CMakeLists.txt @@ -0,0 +1,10 @@ +project(system_cmds-vipw) + +add_darling_executable(vipw + pw_util.c + vipw.c +) + +install(TARGETS vipw DESTINATION libexec/darling/usr/sbin) + +install(FILES vipw.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/vm_purgeable_stat.tproj/CMakeLists.txt b/vm_purgeable_stat.tproj/CMakeLists.txt new file mode 100644 index 0000000..8133a3c --- /dev/null +++ b/vm_purgeable_stat.tproj/CMakeLists.txt @@ -0,0 +1,13 @@ +project(system_cmds-vm_purgeable_stat) + +add_darling_executable(vm_purgeable_stat + vm_purgeable_stat.c +) + +target_link_libraries(vm_purgeable_stat + util +) + +install(TARGETS vm_purgeable_stat DESTINATION libexec/darling/usr/bin) + +install(FILES vm_purgeable_stat.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/vm_stat.tproj/CMakeLists.txt b/vm_stat.tproj/CMakeLists.txt new file mode 100644 index 0000000..93b1032 --- /dev/null +++ b/vm_stat.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-vm_stat) + +add_darling_executable(vm_stat + vm_stat.c +) + +install(TARGETS vm_stat DESTINATION libexec/darling/usr/bin) + +install(FILES vm_stat.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/wait4path/CMakeLists.txt b/wait4path/CMakeLists.txt new file mode 100644 index 0000000..1e0b9fe --- /dev/null +++ b/wait4path/CMakeLists.txt @@ -0,0 +1,11 @@ +project(system_cmds-wait4path) + +add_darling_executable(wait4path + wait4path.c + + ../gen/wait4path/x86_64/darwin_version.c +) + +install(TARGETS wait4path DESTINATION libexec/darling/bin) + +install(FILES wait4path.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/wordexp-helper.tproj/CMakeLists.txt b/wordexp-helper.tproj/CMakeLists.txt new file mode 100644 index 0000000..ec524d2 --- /dev/null +++ b/wordexp-helper.tproj/CMakeLists.txt @@ -0,0 +1,7 @@ +project(system_cmds-wordexp-helper) + +add_darling_executable(wordexp-helper + wordexp-helper.c +) + +install(TARGETS wordexp-helper DESTINATION libexec/darling/usr/lib/system) diff --git a/zdump.tproj/CMakeLists.txt b/zdump.tproj/CMakeLists.txt new file mode 100644 index 0000000..b0d43d4 --- /dev/null +++ b/zdump.tproj/CMakeLists.txt @@ -0,0 +1,9 @@ +project(system_cmds-zdump) + +add_darling_executable(zdump + zdump.c +) + +install(TARGETS zdump DESTINATION libexec/darling/usr/sbin) + +install(FILES zdump.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/zic.tproj/CMakeLists.txt b/zic.tproj/CMakeLists.txt new file mode 100644 index 0000000..de4472e --- /dev/null +++ b/zic.tproj/CMakeLists.txt @@ -0,0 +1,11 @@ +project(system_cmds-zic) + +add_darling_executable(zic + ialloc.c + scheck.c + zic.c +) + +install(TARGETS zic DESTINATION libexec/darling/usr/sbin) + +install(FILES zic.8 DESTINATION libexec/darling/usr/share/man/man8) diff --git a/zlog.tproj/CMakeLists.txt b/zlog.tproj/CMakeLists.txt new file mode 100644 index 0000000..5e8ffec --- /dev/null +++ b/zlog.tproj/CMakeLists.txt @@ -0,0 +1,15 @@ +project(system_cmds-zlog) + +add_darling_executable(zlog + SymbolicationHelper.c + zlog.c +) + +target_link_libraries(zlog + CoreFoundation + CoreSymbolication +) + +install(TARGETS zlog DESTINATION libexec/darling/usr/bin) + +install(FILES zlog.1 DESTINATION libexec/darling/usr/share/man/man1) diff --git a/zprint.tproj/CMakeLists.txt b/zprint.tproj/CMakeLists.txt new file mode 100644 index 0000000..8c348f4 --- /dev/null +++ b/zprint.tproj/CMakeLists.txt @@ -0,0 +1,26 @@ +project(system_cmds-zprint) + +include_directories( + ${CMAKE_SOURCE_DIR}/${DARLING_SDK_RELATIVE_PATH}/usr/include/mach +) + +add_compile_definitions( + KERNEL_PRIVATE +) + +add_darling_executable(zprint + zprint.c +) + +target_link_libraries(zprint + IOKit + CoreSymbolication + CoreFoundation + util +) + +install(TARGETS zprint DESTINATION libexec/darling/usr/bin) + +install(FILES zprint.1 DESTINATION libexec/darling/usr/share/man/man1) + +install(FILES zprint.lua DESTINATION libexec/darling/usr/share/recon)