Using Fedora 17:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-luajit --with-luajit-includes=/opt/luajit-2.0.0/include --with-luajit-libraries=/opt/luajit-2.0.0/lib --enable-profiling --enable-gccprotect PKG_CONFIG_PATH=/opt/luajit-2.0.0/lib/pkgconfig/
works:
checking for LUAJIT... yes
checking lualib.h usability... yes
checking lualib.h presence... yes
checking for lualib.h... yes
checking for LUAJIT... yes
checking for luaL_openlibs in -lluajit-5.1... yes
However, omitting the pkg-config path fails:
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-luajit --with-luajit-includes=/opt/luajit-2.0.0/include --with-luajit-libraries=/opt/luajit-2.0.0/lib --enable-profiling --enable-gccprotect
checking for LUAJIT... no
configure: error: Package requirements (luajit) were not met:
No package 'luajit' 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 LUAJIT_CFLAGS
and LUAJIT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Relevant config.log:
configure:17651: checking for LUAJIT
configure:17658: $PKG_CONFIG --exists --print-errors "luajit"
Package luajit was not found in the pkg-config search path.
Perhaps you should add the directory containing `luajit.pc'
to the PKG_CONFIG_PATH environment variable
No package 'luajit' found
configure:17661: $? = 1
configure:17674: $PKG_CONFIG --exists --print-errors "luajit"
Package luajit was not found in the pkg-config search path.
Perhaps you should add the directory containing `luajit.pc'
to the PKG_CONFIG_PATH environment variable
No package 'luajit' found
configure:17677: $? = 1
configure:17690: result: no
No package 'luajit' found
configure:17706: error: Package requirements (luajit) were not met:
No package 'luajit' 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 LUAJIT_CFLAGS
and LUAJIT_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.