diff --git a/CMakeChecks.cmake b/CMakeChecks.cmake index 32192aa2a..1eace6508 100644 --- a/CMakeChecks.cmake +++ b/CMakeChecks.cmake @@ -1726,6 +1726,37 @@ int main(int argc, char *argv[]) { endif() endmacro() +# +# From BSDBuild/lua.pm: +# +macro(Check_Lua) + set(LUA_CFLAGS "") + set(LUA_LIBS "") + + find_package(Lua) + if(LUA_FOUND) + set(HAVE_LUA ON) + BB_Save_Define(HAVE_LUA) + if(${LUA_INCLUDE_DIRS}) + set(LUA_CFLAGS "-I${LUA_INCLUDE_DIRS}") + endif() + set(LUA_LIBS "${LUA_LIBRARIES}") + else() + set(HAVE_LUA OFF) + BB_Save_Undef(HAVE_LUA) + endif() + + BB_Save_MakeVar(LUA_CFLAGS "${LUA_CFLAGS}") + BB_Save_MakeVar(LUA_LIBS "${LUA_LIBS}") +endmacro() + +macro(Disable_Lua) + set(HAVE_LUA OFF) + BB_Save_Undef(HAVE_LUA) + BB_Save_MakeVar(LUA_CFLAGS "") + BB_Save_MakeVar(LUA_LIBS "") +endmacro() + # # From BSDBuild/math.pm: # diff --git a/configure b/configure index 0e115aae3..e68bc2576 100755 --- a/configure +++ b/configure @@ -10086,19 +10086,22 @@ $ECHO_N 'checking for the X window system...' $ECHO_N '# checking for the X window system...' >>config.log # BEGIN x11(0 ${prefix_x}) if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix x11 2>/dev/null`" != '' ]; then -if [ "$pfx" != "" ]; then +if [ "${prefix_x}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, x11 is installed in prefix: " -echo "# * ERROR: According to pkg-config, x11 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." >>config.log +echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_x} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct x11 prefix (or omit for autodetect)." -echo "# * Please indicate correct x11 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10108,20 +10111,24 @@ echo "***" exit 1 fi fi +fi X11_VERSION=`$PKGCONFIG x11 --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_x}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, x11 is installed in prefix: " -echo "# * ERROR: According to pkg-config, x11 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." >>config.log +echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_x} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct x11 prefix (or omit for autodetect)." -echo "# * Please indicate correct x11 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10131,20 +10138,24 @@ echo "***" exit 1 fi fi +fi X11_CFLAGS=`$PKGCONFIG x11 --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_x}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix x11 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_x}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, x11 is installed in prefix: " -echo "# * ERROR: According to pkg-config, x11 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_x} was given." >>config.log +echo "* ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, x11 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_x} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_x} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct x11 prefix (or omit for autodetect)." -echo "# * Please indicate correct x11 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct x11 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10154,6 +10165,7 @@ echo "***" exit 1 fi fi +fi X11_LIBS=`$PKGCONFIG x11 --libs 2>/dev/null` else X11_CFLAGS="" @@ -10553,19 +10565,22 @@ $ECHO_N 'checking for the Xinerama extension...' $ECHO_N '# checking for the Xinerama extension...' >>config.log # BEGIN xinerama(0 ${prefix_xinerama}) if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix xinerama 2>/dev/null`" != '' ]; then -if [ "$pfx" != "" ]; then +if [ "${prefix_xinerama}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, xinerama is installed in prefix: " -echo "# * ERROR: According to pkg-config, xinerama is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." >>config.log +echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct xinerama prefix (or omit for autodetect)." -echo "# * Please indicate correct xinerama prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10575,20 +10590,24 @@ echo "***" exit 1 fi fi +fi XINERAMA_VERSION=`$PKGCONFIG xinerama --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_xinerama}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, xinerama is installed in prefix: " -echo "# * ERROR: According to pkg-config, xinerama is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." >>config.log +echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct xinerama prefix (or omit for autodetect)." -echo "# * Please indicate correct xinerama prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10598,20 +10617,24 @@ echo "***" exit 1 fi fi +fi XINERAMA_CFLAGS=`$PKGCONFIG xinerama --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_xinerama}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix xinerama 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_xinerama}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, xinerama is installed in prefix: " -echo "# * ERROR: According to pkg-config, xinerama is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_xinerama} was given." >>config.log +echo "* ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, xinerama is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_xinerama} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_xinerama} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct xinerama prefix (or omit for autodetect)." -echo "# * Please indicate correct xinerama prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct xinerama prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -10621,6 +10644,7 @@ echo "***" exit 1 fi fi +fi XINERAMA_LIBS=`$PKGCONFIG xinerama --libs 2>/dev/null` else XINERAMA_CFLAGS="" @@ -11013,19 +11037,22 @@ $ECHO_N 'checking for FreeType...' $ECHO_N '# checking for FreeType...' >>config.log # BEGIN freetype(7.0.1 ${prefix_freetype}) if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix freetype2 2>/dev/null`" != '' ]; then -if [ "$pfx" != "" ]; then +if [ "${prefix_freetype}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, freetype2 is installed in prefix: " -echo "# * ERROR: According to pkg-config, freetype2 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." >>config.log +echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct freetype2 prefix (or omit for autodetect)." -echo "# * Please indicate correct freetype2 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11035,20 +11062,24 @@ echo "***" exit 1 fi fi +fi FREETYPE_VERSION=`$PKGCONFIG freetype2 --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_freetype}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, freetype2 is installed in prefix: " -echo "# * ERROR: According to pkg-config, freetype2 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." >>config.log +echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct freetype2 prefix (or omit for autodetect)." -echo "# * Please indicate correct freetype2 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11058,20 +11089,24 @@ echo "***" exit 1 fi fi +fi FREETYPE_CFLAGS=`$PKGCONFIG freetype2 --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_freetype}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix freetype2 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_freetype}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, freetype2 is installed in prefix: " -echo "# * ERROR: According to pkg-config, freetype2 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_freetype} was given." >>config.log +echo "* ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, freetype2 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_freetype} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_freetype} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct freetype2 prefix (or omit for autodetect)." -echo "# * Please indicate correct freetype2 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct freetype2 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11081,6 +11116,7 @@ echo "***" exit 1 fi fi +fi FREETYPE_LIBS=`$PKGCONFIG freetype2 --libs 2>/dev/null` else FREETYPE_VERSION= @@ -11305,19 +11341,22 @@ echo '#undef HAVE_FREETYPE' >$bb_incdir/have_freetype.h $ECHO_N 'checking for fontconfig...' $ECHO_N '# checking for fontconfig...' >>config.log # BEGIN fontconfig(2.6.0 ${prefix_fontconfig}) -if [ "$pfx" != "" ]; then +if [ "${prefix_fontconfig}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, fontconfig is installed in prefix: " -echo "# * ERROR: According to pkg-config, fontconfig is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." >>config.log +echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct fontconfig prefix (or omit for autodetect)." -echo "# * Please indicate correct fontconfig prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11327,20 +11366,24 @@ echo "***" exit 1 fi fi +fi FONTCONFIG_VERSION=`$PKGCONFIG fontconfig --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_fontconfig}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, fontconfig is installed in prefix: " -echo "# * ERROR: According to pkg-config, fontconfig is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." >>config.log +echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct fontconfig prefix (or omit for autodetect)." -echo "# * Please indicate correct fontconfig prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11350,20 +11393,24 @@ echo "***" exit 1 fi fi +fi FONTCONFIG_CFLAGS=`$PKGCONFIG fontconfig --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_fontconfig}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix fontconfig 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_fontconfig}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, fontconfig is installed in prefix: " -echo "# * ERROR: According to pkg-config, fontconfig is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_fontconfig} was given." >>config.log +echo "* ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, fontconfig is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_fontconfig} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_fontconfig} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct fontconfig prefix (or omit for autodetect)." -echo "# * Please indicate correct fontconfig prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct fontconfig prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -11373,6 +11420,7 @@ echo "***" exit 1 fi fi +fi FONTCONFIG_LIBS=`$PKGCONFIG fontconfig --libs 2>/dev/null` if [ "${FONTCONFIG_VERSION}" != "" ]; then if [ "${prefix_fontconfig}" != "" ]; then @@ -14539,19 +14587,22 @@ SUBDIR_au="au" $ECHO_N 'checking for libsndfile...' $ECHO_N '# checking for libsndfile...' >>config.log # BEGIN sndfile(1.0.21 ${prefix_sndfile}) -if [ "$pfx" != "" ]; then +if [ "${prefix_sndfile}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix sndfile 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_sndfile}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, sndfile is installed in prefix: " -echo "# * ERROR: According to pkg-config, sndfile is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." >>config.log +echo "* ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_sndfile} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_sndfile} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct sndfile prefix (or omit for autodetect)." -echo "# * Please indicate correct sndfile prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14561,20 +14612,24 @@ echo "***" exit 1 fi fi +fi SNDFILE_VERSION=`$PKGCONFIG sndfile --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_sndfile}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix sndfile 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_sndfile}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, sndfile is installed in prefix: " -echo "# * ERROR: According to pkg-config, sndfile is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." >>config.log +echo "* ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_sndfile} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_sndfile} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct sndfile prefix (or omit for autodetect)." -echo "# * Please indicate correct sndfile prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14584,20 +14639,24 @@ echo "***" exit 1 fi fi +fi SNDFILE_CFLAGS=`$PKGCONFIG sndfile --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_sndfile}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix sndfile 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_sndfile}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, sndfile is installed in prefix: " -echo "# * ERROR: According to pkg-config, sndfile is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_sndfile} was given." >>config.log +echo "* ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, sndfile is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_sndfile} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_sndfile} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct sndfile prefix (or omit for autodetect)." -echo "# * Please indicate correct sndfile prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct sndfile prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14607,6 +14666,7 @@ echo "***" exit 1 fi fi +fi SNDFILE_LIBS=`$PKGCONFIG sndfile --libs 2>/dev/null` if [ "${SNDFILE_VERSION}" != "" ]; then if [ "${prefix_sndfile}" != "" ]; then @@ -14723,19 +14783,22 @@ $ECHO_N '# checking for PortAudio2...' >>config.log # BEGIN portaudio(19.0 ${prefix_portaudio}) PORTAUDIO_VERSION="" if [ "${PKGCONFIG}" != '' -a "`${PKGCONFIG} --variable=prefix portaudio-2.0 2>/dev/null`" != '' ]; then -if [ "$pfx" != "" ]; then +if [ "${prefix_portaudio}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix portaudio-2.0 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_portaudio}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " -echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." >>config.log +echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_portaudio} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_portaudio} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." -echo "# * Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14745,20 +14808,24 @@ echo "***" exit 1 fi fi +fi PORTAUDIO_VERSION=`$PKGCONFIG portaudio-2.0 --modversion 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_portaudio}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix portaudio-2.0 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_portaudio}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " -echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." >>config.log +echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_portaudio} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_portaudio} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." -echo "# * Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14768,20 +14835,24 @@ echo "***" exit 1 fi fi +fi PORTAUDIO_CFLAGS=`$PKGCONFIG portaudio-2.0 --cflags 2>/dev/null` -if [ "$pfx" != "" ]; then +if [ "${prefix_portaudio}" != "" ]; then MK_EXEC_PKGPREFIX=`$PKGCONFIG --variable=prefix portaudio-2.0 2>/dev/null` -if [ "$MK_EXEC_PKGPREFIX" != "$pfx" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "" ]; then +if [ "$MK_EXEC_PKGPREFIX" != "${prefix_portaudio}" ]; then +echo "" +echo "# " >>config.log echo "* " echo "# * " >>config.log -echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " -echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in prefix: " >>config.log -echo "* $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." -echo "# * $MK_EXEC_PKGPREFIX, but the prefix ${prefix_portaudio} was given." >>config.log +echo "* ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," +echo "# * ERROR: According to pkg-config, portaudio-2.0 is installed in $MK_EXEC_PKGPREFIX," >>config.log +echo "* but the alternate prefix ${prefix_portaudio} was passed to configure instead." +echo "# * but the alternate prefix ${prefix_portaudio} was passed to configure instead." >>config.log echo "* " echo "# * " >>config.log -echo "* Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." -echo "# * Please indicate correct portaudio-2.0 prefix (or omit for autodetect)." >>config.log +echo "* Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." +echo "# * Please indicate correct portaudio-2.0 prefix (or simply omit to use $MK_EXEC_PKGPREFIX)." >>config.log echo "* " echo "# * " >>config.log echo "***" @@ -14791,6 +14862,7 @@ echo "***" exit 1 fi fi +fi PORTAUDIO_LIBS=`$PKGCONFIG portaudio-2.0 --libs 2>/dev/null` if [ "${PORTAUDIO_VERSION}" != "" ]; then PORTAUDIO_VERSION="${PORTAUDIO_VERSION}.0" diff --git a/gui/AG_DriverGLX.3 b/gui/AG_DriverGLX.3 index 39cd21f42..5c0164fc1 100644 --- a/gui/AG_DriverGLX.3 +++ b/gui/AG_DriverGLX.3 @@ -1,4 +1,4 @@ -.\" Copyright (c) 2010-2022 Julien Nadeau Carriere +.\" Copyright (c) 2010-2024 Julien Nadeau Carriere .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,7 +22,7 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 21, 2022 +.Dd April 9, 2024 .Dt AG_DRIVERGLX 3 .Os Agar 1.7 .Sh NAME @@ -45,6 +45,7 @@ is usually the default driver. .Bd -literal -offset indent .\" SYNTAX(c) AG_InitGraphics("glx"); +AG_InitGraphics("glx(no-im)"); AG_InitGraphics("glx(stereo)"); AG_InitGraphics("glx(debug:xsync)"); .Ed @@ -54,6 +55,8 @@ AG_InitGraphics("glx(debug:xsync)"); Capture .Dv GL_DEBUG_OUTPUT errors. +.It no-im +Disable X input methods. .It stereo Request a stereoscopic visual. .It xsync diff --git a/gui/drv_glx.c b/gui/drv_glx.c index 1949652a7..1d94c591f 100644 --- a/gui/drv_glx.c +++ b/gui/drv_glx.c @@ -159,7 +159,7 @@ static Atom wmDeleteWindow, wmNetWmWindowOpacity, wmProtocols, wmTakeFocus, wmNetWmStateBelow, wmNetWmWindowType, wmNetWmWindowOpacity; #endif -static int GLX_InitGlobals(void); +static int GLX_InitGlobals(AG_Driver *_Nonnull); static void GLX_PostResizeCallback(AG_Window *_Nonnull, AG_SizeAlloc *_Nonnull); static void GLX_PostMoveCallback(AG_Window *_Nonnull, AG_SizeAlloc *_Nonnull); static void GLX_SetTransientFor(AG_Window *, AG_Window *_Nullable); @@ -286,7 +286,7 @@ GLX_Open(void *_Nonnull obj, const char *_Nullable spec) AG_Driver *drv = obj; AG_DriverGLX *glx = obj; - if (GLX_InitGlobals() == -1) + if (GLX_InitGlobals(drv) == -1) return (-1); AG_MutexLock(&agDisplayLock); @@ -2321,7 +2321,7 @@ GLX_EventEpilogue(AG_EventSink *_Nonnull es, AG_Event *_Nonnull event) } static int -GLX_InitGlobals(void) +GLX_InitGlobals(AG_Driver *_Nonnull drvFirst) { int err, ev, xfd; @@ -2395,16 +2395,20 @@ GLX_InitGlobals(void) #endif #ifdef AG_UNICODE - /* Initialize X Input Methods */ - XSetLocaleModifiers(""); - agXIM = XOpenIM(agDisplay, 0, 0, 0); - if(!agXIM) { - XSetLocaleModifiers("@im=none"); + if (AG_Defined(drvFirst, "no-im")) { + Debug(drvFirst, "Disabling input methods (no-im)\n"); + } else { + /* Initialize X Input Methods */ + XSetLocaleModifiers(""); agXIM = XOpenIM(agDisplay, 0, 0, 0); + if(!agXIM) { + XSetLocaleModifiers("@im=none"); + agXIM = XOpenIM(agDisplay, 0, 0, 0); + } + agXIC = XCreateIC(agXIM, XNInputStyle, XIMPreeditNothing | + XIMStatusNothing, NULL); + XSetICFocus(agXIC); } - agXIC = XCreateIC(agXIM, XNInputStyle, XIMPreeditNothing | - XIMStatusNothing, NULL); - XSetICFocus(agXIC); #endif agClipboardWindow = None;