AutoConf,-Make


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users AutoConf,-Make
# 1  
Old 06-29-2015
AutoConf,-Make

Heyas

I'm trying to rewrite the install procedure of TUI, applying the standards of the Autotools.

Inofficial: Official: Which is quite too much to comprehend, without practical (as in: daily usage) knowledge about compiling things, applying to a project that doesnt need compiling.

It feels that the auto-tools dont work properly on a project that doesnt require compiling.

Doing the regular starting steps:
Code:
$ cat gen-autoconf.sh ; sh ./gen-autoconf.sh 
#!/bin/bash
	autoscan
	mv configure.scan configure.ac && vi configure.ac || exit
	[ -f Makefile.in ] || exit 1
	autoconf

Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE [^\}]*}/ at /usr/bin/autoscan line 361.
configure.ac: warning: missing AC_PROG_AWK wanted by: build-rpm-tui.sh:54
configure.ac: warning: missing AC_PROG_CC wanted by: stats.sh:41
configure.ac: warning: missing AC_PROG_INSTALL wanted by: my-configure.sh:381
configure.ac: warning: missing AC_PROG_LN_S wanted by: build-rpm-tui.sh:63
configure.ac: warning: missing AC_PROG_MAKE_SET wanted by: docs/samples/old/demo-interface-select-loop.sh:66

(however, these errors are new)
While the generate configure.ac looks like:
Code:
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.69])
AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS])
AC_CONFIG_SRCDIR([build-aux/link-warning.h])
AC_CONFIG_HEADERS([config.h])

# Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile
                 bin/Makefile
                 conf.etc/Makefile
                 conf.home/Makefile
                 docs/Makefile
                 lists/Makefile
                 man/Makefile
                 templates/Makefile
                 themes/Makefile])
AC_CONFIG_SUBDIRS([tmp])
AC_OUTPUT

Eventhough, the generating of them worked - as in no errors shown, at some earlier time, i cant seem to get it back there.

What remains identical is this:
Code:
make
make: *** No targets specified and no makefile found.  Stop.

Currently only testing with the README.md
Code:
$ find ./ -name Makefile.am

./conf.etc/Makefile.am
./docs/Makefile.am
./templates/Makefile.am
./conf.home/Makefile.am
./tmp/autoconf/Makefile.am
./Makefile.am
./lists/Makefile.am
./man/Makefile.am
./bin/Makefile.am

$ cat Makefile.am 
AUTOMAKE_OPTIONS = foreign
SUBDIRS = docs

compldir = /usr/local/share/bash-completion/completions
compl_DATA = tui_compl.bash

$ cat docs/Makefile.am 
doc_DATA = README.md

Any advices please?
Thank you
# 2  
Old 06-29-2015
If it doesn't require compilation, why use autoconf?
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 06-29-2015
The GNU guys said i should apply that installation method.
They wont accept my install.sh.

EG:
Tui shall be installable by: (as i understood them)
Code:
./configure --prefix=XY
make && make install

---------- Post updated at 18:39 ---------- Previous update was at 17:54 ----------

Well they mentioned i could write my own ./configure, as long it supports make install.
Failing to get make working with the regular tools, makes it even harder to write my own ./configure, as i do not understand the process/requirement yet.

Me not asking for a solution, a direct link to where it explains the actual 'install' (cp, mv, chmod, etc) process requirements would be very apreciated.
Best i have is the doc_DATA = Readme.md part, which doesnt seem to be right, as the make fails (see above).

---------- Post updated at 19:55 ---------- Previous update was at 18:39 ----------

Let me do a practical example, what i tried to achieved using this guide:
autoconf automake tutorial
Which already fails at point 2, as there are no Makefile.in, removed/renamed as suggested by guide, but required by autoscan.

typescript:
Code:
Script started on Mon Jun 29 21:41:45 2015

0 ~/prjs/tui $ ls
bin   lists  templates  tmp        build-rpm-tui.sh  install.sh  tui.spec        typescript
docs  man    themes     README.md  gen-autoconf.sh   stats.sh    tui_compl.bash

0 ~/prjs/tui $ ./gen-autoconf.sh ## Sumarizes that guides steps 1-4
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE [^\}]*}/ at /usr/bin/autoscan line 361.
autoscan: cannot open < Makefile.in: No such file or directory
mv: cannot stat 'configure.scan': No such file or directory

1 ~/prjs/tui $ ls
bin   lists  templates  tmp        autoscan.log      gen-autoconf.sh  stats.sh  tui_compl.bash
docs  man    themes     README.md  build-rpm-tui.sh  install.sh       tui.spec  typescript

0 ~/prjs/tui $ exit
exit

And the log is empty.
Code:
$ cat autoscan.log 

0 ~/prjs/tui $

Weird thing is, i did get (somehow) a generated Makefile.in, sadly i dont remember how.
Most confusing part for me is: Guide tells to 'remove' the Makefile.*'sm while autoscan seems to require one.

Which 'one' is true?
Specialy, since the offical docs, dont mention the requirement for Makefile.in (n)either...
(2.4.1) :: https://www.gnu.org/software/automak...tml#Hello-Worl

Been on this for a week now, and not further a single bit, as what i started to feel/think i had understood is in question again.
Smilie
Any advice please?

---------- Post updated at 21:41 ---------- Previous update was at 19:55 ----------

Quote:
Originally Posted by Corona688
If it doesn't require compilation, why use autoconf?
oh wait, i understand it now...
Are you saying that i should not use autoscan/autoconf to create, but 'continue after' the creation of configure.ac?

This said, it helped to get rid of the 'focused' mind....

I now have this to get started on new projects:
Code:
#!/bin/bash
clear
tui-yesno "Are you in the project directory ($(pwd))?" || exit 1
## Write basic configure.ac
cat > configure.ac <<-EOF
	AC_PREREQ([2.69])
	AC_INIT([TUI], [0.9.0], [erat.simon@gmail.com])
	AM_INIT_AUTOMAKE([-Wall -Werror foreign])
	AC_CONFIG_FILES([
	 Makefile
	 docs/Makefile
	])
	AC_OUTPUT
EOF

## Write makefile in project root
cat > Makefile.am <<-EOF
	AUTOMAKE_OPTIONS = foreign
	SUBDIRS = docs

	compldir = \$(datadir)/bash-completion/completions
	compl_DATA = @PACKAGE_TARNAME@_compl.bash
EOF

## Write makefile in docs
tui-bol-dir docs ; cd docs
cat > Makefile.am <<-EOF
	doc_DATA = LICENSE
EOF
cd ..

## Finalize?
tui-yesno "Run automake now?" || exit
aclocal
automake --add-missing
autoconf

## Final test?
tui-yesno "Test now?" || exit
./configure --prefix=/usr && \
	make && \
	tui-asroot "make install"

Which seems to be working fine, and providing a very basic minimal example to copy/install files.

yay Smilie
/solved

Now asking myself why it took me so long to get (t)here...
Have a good evening and thanks for reading.
# 4  
Old 06-29-2015
I am actually saying that it's far easier to write a makefile than to master the 19 languages autobloat uses to perform such a simple task.

Last edited by Corona688; 06-29-2015 at 05:46 PM..
# 5  
Old 06-29-2015
Err... follow up question:

When i add: 'bin' to 'subdirs', and write: bin/Makefile.am
Code:
bin_SCRIPT = tui tui-asroot

It fails like:
Code:
automake --add-missing && autoconf && ./configure && make
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /usr/bin/automake line 3936.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
Making all in bin
make[1]: Entering directory '/home/sea/prjs/tui/bin'
make[1]: *** No rule to make target 'all'.  Stop.
make[1]: Leaving directory '/home/sea/prjs/tui/bin'
Makefile:371: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

What am i making wrong?

---------- Post updated 30-06-15 at 00:19 ---------- Previous update was 29-06-15 at 22:50 ----------

Uhh, for a second i though it was the typo...
But it isnt.

Wether i use bin_SCRIPT or bin_SCRIPTS, fails the same.
Makefile.am's (bin/Makefile.am is marked bold)
Code:
cat M*am {bin,docs}/M*am

AUTOMAKE_OPTIONS = foreign
SUBDIRS = docs bin

compldir = $(datadir)/bash-completion/completions
compl_DATA = @PACKAGE_TARNAME@_compl.bash

bin_SCRIPTS = tui-asroot
doc_DATA = LICENSE

Output:
Code:
automake --add-missing && autoconf && ./configure && make
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE ([^ \t=:+{}]+)}/ at /usr/bin/automake line 3936.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
Making all in docs
make[1]: Entering directory '/home/sea/prjs/tui/docs'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/sea/prjs/tui/docs'
Making all in bin
make[1]: Entering directory '/home/sea/prjs/tui/bin'
make[1]: *** No rule to make target 'all'.  Stop.
make[1]: Leaving directory '/home/sea/prjs/tui/bin'
Makefile:371: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

This doesnt make ANY sense at all!
The content of bin/Makefile.am is 'just the same' as docs/Makefile.am.

Anyone able to enlighten me on this please?

---------- Post updated at 00:25 ---------- Previous update was at 00:19 ----------

gnh.. new tools, new rules, and new things to forget..
Me asociated configure.ac to autoconf, which i 'could skip', so me forgot that just that file requires the Makefile.am to be listed so automake is working...

/solved again
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. Programming

Using autoconf and automake. aclocal-1.11: command not found

Hi, I'm trying to make my source "buildable". autoconf and automake tools are used. configure and Makefile.in files are created successfully. configure.ac: AC_INIT() AC_CONFIG_SRCDIR() AC_PROG_CXX AM_INIT_AUTOMAKE(main, 0.1) AC_CHECK_HEADERS()... (0 Replies)
Discussion started by: Vourhey
0 Replies

2. Shell Programming and Scripting

using automake and autoconf with C++

hi, I have written the Makefile.am and autoconf.ac files and am looking to build my project by providing the following commands: $autoreconf -f -i -m $./configure both of the above work fine, but when I give the make command, I get the following error: make all-am make: Entering directory... (0 Replies)
Discussion started by: bacpp
0 Replies

3. BSD

You have another version of autoconf...

Hi gurus, I'm a FreeBSD noob who has generated an error, searched everywhere for solutions, and has just joined this forum (and searched it) hoping you can help. I really need to get mysql server installed again ASAP, and preferably with Sphinx as a storage engine, or my web app in dev is... (2 Replies)
Discussion started by: userunx
2 Replies

4. Programming

automake/autoconf problem

hi, i'm fairly new with automake and i ran into a problem that i have found no solution for. so i have a setup where i don't want all the output files generated by the compiler and alike in my src directory, instead i created a build/unix folder and i have build/unix/config set for... (0 Replies)
Discussion started by: Akimaki
0 Replies
Login or Register to Ask a Question