unix - Automatic generation of AC_CONFIG_FILES input -


when creating configure.ac file standard practice seems to explicitly hard code list of makefiles should created corresponding makefile.in. seems should not necessary, list generated sort of glob specification (e.g. */makefile.in) or shell command (e.g. find -name makefile.in).

unfortunately doesn't seem facility built autoconf! i'm new m4 haven't come across running shell commands generate m4 input values. can hacked generating configure.ac file cat-ing files , shell commands seems unnecessarily complex.

is there standard way of doing this? if not why not? there issues?

despite comments ended doing anyway. didn't mention in question autogeneration being done, in ad-hoc way (cating various files, of generated on fly, create configure.ac) , wanted clean up.

in build script have:

confdir="config/configure.ac_scripts"  # generate sorted list of makefiles in project, wrap # autoconfigure command , put file. makefile_list="$(find -type f -name 'makefile.am' \                 | sed -e 's:makefile\.am:makefile:' -e 's:^./::' \                 | sort)"  # bit more explanation of above command: # first find makefile.ams in project. # remove .am using sed list of makefiles create. # remove "./" here because autotools don't it. # sort output order of resulting list # deterministic.   # create file containing list of makefiles cat > "$confdir/new_makefile_list" <<eof # generated file, not modify. ac_config_files([ $makefile_list ]) eof # in case haven't seen before: writes lines between <<eof # , eof file $confdir/new_makefile_list. variables # substituted normal.  # if found new dirs write list file # included in configure.ac , tell user. fact have # modified file included in configure.ac cause make rerun # autoconf , configure. touch "$confdir/makefile_list" if ! diff -q "$confdir/new_makefile_list" "$confdir/makefile_list" > /dev/null 2>&1;      echo "new/removed directories detected , $confdir/makefile_list updated,"     echo "./configure rerun automatically make."     mv "$confdir/new_makefile_list" "$confdir/makefile_list" fi 

then in configure.ac have:

# include file containing constructed ac_config_files([....]) command m4_include([config/configure.ac_scripts/makefile_list]) 

instead of writing makefile list in directly.

the full source code here , here.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -