|
| 1 | +Installation Instructions for async-process |
| 2 | +=========================================== |
| 3 | + |
| 4 | +## Quick Start |
| 5 | + |
| 6 | +For most users on FreeBSD, Linux, or macOS: |
| 7 | + |
| 8 | + make |
| 9 | + sudo make install |
| 10 | + |
| 11 | +This will install to /usr/local by default. |
| 12 | + |
| 13 | +## Detailed Installation Steps |
| 14 | + |
| 15 | +The Makefile handles everything automatically, including generating the |
| 16 | +configure script if needed. No bootstrap script required! |
| 17 | + |
| 18 | +### 1. Build the Library |
| 19 | + |
| 20 | +Simply run: |
| 21 | + |
| 22 | + make |
| 23 | + |
| 24 | +This automatically: |
| 25 | +- Generates the configure script (if not present) |
| 26 | +- Runs configure with default settings |
| 27 | +- Builds the library |
| 28 | + |
| 29 | +### 2. Install |
| 30 | + |
| 31 | + make install |
| 32 | + |
| 33 | +By default, this installs to /usr/local: |
| 34 | +- Library: /usr/local/lib/libasyncprocess.so (or .dylib on macOS) |
| 35 | +- Header: /usr/local/include/async-process.h |
| 36 | + |
| 37 | +You may need to use sudo if installing to a system directory: |
| 38 | + |
| 39 | + sudo make install |
| 40 | + |
| 41 | +### 3. Custom Installation Prefix |
| 42 | + |
| 43 | +To install to a different location, specify PREFIX: |
| 44 | + |
| 45 | + make install PREFIX=/usr # System-wide |
| 46 | + make install PREFIX=$HOME/.local # User installation |
| 47 | + make install PREFIX=/opt/local # Alternative location |
| 48 | + |
| 49 | +#### FreeBSD-Specific Examples |
| 50 | + |
| 51 | + make install PREFIX=/usr/local # Standard FreeBSD location (default) |
| 52 | + make install PREFIX=/usr/local/async-process # Isolated installation |
| 53 | + |
| 54 | +## Advanced Usage |
| 55 | + |
| 56 | +### Manual Configure Options |
| 57 | + |
| 58 | +If you need custom configure options beyond --prefix: |
| 59 | + |
| 60 | + make # This generates configure if needed |
| 61 | + ./configure --prefix=/usr/local --enable-shared --disable-static |
| 62 | + make |
| 63 | + make install |
| 64 | + |
| 65 | +## Configure Dynamic Linker (if needed) |
| 66 | + |
| 67 | +#### On Linux |
| 68 | + |
| 69 | +If you installed to a non-standard prefix, you may need to update the linker cache: |
| 70 | + |
| 71 | + sudo ldconfig |
| 72 | + |
| 73 | +Or add the library directory to LD_LIBRARY_PATH: |
| 74 | + |
| 75 | + export LD_LIBRARY_PATH=/your/prefix/lib:$LD_LIBRARY_PATH |
| 76 | + |
| 77 | +#### On FreeBSD |
| 78 | + |
| 79 | + sudo ldconfig -m /your/prefix/lib |
| 80 | + |
| 81 | +#### On macOS |
| 82 | + |
| 83 | + export DYLD_LIBRARY_PATH=/your/prefix/lib:$DYLD_LIBRARY_PATH |
| 84 | + |
| 85 | +## Verify Installation |
| 86 | + |
| 87 | +Check that the library is installed: |
| 88 | + |
| 89 | + ls -l /usr/local/lib/libasyncprocess.* |
| 90 | + ls -l /usr/local/include/async-process.h |
| 91 | + |
| 92 | +## Uninstalling |
| 93 | + |
| 94 | +To remove the installed files: |
| 95 | + |
| 96 | + sudo make uninstall |
| 97 | + |
| 98 | +## Development Installation |
| 99 | + |
| 100 | +For development, you can use the optional 'copy' target to build platform-specific |
| 101 | +libraries in the static/ directory tree: |
| 102 | + |
| 103 | + make copy |
| 104 | + |
| 105 | +This is useful for bundling pre-built libraries with the project, but is not |
| 106 | +needed for normal installation. |
| 107 | + |
| 108 | +## Platform-Specific Notes |
| 109 | + |
| 110 | +### FreeBSD |
| 111 | + |
| 112 | +FreeBSD uses /usr/local as the standard location for third-party software. |
| 113 | +The default configuration matches this convention. |
| 114 | + |
| 115 | +### Linux |
| 116 | + |
| 117 | +Most Linux distributions use /usr/local for locally-installed software. |
| 118 | +Package managers typically use /usr. |
| 119 | + |
| 120 | +### macOS |
| 121 | + |
| 122 | +Homebrew uses /usr/local on Intel Macs and /opt/homebrew on Apple Silicon. |
| 123 | +The default /usr/local works for manual installations. |
| 124 | + |
| 125 | +## Requirements |
| 126 | + |
| 127 | +- C compiler (GCC, Clang, etc.) |
| 128 | +- GNU Make |
| 129 | +- Autotools (autoconf, automake, libtool) - only needed for bootstrap |
| 130 | +- POSIX-compliant system (Unix, Linux, *BSD, macOS) |
| 131 | + |
| 132 | +## Troubleshooting |
| 133 | + |
| 134 | +### configure: command not found |
| 135 | + |
| 136 | +Run ./bootstrap first to generate the configure script. |
| 137 | + |
| 138 | +### Permission denied during make install |
| 139 | + |
| 140 | +Use sudo: |
| 141 | + |
| 142 | + sudo make install |
| 143 | + |
| 144 | +### Library not found at runtime |
| 145 | + |
| 146 | +Configure your dynamic linker (see step 5 above). |
| 147 | + |
| 148 | +## For Packagers |
| 149 | + |
| 150 | +When building packages, use DESTDIR for staged installation: |
| 151 | + |
| 152 | + make install DESTDIR=/path/to/staging/dir |
| 153 | + |
| 154 | +This installs to $DESTDIR/$PREFIX/... for packaging. |
| 155 | + |
| 156 | +## Support |
| 157 | + |
| 158 | +For issues, please visit: https://github.com/soppelmann/async-process |
0 commit comments