|
From: <kr_...@us...> - 2003-08-30 23:58:05
|
Update of /cvsroot/htoolkit/port
In directory sc8-pr-cvs1:/tmp/cvs-serv6256
Added Files:
configure.ac
Removed Files:
configure.in
Log Message:
Rename configure.in to configure.ac
--- NEW FILE: configure.ac ---
AC_INIT([HToolkit],[1.0],[ka2...@ya...],[htoolkit])
AC_CONFIG_FILES([config.mk:config.mk.in port.pkg:port.pkg.in])
AC_CONFIG_HEADERS([src/include/config.h:config.h.in])
AC_CANONICAL_SYSTEM
dnl ***********************************************
dnl GCC
dnl ***********************************************
AC_ARG_WITH(gcc,
[ --with-gcc=<gcc command>
Use a different command instead of 'gcc' for the GNU C compiler.
],
[CC="$withval"],
[AC_PATH_PROG(CC,gcc)]
)
dnl ** Must have GCC to build Port
if test "$CC" = ""; then
AC_MSG_ERROR([GCC is required to build Port.])
fi;
AC_SUBST(CC)
dnl ***********************************************
dnl GHC
dnl ***********************************************
AC_ARG_WITH(ghc,
[ --with-ghc=<ghc command>
Use a different command instead of 'ghc' for the Haskell compiler.
],
[HC="$withval"],
[AC_PATH_PROG(HC,ghc)]
)
dnl ** Must have GHC to build Port
if test "$HC" = ""; then
AC_MSG_ERROR([GHC is required to build Port.])
fi;
# check ghc version
version="`$HC --numeric-version`"
case $version in
6.*) ;;
*) echo "warning:"
echo " unable to recognise the ghc version ($version ?)"
exit 2;;
esac
LIBDIR="`$HC --print-libdir`"
AC_MSG_RESULT([ghc library directory... $LIBDIR])
AC_SUBST(HC)
AC_SUBST(LIBDIR)
dnl ***********************************************
dnl ghc-pkg
dnl ***********************************************
AC_ARG_WITH(pkg,
[ --with-pkg=<ghc-pkg command>
Use a different command instead of 'ghc-pkg' for the package compiler.
],
[HCPKG="$withval"],
[AC_PATH_PROG(HCPKG,ghc-pkg)]
)
dnl ** Must have ghc-pkg to install Port
if test "$HCPKG" = ""; then
AC_MSG_ERROR([ghc-pkg tool is required to install Port.])
fi;
hcpkglocal=""
if test -z "$hcpkglocal"; then
HCPKG=$HCPKG
else
HCPKG=$HCPKG -f $hcpkglocal
fi
AC_SUBST(HCPKG)
dnl ***********************************************
dnl haddock
dnl ***********************************************
AC_ARG_WITH(haddock,
[ --with-haddock=<haddock command>
Use a different command instead of 'ghc-pkg' for the Haskell documentation tool.
],
[HDOC="$withval"],
[AC_PATH_PROG(HDOC,haddock)]
)
if test "$HDOC" = ""; then
AC_MSG_RESULT([Warning: You will not be able to build the documentation.])
hdocfound="no"
HDOC=echo
else
hdocfound="yes"
fi;
HDOCLIBS=""
HDOCHTML=""
# find haddock/html library and base.haddock
if test $hdocfound = yes; then
hdocdir="`echo $HDOC | sed -e 's|/bin/haddock||' -e 's|.exe||'`"
hdocdir="`echo $hdocdir | sed -e 's%^/cygdrive/\(.\)/%\1:/%'`"
HDOCHTML="$hdocdir"
HDOCLIBS="$hdocdir/doc/html"
if test -d "$HDOCLIBS"; then
AC_MSG_RESULT([ghc documentation directory... $HDOCLIBS])
else
AC_MSG_RESULT([Warning: could not find ghc documentation directory at $HDOCLIBS])
HDOCLIBS=""
fi
if test -f "$HDOCLIBS/base/base.haddock"; then
AC_MSG_RESULT([base.haddock found])
else
AC_MSG_RESULT([Warning: could not find base.haddock, in $HDOCLIBS/base/base.haddock])
HDOCLIBS=""
fi
fi
AC_SUBST(HDOC)
AC_SUBST(HDOCHTML)
AC_SUBST(HDOCLIBS)
dnl ***********************************************
dnl SSHUSER
dnl ***********************************************
AC_ARG_WITH(sshuser,
[ --with-sshuser=<user name>
Use a different user name for SSH access to HToolkit website.
],
[SSHUSER="$withval"],
[SSHUSER=$USERNAME]
)
AC_MSG_RESULT([user name for ssh... $SSHUSER])
AC_SUBST(SSHUSER)
dnl ***********************************************
dnl AR
dnl ***********************************************
AC_PATH_PROG(AR,ar)
if test "$AR" = ""; then
AC_MSG_ERROR([ar is required to build Port.])
fi;
AC_SUBST(AR)
dnl ***********************************************
dnl Enable/Disable DEBUG
dnl ***********************************************
AC_ARG_ENABLE(debug,
[ --enable-debug
Enable/Disable debuging.
],
[DEBUG=YES
AC_DEFINE(DEBUG)],
[DEBUG=NO]
)
AC_SUBST(DEBUG)
# check host
CCOPTIONS=""
EXE=""
DLL=".so"
case $ac_cv_target_alias in
*-*-cygwin*)
CCOPTIONS="-Wall -mno-cygwin"
EXE=".exe"
DLL=".dll"
TARGET="WIN32"
AC_DEFINE(WIN32_TARGET);;
*-*-mingw*|gcc*,*-*-windows*)
EXE=".exe"
DLL=".dll"
TARGET="WIN32"
AC_DEFINE(WIN32_TARGET);;
*)
TARGET="GTK"
AC_DEFINE(GTK_TARGET);;
esac
AC_MSG_RESULT([gui library... $TARGET])
clibs=""
cincflags=""
case "$TARGET" in
WIN32*) clibs="-luser32 -lgdi32 -lkernel32 -lcomctl32 -lcomdlg32 -lshell32 -lwinmm -lwinspool -lole32 -ladvapi32";;
GTK*) AC_PATH_PROG(PKGCONFIG,pkg-config)
if test "$PKGCONFIG" = ""; then
AC_MSG_ERROR([you need to have the 'pkg-config' tool in your PATH
please check your GTK documentation])
fi;
clibs=`pkg-config pango gtk+-2.0 libgnome-2.0 libgnomeui-2.0 --libs`
cincflags=`pkg-config pango gtk+-2.0 libgnome-2.0 libgnomeui-2.0 --cflags`;;
*) echo "warning:"
echo " unknown gui-library specified: $TARGET"
echo " use the -gui option to specify another gui-library"
echo " for example: ./configure -gui WIN32"
exit 2;;
esac
# get current directory
CURDIR="`echo $(pwd) | sed -e 's%^/cygdrive/\(.\)/%\1:/%'`"
AC_SUBST(TARGET)
AC_SUBST(CCOPTIONS)
AC_SUBST(EXE)
AC_SUBST(DLL)
AC_SUBST(CURDIR)
dnl ***********************************************
dnl EXTRALIBS, EXTRALIBDIRS
dnl ***********************************************
# create list of extra c libraries needed, comma seperated and quoted.
# expects $clibs to be in the form: -llib1 -llib2 ... -L/dir/foo -L/bar
# note: $EXTRALIBDIRS always starts with a ','
EXTRALIBS=""
EXTRALIBDIRS=""
CLIBOPTS=""
for lib in $clibs; do
case $lib in
-l*) if test -z "$EXTRALIBS"; then
EXTRALIBS="`echo $lib | sed -e 's|-l|\"|'`"
else
EXTRALIBS="$EXTRALIBS\" `echo $lib | sed -e 's|-l|,\"|'`"
fi
CLIBOPTS="$CLIBOPTS $lib"
;;
-L*) if test -z "$EXTRALIBDIRS"; then
EXTRALIBDIRS="`echo $lib | sed -e 's|-L|, \"|'`"
else
EXTRALIBDIRS="$EXTRALIBDIRS\" `echo $lib | sed -e 's|-L|,\"|'`"
fi
CLIBOPTS="$CLIBOPTS $lib"
;;
esac
done
# append a final double-quote
if test ! -z "$EXTRALIBS"; then
EXTRALIBS="$EXTRALIBS\""
fi
if test ! -z "$EXTRALIBDIRS"; then
EXTRALIBDIRS="$EXTRALIBDIRS\""
fi
AC_SUBST(EXTRALIBS)
AC_SUBST(EXTRALIBDIRS)
AC_SUBST(CLIBOPTS)
dnl ***********************************************
dnl CINCFLAGS, INCDIRS
dnl ***********************************************
# create list of extra include directories needed, comma seperated and quoted.
# expects $cincflags to be in the form: -Idir1 -Idir2 ...
INCDIRS="\"$LIBDIR/include\""
incopts=""
for flag in $cincflags; do
case $flag in
-I*) INCDIRS="$INCDIRS`echo $flag | sed -e 's|-I|, \"|'`\""
incopts="$incopts $flag"
esac
done
CINCFLAGS="$incopts -I$LIBDIR/include"
AC_SUBST(CINCFLAGS)
AC_SUBST(INCDIRS)
dnl ***********************************************
dnl Create directories and output files
dnl ***********************************************
AC_OUTPUT
echo "creating output directories:"
echo " - build/cbits/$TARGET"
mkdir -p build/cbits build/cbits/$TARGET
echo " - build/Graphics/UI/Port"
mkdir -p build build/Graphics build/Graphics/UI build/Graphics/UI/Port
dnl ***********************************************
dnl Done
dnl ***********************************************
echo "done -- type 'make' to build the package."
--- configure.in DELETED ---
|