dnl Process this file with autoconf to produce a configure script. AC_INIT(cdl.h) dnl Checks for programs. #-------------------------------------------------------------------- # See if there was a command-line option for where Python libs are; # if not, assume that we are in site-packages. #-------------------------------------------------------------------- AC_PROG_CC AC_ARG_WITH(python, [ --with-python=DIR provide Python LIBs directory], PYTHON_LIB_DIR=$withval, PYTHON_LIB_DIR=`cd ../../..; pwd`) if test ! -d $PYTHON_LIB_DIR; then AC_MSG_ERROR(PYTHON LIB directory $PYTHON_LIB_DIR doesn't exist) fi if test ! -d $PYTHON_LIB_DIR/site-packages; then AC_MSG_ERROR(There's no site-packages in $PYTHON_LIB_DIR; perhaps you didn't specify the Python *build* directory (but the Python *source* dir?)) fi AC_SUBST(PYTHON_LIB_DIR) # Check whether to use gcc AC_ARG_WITH(gcc, [--with-gcc allow for use of gcc if available], CC=gcc, gcc_ok=no) if test "$gcc_ok" = "no"; then AC_PROG_CC fi if test "$CC" = "gcc"; then SHLIB_CFLAGS=-fPIC AC_SUBST(SHLIB_CFLAGS) fi #------------------------------------------------------------------ # Read site specific information, kept in site.config # There are two ways to read the config.site file: --prefix # and the two lines below #------------------------------------------------------------------ AC_SUBST(pyraf_dir) pyraf_dir=`cd $srcdir; cd ../; pwd` file=$srcdir/config.site . $file #----------------------------------------------------------------- # Paths to where various header files are kept #----------------------------------------------------------------- AC_SUBST(PYTHONVERSION) AC_SUBST(PythonIncludePath) PythonIncludePath=`cd $PYTHON_LIB_DIR; cd ../../include/python$PYTHONVERSION; pwd` AC_SUBST(PythonBin) PYTHONBIN=`cd $PythonIncludePath; cd ../../; pwd` PythonBin=$PYTHONBIN/bin/python$PYTHONVERSION AC_SUBST(OpenGLIncludePath) AC_SUBST(TclIncludePath) #----------------------------------------------------------------- # Paths to where various libraries are located #----------------------------------------------------------------- dnl Checks for libraries. AC_SUBST(TclLibPath) dnl Checks for header files. AC_PATH_X AC_SUBST(x_includes) AC_SUBST(x_libraries) AC_HEADER_STDC dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Checks for library functions. AC_CHECK_FUNCS(strtod) #-------------------------------------------------------------------- # Find what the host system is and define IRAFARCH # SHLIB_CFLAGS - flags to pass to CC when compiling the components # of a shared library #-------------------------------------------------------------------- #AC_SUBST(IRAFARCH) AC_MSG_CHECKING(platform) if test -z "$IRAFPLAT" then system=`uname -s`-`uname -r` AC_MSG_RESULT($system) else AC_MSG_RESULT($system) fi case $system in SunOS-5.*) IRAFARCH="ssun" toglplatform="sunos" CFLAGS="-c" EXTRA_LFLAGS="-lnsl -lsocket" LDFLAG='-G' ;; Linux*) IRAFARCH="redhat" toglplatform="linux" CFLAGS=" -c" EXTRA_LFLAGS="-lc" LDFLAG='-shared' ;; OSF1-V*) IRAFARCH="alpha" toglplatform="osf1" CFLAGS=" -c" LDFLAG='-shared -expect_unresolved "*"' EXTRA_LFLAGS="" ;; esac if test "$CC" != "gcc" then case $system in SunOS-5.*) SHLIB_CFLAGS="-KPIC" ;; Linux*) SHLIB_CFLAGS="-fPIC" ;; OSF1-V*) SHLIB_CFLAGS="" ;; esac fi AC_SUBST(ToglPath) ToglPath=`cd $PYTHON_LIB_DIR/site-packages/OpenGL/Tk*/$toglplatform*; pwd` AC_SUBST(CFLAGS) AC_SUBST(EXTRA_LFLAGS) AC_SUBST(LDFLAG) AC_SUBST(SHLIB_CFLAGS) AC_OUTPUT(Makefile ../pyraf)