From: <kr_...@us...> - 2003-08-30 22:59:46
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv28848 Modified Files: makefile Added Files: config.h.in config.mk.in configure.in install-sh port.pkg.in Log Message: New configuration script. Autoconf generated --- NEW FILE: config.h.in --- #undef WIN32_TARGET #undef GTK_TARGET #undef DEBUG --- NEW FILE: config.mk.in --- CC = @CC@ CINCFLAGS = @CINCFLAGS@ CCOPTIONS = @CCOPTIONS@ HC = @HC@ HCPKG = @HCPKG@ HDOC = @HDOC@ HDOCHTML = @HDOCHTML@ HDOCLIBS = @HDOCLIBS@ HDOCBASE = @HDOCLIBS@/base/base.haddock AR = @AR@ LIBDIR = @LIBDIR@ GUILIB = @TARGET@ CLIBS = @CLIBOPTS@ TOPDIR = @CURDIR@ CP=cp MV=mv CD=cd RM=rm -f MKDIR=mkdir -p RMDIR=rmdir EXE = @EXE@ DLL = @DLL@ USERNAME=@SSHUSER@ DEBUG = @DEBUG@ --- NEW FILE: configure.in --- 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" 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 ... echo $cincflags INCDIRS="" 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." --- NEW FILE: install-sh --- #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" tranformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 --- NEW FILE: port.pkg.in --- Package { name="port" , auto=True , import_dirs=["$libdir/imports"] , library_dirs=["@LIBDIR@" @EXTRALIBDIRS@] , hs_libraries=["HSport"] , extra_libraries=[@EXTRALIBS@] , package_deps=[] , include_dirs = [@INCDIRS@] , c_includes = ["HsPort.h"] } Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** makefile 27 Aug 2003 08:22:12 -0000 1.36 --- makefile 30 Aug 2003 22:59:42 -0000 1.37 *************** *** 19,23 **** # system dependent stuff ! -include config/config.mk #-------------------------------------------------------------------------- --- 19,23 ---- # system dependent stuff ! -include config.mk #-------------------------------------------------------------------------- *************** *** 57,61 **** # package description ! PKG = config/$(MAIN).pkg #-------------------------------------------------------------------------- --- 57,61 ---- # package description ! PKG = $(MAIN).pkg #-------------------------------------------------------------------------- *************** *** 87,91 **** HC-OPTIONS = -O2 ! CC-OPTIONS = -O2 ifdef HDOCHTML --- 87,91 ---- HC-OPTIONS = -O2 ! CC-OPTIONS = -O2 -Wall $(CCOPTIONS) ifdef HDOCHTML |