[argyllcms] Re: Can anyone help me with iccexamin?

  • From: Kai-Uwe Behrmann <ku.b@xxxxxx>
  • To: Leonard Evens <len@xxxxxxxxxxxxxxxxxxxxx>
  • Date: Sat, 9 Feb 2008 22:48:45 +0100 (CET)

It was a configure problem, which I fixed after our ocnversation. It is 
not included in the last development snapshot on SF.

The current scripts are attached. Sorry for the length.


kind regards
Kai-Uwe Behrmann
--
developing for colour management 
www.behrmann.name + www.oyranos.org

Am 09.02.08, 15:29 -0600 schrieb Leonard Evens:
> On Sat, 2008-02-09 at 15:09 -0600, Leonard Evens wrote:
> > On Sat, 2008-02-09 at 19:42 +0100, Kai-Uwe Behrmann wrote:
> > > http://downloads.sourceforge.net/oyranos/icc_examin-0.45_rc4.tar.gz
 
> > Later the log file says:
> > 
> > FTGL      2.1.2         detected
> > !!! ERROR !!!
> >            FLTK (/usr/bin/fltk-config) is not found; download:
> > www.fltk.org
> > 
> > 
> > I have both both the fltk and fltk-devel packages installed, but if I
> > remember correctly, those packages weren't build with the right options.
> > So I downloaded fltk-1.17 and installed that.  In
> > fact /usr/bin/fltk-config does exist (from the package), but it is also
> > in /usr/local/bin.   That come first in my path, so it is the one that
> > should be used.  I believe that worked with iccexamin-0.44, which is
> > what I had before.
> > 
> > I might have forgotten something else I had to do to build 0.44.
> > 
> > Any help would be appreciated.
> 
> I started looking at the configure script to see what it might be doing,
> and it looks very familiar.  I think I had the similar problems before,
> and I may have had to go through the scripts executing one line at a
> time before I was able to get something to work.  I also corresponded
> with you about it.  I hope I don't have to go through the whole thing
> again.
#!/bin/sh

TARGET=icc_examin
TARGET_NAME="ICC Examin"
BINTARGET="`echo $TARGET | sed s/_//g`"
ERROR=0

CONF_H=config.h
CONF=makefile
CONF_TEMP_SH=config.tmp.sh
CONF_LOG=config.log
CONF_I18N=fl_i18n/makefile
SPEC=$TARGET.spec
VERS="$TARGET"_version.h
zeile="$0 $@"
MAKEFILE_DIR=". fl_i18n"; export MAKEFILE_DIR


export CONF_H CONF CONF_I18N CONF_TEMP_SH CONF_LOG

test -f error.tmp && rm error.tmp
test -f $CONF_TEMP_SH && rm $CONF_TEMP_SH

VERSION_A=0
VERSION_B=4
VERSION_C=5
RELEASE=0
ZEIT="May 2004 - January 2008"
VERSION=$VERSION_A.$VERSION_B$VERSION_C
if [ $VERSION_A -gt 9 ]; then
  VERSION_L="$VERSION_A"
else
  VERSION_L="0$VERSION_A"
fi
if [ $VERSION_B -gt 9 ]; then
  VERSION_L="$VERSION_L$VERSION_B"
else
  VERSION_L="${VERSION_L}0$VERSION_B"
fi
if [ $VERSION_C -gt 9 ]; then
  VERSION_L="$VERSION_L$VERSION_C"
else
  VERSION_L="${VERSION_L}0$VERSION_C"
fi
VERSION_L=`echo $VERSION_L | sed 's/^0*//g'`


cwdebug=0
debug=0
verbose=0
nodeps=0

# find a suitable fltk-config script
fltkconfig="fltk-config"
old_IFS=$IFS; 
IFS=:
for i in $PATH; do
  test -x "$i/$fltkconfig" && fltkconfig_="$i/$fltkconfig"
done
if [ -z "$fltkconfig_" ]; then
  for i in $PATH; do
    test -x "$i/fltk-utf8-config" && fltkconfig_="$i/fltk-utf8-config"
  done
fi
if [ -n "$fltkconfig_" ]; then
  fltkconfig="$fltkconfig_"
fi
IFS=$old_IFS

if [ $# -gt 0 ]; then
  prefix=""
  while [ $# -gt 0 ]; do
    arg=$1
    # prefix exec_prefix bindir sbindir libdir includedir datadir mandir
    switch=prefix
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      prefix="`echo \"$1\" | sed s/\"--$switch=\"//`"
    fi
    switch="exec-prefix"
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      exec_prefix="`echo $1 | sed s/--$switch=//`"
    fi
    switch=bindir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      bindir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=sbindir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      sbindir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=libdir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      libdir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=includedir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      includedir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=datadir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      datadir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=mandir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      mandir="`echo $1 | sed s/--$switch=//`"
    fi
    # pixmapdir desktopdir
    switch=pixmapdir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      pixmapdir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=desktopdir
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      desktopdir="`echo $1 | sed s/--$switch=//`"
    fi
    switch=with-fltk-config
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      fltkconfig="`echo $1 | sed s/--$switch=//`"
      fltkldflags="--ldstaticflags"
    fi
    switch=argyll-internal
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      internalargyll="`echo $1 | sed s/--$switch=//`"
    fi
    switch=enable-cwdebug
    if [ "`echo \"$1\" | sed s/\"--$switch=\"//`" != "$1" ]; then
      cwdebug="`echo $1 | sed s/--$switch=//`"
    fi
    switch=enable-cwdebug
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      cwdebug="1"
    fi
    switch=with-rpath
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      rpath=1
    fi
    switch=quick
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      quick="1"
    fi
    switch=enable-debug
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      debug="1"
    fi
    switch=enable-verbose
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      verbose="1"
    fi
    switch=disable-dependency-tracking
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      nodeps="1"
    fi
    switch=help
    if [ "`echo \"$1\" | sed s/\"--$switch\"//`" != "$1" ]; then
      echo "Usage:"
      echo "   --prefix=[/usr/local]                package prefix"
      echo "   --exec-prefix=[\$prefix]              package exec-prefix"
      echo "   --bindir=[\$exec-prefix/bin]          binary installation path"
      echo "   --sbindir=[\$exec-prefix/sbin]        super user binary 
installation path"
      echo "   --libdir=[\$exec-prefix/lib]          library installation path"
      echo "   --includedir=[\$prefix/include]       include file installation"
      echo "   --datadir=[\$prefix/data]             application data base path"
      echo "   --mandir=[\$datadir/man]              manual installation path"
      echo "   --pixmapdir=[\$datadir/pixmaps]       icon installation path"
      echo "   --desktopdir=[\$datadir/applications] xdg installation path"
      echo ""
      echo "   --with-fltk-config=[fltk-config]     alternative fltk version"
      echo "   --enable-debug                       debug version"
      echo "   --enable-verbose                     verbose compiling"
      echo "   --disable-dependency-tracking        no dependencies [default 
check]"
      echo "   --enable-cwdebug=[\$cwdebugdir]       deploy cwlibary for 
debugging"
      echo "   --with-rpath                         use rpath for ELF linking"
      echo "   --quick                              generate config files only"
      echo "   --help"
      echo ""
      echo " Optionally set the CC, CXX, CFLAGS, CXXFLAGS and LDFLAGS 
environment variables."
      echo ""
      exit 0
    fi
    shift
  done
fi

INFOECHO="&2"
echo -e "$zeile \$@\n\nexit 0\n\n" > $CONF_LOG
chmod 0755 $CONF_LOG

echo_=""; echo -e "$echo_" >> $CONF_LOG; echo "$echo_"
echo_="################################################################"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="#                                                              #"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="        Welcome to $TARGET_NAME Version $VERSION configurator"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="#                                                              #"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="#                       Configuration                          #"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"

ECHO="echo";

src_dir="`(cd ..;pwd)`/""$TARGET"-"$VERSION"

#prefix
if [ -z "$prefix" ]; then
  prefix=/usr/local
fi

if [ -z "$datadir" ]; then
  if [ -f $prefix/share/config.site ]; then
    . $prefix/share/config.site
    (. $prefix/share/config.site >> $CONF_LOG )
  fi
else
  if [ -f $datadir/config.site ]; then
    . $datadir/config.site
    (. $datadir/share/config.site >> $CONF_LOG )
  fi
fi

test -f error.txt && rm error.txt
if [ -z "$quick" ]; then
  test -f mkdepend && rm mkdepend config.h
fi

for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "# automatically generated file by configure - do 
not edit" > "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
done
echo "/* automatically generated file by configure - do not edit */" > $CONF_H
echo "#ifndef ICCEXAMIN_CONFIG_H" >> $CONF_H
echo "#define ICCEXAMIN_CONFIG_H" >> $CONF_H
echo "" >> $CONF_H

test -n "$ECHO" && $ECHO "TARGET = $TARGET" >> "$CONF"
test -n "$ECHO" && $ECHO "BINTARGET = $BINTARGET" >> "$CONF"
test -n "$ECHO" && $ECHO "" >> "$i/makefile"

echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"


# detect System

UNAME_=`uname`
OSUNAME=BSD
if [ $? = 0 ] && [ $UNAME_ = "Darwin" ]; then
  echo_="Darwin PPC              detected"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
  osuname="APPLE = 1"
  echo "#define APPLE 1" >> $CONF_H
  OSX_H=""
  OSUNAME=Darwin
else
  if [ $UNAME_ = "Linux" ]; then
    osuname="LINUX = 1"
    echo "#define LINUX 1" >> $CONF_H
    echo_="Linux system            detected"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
    OSUNAME=Linux
  else
    if [ $UNAME_ = "SunOS" ]; then
      osuname="SOLARIS = 1"
      echo "#define SOLARIS 1" >> $CONF_H
      echo_="SunOS                   detected"; echo "$echo_" >> $CONF_LOG; 
echo "$echo_"
      OSUNAME=SunOS
    else
      if [ $UNAME_ = "OpenBSD" ] || [ $UNAME_ = "NetBSD" ] || [ $UNAME_ = 
"FreeBSD" ]; then
        osuname="BSD = 1"
        OS_EXT=.bsd
        echo "#define BSD 1" >> $CONF_H
        echo_="BSD $UNAME_             detected"; echo "$echo_" >> $CONF_LOG; 
echo "$echo_"
        OSUNAME=BSD
      else
        if [ `uname -a | grep W32 | wc -l` -gt 0 ];then
          osuname="WIN32 = 1"
          echo "#define WIN32 1" >> $CONF_H
          echo_="Windows $UNAME_             detected"; echo "$echo_" >> 
$CONF_LOG; echo "$echo_"
          EXEC_END=".exe"
          export EXEC_END
          OSUNAME=Windows
        else
          echo_="ICC Examin may or may not compile on your $UNAME_ system"; 
echo "$echo_" >> $CONF_LOG; echo "$echo_"
        fi
      fi
    fi
  fi
fi
for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "$osuname" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "OSX_H = $OSX_H" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "EXEC_END = $EXEC_END" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "MAKEFILE_ARCH = Makefile$OS_EXT" >> "$i/makefile"
done

MACH_=`uname -m`
MACH=BUILD_32
if [ $? = 0 ]; then
  if [ "$MACH_" = "i686" ]; then
    echo_="32-bit system           detected"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
  else
    if [ "$MACH_" = "x86_64" ]; then
      MACH=BUILD_64
      BUILD_64="BUILD_64 = 1"
      echo_="X86_64                  try build in 64 bit mode"; echo "$echo_" 
>> $CONF_LOG; echo "$echo_"
      BARCH="64"
    else
      if [ "$MACH_" = "sun4u" ]; then
        MACH=BUILD_64
        BUILD_64="BUILD_64 = 1"
        echo_="spark ultra 4           try build in 64 bit mode"; echo "$echo_" 
>> $CONF_LOG; echo "$echo_"
        BARCH="64"
        LINE_ARCH="-64"
      fi
    fi
  fi
fi
for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "$BUILD_64" >> "$i/makefile"
done
LIBDIR="lib"$BARCH
export MACH OSUNAME LIBDIR BARCH LINE_ARCH

if [ $OSUNAME = Windows ]; then
  up="`echo $USERPROFILE | sed s%\\\\\\\%/%g`"
  srcdir=`pwd | sed s%/%"C:/MinGW/"%1`
#  srcdir=`echo $srcdir | sed s%$USERNAME/%%`
#  srcdir=`echo $srcdir | sed s%/%%1`
  srcdir=`echo $srcdir | sed s%/%\\\\\\\\\\\\\\\\\\%g`
  test -z "$srcdir" && echo_="srcdir not detected in `pwd`"; echo "$echo_" >> 
$CONF_LOG; echo "$echo_"
else
  srcdir="`pwd`"
fi

if [ -z "$CC" ]; then
  if [ $OSUNAME = Windows ]; then
    CC=gcc
  else
    CC=cc
  fi
#$LINE_ARCH
fi
if [ -z "$CXX" ]; then
  CXX=c++
#$LINE_ARCH
fi

for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "CC = $CC" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "CXX = $CXX" >> "$i/makefile"
done
export CC CXX

CFLAGS_COMMON="$CFLAGS"
CXXFLAGS_COMMON="$CXXFLAGS"
LDFLAGS_COMMON="$LDFLAGS"
MAKE_CFLAGS="\$(INCL) \$(ARGYLL_H) \$(DEBUG)"
MAKE_CXXFLAGS="\$(INCL) \$(ARGYLL_H) \$(DEBUG)"
MAKE_LDFLAGS="\$(ARGYLL_LIBS)"

# exec_prefix bindir sbindir libdir includedir datadir
if [ -z "$exec_prefix" ]; then
  exec_prefix="$prefix"
fi
if [ "`echo $exec_prefix | grep 64 | wc -l`" -eq "1" ]; then
  BARCH=""
  LIBDIR="lib"
  echo_="unset BARCH LIBDIR"; echo "$echo_" >> $CONF_LOG; echo "$echo_"
  export BARCH LIBDIR
fi
if [ -z "$bindir" ]; then
  bindir="$exec_prefix/bin"
fi
if [ -z "$sbindir" ]; then
  sbindir="$exec_prefix/sbin"
fi
if [ -z "$libdir" ]; then
  libdir="$exec_prefix/$LIBDIR"
fi
if [ -z "$includedir" ]; then
  includedir="$prefix/include"
fi
if [ -z "$datadir" ]; then
  datadir="$prefix/share"
fi
if [ -z "$mandir" ]; then
  mandir="$datadir/man"
fi
# pixmapdir desktopdir
if [ -z "$pixmapdir" ]; then
  pixmapdir="$datadir/pixmaps"
fi
if [ -z "$desktopdir" ]; then
  desktopdir="$datadir/applications"
fi
if [ "$cwdebug" -eq "1" ]; then
  cwdebug="$libdir"
else
  if [ `echo $cwdebug | wc -m` -eq 2 ]; then
    if [ "$cwdebug" -eq "0" ]; then
      unset cwdebug
    fi
  fi
fi
export prefix exec_prefix bindir sbindir libdir includedir datadir mandir
export pixmapdir desktopdir
export fltkconfig fltkldflags cwdebug debug verbose

PATH=$bindir:$PATH
export PATH



# detect Libraries

if [ "$internalargyll" != "no" ]; then
  ARGYLL_VERSION="argyll-0.60"
  export ARGYLL_VERSION
fi
export internalargyll

# walk into sub dirs and configure there
if [ -n "$ECHO" ]; then
  if [ "$internalargyll" != "no" ] && [ -z "$quick" ]; then
    if [ -d $ARGYLL_VERSION ]; then
      cd $ARGYLL_VERSION
      if [ -n "$ECHO" ]; then
        echo_="./configure --enable-static $nodeps_config_opt 
--prefix=$prefix"; echo "$echo_" >> $CONF_LOG; echo "$echo_"
      fi
      ./configure --enable-static $nodeps_config_opt --prefix=$prefix
      cd $srcdir
    fi
  fi
fi

if [ $nodeps -eq 1 ]; then
  GCC_MM="echo \"\#disable dependency tracking\""
  nodeps_config_opt=--disable-dependency-tracking
else
  GCC_MM="$CC -MM"
fi

for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "LIB=/"$LIBDIR >> "$i/makefile"
  test -n "$ECHO" && $ECHO "MAKEDEPEND  = $GCC_MM" >> "$i/makefile"
done

# set some compiler and linker options

RM="rm -f $DEBUG_SWITCH"
if [ $OSUNAME = "Darwin" ]; then
  COPY="cp -p $DEBUG_SWITCH"
  LDFLAGS="-L."
  MAKE_LDFLAGS="\$(dl) \$(iconv)"
  echo "DBG_LIBS = #-lMallocDebug" >> $CONF
  I18N_LIB="\$(intl) \$(LIBNAME)"
  I18N_LIBSTAT="/opt/local/lib/libintl.a \$(LIBNAME) \$(iconv)"
  INCL="-I\$(includedir) -I/usr/X11R6/include -I./ 
-I/usr/include/gcc/darwin/default/c++"
  LIBEXT=".dylib"
  LINK_FLAGS="-dynamiclib -L."
  MSGMERGE="msgmerge"
  CFLAGS="-Wall -g -DPIC -Wunused"
  CXXFLAGS="-Wall -g -DPIC"
  REZ="\$(fltkconfig) --post \$@"
  OSX_CPP="\$(OSX_CPPFILES)"
  XGETTEXT_OPTIONS="--keyword=gettext \
        --keyword=_ \
        --keyword=N_"
  INSTALL="install $DEBUG_SWITCH"
else
  LIBMID=".so"
  
LIBNAMEFULL="lib\$(TARGET)\$(LIBMID).\$(VERSION_A).\$(VERSION_B).\$(VERSION_C)"
  MSGMERGE="msgmerge"
  MSGMERG_OPTS="--update"
  XGETTEXT_OPTIONS="--keyword=gettext --flag=gettext:1:pass-c-format \
        --keyword=_ --flag=_:1:pass-c-format \
        --keyword=N_ --flag=N_:1:pass-c-format \
        --copyright-holder='Kai-Uwe Behrmann' \
        --msgid-bugs-address='ku.b@xxxxxx' \
        --from-code=utf-8"
  if [ $OSUNAME = "Linux" ]; then
    COPY="cp $DEBUG_SWITCH -dpa"
    LDFLAGS="-L."
    MAKE_LDFLAGS="\$(dl) \$(iconv)"
    I18N_LIB="\$(LIBNAME)"
    I18N_LIBSTAT="\$(LIBNAME)"
    INCL="-I\$(includedir) -I/usr/X11R6/include -I. -I/usr/include/g++ 
-I/usr/include"
    LINK_FLAGS="-shared \$(dl) -fPIC -L. -lpthread"
    LIBNAMEV="lib\$(TARGET)\$(LIBMID).\$(VERSION_A)"
    if [ -n "$rpath" ]; then
      LINK_LIB_PATH="-Wl,--rpath -Wl,\$(libdir)"
      LINK_SRC_PATH="-Wl,--rpath -Wl,\$(srcdir)"
    fi
    INSTALL="install $DEBUG_SWITCH"
  else
    COPY="cp -p"
    INCL="-I\$(includedir) -I/usr/X11R6/include -I. -I/usr/include/g++ 
-I/usr/include"
    PIC=-fPIC
    if [ $OSUNAME = "BSD" ]; then
      MAKE_LDFLAGS="\$(iconv)"
      INSTALL="install $DEBUG_SWITCH"
      LINK_FLAGS="-shared \$(iconv)"
      if [ -n "$rpath" ]; then
        LINK_LIB_PATH="-Wl,--rpath -Wl,\$(libdir)"
        LINK_SRC_PATH="-Wl,--rpath -Wl,\$(srcdir)"
      fi
      INSTALL="install $DEBUG_SWITCH"
    fi
    if [ $OSUNAME = "SunOS" ]; then
      LDFLAGS="-mimpure-text -lrt"
      MAKE_LDFLAGS="\$(dl) \$(iconv)"
      INSTALL="install"
    else
      LDFLAGS="-mimpure-text"
      MAKE_LDFLAGS="\$(dl) \$(iconv)"
      INSTALL="install"
      LINK_FLAGS="-shared \$(dl) \$(iconv)"
    fi
    CFLAGS="-L. -fPIC"
    CXXFLAGS="-L. $PIC"
    if [ $OSUNAME = "Windows" ]; then
      PIC=""
      LDFLAGS=""
      CFLAGS="-L."
      CXXFLAGS="-L."
    fi
    I18N_LIB="\$(iconv) \$(intl) \$(LIBNAMEV)"
    I18N_LIBSTAT="\$(iconv) \$(intl) \$(LIBNAMEV)"
    RM="rm -f"
  fi
fi

CFLAGS="$CFLAGS $CFLAGS_COMMON $MAKE_CFLAGS"
CXXFLAGS="$CXXFLAGS $CXXFLAGS_COMMON $MAKE_CXXFLAGS"
LDFLAGS="$LDFLAGS $LDFLAGS_COMMON $MAKE_LDFLAGS"

for i in $MAKEFILE_DIR; do
  #test -n "$ECHO" && $ECHO " = $" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "COPY = $COPY" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "RM = $RM" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "INSTALL = $INSTALL" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "COLLECT = ar cru" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "RANLIB = ranlib" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LINK = ln -s" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "MSGMERGE = $MSGMERGE" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "MSGMERG_OPTS = $MSGMERG_OPTS" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "XGETTEXT_OPTIONS = $XGETTEXT_OPTIONS" >> 
"$i/makefile"
  test -n "$ECHO" && $ECHO "REZ = $REZ" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LIBMID = $LIBMID" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LIBEXT = $LIBEXT" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LINK_LIB_PATH = $LINK_LIB_PATH" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LINK_SRC_PATH = $LINK_SRC_PATH" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "I18N_LIB = $I18N_LIB" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "I18N_LIBSTAT = $I18N_LIBSTAT" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "INCL = $INCL" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "OSX_CPP = $OSX_CPP" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LINK_FLAGS = $LINK_FLAGS" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "CFLAGS   = $CFLAGS"       >> "$i/makefile"
  test -n "$ECHO" && $ECHO "CXXFLAGS = $CXXFLAGS" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "LDFLAGS  = $LDFLAGS"    >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
done
test -n "$ECHO" && $ECHO "LIBNAMEFULL = $LIBNAMEFULL" >> "$CONF"
test -n "$ECHO" && $ECHO "LIBNAMEV = $LIBNAMEV" >> "$CONF"

unset CFLAGS CXXFLAGS LDFLAGS
CFLAGS="$CFLAGS $CFLAGS_COMMON"
CXXFLAGS="$CXXFLAGS $CXXFLAGS_COMMON"
LDFLAGS="$LDFLAGS $LDFLAGS_COMMON"

if [ -n "$cwdebug" ]; then
  for i in $MAKEFILE_DIR; do
    echo "" >> "$i/makefile"
    echo "cwdebug = $cwdebug" >> "$i/makefile"
    echo "CWLIB = -L$cwdebug -lcwd"  >> "$i/makefile"
    echo "CCFILES = \$(DEBUG_CC)" >> "$i/makefile"
  done
  echo "#define CWDEBUG 1" >> $CONF_H
fi

echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"

LIBS_TEST="dl iconv intl c m"; export LIBS_TEST
X_ADD="Xpm Xext"; export X_ADD


ECHO="echo"; export ECHO
LIBS=1; export LIBS
ARGYLL=1; export ARGYLL
#export ELEKTRA=1
OYRANOS=1; export OYRANOS
LCMS=1; export LCMS
FTGL=2; export FTGL
FLTK=1; export FLTK
LIBPNG=0; export LIBPNG
LIBTIFF=1; export LIBTIFF
#FLU=2; export FLU
if [ $OSUNAME != "Darwin" ] && [ $OSUNAME != "Windows" ]; then
X11=1;   export X11
fi
XINERAMA=1; export XINERAMA
XF86VMODE=1; export XF86VMODE
DEBUG=1; export DEBUG
PO=1; export PO
GETTEXT=1; export GETTEXT
./configure.sh
LIBS=0; export LIBS

ARGYLL=0; export ARGYLL
ELEKTRA=0; export ELEKTRA
OYRANOS=0; export OYRANOS
LCMS=0; export LCMS
FTGL=0; export FTGL
FLTK=0; export FLTK
LIBPNG=0; export LIBPNG
LIBTIFF=0; export LIBTIFF
FLU=0; export FLU
X11=0; export X11
XINERAMA=0; export XINERAMA
XF86VMODE=0; export XF86VMODE
DEBUG=0; export DEBUG
PO=0; export PO
GETTEXT=0; export GETTEXT

if [ -d ../../../plug-ins/icc_examin/ ]; then
  build_plug_in_only=1
  CP_CONFIG=../../../cinepainttool
  CP_FLAGS="$CP_CONFIG --cflags-local"
  CP_LIBS="$CP_CONFIG --libs-local"
  CP_VERSION=`$CP_CONFIG --version`
  echo "CP_DIR=`$CP_CONFIG --install-dir`" >> $CONF
  echo "INSTALL_TARGET=install_cp" >> $CONF
  echo_="local CinePaint $CP_VERSION  detected"; echo "$echo_" >> $CONF_LOG; 
echo "$echo_"
  echo "CINEPAINT = icc_examin_cp" >> $CONF
else
  echo "INSTALL_TARGET=install_global" >> $CONF
fi
if [ -z "$CP_CONFIG" ]; then
  CP_CONFIG=`which cinepainttool 2>/dev/null`
  if [ -n "$CP_CONFIG" ]; then
    CP_FLAGS="cinepainttool --cflags"
    CP_LIBS="cinepainttool --libs"
    CP_VERSION=`cinepainttool --version`
    CP_N_VERSION=`cinepainttool --version | sed "s/\.// ; s/-.//"`
    echo_="Gtk CinePaint $CP_VERSION    detected"; echo "$echo_" >> $CONF_LOG; 
echo "$echo_"
    cp_reqired=22
    if [ "$CP_N_VERSION" -ge $cp_reqired ]; then
      echo "CINEPAINT = icc_examin_cp" >> $CONF
    else
      echo_="too old CinePaint version - need at least 0.$cp_reqired"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
    fi
  fi
fi
 
if [ -n "$CP_VERSION" ]; then
  echo "CP_FLAGS=$CP_FLAGS" >> $CONF
  echo "CP_LIBS=$CP_LIBS" >> $CONF
  echo "#define ICC_CINEPAINT_VERSION \"Gtk CinePaint $CP_VERSION\"" >> $VERS
fi

echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"



# Alle ifdefs landen hier

echo "" >> $CONF
echo "VERSION_A = $VERSION_A" >> $CONF
echo "VERSION_B = $VERSION_B" >> $CONF
echo "VERSION_C = $VERSION_C" >> $CONF
echo "VERSION   = $VERSION" >> $CONF
echo "VERSION_L = $VERSION_L" >> $CONF
echo "" >> $CONF

echo "#ifndef ICC_VERSION_H" > $VERS
echo "#define ICC_VERSION_H" >> $VERS
echo "" >> $VERS
echo "#define ICC_EXAMIN_VERSION_A $VERSION_A" >> $VERS
echo "#define ICC_EXAMIN_VERSION_B $VERSION_B" >> $VERS
echo "#define ICC_EXAMIN_VERSION_C $VERSION_C" >> $VERS
echo "#define ICC_EXAMIN_VERSION $VERSION_L" >> $VERS
echo "#define ICC_EXAMIN_V \"$VERSION\"" >> $VERS
echo "#define ICC_EXAMIN_D _(\"$ZEIT\")" >> $VERS
if [ -n "$CP_VERSION" ]; then
  echo "#define ICC_CINEPAINT_VERSION \"Gtk CinePaint $CP_VERSION\"" >> $VERS
fi
echo "" >> $VERS
echo "#endif //ICC_VERSION_H" >> $VERS

echo "Version: $VERSION" > $SPEC
echo "Source:  $TARGET"-"$VERSION".tar.gz >> $SPEC
echo "Release: $RELEASE" >> $SPEC
echo "%define pixmapdir       $pixmapdir" >> $SPEC
echo "%define desktopdir      $desktopdir" >> $SPEC
cat  "$SPEC.in" >> $SPEC
echo_="generated $SPEC from \"$SPEC.in\""; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"


echo_="prefix =                $prefix"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"

echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_="################################################################"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="#                       Configuration                          #"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_="prefix          =       $prefix"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="exec_prefix     =       $exec_prefix"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="bindir          =       $bindir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="sbindir         =       $sbindir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="libdir          =       $libdir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="includedir      =       $includedir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="datadir         =       $datadir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="mandir          =       $mandir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="pixmapdir       =       $pixmapdir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="desktopdir      =       $desktopdir"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="srcdir          =       $srcdir" ; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
if [ -n "$cwdebug" ]; then
echo_="cwdebug         =       $cwdebug"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
fi
echo_="CC              =       $CC"; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_="CXX             =       $CXX"; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_="CFLAGS          =       $CFLAGS"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="CXXFLAGS        =       $CXXFLAGS"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="LDFLAGS         =       $LDFLAGS"; echo "$echo_" >> $CONF_LOG; echo 
"$echo_"
echo_="INCL            =       $INCL"; echo "$echo_" >> $CONF_LOG; echo "$echo_"
echo_="################################################################"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"

for i in $MAKEFILE_DIR; do
  test -n "$ECHO" && $ECHO "src_dir = $src_dir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "srcdir = $srcdir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "prefix=$prefix" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "exec_prefix=$exec_prefix" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "bindir=$bindir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "sbindir=$sbindir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "libdir=$libdir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "includedir=$includedir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "datadir=$datadir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "mandir=$mandir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "pixmapdir=$pixmapdir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "desktopdir=$desktopdir" >> "$i/makefile"
  test -n "$ECHO" && $ECHO "" >> "$i/makefile"
done

echo "#define PREFIX         \"$prefix\"" >> $CONF_H
echo "#define ICCEXAMIN_DATADIR        \"$datadir\"" >> $CONF_H
echo "#define LOCALEDIR      \"$datadir/locale\"" >> $CONF_H
echo "#define PIXMAPDIR      \"$pixmapdir\"" >> $CONF_H
echo "#define SRCDIR         \"$srcdir\"" >> $CONF_H
if [ $OSUNAME = Windows ]; then
  echo "#define SRC_LOCALEDIR  \"$srcdir\\\\po\"" >> $CONF_H
else
  echo "#define SRC_LOCALEDIR  \"$srcdir/po\"" >> $CONF_H
fi

echo "" >> $CONF


if [ -z "$quick" ]; then
  echo "" > mkdepend
fi

# prepare makefile from MAKEFILE_DIR
PREPARE_MAKEFILES=1; export PREPARE_MAKEFILES
./configure.sh
PREPARE_MAKEFILES=0; export PREPARE_MAKEFILES

echo "" >> $CONF_H
echo "#endif /* ICCEXAMIN_CONFIG_H */" >> $CONF_H

test -f error.tmp && ERROR=1
test -f error.tmp && rm error.tmp
if [ "$ERROR" -ne "0" ]; then
  echo_="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; 
echo "$echo_" >> $CONF_LOG; echo "$echo_"
  echo_="!!!                     An ERROR occured                     !!!"; 
echo "$echo_" >> $CONF_LOG; echo "$echo_"
  echo_="!!!                     See Log above                        !!!"; 
echo "$echo_" >> $CONF_LOG; echo "$echo_"
  echo_="!!!                     remove  $CONF                     !!!"; echo 
"$echo_" >> $CONF_LOG; echo "$echo_"
  echo_="!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"; 
echo "$echo_" >> $CONF_LOG; echo "$echo_"
  echo_=""; echo "$echo_" >> $CONF_LOG; echo "$echo_"
  rm Makefile $CONF_H $CONF_SH $SPEC $PKGC $MPKG
  exit
else
  if [ -z "$quick" ]; then
    make depend
  fi
fi



Other related posts: