Configure ac code fails to detect libXI presence - gtk3

I am currently executing the configure script of gtk. It tests for the presence of XInput, and it stops the execution with the error message:"configure: error: *** XInput2 extension not found. Check 'config.log' for more details.
Looking at config.log, it says "configure:23050: error: *** XInput2 extension not found. Check 'config.log' for more details."
So, the same except for the line number.
Then I decided to look at configure.ac. There I found the full Xi detection test that it is:
if $PKG_CONFIG --exists "xi" ; then
X_PACKAGES="$X_PACKAGES xi"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
gtk_save_LIBS="$LIBS"
LIBS="$LIBS -lXi"
# Note that we also check that the XIScrollClassInfo struct is defined,
# because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), but not the XIScrollClassInfo struct.
AC_CHECK_FUNC([XIAllowTouchEvents],
[AC_CHECK_MEMBER([XIScrollClassInfo.number],
have_xinput2_2=yes
AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
have_xinput2_2=no,
[[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"
if test "x$have_xinput2_2" = "xyes"; then
X_EXTENSIONS="$X_EXTENSIONS XI2.2"
else
X_EXTENSIONS="$X_EXTENSIONS XI2"
fi
fi
AS_IF([test "x$have_xinput2" != "xyes"],
[AC_MSG_ERROR([*** XInput2 extension not found. Check 'config.log' for more details.])])
I am no expert about setting configure.ac, but I thought that this line: "if $PKG_CONFIG --exists "xi" ; then" would be satisfied by this parameter that I pass to configure:
PKG_CONFIG_PATH=:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/
Also this line:
AC_CHECK_HEADER(X11/extensions/XInput2.h,
have_xinput2=yes
AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))
could not have been satisfied by this parameter that I pass to configure?
CPPFLAGS=-I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/
I am a bit lost as to why it doesn't detect nothing.
A curious point that I read in the documentation is that there is a parameter called: --disable-xinput.
Well I am passing it to configure and it obviously didn't disable the test. So I would appreciate any suggestions about how to change the test to try to figure out what is wrong with it (or with my system)

Solution found
If I replace:
if $PKG_CONFIG --exists "xi" ; then
on configure.ac, by:
if $PKG_CONFIG --print-errors --exists "xi" ; then
and then execute autoconf, it will generate a new configure based on this "new" configure.ac that will print all the required libraries that should be passed to configure.
First it was the .pc file of libXi, then the pc. file of Inputproto (that I had to download and install) an so on. I also really had to add libXi's include dir to CPPFLAGS, so it could find XInput2.h.
My final configure command was:
LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/ CPPFLAGS="-I/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/" LDFLAGS="-L/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/" ./configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gtk+-3.4.0 PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.8.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Inputproto-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/share/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xcb-1.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Pthread-stubs-0.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xau-1.0.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xext-1.1.1/lib/pkgconfig/

Related

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

How can I get "HelloWorld - BitBake Style" working on a newer version of Yocto?

In the book "Embedded Linux Systems with the Yocto Project", Chapter 4 contains a sample called "HelloWorld - BitBake style". I encountered a bunch of problems trying to get the old example working against the "Sumo" release 2.5.
If you're like me, the first error you encountered following the book's instructions was that you copied across bitbake.conf and got:
ERROR: ParseError at /tmp/bbhello/conf/bitbake.conf:749: Could not include required file conf/abi_version.conf
And after copying over abi_version.conf as well, you kept finding more and more cross-connected files that needed to be moved, and then some relative-path errors after that... Is there a better way?
Here's a series of steps which can allow you to bitbake nano based on the book's instructions.
Unless otherwise specified, these samples and instructions are all based on the online copy of the book's code-samples. While convenient for copy-pasting, the online resource is not totally consistent with the printed copy, and contains at least one extra bug.
Initial workspace setup
This guide assumes that you're working with Yocto release 2.5 ("sumo"), installed into /tmp/poky, and that the build environment will go into /tmp/bbhello. If you don't the Poky tools+libraries already, the easiest way is to clone it with:
$ git clone -b sumo git://git.yoctoproject.org/poky.git /tmp/poky
Then you can initialize the workspace with:
$ source /tmp/poky/oe-init-build-env /tmp/bbhello/
If you start a new terminal window, you'll need to repeat the previous command which will get get your shell environment set up again, but it should not replace any of the files created inside the workspace from the first time.
Wiring up the defaults
The oe-init-build-env script should have just created these files for you:
bbhello/conf/local.conf
bbhello/conf/templateconf.cfg
bbhello/conf/bblayers.conf
Keep these, they supersede some of the book-instructions, meaning that you should not create or have the files:
bbhello/classes/base.bbclass
bbhello/conf/bitbake.conf
Similarly, do not overwrite bbhello/conf/bblayers.conf with the book's sample. Instead, edit it to add a single line pointing to your own meta-hello folder, ex:
BBLAYERS ?= " \
${TOPDIR}/meta-hello \
/tmp/poky/meta \
/tmp/poky/meta-poky \
/tmp/poky/meta-yocto-bsp \
"
Creating the layer and recipe
Go ahead and create the following files from the book-samples:
meta-hello/conf/layer.conf
meta-hello/recipes-editor/nano/nano.bb
We'll edit these files gradually as we hit errors.
Can't find recipe error
The error:
ERROR: BBFILE_PATTERN_hello not defined
It is caused by the book-website's bbhello/meta-hello/conf/layer.conf being internally inconsistent. It uses the collection-name "hello" but on the next two lines uses _test suffixes. Just change them to _hello to match:
# Set layer search pattern and priority
BBFILE_COLLECTIONS += "hello"
BBFILE_PATTERN_hello := "^${LAYERDIR}/"
BBFILE_PRIORITY_hello = "5"
Interestingly, this error is not present in the printed copy of the book.
No license error
The error:
ERROR: /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb: This recipe does not have the LICENSE field set (nano)
ERROR: Failed to parse recipe: /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb
Can be fixed by adding a license setting with one of the values that bitbake recognizes. In this case, add a line onto nano.bb of:
LICENSE="GPLv3"
Recipe parse error
ERROR: ExpansionError during parsing /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb
[...]
bb.data_smart.ExpansionError: Failure expanding variable PV_MAJOR, expression was ${#bb.data.getVar('PV',d,1).split('.')[0]} which triggered exception AttributeError: module 'bb.data' has no attribute 'getVar'
This is fixed by updating the special python commands being used in the recipe, because #bb.data was deprecated and is now removed. Instead, replace it with #d, ex:
PV_MAJOR = "${#d.getVar('PV',d,1).split('.')[0]}"
PV_MINOR = "${#d.getVar('PV',d,1).split('.')[1]}"
License checksum failure
ERROR: nano-2.2.6-r0 do_populate_lic: QA Issue: nano: Recipe file fetches files and does not have license file information (LIC_FILES_CHKSUM) [license-checksum]
This can be fixed by adding a directive to the recipe telling it what license-info-containing file to grab, and what checksum we expect it to have.
We can follow the way the recipe generates the SRC_URI, and modify it slightly to point at the COPYING file in the same web-directory. Add this line to nano.bb:
LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
The MD5 checksum in this case came from manually downloading and inspecting the matching file.
Done!
Now bitbake nano ought to work, and when it is complete you should see it built nano:
/tmp/bbhello $ find ./tmp/deploy/ -name "*nano*.rpm*"
./tmp/deploy/rpm/i586/nano-dbg-2.2.6-r0.i586.rpm
./tmp/deploy/rpm/i586/nano-dev-2.2.6-r0.i586.rpm
I have recently worked on that hands-on hello world project. As far as I am concerned, I think that the source code in the book contains some bugs. Below there is a list of suggested fixes:
Inheriting native class
In fact, when you build with bitbake that you got from poky, it builds only for the target, unless you mention in your recipe that you are building for the host machine (native). You can do the latter by adding this line at the end of your recipe:
inherit native
Adding license information
It is worth mentioning that the variable LICENSE is important to be set in any recipe, otherwise bitbake rises an error. In our case, we try to build the version 2.2.6 of the nano editor, its current license is GPLv3, hence it should be mentioned as follow:
LICENSE = "GPLv3"
Using os.system calls
As the book states, you cannot dereference metadata directly from a python function. Which means it is mandatory to access metadata through the d dictionary. Bellow, there is a suggestion for the do_unpack python function, you can use its concept to code the next tasks (do_configure, do_compile):
python do_unpack() {
workdir = d.getVar("WORKDIR", True)
dl_dir = d.getVar("DL_DIR", True)
p = d.getVar("P", True)
tarball_name = os.path.join(dl_dir, p+".tar.gz")
bb.plain("Unpacking tarball")
os.system("tar -x -C " + workdir + " -f " + tarball_name)
bb.plain("tarball unpacked successfully")
}
Launching the nano editor
After successfully building your nano editor package, you can find your nano executable in the following directory in case you are using Ubuntu (arch x86_64):
./tmp/work/x86_64-linux/nano/2.2.6-r0/src/nano
Should you have any comments or questions, Don't hesitate !

Configuring OpenDDS

I am trying to configure the environment for OpenDDS, but I could not run the configure script. Would really appreciate much, if there are any insight from you guys. =D
So basically, after I download the OpenDDS-3.12.zip from here. I have extracted to a folder and tried to run the configure file with this command in VS command prompt (VS2017)
configure --compiler=gcc
Next, the "ACE+TAO-2.2a_with_latest_patches_NO_makefiles" is downloaded and I extract the zip file to the root folder.
Then it shows this message.
ACE_ROOT/ace/config.h exists, skipping configuration of ACE+TAO
Use of uninitialized value $mpctype in string eq at configure line 1103.
Use of uninitialized value $mpctype in concatenation (.) or string at configure line 1257.
Use of uninitialized value $mpctype in string eq at configure line 1266.
Running MPC to generate project files.
MPC_ROOT was set to C:\src\OpenDDS-DDS-3.12.2\ACE_wrappers\MPC.
Using .../OpenDDS-DDS-
3.12.2/ACE_wrappers/bin/MakeProjectCreator/config/MPC.cfg
ERROR: Invalid type: C:\src\OpenDDS-DDS-3.12.2\DDS_TAOv2_all.mwc
mwc.pl v4.1.28
...
/*lots of explanation of each file here*
*then followed by*/
...
ERROR: Error from MPC, stopped at configure line 1270.
I have both Visual Studio 2017 and Perl 5.22 installed as well, I am not sure whether if this is a compiler issue or any other issue. The following is the configure script that printed the error above.
## line 1268 -- 1270 ##
if (!$opts{'dry-run'}) {
if (system("perl \"$ENV{'ACE_ROOT'}/bin/mwc.pl\" $mwcargs") != 0) {
die "ERROR: Error from MPC, stopped";
}
}
$mpctype is defined here:
my $mpctype = ($slash eq '/' ||
($cross_compile && $buildEnv->{'build'} eq 'target'))
? 'gnuace' : $opts{'compiler_version'};
It seems to be looking at $opts{'compiler_version'}, which is apparently empty. %opts is defined here:
my %opts = %{parseArgs()};
so it looks like you should define the compiler_version in the command line or define the target platform. It's probably better if you check out the INSTALL options thoroughly
VS2017 doesn't install c++ compiler by default.
Modify VS 2017 and select c++ compiler and install if VS 2017 already install.
configure (without --compiler=gcc flag)
I had a similar question. Being a newbie, I started with the getting started with java and windows on https://opendds.org/quickstart/GettingStartedWindows.html .
Step 5, "configure (To enable Java support, use configure --java)" didn't work in a visual studio command window despite
having set JAVA_HOME. I had sent ACE_ROOT, DDS_ROOT, TAO_ROOT and MPC_ROOT though the tutorial didn't specify based on trying to debug this problem.
When using the "--compiler" option I get errors similar to the ones in this thread. Was there any resolution just to get the"
"off-the-shelf" tutorial working. Using Windows 10.
D:\data\OpenDDS-3.13.3>configure --java --compiler="C:\Program Files\Java\jdk1.8.0_221\bin"
ACE_ROOT/ace/config.h exists, skipping configuration of ACE+TAO
Use of uninitialized value $mpctype in string eq at configure line 1482.
Use of uninitialized value $mpctype in concatenation (.) or string at configure line
1646.
Use of uninitialized value $mpctype in string eq at configure line 1655.
Running MPC to generate project files.
MPC_ROOT was set to D:\data\OpenDDS-3.13.3\ACE_WRAPPERS\MPC.
Using .../OpenDDS-3.13.3/ACE_WRAPPERS/bin/MakeProjectCreator/config/MPC.cfg
ERROR: Invalid type: D:\data\OpenDDS-3.13.3\DDS_TAOv2_all.mwc
mwc.pl v4.1.44
...
ERROR: Error from MPC, stopped at configure line 1659.

Testing for LibreSSL in a Perl build script

I released Net::NSCAng::Client a while ago and am getting a lot of test failures on OpenBSD. The reason for that is that the NSCAng protocol uses OpenSSL in preshared-key mode (RFC4279), something the folks at LibreSSL (default on OpenBSD now) have ripped out. However, they seem to have been hell-bent on doing this the most intransparent way: the include files have all the functions defined, just the shared library is missing the corresponding symbols, so compilation works fine but the tests fail.
There is a compatibility package on OpenBSD called eopenssl, and by testing for this first in Makefile.PL (using ExtUtils::PkgConfig) I can make it work if the compatibility library is installed. If it isn't, things still fail.
I could check for the CPP symbol OPENSSL_NO_PSK, but as the includes always come from LibreSSL, this fails even if linking with eopenssl would work fine. The only idea I have left is to try and have a test program run as part of the compilation phase as autoconf does it. Is that even possible with ExtUtils::MakeMaker (or something else -- I wouldn't mind switching the build system if necessary)?
It's easy to write feature tests with Devel::CheckLib. Something like the following can be used to check for the presence of function your_func (in Makefile.PL):
my $your_func_exists = check_lib(
header => 'your_header.h',
function => 'return your_func ? 1 : 0;',
);
If you simply want to abort compilation if the function is missing:
check_lib(
...
) or warn('your_func is missing'), exit;
Exiting with 0 should avoid a CPAN Tester's 'FAIL' report.

Using devenv to pass preprocessor variables to Intel Fortran compiler

I'm using VS 2008 with Intel(R) Fortran Compiler version 10.1.025.
To build my solution I'm using a batch file with the following syntax:
devenv /rebuild "Release|Win32" "c:...\solution.sln" /Project "ProjectName_InTheSolution"
Using the configuration "Release|Win32" I specify, in VS ProjectProperties->Fortran->Proprocessor->Preprocessor Definitions the value "test".
Inside my code I'm testing if the "test" variable is define which is working everything correctly.
Any one know any way to change the "Preprocessor Definitions" of the fortran compiler using the command line ? I want to add also the value "commandLine" so would be "test;commandline" in the "Preprocessor Definitions".
Some notes:
1) I have to use the devenv.exe
2) I don't want to change neither the source code or the project file prior the compilation
3) I can use environment variable to pass option (if there is any way, I try the CL but didn't work)
Thanks in advance
Thanks for your answer but maybe I didn't understand completely your solution, but this is what I tried:
1)I change the "Additional Options" (AO) to /Dtest and:
1.1) If I compile from the Visual Studio or Command Line the check "!DEC$ IF DEFINED (test)" is true
2)I changed the AO to "$(DEFINE)" and:
2.1) From Visual Studio I see warnings: "command line warning #10161: unrecognized source type '$(DEFINE)'; object file assumed ifort " and the check "!DEC$ IF DEFINED (test)" is false
2.2) I add the Define variable to "User environment variables", same error from 2.1
3) I change the AO to "/D$(DEFINE)" I got an error "Bad syntax, '=' expected while processing '#$(define)' fortcom "
4) I change the AO to "$(DEFINE)" and SET DEFINE=/test, and didn't work either, the "!DEC$ IF DEFINED (test)" is false
#cup I think I need to understand a little better your solution, if you please could give me an additional information about your solution would be very appreciated.
What I'm trying to do is this:
program main
integer:: ii
!DEC$ IF DEFINED (test)
ii = 72
!DEC$ ENDIF
!DEC$ IF DEFINED (test2)
ii = 80
!DEC$ ENDIF
print *, "this is up to column ", ii
end
Now I want to control from the command line which part of code will be compiled, doing something like this:
1) from the command line: set define=test
2) devenv elephant.sln /build
3) run debug/elephant.exe -> get "72"
4) from the command line: set define=test2
5) devenv elephant.sln /build
6) run debug/elephant.exe -> get "80"
This is possible ?
Thanks in advance,
rui
Try this
1) Create the following F77 program
program main
integer:: ii
! ,-- column 73
ii = 72 +8
print *, "this is up to column ", ii
end
2) Create a solution for the above program, say elephant.sln
If you just build and run, it should display "this is up to column 72"
3) Pop up project properties, under Fortran/Command Line, add $(DEFINES) in the Additional Options Box.
4) Save and exit
5) set DEFINES=/extend_source:72
6) devenv elephant.sln /build
7) run debug/elephant.exe - you should get 72
8) set DEFINES=/extend_source:80
9) devenv elephant.sln /build
10) run debug/elephant.exe - you should get 80.
11) If you wish to add more /D options, stick it in the DEFINES environment variable.
Basically don't use preprocessor defines - just dump your settings into the DEFINES environment variable and it will be picked up by the Additional Options.