DAQ++ git-vmedaq
Brought to you by:
lacasta
dnl Process this file with autoconf to produce a configure script.
AC_INIT(daq/GenModule.cc)
AC_CONFIG_AUX_DIR(scripts)
dnl For automake.
VMEDAQ_MAJOR_VERSION=0
VMEDAQ_MINOR_VERSION=5
VMEDAQ_MICRO_VERSION=3
VMEDAQ_INTERFACE_AGE=1
VMEDAQ_BINARY_AGE=0
VERSION=$VMEDAQ_MAJOR_VERSION.$VMEDAQ_MINOR_VERSION.$VMEDAQ_MICRO_VERSION
PACKAGE=vmedaq
VMEDAQ_VERSIOM=$VERSION
VMEDAQ_RELEASE=2
AC_SUBST(VMEDAQ_RELEASE)
AC_SUBST(VMEDAQ_VERSION)
dnl libtool versioning
LT_RELEASE=$VERSION
LT_CURRENT=$VMEDAQ_MINOR_VERSION
LT_REVISION=$VMEDAQ_MICRO_VERSION
LT_AGE=$VMEDAQ_MINOR_VERSION
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AM_CONFIG_HEADER(config.h)
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
#dnl Initialize libtool
AM_PROG_LIBTOOL
AM_MAINTAINER_MODE
# Build time sanity check...
AM_SANITY_CHECK
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_F77
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_HEADER_STDC
dnl Check for GLib
PKG_CHECK_MODULES(GLIB, glib-2.0 gmodule-2.0)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
dnl Check for a libxml2
PKG_CHECK_MODULES(XML,libxml-2.0 >= 2.6.0 ,AC_DEFINE([HAS_LIBXML],1,'libxml present'))
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
PKG_CHECK_MODULES(LIBGLADE, libglade-2.0)
AC_SUBST(LIBGLADE_CFLAGS)
AC_SUBST(LIBGLADE_LIBS)
PKG_CHECK_MODULES(GTK, gtk+-2.0)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
# Check for ScrollKeeper.
AC_CHECK_PROG(have_scrollkeeper, scrollkeeper-config, yes, no)
AM_CONDITIONAL(HAVE_SCROLLKEEPER, test "$have_scrollkeeper" = "yes")
if test "$have_scrollkeeper" = "yes"; then
AC_DEFINE([HAS_SCROLLKEEPER],1,'scrollkeeper is there')
fi
dnl This is for the python part
AM_PATH_PYTHON(2.0)
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
PKG_CHECK_MODULES(DAQPP, DAQ++)
AC_SUBST(DAQPP_CFLAGS)
AC_SUBST(DAQPP_LIBS)
PKG_CHECK_MODULES(GTKHST, gtkhst >= 0.2.0)
AC_SUBST(GTKHST_CFLAGS)
AC_SUBST(GTKHST_LIBS)
dnl Check DAQcorba
has_daqcorba=no
corba=no
AC_ARG_ENABLE(corba,
[ --enable-corba Turn on CORBA stuff if present],
[case "${enableval}" in
yes) corba=yes ;;
no) corba=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-corba) ;;
esac],[corba=yes])
PKG_CHECK_MODULES(DAQcorba, DAQcorba,
[
has_daqcorba=true
],
[
DAQcorba_CFLAGS=
DAQcorba_LIBS=
AC_SUBST(DAQcorba_CFLAGS)
AC_SUBST(DAQcorba_LIBS)
AC_MSG_RESULT([***DAQcorba is not installed])
]
)
if test x$has_daqcorba = xtrue -a x$corba = xyes; then
AM_CONDITIONAL(DAQcorba,test x = x)
AC_DEFINE([HAS_DAQcorba],1,'DAQcorba is there')
else
AM_CONDITIONAL(DAQcorba, test x = y)
if test x$has_daqcorba = xtrue; then
AC_MSG_RESULT([***DAQcorba disabled])
fi
fi
dnl Checks for ROOT
use_root=no
has_root=no
AC_ARG_ENABLE(root,
[ --enable-root Turn on ROOT stuff if present],
[case "${enableval}" in
yes) use_root=yes ;;
no) use_root=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-corba) ;;
esac],[use_root=yes])
AM_PATH_ROOT(2.25.0,
has_root=true,
[ROOT_CFLAGS=
ROOT_LIBS=
AC_SUBST(ROOT_CFLAGS)
AC_SUBST(ROOT_LIBS)
]
)
if test x$has_root = xtrue -a x$use_root = xyes; then
AC_DEFINE([HAS_ROOT],1,'ROOT is there')
else
if test x$has_root = xtrue; then
AC_MSG_RESULT([***ROOT disabled])
fi
fi
dnl VME stuff
VME_CFLAGS=
VME_LIBS=
has_sis1100=false
has_nivxi=false
if test -d /home/gamma/vme; then
VME_CFLAGS="-I/home/gamma/sis1100/V1.0/linux-gnu/ -I/home/gamma/sis1100/V1.0/sis3100_calls/"
VME_LIBS="-L/home/gamma/sis1100/V1.0/sis3100_calls -l_sis3100_gpp"
AC_DEFINE([HAS_SIS1100],1,'Sis1100 VME system')
AC_DEFINE([HAS_VME],1,'VME present')
if test -e /dev/sis1100; then
AC_DEFINE([SYS_DEVICE],"/dev/sis1100",'SIS driver')
else
AC_DEFINE([SYS_DEVICE],"/tmp/sis1100",'SIS driver')
fi
has_sis1100=true
echo "System has SIS1100"
elif test -d /usr/local/sis1100/V2.02; then
VME_CFLAGS="-I/usr/local/sis1100/V2.02 -I/usr/local/sis1100/V2.02/sis3100_calls/"
VME_LIBS="-L/usr/local/sis1100/V2.02/sis3100_calls -l_sis3100"
AC_DEFINE([HAS_SIS1100],1,'Sis1100 VME system')
AC_DEFINE([HAS_VME],1,'VME present')
if test -e /dev/sis1100_00remote; then
AC_DEFINE([SIS_DEVICE],"/dev/sis1100_00remote",'SIS driver')
else
AC_DEFINE([SIS_DEVICE],"/tmp/sis1100_00remote",'SIS driver')
fi
has_sis1100=true
echo "System has SIS1100"
elif test -d /usr/local/nivxi; then
VME_CFLAGS="-DNIVXI -I/usr/local/nivxi/include"
VME_LIBS="-L/usr/local/nivxi/lib -lnivxi"
AC_DEFINE([HAS_NIVXI],1,'NI VXI system for VME')
AC_DEFINE([HAS_VME],1,'VME present')
has_nivxi=true
echo "System has NI-VXI"
else
AC_DEFINE([SYS_DEVICE],"*** None ***",'SIS driver')
VME_CFLAGS=""
VME_LIBS=""
echo "*** System does not have a VME interface ***"
fi
AC_SUBST(VME_CFLAGS)
AC_SUBST(VME_LIBS)
AM_CONDITIONAL(SIS1100, test x$has_sis1100 = xtrue)
AM_CONDITIONAL(NIVXI, test x$has_nivxi = xtrue)
dnl Check for libftdi
has_ftdi=false
AC_CHECK_LIB(ftdi, ftdi_init,[has_ftdi=true])
AM_CONDITIONAL(FTDI, test x$has_nivxi = xtrue)
has_gpib=false
if test -f /usr/local/lib/libgpib.a; then
GPIB_CFLAGS="-I/usr/local/nigpib"
GPIB_LIBS="-L/usr/local/lib -lgpib"
echo "System has a beta version of GPIB"
has_gpib=true
AC_DEFINE([HAS_GPIB],1,'Defined if GPIB is present in the system')
elif test -d /usr/local/natinst; then
GPIB_CFLAGS="-I/usr/local/include"
GPIB_LIBS="-L/usr/local/lib -lgpibapi"
echo "System has GPIB"
has_gpib=true
AC_DEFINE([HAS_GPIB],2,'Defined if GPIB is present in the system')
else
GPIB_CFLAGS=
GPIB_LIBS=
fi
AM_CONDITIONAL(GPIB, test x$has_gpib = xtrue)
AC_SUBST(GPIB_CFLAGS)
AC_SUBST(GPIB_LIBS)
CXXFLAGS="$CXXFLAGS -Wall"
CFLAGS="$CFLAGS -Wall"
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on compiler flags for debug],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],
[debug=false])
if test "$debug" = "true"; then
CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O2/-fno-inline/g'`
CFLAGS=`echo $CFLAGS | sed -e 's/-O2/-fno-inline/g'`
#else
# CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-O2/-O3/g'`
# CFLAGS=`echo $CFLAGS | sed -e 's/-O2/-O3/g'`
# AC_Check_CXXFLAGS("-mcpu=$march",has_mcpu_flag)
# AC_Check_CXXFLAGS("-msse2",has_sse2_flag)
# AC_Check_CXXFLAGS("-mfpmath=sse",has_mfpmath_flag)
# AC_Check_CXXFLAGS("-ffast-math",has_math_flag)
# AC_Check_CXXFLAGS("-fschedule-insns2",has_s1_flag)
# AC_Check_CXXFLAGS("-fomit-frame-pointer",has_s2_flag)
fi
AC_OUTPUT(
gui/Makefile
gui/glade/Makefile
config/Makefile
data/Makefile
daq/Makefile
modules/Makefile
modules/SIS3300/Makefile
modules/SIS3300/usb/Makefile
bin/Makefile
scripts/Makefile
test/Makefile
doc/VMEDAQ.doc
doc/Makefile
doc/html/Makefile
analysis/Makefile
analysis/fortran/Makefile
analysis/python/Makefile
analysis/python/corba/Makefile
analysis/python/test/Makefile
analysis/python/setup.py
analysis/c++/Makefile
making_a_module/Makefile
spydata/Makefile
Makefile
vmedaq.spec
vmedaq-modules.pc
vmedaq-f77.pc
vmedaq-c++.pc
)