#!/bin/sh -e

version=`cat conf-version`
major=`echo "$version" | cut -d. -f1`
minor=`echo "$version" | cut -d. -f2`

test -f flag-allstatic && trydyn=false || trydyn=true

if test -f EXPORT.header ; then
  cat < EXPORT.header
fi

ls -1 deps-exe

for file in `ls -1 deps-lib` ; do
  echo "lib$file.a"
  if $trydyn && test -x deps-lib/$file ; then
    echo "lib$file.so.$version"
    if test "$version" != "$major.$minor" ; then
      echo "lib$file.so.$major.$minor"
    fi
    echo "lib$file.so.$major"
    echo "lib$file.so"
  fi
done

if test -f EXPORT.footer ; then
  cat EXPORT.footer
fi
