A simple and clean Bash script to install and configure GNU readline library using Homebrew with proper environment variable setup.
- π§ Automated GNU readline installation via Homebrew
- π Automatic library linking with force flag
- π Dynamic path detection and configuration
- π Environment variables setup (LDFLAGS, CPPFLAGS)
- π Automatic shell configuration reload
- π One-command installation process
- macOS or Linux system
- Homebrew installed
- Bash shell
- Clone this repository:
git clone https://github.com/aboubakr-jelloulat/readline-brew-installer.git
cd readline-brew-installer- Make the script executable:
chmod +x install_readline.sh- Run the installation script:
./install_readline.sh- Installs readline using Homebrew
- Links the library with force flag to ensure proper linking
- Detects installation path automatically
- Sets environment variables for compilation
- Reloads shell configuration to apply changes immediately
If you need to manually set the paths, update these environment variables in your shell configuration file (.zshrc, .bashrc, etc.):
export LDFLAGS="-L/path/to/readline/lib"
export CPPFLAGS="-I/path/to/readline/include"- Permission denied: Make sure the script is executable (
chmod +x install_readline.sh) - Homebrew not found: Install Homebrew first from brew.sh
- Path issues: Verify your readline installation path with
brew --prefix readline
Check if readline is properly installed:
brew list | grep readline
pkg-config --libs readlinereadline-brew-installer/
βββ README.md
βββ install_readline.sh
βββ LICENSE
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- GNU Project for the readline library
- Homebrew team for the package manager
- Open source community
β Star this repo if it helped you! β