No package ‘mono’ found when configuring xsp

While setting up mono/fastcgi for a customer on their RHEL 6 server at AWS, I got the error "No package ‘mono’ found" when trying to configure xsp. This post shows the error and the simple solution.

The error

I’d already compiled mono and then ran configure in the xsp directory and got the following output. I was surprised to be told that mono could not be found.

$ ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... (cached) gawk
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for MONO_MODULE... configure: error: Package requirements (mono >= 2.10.0) were not met:

No package 'mono' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables MONO_MODULE_CFLAGS
and MONO_MODULE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

The solution

Run this first:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 

And then run ./configure in the normal way. 

Linux distros

This should work for RHEL (Red Hat Enterprise Linux) 6 and CentOS 6, and possibly earlier versions of these Linux distros as well. I ran these commands on RHEL6.