AC_INIT(README) AC_PREFIX_DEFAULT(/usr/local) AC_CONFIG_HEADER(src/include/config.h) AC_CANONICAL_HOST AC_PROG_CC AC_MSG_CHECKING(whether ld -s works) STRIPFLAG= ac_save_ldflags=${LDFLAGS} LDFLAGS=-s AC_TRY_LINK(,,STRIPFLAG=-s; AC_MSG_RESULT(yes),AC_MSG_RESULT(no)) LDFLAGS=${ac_save_ldflags} AC_SUBST(STRIPFLAG) # Put this early on so CPPFLAGS and LDFLAGS have any additional dirs AC_ARG_WITH(includes, [ --with-includes=DIR site header files in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-includes option.]) ;; esac INC_DIRS="$withval" ]) if test "$INC_DIRS"; then for dir in $INC_DIRS; do if test -d "$dir"; then INCLUDE_DIRS="$INCLUDE_DIRS -I$dir" else AC_MSG_WARN([*** Include directory $dir does not exist.]) fi done AC_MSG_CHECKING(additional include dirs) AC_MSG_RESULT($INCLUDE_DIRS) CPPFLAGS="$CPPFLAGS $INCLUDE_DIRS" fi AC_SUBST(INCLUDE_DIRS) AC_ARG_WITH(libs, [ --with-libs=DIR also search for libraries in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-libs option.]) ;; esac LIB_DIRS="$withval" ]) if test "$LIB_DIRS"; then for dir in $LIB_DIRS; do if test -d "$dir"; then LIBRARY_DIRS="$LIBRARY_DIRS -L$dir" else AC_MSG_WARN([*** Library directory $dir does not exist.]) fi done AC_MSG_CHECKING(additional library dirs) AC_MSG_RESULT($LIBRARY_DIRS) LDFLAGS="$LDFLAGS $LIBRARY_DIRS" fi AC_SUBST(LIBRARY_DIRS) AC_PROG_INSTALL AC_PROG_LEX AC_PROG_RANLIB AC_CHECK_PROGS(ENV, env) AC_CHECK_PROGS(F77, f77 g77) AC_PATH_XTRA AC_HEADER_STDC AC_CHECK_HEADERS(curses.h limits.h termio.h termios.h unistd.h values.h zlib.h) AC_CHECK_HEADERS(sys/ioctl.h sys/mtio.h sys/resource.h sys/time.h) AC_CHECK_HEADERS(sys/timeb.h sys/types.h sys/utsname.h) AC_HEADER_TIME AC_TYPE_OFF_T AC_TYPE_UID_T AC_MSG_CHECKING(curses.h WINDOW structure component) CURSES_MAXY=NONE AC_TRY_COMPILE([ #include WINDOW w; ],[w.maxy = 0;], CURSES_MAXY=maxy) AC_TRY_COMPILE([ #include WINDOW w; ],[w._maxy = 0;], CURSES_MAXY=_maxy) AC_DEFINE_UNQUOTED(CURSES_MAXY,$CURSES_MAXY) AC_SUBST(CURSES_MAXY) AC_MSG_RESULT($CURSES_MAXY) AC_CHECK_FUNCS(ftime gethostname gettimeofday lseek nice time uname) AC_CHECK_FUNCS(seteuid setpriority setreuid setruid) AC_FUNC_SETPGRP CURSESLIB= if test -z "${CURSESLIB}"; then AC_CHECK_LIB(ncurses, initscr, CURSESLIB=-lncurses) fi if test -z "${CURSESLIB}"; then AC_CHECK_LIB(curses, initscr, CURSESLIB=-lcurses) fi AC_SUBST(CURSESLIB) COMPATLIB= if test -z "${COMPATLIB}"; then AC_CHECK_LIB(compat, gtty, COMPATLIB=-lcompat) fi AC_SUBST(COMPATLIB) TERMLIB= if test -z "${TERMLIB}"; then AC_CHECK_LIB(termlib, tgetent, TERMLIB=-ltermlib) fi AC_SUBST(TERMLIB) XDRLIB= if test -z "${XDRLIB}"; then AC_CHECK_LIB(sun, xdrmem_create, XDRLIB=-lsun) fi if test -z "${XDRLIB}"; then AC_CHECK_LIB(nsl, xdrmem_create, XDRLIB=-lnsl) fi if test -z "${XDRLIB}"; then AC_CHECK_LIB(rpclib, xdrmem_create, XDRLIB=-lrpclib) fi # IRIX and glibc2.2 have this in C lib as well, so check if test "${XDRLIB}"; then AC_CHECK_LIB(c, xdrmem_create, XDRLIB="") fi AC_SUBST(XDRLIB) ZLIB= if test -z "${ZLIB}"; then AC_CHECK_LIB(z, deflate, ZLIB=-lz) fi AC_SUBST(ZLIB) # Test if mathlib needs -lm flag or is included with libc MATHLIB="-lm" AC_CHECK_LIB(c, atan, MATHLIB="") if test "$MATHLIB"; then AC_CHECK_LIB(m, atan, MATHLIB=-lm, MATHLIB="") if test -z "$MATHLIB"; then AC_MSG_WARN([*** Failed check for math library.]) fi fi AC_SUBST(MATHLIB) # Handle this the same BINDIR=/usr/local/bin #if test -z "${exec_prefix}" || test "${exec_prefix}" = "NONE"; then #exec_prefix="/usr/local" #fi if test "${bindir}"; then BINDIR="${bindir}" fi AC_SUBST(BINDIR) DLLIB= AC_CHECK_LIB(dl, dlsym, DLLIB=-ldl) AC_SUBST(DLLIB) # Some search directories to use as the base for other searches when not specified my_inc_dirs="/usr/include /usr/local/include /usr/X11R6/include /opt/include /usr/freeware/include" my_lib_dirs="/usr/lib /usr/local/lib /usr/X11R6/lib /opt/lib /usr/freeware/lib" # TIFF includes and library checks.... AC_ARG_WITH(tiff-includes, [ --with-tiff-includes=DIR site header files for TIFF in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tiff-includes option.]) ;; esac tiff_inc_dirs="$withval" ]) TIFF_INCLUDE_DIRS= if test "$tiff_inc_dirs"; then for dir in $tiff_inc_dirs; do if test -d "$dir"; then TIFF_INCLUDE_DIRS="$TIFF_INCLUDE_DIRS -I$dir" else AC_MSG_WARN([*** TIFF include directory $dir does not exist.]) fi done AC_MSG_CHECKING(TIFF include dirs) AC_MSG_RESULT($TIFF_INCLUDE_DIRS) fi if test -z "$TIFF_INCLUDE_DIRS"; then AC_MSG_CHECKING(TIFF include dirs) for dir in $my_inc_dirs; do if test -z "$TIFF_INCLUDE_DIRS" && test -d "$dir" && test -f "$dir/tiffio.h"; then TIFF_INCLUDE_DIRS="-I$dir" fi done AC_MSG_RESULT($TIFF_INCLUDE_DIRS) fi if test -z "$TIFF_INCLUDE_DIRS"; then AC_MSG_WARN([*** Couldn't find 'tiffio.h'.]) fi AC_SUBST(TIFF_INCLUDE_DIRS) AC_ARG_WITH(tiff-libs, [ --with-tiff-libs=DIR also search for TIFF libraries in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tiff-libs option.]) ;; esac tiff_lib_dirs="$withval" ]) TIFF_LIBRARY_DIRS= if test "$tiff_lib_dirs"; then for dir in $tiff_lib_dirs; do if test -d "$dir"; then TIFF_LIBRARY_DIRS="$TIFF_LIBRARY_DIRS -L$dir" else AC_MSG_WARN([*** TIFF library directory $dir does not exist.]) fi done AC_MSG_CHECKING(additional TIFF library dirs) AC_MSG_RESULT($TIFF_LIBRARY_DIRS) fi if test -z "$TIFF_LIBRARY_DIRS"; then AC_MSG_CHECKING(TIFF library dirs) for dir in $my_lib_dirs; do if test -z "$TIFF_LIBRARY_DIRS" && test -d "$dir" && test -f "$dir/libtiff.a"; then TIFF_LIBRARY_DIRS="-L$dir" fi done AC_MSG_RESULT($TIFF_LIBRARY_DIRS) fi if test -z "$TIFF_LIBRARY_DIRS"; then AC_MSG_WARN([*** Couldn't find 'libtiff.a'.]) fi AC_SUBST(TIFF_LIBRARY_DIRS) ldflags_save="$LDFLAGS" LDFLAGS="$LDFLAGS $MATHLIB $TIFF_LIBRARY_DIRS" AC_CHECK_LIB(tiff, TIFFOpen, has_tiff_lib=1) LDFLAGS="$ldflags_save" if test -z "$has_tiff_lib"; then AC_MSG_WARN([*** Failed to find TIFF library]) fi AC_SUBST(TIFF_LIBRARY_DIRS) # TCL/TK includes and library tests... # Check headers in default location first. #AC_CHECK_HEADER(/usr/include/tk.h, HAVE_TK_H=1) #AC_CHECK_HEADER(/usr/include/tcl.h,HAVE_TCL_H=1) #tcltk_ver= #if test "$HAVE_TK_H"; then # tcltk_ver=`grep TK_VERSION "/usr/include/tk.h" | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` #fi AC_ARG_WITH(tcltk-includes, [ --with-tcltk-includes=DIR site header files for Tcl and Tk in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tcltk-includes option.]) ;; esac tclincdir="$withval" tkincdir="$withval" ]) tcltk_ver= TCLINCDIR= if test "$tclincdir" && test -z "$HAVE_TCL_H"; then for dir in $tclincdir; do if test -d "$dir"; then TCLINCDIR="$TCLINCDIR -I${dir}" if test -f "$dir/tcl.h"; then grep_cmd="grep TCL_VERSION ${dir}/tcl.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` fi else AC_MSG_WARN([*** Tcl include directory $dir does not exist.]) fi done AC_MSG_CHECKING(Tcl include dirs) AC_MSG_RESULT($TCLINCDIR) fi # NEEDS else check known places ... if test -z "$TCLINCDIR" && test -z "$HAVE_TCL_H"; then AC_MSG_CHECKING(Tcl include dirs) tk_try="tcl8.3 tcl8.2 tcl8.1 tcl8.0" for my_dir in $my_inc_dirs; do if test -z "$TCLINCDIR" && test -d $my_dir; then if test -z "$TCLINCDIR" && test -f "$my_dir/tcl.h"; then grep_cmd="grep TCL_VERSION ${my_dir}/tcl.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` TCLINCDIR="-I${my_dir}" fi for dir in $tk_try; do if test -z "$TCLINCDIR" && test -d "$my_dir/$dir" && test -f "$my_dir/$dir/tcl.h"; then grep_cmd="grep TCL_VERSION ${my_dir}/${dir}/tcl.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` TCLINCDIR="-I${my_dir}/${dir}" fi done fi done AC_MSG_RESULT($TCLINCDIR) fi if test -z "$TCLINCDIR" && test -z "$HAVE_TCL_H"; then AC_MSG_WARN([*** Didn't find tcl.h, maybe okay...]) fi AC_SUBST(TCLINCDIR) TKINCDIR= if test $tkincdir && test -z $HAVE_TK_H ; then for dir in $tkincdir; do if test -d "${dir}"; then TKINCDIR="$TKINCDIR -I${dir}" if test -f "${dir}/tk.h"; then grep_cmd="grep TK_VERSION ${dir}/tk.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` fi else AC_MSG_WARN([*** Tk include directory $dir does not exist.]) fi done AC_MSG_CHECKING(Tk include dirs) AC_MSG_RESULT($TKINCDIR) fi if test -z "$TKINCDIR" && test -z "$HAVE_TK_H"; then AC_MSG_CHECKING(Tk include dirs) tk_try="tk8.3 tk8.2 tk8.1 tk8.0" for my_dir in $my_inc_dirs; do if test -z "$TKINCDIR" && test -d $my_dir; then if test -z "$TKINCDIR" && test -f "$my_dir/tk.h"; then grep_cmd="grep TK_VERSION ${my_dir}/tk.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` TKINCDIR="-I${my_dir}" fi for dir in $tk_try; do if test -z "$TKINCDIR" && test -d "$my_dir/$dir" && test -f "$my_dir/$dir/tk.h"; then grep_cmd="grep TK_VERSION ${my_dir}/${dir}/tk.h" tcltk_ver=`$grep_cmd | sed -e 's/^\(.*\)\"\(.*\)\"$/\2/'` TKINCDIR="-I${my_dir}/${dir}" fi done fi done AC_MSG_RESULT($TKINCDIR) fi if test -z "$TKINCDIR" && test -z "$HAVE_TK_H"; then AC_MSG_WARN([*** Didn't find tk.h, maybe okay...]) fi AC_SUBST(TKINCDIR) # Also need this for Cygwin (how is it identified??) if test `uname -s` = FreeBSD; then tcltk_ver=`echo $tcltk_ver | sed 's/\.//g'` fi AC_ARG_WITH(tcltk-libs, [ --with-tcltk-libs=DIR also search for Tcl and Tk libraries in DIR], [ case "$withval" in "" | y | ye | yes | n | no) AC_MSG_ERROR([*** You must supply an argument to the --with-tcltk-libs option.]) ;; esac tcltk_lib_dirs="$withval" ]) TCLTKLIBS= TCLTKLIBPATH= if test "$tcltk_lib_dirs"; then for dir in $tcltk_lib_dirs; do if test -d "$dir"; then TCLTKLIBPATH="$TCLTKLIBPATH -L${dir}" else AC_MSG_WARN([*** Tcl/Tk library directory $dir does not exist.]) fi done AC_MSG_CHECKING(additional Tcl and Tk library dirs) AC_MSG_RESULT($TCLTKLIBPATH) fi if test -z "$TCLTKLIBPATH"; then AC_MSG_CHECKING(Tcl/Tk library dirs) for dir in $my_lib_dirs; do if test -z "$TCLTKLIBPATH" && test -d "$dir" && test -f "$dir/libtcl$tcltk_ver.a" && test -f "$dir/libtk$tcltk_ver.a"; then TCLTKLIBPATH="-L$dir" fi done AC_MSG_RESULT($TCLTKLIBPATH) fi if test -z "$TCLTKLIBPATH"; then AC_MSG_WARN([*** Couldn't find tcl/tk library.]) fi AC_SUBST(TCLTKLIBPATH) if test "$tcltk_ver"; then ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $TCLTKLIBPATH $X_LIBS -Xt -ltcl$tcltk_ver" AC_CHECK_LIB("tk$tcltk_ver", Tk_MainWindow, has_tk_lib="1") if test "$has_tk_lib"; then TCLTKLIBS="$TCLTKLIBS -ltk$tcltk_ver -ltcl$tcltk_ver" else AC_MSG_WARN([*** Failed to find Tcl/Tk libraries]) fi LDFLAGS=${ac_save_ldflags} AC_SUBST(TCLTKLIBS) else AC_MSG_WARN([*** Unable to find Tcl/Tk libraries and headers]) fi AC_SUBST(TCLTKLIBPATH) SYSV= AC_ARG_WITH(SYSV, [ --with-SYSV define the compiler macro SYSV], [ case "$withval" in "" | y | ye | yes) SYSV=-DSYSV AC_MSG_CHECKING(for SYSV) AC_MSG_RESULT($SYSV) ;; n | no) SYSV= ;; *) AC_MSG_ERROR([*** Invalid argument $withval supplied to the --with-SYSV option.]) ;; esac ]) AC_SUBST(SYSV) USE_TERMIO= AC_ARG_WITH(USE_TERMIO, [ --with-USE_TERMIO define the compiler macro USE_TERMIO], [ case "$withval" in "" | y | ye | yes) USE_TERMIO=-DUSE_TERMIO AC_MSG_CHECKING(for USE_TERMIO) AC_MSG_RESULT($USE_TERMIO) ;; n | no) USE_TERMIO= ;; *) AC_MSG_ERROR([*** Invalid argument $withval supplied to the --with-USE_TERMIO option.]) ;; esac ]) AC_SUBST(USE_TERMIO) # Make sure this is set correctly SRCDIR=`pwd` AC_SUBST(SRCDIR) # Add VERSION and GISBASE VERSION=`cat ${SRCDIR}/src/CMD/VERSION | head -1` NAME_VER=`echo ${VERSION} | sed 's/\..*//'` #GISBASE="${prefix}/grass${NAME_VER}" AC_SUBST(VERSION) AC_SUBST(NAME_VER) #AC_SUBST(GISBASE) ARCH= if test -z "${host}"; then ARCH="unknown" else ARCH="${host}" fi AC_SUBST(ARCH) # Enable PostgreSQL always ... USE_POSTGRES= AC_ARG_ENABLE(postgres, [ --enable-postgres=yes/no Support PostgreSQL functionality (default: yes)], [ case "$enableval" in "n" | "no") USE_POSTGRES= ;; *) USE_POSTGRES="1" ;; esac ], [ USE_POSTGRES="1" ] ) # With/Without PostgreSQL root: AC_ARG_WITH(postgres-root, [ --with-postgres-root=DIR Specify root directory for PostgreSQL], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-postgres-root.]) ;; esac pg_root="$withval" ]) # With Postgresql includes directory: AC_ARG_WITH(postgres-includes, [ --with-postgres-includes=DIR Specify includes directory for PostgreSQL], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-postgres-includes.]) ;; esac pg_includes="$withval" ]) # With Postgresql library directory: AC_ARG_WITH(postgres-libs, [ --with-postgres-libs=DIR Specify library directory for PostgreSQL], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-postgres-libs.]) ;; esac pg_libs="$withval" ]) # If a --with-postgres option was given, turn on enable-postgres if test "$pg_root" -o "$pg_includes" -o "$pg_libs"; then USE_POSTGRES="1" fi # Process PostgreSQL --with directives PQINCPATH= PQLIB= PQLIBPATH= if test "$pg_root"; then if test -z "$pg_includes"; then pg_includes="$pg_root/include" fi if test -z "$pg_libs"; then pg_libs="$pg_root/lib" fi fi if test "$pg_includes"; then AC_MSG_CHECKING(libpq-fe.h) for dir in $pg_includes; do if test -d "$dir" && test -f "$dir/libpq-fe.h"; then PQINCPATH="$PQINCPATH -I$dir" fi done AC_MSG_RESULT($PQINCPATH) fi if test "$pg_libs"; then AC_MSG_CHECKING(libpq path) for dir in $pg_libs; do if test -d "$dir"; then PQLIBPATH="$PQLIBPATH -L$dir" fi done AC_MSG_RESULT($PQLIBPATH) fi # If enabled but no paths given, look in our search paths if test -n "$USE_POSTGRES"; then if test -z "$PQINCPATH"; then my_pginc_path="/usr/include /usr/include/pgsql /usr/include/postgresql /usr/local/include /usr/local/pgsql/include /opt/pgsql/include" AC_MSG_CHECKING(libpq-fe.h) for dir in $my_pginc_path; do if test -d "$dir" && test -f "$dir/libpq-fe.h"; then PQINCPATH="$PQINCPATH -I$dir" fi done AC_MSG_RESULT($PQINCPATH) if test -z "$PQINCPATH"; then AC_MSG_WARN([*** libpq-fe.h not found, but needed for PostgreSQL support]) fi fi if test -z "$PQLIBPATH"; then my_pglib_path="/usr/lib /usr/local/lib /usr/local/pgsql/lib /usr/lib/pgsql /usr/lib/postgres /opt/pgsql/lib" AC_MSG_CHECKING(libpq paths) for dir in $my_pglib_path; do if test -d "$dir"; then PQLIBPATH="$PQLIBPATH -L$dir" fi done AC_MSG_RESULT($PQLIBPATH) fi fi if test -n "$USE_POSTGRES"; then ac_save_ldflags=${LDFLAGS} LDFLAGS="$LDFLAGS $PQLIBPATH" AC_CHECK_LIB(pq,PQcmdTuples, [ AC_DEFINE(HAVE_PQCMDTUPLES) PQLIB=-lpq ]) LDFLAGS=${ac_save_ldflags} fi # Done with PostgreSQL AC_SUBST(PQINCPATH) AC_SUBST(PQLIBPATH) AC_SUBST(PQLIB) # OpenGL # Allow OpenGL to be disabled USE_OPENGL= AC_ARG_ENABLE(opengl, [ --enable-opengl=yes/no Enable or disable OpenGL programs (default: yes)], [ case "$enableval" in "n" | "no") USE_OPENGL= ;; *) USE_OPENGL="1" ;; esac ], [ USE_OPENGL="1" ] ) AC_ARG_WITH(opengl-includes, [ --with-opengl-includes=DIR Specify the directory for OpenGL (or Mesa) headers], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-opengl-includes.]) ;; esac opengl_includes="$withval" ]) AC_ARG_WITH(opengl-libs, [ --with-opengl-libs=DIR Specify the directory for OpenGL (or Mesa) libraries], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-opengl-libs.]) ;; esac opengl_libs="$withval" ]) if test -n "$opengl_libs" || test -n "opengl_includes" ; then if test -z "$USE_OPENGL"; then USE_OPENGL="1" fi fi OPENGLINC= OPENGLwINC= OPENGLLIB= OPENGLULIB= LGLWM= if test -z "$opengl_includes" && test -n "$USE_OPENGL"; then opengl_includes="/usr/include/GL /usr/local/include/GL \ /usr/include/Mesa/GL /usr/local/include/Mesa/GL \ /usr/local/Mesa/include/GL /opt/include/GL /opt/Mesa/include/GL \ /usr/X11R6/include /usr/X11R6/include/GL /opt/Mesa/include" fi if test -n "$opengl_includes"; then AC_MSG_CHECKING(GL/gl.h and GL/GLwMDrawA.h) for dir in $opengl_includes; do if test -d "$dir" && test -f "$dir/gl.h"; then OPENGLINC="$OPENGLINC -I$dir" fi if test -d "$dir" && test -f "$dir/GLwMDrawA.h"; then OPENGLwINC="$OPENGLwINC -I$dir" fi done if test -z "$OPENGLINC"; then AC_MSG_WARN([*** Didn't find GL/gl.h]) fi if test -z "$OPENGLwINC"; then AC_MSG_WARN([*** Didn't find GL/GLwMDrawA.h]) fi AC_MSG_RESULT($OPENGLINC and $OPENGLwINC) fi if test -z "$opengl_libs" && test -n "$USE_OPENGL"; then opengl_libs="/usr/lib /usr/local/lib /usr/lib/X11 \ /usr/local/Mesa/lib /usr/X11R6/lib /usr/local/X11/lib \ /usr/local/X11R6/lib /usr/lib/Mesa /opt/lib /opt/Mesa \ /opt/Mesa/lib" fi if test -n "$opengl_libs"; then for dir in $opengl_libs; do if test -d "$dir"; then OPENGLLIB="$OPENGLLIB -L$dir" fi done fi if test -n "$USE_OPENGL"; then ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $MATHLIB $OPENGLLIB" AC_CHECK_LIB(GL,glBegin,OPENGLLIB="$OPENGLLIB -lGL") LDFLAGS=${ac_save_ldflags} ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $MATHLIB $OPENGLLIB" AC_CHECK_LIB(GLU,gluBeginCurve, OPENGLULIB="-lGLU") LDFLAGS=${ac_save_ldflags} ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $MATHLIB $OPENGLLIB $OPENGLULIB $X_LIBS -lXt -lXm" AC_CHECK_LIB(GLw,GLwDrawingAreaMakeCurrent,LGLWM=-lGLw) AC_CHECK_LIB(GLwM,GLwCreateMDrawingArea,LGLWM="$LGLWM -lGLwM") LDFLAGS=${ac_save_ldflags} fi AC_SUBST(OPENGLINC) AC_SUBST(OPENGLwINC) AC_SUBST(OPENGLLIB) AC_SUBST(OPENGLULIB) AC_SUBST(LGLWM) AC_SUBST(USE_OPENGL) #End of OpenGL tests # ODBC include paths.. ODBCINC= AC_ARG_WITH(odbc-includes, [ --with-odbc-includes=DIR Specify path for ODBC header files], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-odbc-includes.]) ;; esac odbc_includes="$withval" ]) if test "$odbc_includes"; then for dir in $odbc_includes; do if test -d "$dir" && test -f "$dir/sql.h"; then ODBCINC="$ODBCINCPATH -I$dir" fi done else for dir in $my_inc_dirs; do if test -d "$dir" && test -f "$dir/sql.h"; then ODBCINC="$ODBCINCPATH -I$dir" elif test -d "$dir/odbc" && test -f "$dir/odbc/sql.h"; then ODBCINC="$ODBCINCPATH -I$dir/odbc" fi done fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ODBCINC" AC_CHECK_HEADER(sql.h,HAVE_SQL_H=1 ,ODBCINC="") CPPFLAGS=${ac_save_cppflags} AC_SUBST(ODBCINC) # JPEG library checking # Function to test for jpeg_start_compress JPEGLIB= JPEGLIBPATH= JPEGINCPATH= AC_ARG_WITH(jpeg-includes, [ --with-jpeg-includes=DIR Specify directory for jpeg library headers], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** you must supply a directory to --with-jpeg-includes.]) ;; esac jpeg_includes="$withval" ]) AC_ARG_WITH(jpeg-libs, [ --with-jpeg-libs=DIR Specify directory for jpeg library], [ case "$withval" in "" | "y" | "ye" | "yes" | "n" | "no") AC_MSG_ERROR([*** You must supply a directory to --with-jpeg-lib.]) ;; esac jpeg_libs="$withval" ]) if test "$jpeg_includes"; then for dir in $jpeg_includes; do if test -d "$dir"; then JPEGINCPATH="$JPEGINCPATH -I$dir" else AC_MSG_WARN([*** Directory $dir does not exist]) fi done else for dir in $my_inc_dirs; do if test -d "$dir" && test -f "$dir/jpeglib.h"; then JPEGINCPATH="$JPEGINCPATH -I$dir" fi done fi if test "$jpeg_libs"; then for dir in $jpeg_libs ; do if test -d "$dir" ; then JPEGLIBPATH="$JPEGLIBPATH -L$dir" else AC_MSG_WARN([*** Directory $dir does not exist]) fi done else for dir in $my_lib_dirs; do if test -d "$dir" && test -f "$dir/libjpeg.a"; then JPEGLIBPATH="$JPEGLIBPATH -L$dir" fi done fi ac_save_cppflags="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $JPEGINCPATH" AC_CHECK_HEADERS(jpeglib.h) CPPFLAGS=${ac_save_cppflags} ac_save_ldflags="$LDFLAGS" LDFLAGS="$LDFLAGS $JPEGLIBPATH" AC_CHECK_LIB(jpeg,jpeg_start_compress,JPEGLIB=-ljpeg) LDFLAGS=${ac_save_ldflags} AC_SUBST(JPEGLIB) AC_SUBST(JPEGLIBPATH) AC_SUBST(JPEGINCPATH) # Done with JPEG library AC_OUTPUT(Makefile src/CMD/head/head src/scripts/shells/create_fifos.sh)