How to build this project? - linux

I've been a visual studio developer for long and just trying to understand how things are in linux/unix worl. I found an open source project (Gcomandos) in source forge and tried to build it. when I download the source, I get these files:
16/02/2007 05:16 PM 25,987 aclocal.m4
16/02/2007 05:17 PM 127,445 configure
16/02/2007 05:16 PM 1,925 configure.ac
17/03/2010 03:48 PM <DIR> gComandos
16/02/2007 05:16 PM 332 gcomandos.pc.in
25/11/2006 10:03 PM 9,233 install-sh
16/02/2007 05:16 PM 353 Makefile.am
16/02/2007 05:17 PM 20,662 Makefile.in
16/02/2007 05:16 PM 1,019 Makefile.include
25/11/2006 10:03 PM 11,014 missing
I am now lost. I tried making the .am or the .in files, but GnuMake says there is nothing to make. I tried running the shell scripts, but I got errors. Any guidance appreciated.

Normally it's supposed to come with an INSTALL file to read. Since it doesn't, here's the basic routine:
./configure
make
sudo make install
Note that configure has a number of options it can take; pass --help to see them.

If you simply want to build and install it:
./configure
make
sudo make install
If you make some changes to this project and rebuild it later do:
aclocal - adds aclocal.m4 to directory. Defines some m4 macros used by the auto tools.
'autoconf '- creates configure from configure.ac
'automake' - Creates Makefile.in from Makefile.am
'./configure' - creates Makefile from Makefile.in
'make'
sudo make install

One recommendation to make on top of the various correct answers is to see what build options are available. The first command I like to run is:
./configure --help
This will list various build options. Some are standard (such as --prefix= for changing where the package is intalled) and others are project specific (often in the form --with-FOO to build with extra features based on the FOO package).

Related

Why Makefile.am is included in the release tarball?

From the description of https://stackoverflow.com/a/2531841/5983841 and https://stackoverflow.com/a/26832773/5983841 , my understanding is that Makefile.am is not needed in the dist tarball.
I tried
wget https://dist.libuv.org/dist/v1.44.2/libuv-v1.44.2-dist.tar.gz
tar xf libuv-v1.44.2-dist.tar.gz
cd libuv-1.44.2/
mv Makefile.am Makefile.am.bak
./configure
make
it gives error when running make:
tian#tian-B250M-Wind:~/Desktop/playground/garage/libuv-1.44.2$ make
make: *** No rule to make target 'Makefile.am', needed by 'Makefile.in'. Stop.
I answered there: autotools are intended to be used with free software. A dist tarball for a free software project should include all the files needed for someone to be able to make changes to the project and rebuild it, as they want to: that's the foundational goal of Free Software.
They can't do that if you omit critical build files, like Makefile.am. If they wanted to add a new file or something to the project, they need the Makefile.am to modify it. So it should be included in the dist tarball.
Saying that the file is not required in order to build the software as-is without modification, is not the same thing as saying that it can be omitted.
In this specific case, automake-generated makefiles contain rules to check whether someone modified the Makefile.am file and if so, the rules will re-run automake to ensure everything is up to date and correct so you don't have to remember to do it by hand. However this of course requires that the Makefile.am file be present so make can determine that it's up to date.

Yocto bitbake build error when adding fftw package

I am using Yocto Warrior release to build linux for Dart-imx8m SOM. Documentation can be found here : https://variwiki.com/index.php?title=DART-MX8M_Yocto&release=RELEASE_WARRIOR_V1.1_DART-MX8M.
I want to add fftw package whose recipe is in meta-oe layer. Whenever I add this package in my local.conf file, I get an error with bitbake regarding a dnf related task.
I add the package like this in my local.conf file : IMAGE_INSTALL_append = " fftw"
I get the following error when building image with bitbake fsl-image-gui :
ERROR: fsl-image-gui-1.0-r0 do_rootfs: Could not invoke dnf. Command '/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/etc/yum.repos.d --installroot=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs --setopt=logdir=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/temp --repofrompath=oe-repo,/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/oe-rootfs-repo --nogpgcheck install packagegroup-core-tools-profile packagegroup-fsl-tools-audio packagegroup-core-ssh-dropbear tree rpm packagegroup-fsl-tools-benchmark boost gstreamer1.0 packagegroup-fsl-tools-gpu packagegroup-fsl-gstreamer1.0 psplash gpsd packagegroup-base-extended collectd kernel-image-4.19.35-imx8mq+gdc7a2fd packagegroup-core-tools-testapps packagegroup-core-boot tcf-agent packagegroup-fsl-tools-gpu-external packagegroup-core-full-cmdline packagegroup-tools-bluetooth packagegroup-fsl-tools-testapps opencv fftw libsdl-1.2-0 packagegroup-fsl-gstreamer1.0-full lftp packagegroup-core-tools-debug libgpiod2 dnf weston-init run-postinsts mosquitto packagegroup-core-nfs-server sshfs-fuse spitools kernel-devicetree android-tools htop poco tmux openssh-sftp-server weston-xwayland xterm locale-base-en-us locale-base-en-gb' returned 1:
DNF version: 4.1.0
cachedir: /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/oe-rootfs-repo
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Wed 28 Oct 2020 09:16:57 AM UTC.
Last metadata expiration check: 0:00:01 ago on Wed 28 Oct 2020 09:16:57 AM UTC.
No module defaults found
No match for argument: fftw
Error: Unable to find a match
ERROR: fsl-image-gui-1.0-r0 do_rootfs:
ERROR: fsl-image-gui-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/temp/log.do_rootfs.2614
ERROR: Task (/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-gui.bb:do_rootfs) failed with exit code '1'
Woud you have any clue where this error come from ?
Thanks,
Paul
Edit :
Found a way to make it compile for those who are intereseted. (inspired by Yocto build for a static library fails with error "No Match Found")
I edited my *.bb file and added ALLOW_EMPTY_${PN} = "1"
I am not sure I got it completely but it looks like dnf package manager needs folders created for all added packages even if empty.
https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ALLOW_EMPTY
The fftw recipe is set up to create a few different packages (RPM) like libfftw, libfftwl, libfftwf, fftw-wisdom, fftwl-wisdom, fftwf-wisdom, and fftw-wisdom-to-conf.
You probably want to add one or more of those. It seems there is no actual fftw package.
It is important to remember that IMAGE_INSTALL and RDEPEND lists items from the package namespace, while DEPENDS lists items from the recipe namespace.
If you are unsure about which package you want to install you can inspect the packages-split folder for fftw in tmp/work to see which files are included in which package.

How to convert perl modules into deb packages?

My team is delivering a product that requires some perl modules, and since we deliver a full OS installer (Ubuntu 12.04) we want those modules as .deb packages. I've been able to build some other perl (like Algorithm::LUHN, Env::C, Linux::PID and Config::Properties) by following the instructions here, but having problems with Apache2::SizeLimit
Tried with Apache-SizeLimit-0.96 and Apache-SizeLimit-0.97... and all the methods described in the doc. Also tried in different OSs versions; Ubuntu 14.04.2, Ubuntu 12.04.5 (clean install), all the attempts ended with the same error:
test#test:~$ dh-make-perl --build --cpan Apache::SizeLimit
Going to read '/home/test/.cpan/Metadata'
Database was generated on Thu, 19 Mar 2015 02:17:02 GMT
CPAN: Digest::SHA loaded ok (v5.61)
Checksum for /home/test/.cpan/sources/authors/id/P/PH/PHRED/Apache-SizeLimit-0.97.tar.gz ok
Apache-SizeLimit-0.97/
Apache-SizeLimit-0.97/Changes
Apache-SizeLimit-0.97/INSTALL
Apache-SizeLimit-0.97/lib/
Apache-SizeLimit-0.97/LICENSE
Apache-SizeLimit-0.97/Makefile.PL
Apache-SizeLimit-0.97/MANIFEST
Apache-SizeLimit-0.97/MANIFEST.SKIP
Apache-SizeLimit-0.97/META.json
Apache-SizeLimit-0.97/META.yml
Apache-SizeLimit-0.97/README
Apache-SizeLimit-0.97/t/
Apache-SizeLimit-0.97/t/apache/
Apache-SizeLimit-0.97/t/apache2/
Apache-SizeLimit-0.97/t/pod.t
Apache-SizeLimit-0.97/t/response/
Apache-SizeLimit-0.97/t/response/TestApache/
Apache-SizeLimit-0.97/t/response/TestApache2/
Apache-SizeLimit-0.97/t/response/TestApache2/basic.pm
Apache-SizeLimit-0.97/t/response/TestApache2/check_n_requests2.pm
Apache-SizeLimit-0.97/t/response/TestApache2/deprecated.pm
Apache-SizeLimit-0.97/t/response/TestApache2/zzz_check_n_requests.pm
Apache-SizeLimit-0.97/t/response/TestApache/basic.pm
Apache-SizeLimit-0.97/t/response/TestApache/check_n_requests2.pm
Apache-SizeLimit-0.97/t/response/TestApache/deprecated.pm
Apache-SizeLimit-0.97/t/response/TestApache/zzz_check_n_requests.pm
Apache-SizeLimit-0.97/t/apache2/all.t
Apache-SizeLimit-0.97/t/apache/all.t
Apache-SizeLimit-0.97/lib/Apache/
Apache-SizeLimit-0.97/lib/Apache2/
Apache-SizeLimit-0.97/lib/Apache2/SizeLimit.pm
Apache-SizeLimit-0.97/lib/Apache/SizeLimit/
Apache-SizeLimit-0.97/lib/Apache/SizeLimit.pm
Apache-SizeLimit-0.97/lib/Apache/SizeLimit/Core.pm
CPAN: File::Temp loaded ok (v0.22)
======================================================================
Unpacked tarball already existed, directory renamed to /home/test/Apache-SizeLimit-0.97.13910
======================================================================
Using META.json
Found: Apache2-SizeLimit 0.97 (libapache2-sizelimit-perl arch=all)
cat: /etc/mailname: No such file or directory
No APT contents can be loaded.
Please install 'apt-file' package (at least version 2.5.0) and
run 'apt-file update' as root.
Dependencies not updated.
Using maintainer: test
Found docs: README
cat: /etc/mailname: No such file or directory
Using rules: /usr/share/dh-make-perl/rules.dh7.tiny
cat: /etc/mailname: No such file or directory
make: Entering directory `/home/test/Apache-SizeLimit-0.97'
dh clean
dh_testdir
dh_auto_clean
dh_clean
make: Leaving directory `/home/test/Apache-SizeLimit-0.97'
make: Entering directory `/home/test/Apache-SizeLimit-0.97'
dh build
dh_testdir
dh_auto_configure
Can't find mod_perl installed
The error was: Can't locate mod_perl2.pm in #INC (#INC contains: /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at Makefile.PL line 147.
dh_auto_configure: perl Makefile.PL INSTALLDIRS=vendor returned exit code 2
make: *** [build] Error 2
make: Leaving directory `/home/test/Apache-SizeLimit-0.97'
Cannot create deb package: 'debian/rules build' failed.
Will appreciate any help on fixing it
Sharing how it was solved. As #grant-mclean answered; I was missing a -dev package: the "apache2-dev" (apache2-threaded-dev).
With it, and skipping tests I was able to build the .deb package.
sudo apt-get install devscripts dh-make-perl libapache2-mod-perl2 libapache2-mod-perl2-dev apache2-threaded-dev
export DEB_BUILD_OPTIONS="$DEB_BUILD_OPTIONS nocheck"
dh-make-perl --build --cpan Apache::SizeLimit
Usually when you're trying to build something on Debian and get a message about something being missing, you need to install a 'dev' package - one that contains things like header files that aren't needed by the runtime.
I'm just guessing, but in your case perhaps you need to install: libapache2-mod-perl2-dev

Changing python headers directory for configure

I'm trying to build gnome-weather using jhbuild, but running build process results in the following errors:
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages
checking for headers required to compile python extensions... ./configure: line 14697: /usr/local/bin/python-config: No such file or directory
not found
configure: error: Python headers not found
*** Error during phase configure of gobject-introspection: ########## Error running ./autogen.sh --prefix /home/pgolinski/jhbuild/install --disable-static --disable-gtk-doc *** [7/36]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
[7] Go to phase "clean"
[8] Go to phase "distclean"
Strangely the error says that Python headers were not found even though I have python-devel installed. I managed to find python-config in usr/bin so how to change its directory for configure? Or maybe the problem lies elsewhere? (I just want to build gnome-weather)
you can download the last version of gnome-weather here:
https://git.gnome.org/browse/gnome-weather/snapshot/gnome-weather-3.14.1.zip
and compile that with these command after unzip it:
libtoolize
aclocal
autoheader
autoconf
automake --add-missing --foreign
./configure
make && make install
this should work.8y3
Here's what finally worked for me if someone struggles with something similair in future:
PYTHON=/usr/bin/python jhbuild build gnome-weather

Changing directories for the makefile in xScreenSaver

I am trying to build an xsreensaver module using the makefile. I downloaded the source from http://www.jwz.org/xscreensaver/, and read the hacking readme.
As my screensaver involves opengl and reading of images, I'm trying to compile the 'photopile' screensaver.
I've run the following
$ cd xscreensaver-5.29
$ cd hacks
$ cd glx
$ make photopile
After running I get the following output errors
cc photopile.c -o photopile
photopile.c:38:23: fatal error: xlockmore.h: No such file or directory compilation terminated.
make: *** [photopile] Error 1
The referenced file is in the "hacks" root folder rather than the "glx" folder. I realize it would be simple enough to just copy that needed file to "glx", but the "xlockmore.h" file is not the only file that its trying to find that is not in the current directory.
It is also looking for "yarandom.h" in the "../../utils" folder.
I'm assuming the makefile was made correctly, and that I am doing something wrong with regards to calling the
make photopile
option from within the "glx" folder.
I'm still learning makefiles and would rather not modify it (or the directory structure by copying header files) anymore than the directions say to.
Any advice?

Resources