如何在17.10下从源码编译Geany并启用--enable-gtk3参数?
Hey there, I’ve dealt with similar HDPI scaling headaches with Geany before, so let’s walk through solving your missing configure file issue first, then cover the full compilation steps for Ubuntu 17.10.
Why You’re Missing the configure File
When you clone Geany’s source from GitHub, you’re getting the raw, unprocessed repository—the configure script isn’t pre-generated. You need to create it yourself using the autotools you already installed (automake, autoconf, etc.).
Step 1: Generate the configure Script
Navigate to your Geany source directory in the terminal, then run this command:
autoreconf -vfi
Let me break this down:
-v: Verbose output so you can see exactly what’s happening-f: Force overwrite any existing autotools files to avoid conflicts-i: Install missing auxiliary files (likeinstall-sh) that the build process needs
After this runs, you should see the configure executable appear in your source folder.
Step 2: Full Compilation Steps for Ubuntu 17.10
First, make sure you have all required dependencies installed (you might already have some, but it’s safe to run this):
sudo apt-get install build-essential automake autoconf libtool intltool libgtk-3-dev libglib2.0-dev libpango1.0-dev libcairo2-dev libgdk-pixbuf2.0-dev libvte-2.91-dev pkg-config
Once dependencies are set and you’ve generated configure, proceed with these steps:
Configure the build:
./configure --prefix=/usr/localUsing
/usr/localensures your compiled Geany doesn’t overwrite the system’s default version (if you have it installed). You can add flags like--enable-debugif you want debug symbols, but it’s not necessary for normal use.Compile the source:
make -j$(nproc)The
-j$(nproc)flag uses all your CPU cores to speed up compilation significantly.Install Geany:
sudo make install
Step 3: Tweak HDPI Scaling (Optional but Recommended)
Even after compiling, you might need to tell GTK to scale properly for your HDPI screen. Here’s how:
Temporary fix (current session only):
export GDK_SCALE=2Launch Geany from this terminal window to see the scaled UI immediately.
Permanent fix:
Create or edit the file~/.config/gtk-3.0/settings.iniand add these lines:[Settings] gtk-scaling-factor=2Adjust the number (1.5 works well for some screens too) based on your display’s exact DPI.
Troubleshooting Tips
- If
autoreconfthrows errors, double-check that all autotools packages are installed correctly (automake,autoconf,libtool,intltool). - If
configurefails with missing dependencies, the error message will explicitly name the package you need—install it and re-run./configure.
内容的提问来源于stack exchange,提问作者Enterprise

