X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=gnulib-tool;h=6dcee926509ff014ec7e8ed0e4482848ef080543;hb=6286aba7da0cee73276babaf4d79d67f91f368d2;hp=4fa2f476a6b6e88198ccdaefeb854f40bff1752d;hpb=f7ac08280d0cee18e40eae48f097175b99b7a1ad;p=gnulib.git diff --git a/gnulib-tool b/gnulib-tool index 4fa2f476a..6dcee9265 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -22,18 +22,18 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2004-09-19 02:08:45 $' +cvsdatestamp='$Date: 2004-09-29 05:58:14 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. AUTOCONFPATH= -case $USER in - bruno ) - AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin - AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH " - ;; -esac +#case $USER in +# bruno ) +# AUTOCONFBINDIR=/packages/gnu-inst-autoconf/2.57/bin +# AUTOCONFPATH="eval env PATH=${AUTOCONFBINDIR}:\$PATH " +# ;; +#esac AUTORECONF="${AUTOCONFPATH}autoreconf" @@ -54,6 +54,7 @@ Usage: gnulib-tool --list gnulib-tool --extract-autoconf-snippet module gnulib-tool --extract-automake-snippet module gnulib-tool --extract-include-directive module + gnulib-tool --extract-license module gnulib-tool --extract-maintainer module Operation modes: @@ -72,6 +73,8 @@ Operation modes: --extract-autoconf-snippet extract the snippet for configure.ac --extract-automake-snippet extract the snippet for lib/Makefile.am --extract-include-directive extract the #include directive + --extract-license report the license terms of the source files + under lib/ --extract-maintainer report the maintainer(s) inside gnulib Options: @@ -85,6 +88,8 @@ Options: placed (default \"lib\"), for --import. --m4-base=DIRECTORY Directory relative --dir where *.m4 macros are placed (default \"m4\"), for --import. + --lgpl Abort if modules aren't available under the LGPL. + Also modify license template from GPL to LGPL. --libtool Use libtool rules, for --import. --no-changelog don't update or create ChangeLog files --dry-run For --import, only print what would have been done. @@ -131,6 +136,7 @@ func_fatal_error () libtool= do_changelog=: dry_run= + lgpl= supplied_opts="$@" @@ -202,6 +208,9 @@ func_fatal_error () --libtool ) libtool=true shift ;; + --lgpl ) + lgpl=true + shift ;; --no-changelog | --no-changelo | --no-changel | --no-change | --no-chang | --no-chan | --no-cha | --no-ch | --no-c ) do_changelog=false shift ;; @@ -285,6 +294,7 @@ sed_extract_prog=':[ ]*$/ { s/^configure\.ac:[ ]*$// s/^Makefile\.am:[ ]*$// s/^Include:[ ]*$// + s/^License:[ ]*$// s/^Maintainer:[ ]*$// tb p @@ -331,6 +341,12 @@ func_get_include_directive () sed -e 's/^\(["<]\)/#include \1/' } +# func_get_license module +func_get_license () +{ + sed -n -e "/^License$sed_extract_prog" < "$gnulib_dir/modules/$1" +} + # func_get_maintainer module func_get_maintainer () { @@ -598,6 +614,7 @@ case $mode in }; /A[CM]_PROG_LIBTOOL/ { s,^.*$,seen_libtool=:,; p; }; /LT_INIT/ { s,^.*$,seen_libtool=:,; p; }; + /gl_LGPL/ { s,^.*$,lgpl=true,; p; }; d;' eval `cat $configure_ac | sed "$my_sed_traces"` @@ -615,7 +632,7 @@ case $mode in # Set up m4 base. test -z "$m4base" && m4base="$ac_m4base" - test -z "$sourcebase" && m4base="m4" + test -z "$m4base" && m4base="m4" test -d "$destdir/$m4base" || \ (test -z "$dry_run" && mkdir "$destdir/$m4base") || \ func_fatal_error "m4 base $destdir/$m4base doesn't exist" @@ -655,6 +672,17 @@ case $mode in echo "Module list with included dependencies:" echo "$modules" | sed -e 's/^/ /' + # If --lgpl, check the license of modules are compatible. + if test -n "$lgpl"; then + for module in $modules; do + license=`sed -n -e "/^License$sed_extract_prog" < "$gnulib_dir/modules/$module"` + if test $license != LGPL; then + func_fatal_error \ + "incompatible license on module \`$module\`: $license" + fi + done + fi + # Determine final file list. files= for module in $modules; do @@ -672,14 +700,21 @@ case $mode in # Copy files. for f in $files; do + source= case "$f" in config/*) g=`echo "$f" | sed -e 's,^config/,,'` ;; - lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"` ;; + lib/*) g=`echo "$f" | sed -e "s,^lib/,$sourcebase/,"`; + source=true ;; m4/*) g=`echo "$f" | sed -e "s,^m4/,$m4base/,"` ;; *) g="$f" ;; esac test -n "$dry_run" && dry=echo $dry cp -p "$gnulib_dir/$f" "$destdir/$g" + # Update license. + if test -z "$dry_run" -a -n "$lgpl" -a -n "$source"; then + perl -pi -e 's/GNU General/GNU Lesser General/g;' \ + -e 's/version 2([ ,])/version 2.1\1/g' $destdir/$g + fi done # Commands printed in a comment in generated files. @@ -688,7 +723,10 @@ case $mode in if test -n "$libtool"; then opt_libtool="--libtool" fi - actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool `echo $modules`" + if test -n "$lgpl"; then + opt_lgpl="--lgpl" + fi + actioncmd="gnulib-tool --import --dir=$destdir --lib=$libname --source-base=$sourcebase --m4-base=$m4base $opt_libtool $opt_lgpl `echo $modules`" # Create lib/Makefile.am. echo "Creating $destdir/$sourcebase/Makefile.am..." @@ -797,6 +835,9 @@ case $mode in echo "dnl Usage: gl_LIB(LIBNAME)" echo "AC_DEFUN([gl_LIB], [])" echo + echo "dnl Usage: gl_LGPL" + echo "AC_DEFUN([gl_LGPL], [])" + echo echo "# gnulib.m4 ends here" ) echo "Finished." @@ -928,6 +969,16 @@ case $mode in done ;; + extract-license ) + for module + do + func_verify_module + if test -n "$module"; then + func_get_license "$module" + fi + done + ;; + extract-maintainer ) for module do