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:

$ 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:

#                                               -*- 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:

make
make: *** No targets specified and no makefile found.  Stop.

Currently only testing with the README.md

$ 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

If it doesn't require compilation, why use autoconf?

1 Like

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)

./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:

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.

$ 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/automake/manual/automake.html\#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.
:confused:
Any advice please?

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

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:

#!/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 :b:
/solved

Now asking myself why it took me so long to get (t)here...
Have a good evening and thanks for reading.

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.

Err... follow up question:

When i add: 'bin' to 'subdirs', and write: bin/Makefile.am

bin_SCRIPT = tui tui-asroot

It fails like:

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)

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:

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