Index: head/contrib/mdocml/lib.in =================================================================== --- head/contrib/mdocml/lib.in (revision 274986) +++ head/contrib/mdocml/lib.in (revision 274987) @@ -1,123 +1,124 @@ /* $Id: lib.in,v 1.18 2014/01/06 00:53:33 schwarze Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * Copyright (c) 2009, 2012 Joerg Sonnenberger * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * These are all possible .Lb strings. When a new library is added, add * its short-string to the left-hand side and formatted string to the * right-hand side. * * Be sure to escape strings. */ LINE("libarchive", "Streaming Archive Library (libarchive, \\-larchive)") LINE("libarm", "ARM Architecture Library (libarm, \\-larm)") LINE("libarm32", "ARM32 Architecture Library (libarm32, \\-larm32)") LINE("libbluetooth", "Bluetooth Library (libbluetooth, \\-lbluetooth)") LINE("libbsm", "Basic Security Module Library (libbsm, \\-lbsm)") LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") LINE("libcapsicum", "Capsicum Library (libcapsicum, \\-lcapsicum)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") LINE("libdisk", "Interface to Slice and Partition Labels Library (libdisk, \\-ldisk)") LINE("libdm", "Device Mapper Library (libdm, \\-ldm)") LINE("libdwarf", "DWARF Access Library (libdwarf, \\-ldwarf)") LINE("libedit", "Command Line Editor Library (libedit, \\-ledit)") LINE("libefi", "EFI Runtime Services Library (libefi, \\-lefi)") LINE("libelf", "ELF Access Library (libelf, \\-lelf)") LINE("libevent", "Event Notification Library (libevent, \\-levent)") LINE("libexecinfo", "Backtrace Information Library (libexecinfo, \\-lexecinfo)") LINE("libfetch", "File Transfer Library (libfetch, \\-lfetch)") LINE("libfsid", "Filesystem Identification Library (libfsid, \\-lfsid)") LINE("libftpio", "FTP Connection Management Library (libftpio, \\-lftpio)") LINE("libform", "Curses Form Library (libform, \\-lform)") LINE("libgeom", "Userland API Library for Kernel GEOM subsystem (libgeom, \\-lgeom)") LINE("libgpib", "General-Purpose Instrument Bus (GPIB) library (libgpib, \\-lgpib)") +LINE("libgpio", "General-Purpose Input Output (GPIO) library (libgpio, \\-lgpio)") LINE("libhammer", "HAMMER Filesystem Userland Library (libhammer, \\-lhammer)") LINE("libi386", "i386 Architecture Library (libi386, \\-li386)") LINE("libintl", "Internationalized Message Handling Library (libintl, \\-lintl)") LINE("libipsec", "IPsec Policy Control Library (libipsec, \\-lipsec)") LINE("libiscsi", "iSCSI protocol library (libiscsi, \\-liscsi)") LINE("libisns", "Internet Storage Name Service Library (libisns, \\-lisns)") LINE("libjail", "Jail Library (libjail, \\-ljail)") LINE("libkcore", "Kernel Memory Core Access Library (libkcore, \\-lkcore)") LINE("libkiconv", "Kernel-side iconv Library (libkiconv, \\-lkiconv)") LINE("libkse", "N:M Threading Library (libkse, \\-lkse)") LINE("libkvm", "Kernel Data Access Library (libkvm, \\-lkvm)") LINE("libm", "Math Library (libm, \\-lm)") LINE("libm68k", "m68k Architecture Library (libm68k, \\-lm68k)") LINE("libmagic", "Magic Number Recognition Library (libmagic, \\-lmagic)") LINE("libmandoc", "Mandoc Macro Compiler Library (libmandoc, \\-lmandoc)") LINE("libmd", "Message Digest (MD4, MD5, etc.) Support Library (libmd, \\-lmd)") LINE("libmemstat", "Kernel Memory Allocator Statistics Library (libmemstat, \\-lmemstat)") LINE("libmenu", "Curses Menu Library (libmenu, \\-lmenu)") LINE("libmj", "Minimalist JSON library (libmj, \\-lmj)") LINE("libnetgraph", "Netgraph User Library (libnetgraph, \\-lnetgraph)") LINE("libnetpgp", "Netpgp Signing, Verification, Encryption and Decryption (libnetpgp, \\-lnetpgp)") LINE("libnetpgpverify", "Netpgp Verification (libnetpgpverify, \\-lnetpgpverify)") LINE("libnpf", "NPF Packet Filter Library (libnpf, \\-lnpf)") LINE("libnv", "Name/value pairs library (libnv, \\-lnv)") LINE("libossaudio", "OSS Audio Emulation Library (libossaudio, \\-lossaudio)") LINE("libpam", "Pluggable Authentication Module Library (libpam, \\-lpam)") LINE("libpcap", "Packet Capture Library (libpcap, \\-lpcap)") LINE("libpci", "PCI Bus Access Library (libpci, \\-lpci)") LINE("libpmc", "Performance Counters Library (libpmc, \\-lpmc)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libposix", "POSIX Compatibility Library (libposix, \\-lposix)") LINE("libposix1e", "POSIX.1e Security API Library (libposix1e, \\-lposix1e)") LINE("libppath", "Property-List Paths Library (libppath, \\-lppath)") LINE("libproc", "Processor Monitoring and Analysis Library (libproc, \\-lproc)") LINE("libprocstat", "Process and Files Information Retrieval (libprocstat, \\-lprocstat)") LINE("libprop", "Property Container Object Library (libprop, \\-lprop)") LINE("libpthread", "POSIX Threads Library (libpthread, \\-lpthread)") LINE("libpuffs", "puffs Convenience Library (libpuffs, \\-lpuffs)") LINE("libquota", "Disk Quota Access and Control Library (libquota, \\-lquota)") LINE("libradius", "RADIUS Client Library (libradius, \\-lradius)") LINE("librefuse", "File System in Userspace Convenience Library (librefuse, \\-lrefuse)") LINE("libresolv", "DNS Resolver Library (libresolv, \\-lresolv)") LINE("librpcsec_gss", "RPC GSS-API Authentication Library (librpcsec_gss, \\-lrpcsec_gss)") LINE("librpcsvc", "RPC Service Library (librpcsvc, \\-lrpcsvc)") LINE("librt", "POSIX Real\\-time Library (librt, \\-lrt)") LINE("librtld_db", "Run-time Linker Debugging Library (librtld_db, \\-lrtld_db)") LINE("libsaslc", "Simple Authentication and Security Layer client library (libsaslc, \\-lsaslc)") LINE("libsbuf", "Safe String Composition Library (libsbuf, \\-lsbuf)") LINE("libsdp", "Bluetooth Service Discovery Protocol User Library (libsdp, \\-lsdp)") LINE("libssp", "Buffer Overflow Protection Library (libssp, \\-lssp)") LINE("libstdthreads", "C11 Threads Library (libstdthreads, \\-lstdthreads)") LINE("libSystem", "System Library (libSystem, \\-lSystem)") LINE("libtacplus", "TACACS+ Client Library (libtacplus, \\-ltacplus)") LINE("libtcplay", "TrueCrypt-compatible API library (libtcplay, \\-ltcplay)") LINE("libtermcap", "Termcap Access Library (libtermcap, \\-ltermcap)") LINE("libterminfo", "Terminal Information Library (libterminfo, \\-lterminfo)") LINE("libthr", "1:1 Threading Library (libthr, \\-lthr)") LINE("libufs", "UFS File System Access Library (libufs, \\-lufs)") LINE("libugidfw", "File System Firewall Interface Library (libugidfw, \\-lugidfw)") LINE("libulog", "User Login Record Library (libulog, \\-lulog)") LINE("libusbhid", "USB Human Interface Devices Library (libusbhid, \\-lusbhid)") LINE("libutil", "System Utilities Library (libutil, \\-lutil)") LINE("libvgl", "Video Graphics Library (libvgl, \\-lvgl)") LINE("libx86_64", "x86_64 Architecture Library (libx86_64, \\-lx86_64)") LINE("libz", "Compression Library (libz, \\-lz)") Index: head/lib/Makefile =================================================================== --- head/lib/Makefile (revision 274986) +++ head/lib/Makefile (revision 274987) @@ -1,308 +1,309 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ .include # The SUBDIR_ORDERED list is a small set of libraries which are used by many # of the other libraries. These are built first with a .WAIT between them # and the main list to avoid needing a SUBDIR_DEPEND line on every library # naming just these few items. SUBDIR_ORDERED= ${_csu} \ .WAIT \ libc \ libc_nonshared \ libcompiler_rt \ ${_libcplusplus} \ ${_libcxxrt} \ libelf \ msun # The main list; please keep these sorted alphabetically. SUBDIR= ${SUBDIR_ORDERED} \ .WAIT \ libalias \ libarchive \ ${_libatm} \ libauditd \ libbegemot \ libblocksruntime \ ${_libbluetooth} \ ${_libbsnmp} \ libbsdstat \ libbsm \ libbz2 \ libcalendar \ libcam \ ${_libcapsicum} \ ${_libcasper} \ ${_libcom_err} \ libcompat \ libcrypt \ libdevinfo \ libdevstat \ libdpv \ libdwarf \ libedit \ ${_libevent} \ libexecinfo \ libexpat \ libfetch \ libfigpar \ libgeom \ ${_libgpib} \ + libgpio \ ${_libgssapi} \ ${_librpcsec_gss} \ ${_libiconv_modules} \ libipsec \ libjail \ libkiconv \ libkvm \ ${_libldns} \ liblzma \ libmagic \ libmandoc \ libmemstat \ libmd \ ${_libmilter} \ ${_libmp} \ ${_libnandfs} \ libnetbsd \ ${_libnetgraph} \ ${_libngatm} \ libnv \ libohash \ libopie \ libpam \ libpcap \ libpjdlog \ ${_libpmc} \ ${_libproc} \ libprocstat \ libradius \ librpcsvc \ librt \ ${_librtld_db} \ libsbuf \ ${_libsdp} \ ${_libsm} \ ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} \ libsqlite3 \ libstand \ libstdbuf \ libstdthreads \ libtacplus \ ${_libtelnet} \ ${_libthr} \ libthread_db \ libucl \ libufs \ libugidfw \ libulog \ ${_libunbound} \ ${_libusbhid} \ ${_libusb} \ libutil \ ${_libvgl} \ ${_libvmmapi} \ libwrap \ libxo \ liby \ ${_libypclnt} \ libz \ ncurses \ ${_atf} \ ${_clang} \ ${_cuse} \ ${_tests} # Inter-library dependencies. When the makefile for a library contains LDADD # libraries, those libraries should be listed as build order dependencies here. SUBDIR_DEPEND_libarchive= libz libbz2 libexpat liblzma libmd SUBDIR_DEPEND_libatm= libmd SUBDIR_DEPEND_libauditdm= libbsm SUBDIR_DEPEND_libbsnmp= ${_libnetgraph} SUBDIR_DEPEND_libc++= libcxxrt SUBDIR_DEPEND_libc= libcompiler_rt SUBDIR_DEPEND_libcam= libsbuf SUBDIR_DEPEND_libcapsicum= libnv SUBDIR_DEPEND_libcasper= libcapsicum libnv libpjdlog SUBDIR_DEPEND_libdevstat= libkvm SUBDIR_DEPEND_libdpv= libfigpar ncurses libutil SUBDIR_DEPEND_libedit= ncurses SUBDIR_DEPEND_libg++= msun SUBDIR_DEPEND_libgeom= libexpat libsbuf SUBDIR_DEPEND_liblibrpcsec_gss= libgssapi SUBDIR_DEPEND_libmagic= libz SUBDIR_DEPEND_libmemstat= libkvm SUBDIR_DEPEND_libopie= libmd SUBDIR_DEPEND_libpam= libcrypt libopie libradius librpcsvc libtacplus libutil ${_libypclnt} ${_libcom_err} SUBDIR_DEPEND_libpjdlog= libutil SUBDIR_DEPEND_libprocstat= libkvm libutil SUBDIR_DEPEND_libradius= libmd SUBDIR_DEPEND_libreadline= ncurses SUBDIR_DEPEND_libsmb= libkiconv SUBDIR_DEPEND_libstdc++= msun SUBDIR_DEPEND_libtacplus= libmd SUBDIR_DEPEND_libulog= libmd SUBDIR_DEPEND_libunbound= ${_libldns} .if exists(${.CURDIR}/csu/${MACHINE_ARCH}-elf) _csu=csu/${MACHINE_ARCH}-elf .elif exists(${.CURDIR}/csu/${MACHINE_ARCH}) _csu=csu/${MACHINE_ARCH} .elif exists(${.CURDIR}/csu/${MACHINE_CPUARCH}/Makefile) _csu=csu/${MACHINE_CPUARCH} .else _csu=csu .endif # NB: keep these sorted by MK_* knobs .if ${MK_ATM} != "no" _libngatm= libngatm .endif .if ${MK_BLUETOOTH} != "no" _libbluetooth= libbluetooth _libsdp= libsdp .endif .if ${MK_BSNMP} != "no" _libbsnmp= libbsnmp .endif .if ${MK_CASPER} != "no" _libcapsicum= libcapsicum _libcasper= libcasper .endif .if ${MK_CLANG} != "no" && !defined(COMPAT_32BIT) _clang= clang .endif .if ${MK_CUSE} != "no" _cuse= libcuse .endif .if ${MK_GPIB} != "no" _libgpib= libgpib .endif .if ${MK_GSSAPI} != "no" _libgssapi= libgssapi _librpcsec_gss= librpcsec_gss .endif .if ${MK_ICONV} != "no" _libiconv_modules= libiconv_modules .endif .if ${MK_KERBEROS_SUPPORT} != "no" _libcom_err= libcom_err .endif .if ${MK_LDNS} != "no" _libldns= libldns .endif .if ${MK_LIBCPLUSPLUS} != "no" _libcxxrt= libcxxrt _libcplusplus= libc++ .endif .if ${MK_LIBTHR} != "no" _libthr= libthr .endif .if ${MK_NAND} != "no" _libnandfs= libnandfs .endif .if ${MK_NETGRAPH} != "no" _libnetgraph= libnetgraph .endif .if ${MK_NIS} != "no" _libypclnt= libypclnt .endif .if ${MK_PF} != "no" _libevent= libevent .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" _libsmb= libsmb _libvgl= libvgl _libproc= libproc _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" _libvmmapi= libvmmapi .endif .if ${MACHINE_CPUARCH} == "mips" _libproc= libproc _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "powerpc" _libproc= libproc _librtld_db= librtld_db _libsmb= libsmb .endif .if ${MACHINE_CPUARCH} == "sparc64" _libsmb= libsmb .endif .if ${MK_OPENSSL} != "no" _libmp= libmp .endif .if ${MK_PMC} != "no" _libpmc= libpmc .endif .if ${MK_SENDMAIL} != "no" _libmilter= libmilter _libsm= libsm _libsmdb= libsmdb _libsmutil= libsmutil .endif .if ${MK_TELNET} != "no" _libtelnet= libtelnet .endif .if ${MK_TESTS_SUPPORT} != "no" _atf= atf .endif .if ${MK_TESTS} != "no" _tests= tests .endif .if ${MK_UNBOUND} != "no" _libunbound= libunbound .endif .if ${MK_USB} != "no" _libusbhid= libusbhid _libusb= libusb .endif .if !defined(LIBRARIES_ONLY) afterinstall: ${INSTALL_SYMLINK} ../include ${DESTDIR}/usr/lib/include .endif .if !make(install) SUBDIR_PARALLEL= .endif .include Index: head/lib/libgpio/Makefile =================================================================== --- head/lib/libgpio/Makefile (nonexistent) +++ head/lib/libgpio/Makefile (revision 274987) @@ -0,0 +1,35 @@ +# $FreeBSD$ + +LIB= gpio +SHLIB_MAJOR= 0 + +SRCS= gpio.c +INCS= libgpio.h +MAN+= gpio.3 + +CFLAGS+= -I${.CURDIR} + +MLINKS= gpio.3 gpio_open.3 \ + gpio.3 gpio_open_device.3 \ + gpio.3 gpio_close.3 \ + gpio.3 gpio_pin_list.3 \ + gpio.3 gpio_pin_config.3 \ + gpio.3 gpio_pin_set_flags.3 \ + gpio.3 gpio_pin_get.3 \ + gpio.3 gpio_pin_set.3 \ + gpio.3 gpio_pin_low.3 \ + gpio.3 gpio_pin_high.3 \ + gpio.3 gpio_pin_input.3 \ + gpio.3 gpio_pin_output.3 \ + gpio.3 gpio_pin_opendrain.3 \ + gpio.3 gpio_pin_pushpull.3 \ + gpio.3 gpio_pin_tristate.3 \ + gpio.3 gpio_pin_pullup.3 \ + gpio.3 gpio_pin_pulldown.3 \ + gpio.3 gpio_pin_invin.3 \ + gpio.3 gpio_pin_invout.3 \ + gpio.3 gpio_pin_pulsate.3 + +WARNS?= 6 + +.include Property changes on: head/lib/libgpio/Makefile ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lib/libgpio/gpio.3 =================================================================== --- head/lib/libgpio/gpio.3 (nonexistent) +++ head/lib/libgpio/gpio.3 (revision 274987) @@ -0,0 +1,192 @@ +.\" +.\" Copyright (c) 2014 Rui Paulo +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 17, 2014 +.Dt GPIO 3 +.Os +.Sh NAME +.Nm gpio_open , +.Nm gpio_close +.Nd "library to handle GPIO pins" +.Sh LIBRARY +.Lb libgpio +.Sh SYNOPSIS +.In libgpio.h +.Ft "gpio_handle_t" +.Fn gpio_open "unsigned int unit" +.Ft "gpio_handle_t" +.Fn gpio_open_device "const char *device" +.Ft void +.Fn gpio_close "gpio_handle_t handle" +.Ft int +.Fn gpio_pin_list "gpio_handle_t handle, gpio_config_t **pcfgs" +.Ft int +.Fn gpio_pin_config "gpio_handle_t handle, gpio_config *cfg" +.Ft int +.Fn gpio_pin_set_flags "gpio_handle_t handle, gpio_config_t *cfg" +.Ft gpio_value_t +.Fn gpio_pin_get "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_set "gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value" +.Ft int +.Fn gpio_pin_toggle "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_low "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_high "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_input "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_output "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_opendrain "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_pushpull "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_tristate "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_pullup "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_pulldown "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_invin "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_invout "gpio_handle_t handle, gpio_pin_t pin" +.Ft int +.Fn gpio_pin_pulsate "gpio_handle_t handle, gpio_pin_t pin" +.Sh DESCRIPTION +The +.Nm libgpio +library provides an interface to configure GPIO pins. +The library operates with a +.Ft gpio_handle_t +opaque type which can be created with +.Fn gpio_open +or +.Fn gpio_open_device . +When no more GPIO operations are needed, this handle can be destroyed +with +.Fn gpio_close . +.Pp +To get a list of all available pins, one can call +.Fn gpio_pin_list . +This function takes a pointer to a +.Ft gpio_config_t +which is dynamically allocated. +This pointer should be freed with +.Xr free 3 +when it's no longer necessary. +.Pp +The function +.Fn gpio_pin_config +retrieves the current configuration of a pin. +The pin number should be passed in via the +.Ft g_pin +variable which is part of the +.Ft gpio_config_t +structure. +.Pp +The function +.Fn gpio_pin_set_flags +configures a pin with the flags passed in by the +.Ft gpio_config_t +structure. +The pin number should also be passed in through the +.Ft g_pin +variable. +All other structure members will be ignored by this function. +The list of flags can be found in +.Pa /usr/include/sys/gpio.h . +.Pp +The get or set the state of a GPIO pin, the functions +.Fn gpio_pin_get +and +.Fn gpio_pin_set +are available, respectively. +To toggle the state, use +.Fn gpio_pin_toggle . +.Pp +The functions +.Fn gpio_pin_low +and +.Fn gpio_pin_high +are wrappers around +.Fn gpio_pin_set . +.Pp +The functions +.Fn gpio_pin_input , +.Fn gpio_pin_output , +.Fn gpio_pin_opendrain , +.Fn gpio_pin_pushpull , +.Fn gpio_pin_tristate , +.Fn gpio_pin_pullup , +.Fn gpio_pin_pulldown , +.Fn gpio_pin_invin , +.Fn gpio_pin_invout +and +.Fn gpio_pin_pulsate +are wrappers around +.Fn gpio_pin_set_flags . +.Sh EXAMPLES +The following example shows how to configure pin 16 as output and then +drive it high: +.Bd -literal +#include +#include + +gpio_handle_t handle; + +handle = gpio_open(0); +if (handle == GPIO_HANDLE_INVALID) + err(1, "gpio_open failed"); +gpio_pin_output(handle, 16); +gpio_pin_high(handle, 16); +gpio_close(handle); +.Ed +.Pp +The following example shows how to get a configuration of a pin: +.Bd -literal +gpio_config_t cfg; + +cfg.g_pin = 32; +gpio_pin_config(handle, &cfg); +.Ed +.Pp +The structure will contain the name of the pin and its flags. +.Sh SEE ALSO +.Xr gpiobus 4 , +.Xr gpioctl 8 +.Sh HISTORY +The +.Nm libgpio +library first appeared in +.Fx 11.0 . +.Sh AUTHORS +The +.Nm libgpio +library was implemented by +.An Rui Paulo Aq Mt rpaulo@FreeBSD.org . Property changes on: head/lib/libgpio/gpio.3 ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lib/libgpio/gpio.c =================================================================== --- head/lib/libgpio/gpio.c (nonexistent) +++ head/lib/libgpio/gpio.c (revision 274987) @@ -0,0 +1,262 @@ +/*- + * Copyright (c) 2013-2014 Rui Paulo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +gpio_handle_t +gpio_open(unsigned int unit) +{ + char device[16]; + + snprintf(device, sizeof(device), "/dev/gpioc%u", unit); + + return (gpio_open_device(device)); +} + +gpio_handle_t +gpio_open_device(const char *device) +{ + int fd, maxpins; + int serr; + + fd = open(device, O_RDONLY); + if (fd < 0) + return (GPIO_INVALID_HANDLE); + /* + * Check whether a simple ioctl works. + */ + if (ioctl(fd, GPIOMAXPIN, &maxpins) < 0) { + serr = errno; + close(fd); + errno = serr; + return (GPIO_INVALID_HANDLE); + } + + return (fd); +} + +void +gpio_close(gpio_handle_t handle) +{ + close(handle); +} + +int +gpio_pin_list(gpio_handle_t handle, gpio_config_t **pcfgs) +{ + int maxpins, i; + gpio_config_t *cfgs; + + *pcfgs = NULL; + if (ioctl(handle, GPIOMAXPIN, &maxpins) < 0) + return (-1); + /* Reasonable values. */ + if (maxpins < 0 || maxpins > 4096) { + errno = EINVAL; + return (-1); + } + cfgs = calloc(maxpins, sizeof(*cfgs)); + if (cfgs == NULL) + return (-1); + for (i = 0; i <= maxpins; i++) { + cfgs[i].g_pin = i; + gpio_pin_config(handle, &cfgs[i]); + } + *pcfgs = cfgs; + + return (maxpins); +} + +int +gpio_pin_config(gpio_handle_t handle, gpio_config_t *cfg) +{ + struct gpio_pin gppin; + + if (cfg == NULL) + return (-1); + gppin.gp_pin = cfg->g_pin; + if (ioctl(handle, GPIOGETCONFIG, &gppin) < 0) + return (-1); + strlcpy(cfg->g_name, gppin.gp_name, GPIOMAXNAME); + cfg->g_caps = gppin.gp_caps; + cfg->g_flags = gppin.gp_flags; + + return (0); +} + +int +gpio_pin_set_flags(gpio_handle_t handle, gpio_config_t *cfg) +{ + struct gpio_pin gppin; + + if (cfg == NULL) + return (-1); + gppin.gp_pin = cfg->g_pin; + gppin.gp_flags = cfg->g_flags; + if (ioctl(handle, GPIOSETCONFIG, &gppin) < 0) + return (-1); + + return (0); +} + +gpio_value_t +gpio_pin_get(gpio_handle_t handle, gpio_pin_t pin) +{ + struct gpio_req gpreq; + + bzero(&gpreq, sizeof(gpreq)); + gpreq.gp_pin = pin; + if (ioctl(handle, GPIOGET, &gpreq) < 0) + return (GPIO_VALUE_INVALID); + + return (gpreq.gp_value); +} + +int +gpio_pin_set(gpio_handle_t handle, gpio_pin_t pin, gpio_value_t value) +{ + struct gpio_req gpreq; + + if (value == GPIO_VALUE_INVALID) + return (-1); + bzero(&gpreq, sizeof(gpreq)); + gpreq.gp_pin = pin; + gpreq.gp_value = value; + if (ioctl(handle, GPIOSET, &gpreq) < 0) + return (-1); + + return (0); +} + +int +gpio_pin_toggle(gpio_handle_t handle, gpio_pin_t pin) +{ + gpio_value_t value; + + value = gpio_pin_get(handle, pin); + if (value == GPIO_VALUE_INVALID) + return (-1); + value = !value; + + return (gpio_pin_set(handle, pin, value)); +} + +int +gpio_pin_low(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set(handle, pin, GPIO_VALUE_LOW)); +} + +int +gpio_pin_high(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set(handle, pin, GPIO_VALUE_HIGH)); +} + +static int +gpio_pin_set_flag(gpio_handle_t handle, gpio_pin_t pin, uint32_t flag) +{ + gpio_config_t cfg; + + bzero(&cfg, sizeof(cfg)); + cfg.g_pin = pin; + if (gpio_pin_config(handle, &cfg) < 0) + return (-1); + cfg.g_flags = flag; + + return (gpio_pin_set_flags(handle, &cfg)); +} + +int +gpio_pin_input(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INPUT)); +} + +int +gpio_pin_output(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_OUTPUT)); +} + +int +gpio_pin_opendrain(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_OPENDRAIN)); +} + +int +gpio_pin_pushpull(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PUSHPULL)); +} + +int +gpio_pin_tristate(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_TRISTATE)); +} + +int +gpio_pin_pullup(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULLUP)); +} + +int +gpio_pin_pulldown(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULLDOWN)); +} + +int +gpio_pin_invin(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INVIN)); +} + +int +gpio_pin_invout(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_INVOUT)); +} + +int +gpio_pin_pulsate(gpio_handle_t handle, gpio_pin_t pin) +{ + return (gpio_pin_set_flag(handle, pin, GPIO_PIN_PULSATE)); +} Property changes on: head/lib/libgpio/gpio.c ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lib/libgpio/libgpio.h =================================================================== --- head/lib/libgpio/libgpio.h (nonexistent) +++ head/lib/libgpio/libgpio.h (revision 274987) @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2013-2014 Rui Paulo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LIBGPIO_H_ +#define _LIBGPIO_H_ + +#include + +__BEGIN_DECLS + +#define GPIO_INVALID_HANDLE -1 +typedef int gpio_handle_t; +typedef uint32_t gpio_pin_t; + +/* + * Structure describing a GPIO pin configuration. + */ +typedef struct { + gpio_pin_t g_pin; + char g_name[GPIOMAXNAME]; + uint32_t g_caps; + uint32_t g_flags; +} gpio_config_t; + +typedef enum { + GPIO_VALUE_INVALID = -1, + GPIO_VALUE_LOW = GPIO_PIN_LOW, + GPIO_VALUE_HIGH = GPIO_PIN_HIGH +} gpio_value_t; + +/* + * Open /dev/gpiocN or a specific device. + */ +gpio_handle_t gpio_open(unsigned int); +gpio_handle_t gpio_open_device(const char *); +void gpio_close(gpio_handle_t); +/* + * Get a list of all the GPIO pins. + */ +int gpio_pin_list(gpio_handle_t, gpio_config_t **); +/* + * GPIO pin configuration. + * + * Retrieve the configuration of a specific GPIO pin. The pin number is + * passed through the gpio_config_t structure. + */ +int gpio_pin_config(gpio_handle_t, gpio_config_t *); +/* + * Sets the GPIO flags on a specific GPIO pin. The pin number and the flags + * to be set are passed through the gpio_config_t structure. + */ +int gpio_pin_set_flags(gpio_handle_t, gpio_config_t *); +/* + * GPIO pin values. + */ +int gpio_pin_get(gpio_handle_t, gpio_pin_t); +int gpio_pin_set(gpio_handle_t, gpio_pin_t, int); +int gpio_pin_toggle(gpio_handle_t, gpio_pin_t); +/* + * Helper functions to set pin states. + */ +int gpio_pin_low(gpio_handle_t, gpio_pin_t); +int gpio_pin_high(gpio_handle_t, gpio_pin_t); +/* + * Helper functions to configure pins. + */ +int gpio_pin_input(gpio_handle_t, gpio_pin_t); +int gpio_pin_output(gpio_handle_t, gpio_pin_t); +int gpio_pin_opendrain(gpio_handle_t, gpio_pin_t); +int gpio_pin_pushpull(gpio_handle_t, gpio_pin_t); +int gpio_pin_tristate(gpio_handle_t, gpio_pin_t); +int gpio_pin_pullup(gpio_handle_t, gpio_pin_t); +int gpio_pin_pulldown(gpio_handle_t, gpio_pin_t); +int gpio_pin_invin(gpio_handle_t, gpio_pin_t); +int gpio_pin_invout(gpio_handle_t, gpio_pin_t); +int gpio_pin_pulsate(gpio_handle_t, gpio_pin_t); + +__END_DECLS + +#endif /* _LIBGPIO_H_ */ Property changes on: head/lib/libgpio/libgpio.h ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +FreeBSD=%H \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/share/mk/bsd.libnames.mk =================================================================== --- head/share/mk/bsd.libnames.mk (revision 274986) +++ head/share/mk/bsd.libnames.mk (revision 274987) @@ -1,173 +1,174 @@ # $FreeBSD$ # The include file define library names. # Other include files (e.g. bsd.prog.mk, bsd.lib.mk) include this # file where necessary. .if !target(____) .error bsd.libnames.mk cannot be included directly. .endif .sinclude LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a LIBARCHIVE?= ${DESTDIR}${LIBDIR}/libarchive.a LIBASN1?= ${DESTDIR}${LIBDIR}/libasn1.a LIBATM?= ${DESTDIR}${LIBDIR}/libatm.a LIBAUDITD?= ${DESTDIR}${LIBDIR}/libauditd.a LIBAVL?= ${DESTDIR}${LIBDIR}/libavl.a LIBBEGEMOT?= ${DESTDIR}${LIBDIR}/libbegemot.a LIBBLUETOOTH?= ${DESTDIR}${LIBDIR}/libbluetooth.a LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxml.a LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBC?= ${DESTDIR}${LIBDIR}/libc.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a LIBCAPSICUM?= ${DESTDIR}${LIBDIR}/libcapsicum.a LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a LIBDIALOG?= ${DESTDIR}${LIBDIR}/libdialog.a LIBDNS?= ${DESTDIR}${LIBDIR}/libdns.a LIBDPV?= ${DESTDIR}${LIBDIR}/libdpv.a LIBDTRACE?= ${DESTDIR}${LIBDIR}/libdtrace.a LIBDWARF?= ${DESTDIR}${LIBDIR}/libdwarf.a LIBEDIT?= ${DESTDIR}${LIBDIR}/libedit.a LIBELF?= ${DESTDIR}${LIBDIR}/libelf.a LIBEXECINFO?= ${DESTDIR}${LIBDIR}/libexecinfo.a LIBFETCH?= ${DESTDIR}${LIBDIR}/libfetch.a LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpar.a LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a +LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libheimbase.a LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a LIBKADM5SRV?= ${DESTDIR}${LIBDIR}/libkadm5srv.a LIBKAFS5?= ${DESTDIR}${LIBDIR}/libkafs5.a LIBKDC?= ${DESTDIR}${LIBDIR}/libkdc.a LIBKEYCAP?= ${DESTDIR}${LIBDIR}/libkeycap.a LIBKICONV?= ${DESTDIR}${LIBDIR}/libkiconv.a LIBKRB5?= ${DESTDIR}${LIBDIR}/libkrb5.a LIBKVM?= ${DESTDIR}${LIBDIR}/libkvm.a LIBL?= ${DESTDIR}${LIBDIR}/libl.a LIBLN?= "don't use LIBLN, use LIBL" LIBLZMA?= ${DESTDIR}${LIBDIR}/liblzma.a LIBM?= ${DESTDIR}${LIBDIR}/libm.a LIBMAGIC?= ${DESTDIR}${LIBDIR}/libmagic.a LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnetgraph.a LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a # The static PAM library doesn't know its secondary dependencies, # so we have to specify them explicitly. Ths is an unfortunate, # but necessary departure from testing MK_ flags to define # values here. LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a MINUSLPAM= -lpam .if defined(LDFLAGS) && !empty(LDFLAGS:M-static) .if ${MK_KERBEROS} != "no" LIBPAM+= ${LIBKRB5} ${LIBHX509} ${LIBASN1} ${LIBCRYPTO} ${LIBCRYPT} \ ${LIBROKEN} ${LIBCOM_ERR} MINUSLPAM+= -lkrb5 -lhx509 -lasn1 -lcrypto -lcrypt -lroken -lcom_err .endif LIBPAM+= ${LIBRADIUS} ${LIBTACPLUS} ${LIBCRYPT} \ ${LIBUTIL} ${LIBOPIE} ${LIBMD} MINUSLPAM+= -lradius -ltacplus -lcrypt \ -lutil -lopie -lmd .if ${MK_OPENSSH} != "no" LIBPAM+= ${LIBSSH} ${LIBCRYPTO} ${LIBCRYPT} MINUSLPAM+= -lssh -lcrypto -lcrypt .endif .if ${MK_NIS} != "no" LIBPAM+= ${LIBYPCLNT} MINUSLPAM+= -lypclnt .endif .endif LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a LIBPCAP?= ${DESTDIR}${LIBDIR}/libpcap.a LIBPJDLOG?= ${DESTDIR}${LIBDIR}/libpjdlog.a LIBPMC?= ${DESTDIR}${LIBDIR}/libpmc.a LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a LIBSDP?= ${DESTDIR}${LIBDIR}/libsdp.a LIBSMB?= ${DESTDIR}${LIBDIR}/libsmb.a LIBSSL?= ${DESTDIR}${LIBDIR}/libssl.a LIBSSP_NONSHARED?= ${DESTDIR}${LIBDIR}/libssp_nonshared.a LIBSTAND?= ${DESTDIR}${LIBDIR}/libstand.a LIBSTDCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libstdc++.a LIBTACPLUS?= ${DESTDIR}${LIBDIR}/libtacplus.a LIBTERMCAP?= ${DESTDIR}${LIBDIR}/libtermcap.a LIBTERMCAPW?= ${DESTDIR}${LIBDIR}/libtermcapw.a LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTERMCAP" LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a LIBZFS?= ${DESTDIR}${LIBDIR}/libzfs.a LIBZFS_CORE?= ${DESTDIR}${LIBDIR}/libzfs_core.a LIBZPOOL?= ${DESTDIR}${LIBDIR}/libzpool.a # enforce the 2 -lpthread and -lc to always be the last in that exact order .if defined(LDADD) .if ${LDADD:M-lpthread} LDADD:= ${LDADD:N-lpthread} -lpthread .endif .if ${LDADD:M-lc} LDADD:= ${LDADD:N-lc} -lc .endif .endif