[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: big libtoolize problem.



Xavier Bestel <xavier.bestel@free.fr> writes:

> /bin/sh ../libtool --mode=link gcc  -O2 -g -Wall -Wall   -o gimp-remote-1.3  gimp-remote.o -Wl,--export-dynamic
> -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0   -L/usr/X11R6/lib  -lSM -lICE -lX11 -lXmu -lXt
> ../libtool: line 4947: syntax error near unexpected token `done'
> ../libtool: line 4947: `    done'
> 
> I have attached the generated libtool; there's effectively something
> really messed up inside, but I don't know why it's been born dead.

Looks like a bad ltmain.sh. If your version of libtool is part of a
distribution, you may want to file a bug report.

The problem is a parse error in that /bin/sh expects one token but
was given another, note the "ADDED!!!!" comments below:

    # Handle -dlopen flags immediately.
    for file in $execute_dlfiles; do
      if test ! -f "$file"; then
	$echo "$modename: \`$file' is not a file" 1>&2
	$echo "$help" 1>&2
	exit 1
      fi

      dir=
      case $file in # [E]
      *.la)
	# Check to see that this really is a libtool archive.
	if (${SED} -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
	else
	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
	  $echo "$help" 1>&2
	  exit 1
	fi

	# Read the libtool library.
	dlname=
	library_names=

	# If there is no directory component, then add one.
	case $file in
	*/* | *\\*) . $file ;;
	*) . ./$file ;;
	esac

	# Skip this library if it cannot be dlopened.
	if test -z "$dlname"; then # [a]
	  # Warn if it was a he absolute pathname.
      absdir=`cd "$dir" && pwd`
      test -n "$absdir" && dir="$absdir"
        fi # ADDED!!!!
      # Now add the directory to shlibpath_var.
      if eval "test -z \"\$$shlibpath_var\""; then # [b]
	eval "$shlibpath_var=\"\$dir\""
      else
	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
      fi # [c]
      esac # ADDED!!!!
    done # [d]

Without the "Added!" parts

    1) Bash goes into the [a] if, and then it looks for "fi".
    2) At [b], it goes into another one, but this is closed at
       [c].
    3) Then it hits "done" at [d], which doesn't make sense as
       the parser must have seen a token-wise immediately prior,
       but in fact has the "if" of [a] there.

To remedy, I closed off the if at [a], then added the "esac" to close
the "case" at [E].

This was not an exhaustive study, but with the added instructions,
this built the test library okay as where before it did not.

My guess is that ltmain.sh (which is distributed with libtool) is
corrupted somehow and for some weird reason, those loops were not tied
off properly.

Elizabeth



Reply to: