comparison gnulib-tool @ 7072:a1e9235fc6ff

Support projects without a top-level Makefile.am.
author Bruno Haible <bruno@clisp.org>
date Sat, 29 Jul 2006 13:18:04 +0000
parents 71c5caf223fc
children eb23418a908e
comparison
equal deleted inserted replaced
7071:71c5caf223fc 7072:a1e9235fc6ff
20 # This program is meant for authors or maintainers which want to import 20 # This program is meant for authors or maintainers which want to import
21 # modules from gnulib into their packages. 21 # modules from gnulib into their packages.
22 22
23 progname=$0 23 progname=$0
24 package=gnulib 24 package=gnulib
25 cvsdatestamp='$Date: 2006-07-29 13:14:42 $' 25 cvsdatestamp='$Date: 2006-07-29 13:18:04 $'
26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` 26 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` 27 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
28 28
29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. 29 # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH.
30 AUTOCONFPATH= 30 AUTOCONFPATH=
1909 else 1909 else
1910 func_fatal_error "cannot find $destdir/configure.ac" 1910 func_fatal_error "cannot find $destdir/configure.ac"
1911 fi 1911 fi
1912 fi 1912 fi
1913 1913
1914 test -f "$destdir"/Makefile.am \
1915 || func_fatal_error "cannot find $destdir/Makefile.am"
1916
1917 # Analyze configure.ac. 1914 # Analyze configure.ac.
1918 guessed_auxdir="." 1915 guessed_auxdir="."
1919 guessed_libtool= 1916 guessed_libtool=
1920 my_sed_traces=' 1917 my_sed_traces='
1921 s,#.*$,, 1918 s,#.*$,,
1949 else 1946 else
1950 # Apply func_import to all gnulib directories. 1947 # Apply func_import to all gnulib directories.
1951 # To get this list of directories, look at Makefile.am. (Not at 1948 # To get this list of directories, look at Makefile.am. (Not at
1952 # configure, because it may be omitted from CVS. Also, don't run 1949 # configure, because it may be omitted from CVS. Also, don't run
1953 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.) 1950 # "find $destdir -name gnulib-cache.m4", as it might be too expensive.)
1954 aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
1955 m4dirs= 1951 m4dirs=
1956 m4dirs_count=0 1952 m4dirs_count=0
1957 m4dir_is_next= 1953 if test -f "$destdir"/Makefile.am; then
1958 for arg in $aclocal_amflags; do 1954 aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' "$destdir"/Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
1959 if test -n "$m4dir_is_next"; then 1955 m4dir_is_next=
1960 # Ignore absolute directory pathnames, like /usr/local/share/aclocal. 1956 for arg in $aclocal_amflags; do
1961 case "$arg" in 1957 if test -n "$m4dir_is_next"; then
1962 /*) ;; 1958 # Ignore absolute directory pathnames, like /usr/local/share/aclocal.
1963 *) 1959 case "$arg" in
1964 if test -f "$destdir/$arg"/gnulib-cache.m4; then 1960 /*) ;;
1965 m4dirs="$m4dirs $arg" 1961 *)
1966 m4dirs_count=`expr $m4dirs_count + 1` 1962 if test -f "$destdir/$arg"/gnulib-cache.m4; then
1967 fi 1963 m4dirs="$m4dirs $arg"
1968 ;; 1964 m4dirs_count=`expr $m4dirs_count + 1`
1969 esac 1965 fi
1970 else 1966 ;;
1971 if test "X$arg" = "X-I"; then 1967 esac
1972 m4dir_is_next=yes
1973 else 1968 else
1974 m4dir_is_next= 1969 if test "X$arg" = "X-I"; then
1970 m4dir_is_next=yes
1971 else
1972 m4dir_is_next=
1973 fi
1975 fi 1974 fi
1975 done
1976 else
1977 # No Makefile.am! Oh well. Look at the last generated aclocal.m4.
1978 if test -f "$destdir"/aclocal.m4; then
1979 sedexpr1='s,^m4_include(\[\(.*\)])$,\1,p'
1980 sedexpr2='s,^[^/]*$,.,'
1981 sedexpr3='s,/[^/]*$,,'
1982 m4dirs=`sed -n -e "$sedexpr1" aclocal.m4 | sed -e "$sedexpr2" -e "$sedexpr3" | LC_ALL=C sort | LC_ALL=C uniq`
1983 m4dirs_count=`echo "$m4dirs" | wc -l`
1976 fi 1984 fi
1977 done 1985 fi
1978 if test $m4dirs_count = 0; then 1986 if test $m4dirs_count = 0; then
1979 # First use of gnulib in a package. 1987 # First use of gnulib in a package.
1980 # Any number of additional modules can be given. 1988 # Any number of additional modules can be given.
1981 test -n "$supplied_libname" || supplied_libname=true 1989 test -n "$supplied_libname" || supplied_libname=true
1982 test -n "$sourcebase" || sourcebase="lib" 1990 test -n "$sourcebase" || sourcebase="lib"