dnl This is the configuration script for ggobi dnl to be used when installing it. (It is not dnl necessarily used in development versions.) dnl This tries to find the optional elements dnl of ggobi such as dnl XML dnl MySQL, Postgres, etc. dnl Properties library from Omega. dnl This also determines where the gtk-config dnl executable is. AC_INIT(src/ggobi.c) # Get the version information. . src/VersionInfo if test -d CVS ; then GGOBI_VERSION_STRING="CVS version (`date`)" fi GGOBI_HOME=`pwd` AC_ARG_ENABLE(embed, [--enable-embed Build the ggobi library for embedding in other applications (e.g. R)]) AC_ARG_ENABLE(debug, [--enable-debug Compile with debugging symbols]) AC_ARG_WITH(prefix, [--with-prefix Specify where the files are to be installed (default /usr/local/).],INSTALL_DIR=${with_prefix},INSTALL_DIR="/usr/local") AC_ARG_WITH(xml, --with-xml Enable reading and writing of XML datasets.) AC_ARG_WITH(mysql, --with-mysql Enable reading data from MySQL databases., USE_MYSQL=1) AC_ARG_WITH(R,--with-R Install the Rggobi package) AC_ARG_WITH(Python,--with-Python Install the Pythonggobi module) AC_ARG_WITH(Perl,--with-Perl Install the Perlggobi module) dnl Check for gtk-config. dnl We are not going anywhere without that. AC_PATH_PROG(GTK_CONFIG, gtk-config, "", $PATH) if test "${GTK_CONFIG}" = "" ; then echo "Cannot find gtk-config" exit 1 fi AC_PATH_PROG(UNAME, uname) if test -n "${UNAME}" ; then OS_INFO=`uname -a` fi DEFAULT_LIB_DIRS="/usr/lib /usr/local/lib /opt/lib" DEFAULT_INC_DIRS="/usr/include /usr/local/include /usr/local/src/include /usr/include/gnome-xml" AC_PROG_CC LO_DIR=. c_rules_frag=.CRulesFrag if test "${GCC}" = "yes" ; then PIC_CFLAG=-fPIC SHLIB_LDFLAGS=-shared LO_DIR=. cat << \EOF > ${c_rules_frag} %.o: %.c $(CC) $(CFLAGS) -static $(OTHER_FLAGS) -c $< -o $@ # Just copy the .o to .lo since the .o is position independent # and relocatable by default with gcc. # (Could be a symbolic link also) %.lo: %.o cp $*.o $@ EOF else dnl assume Solari's cc compiler PIC_CFLAG=-KPIC OTHER_CFLAGS="-DG_INLINE_FUNC=extern" SHLIB_LDFLAGS=-G LO_DIR=.libs cat << \EOF > ${c_rules_frag} %.lo: %.c @test -d ${LO_DIR} || mkdir ${LO_DIR} $(CC) $(PIC_CFLAG) $(CFLAGS) $(OTHER_CFLAGS) -c $< -o ${LO_DIR}/$*.o mv ${LO_DIR}/$*.o $*.lo EOF fi AC_SUBST(OTHER_CFLAGS) AC_SUBST_FILE(c_rules_frag) dnl Start looking for the XML libraries. if test -n "${with_xml}" ; then echo "with_xml: ${with_xml}" dnl If the user gave us a --with-xml=value, dnl then use that as the setting for the include dnl and lib directory. if test -d ${with_xml} ; then XML_INC_DIRS=${with_xml} XML_LIB_DIRS="${with_xml} ${with_xml}/.libs" dnl Have to get a version that can be used in LD_LIBRARY_PATH, dnl i.e. with the spaces replaced by : XML_LIB_DIRS_PATH=`echo "${with_xml} ${with_xml}/.libs" | sed -e 's/[ \t]*/:/g'` fi dnl Now find the libxml-1.8.* ORIG_CPPFLAGS=$CPPFLAGS for f in $XML_INC_DIRS ${DEFAULT_INC_DIRS} ; do for ext in / /xml ; do TMP="" if test -f $f$ext/parser.h ; then TMP=$f$ext XML_INC_DIRS=${TMP} fi dnl CPPFLAGS="${ORIG_CPPFLAGS} -I$f$ext" dnl AC_CHECK_HEADER(parserInternals.h, XML_INC_DIRS=$f$ext) if test "${TMP}" != "" ; then echo "Found XML include file(s): $XML_INC_DIRS, $TMP" break fi done if test "${TMP}" != "" ; then break; fi done dnl now we should test for the library. if test "${TMP}" = "" ; then echo "Cannot find the XML header files. Please specify these via" echo "--with-xml=, or by setting the XML_INC_DIRS environment variable." exit 2 else XML_UTILS=xmlConvert USE_XML="USE_XML=1" XML_SRC="read_xml.c write_xml.c" XML_CFLAG_DEFINES="-DUSE_XML=1" enable_embed="yes" dnl -DDIR_SEPARATOR=\"'/'\"" fi fi if test -n "${with_R}" ; then if test -d Rggobi ; then WITH_R=1 AC_PATH_PROG(R_BIN,R,[Cannot find the R executable]) if test -d $with_R ; then R_PKG_DIR="-l $with_R" fi PACKAGES="Rggobi ${PACKAGES}" else echo "" echo "**Error" echo "You cannot install the Rggobi interface without first downloading Rggobi.tar.gz" echo "and then un-tarring it" echo "" fi fi if test -n "${USE_MYSQL}" ; then echo "with_mysql: ${with_mysql}" MYSQL_SRC=read_mysql.c if test -d ${with_mysql} ; then MYSQL_INC_DIRS=$with_mysql MYSQL_LIB_DIRS=$with_mysql fi dnl Now find libmysqlclient if test -z "${MYSQL_INC_DIRS}" ; then ORIG_CPPFLAGS=$CPPFLAGS for f in ${DEFAULT_INC_DIRS} ; do for ext in "/" "/mysql" ; do CPPFLAGS="${ORIG_CPPFLAGS} -I$f$ext" echo "Checking $f$ext" if test -f $f$ext/mysql.h ; then MYSQL_INC_DIRS=$f$ext fi dnl AC_CHECK_HEADER(mysql.h, MYSQL_INC_DIRS=$f$ext) if test -n "${MYSQL_INC_DIRS}" ; then echo "Found MYSQL include file(s): $MYSQL_INC_DIRS" break fi done done fi # end of test -z "${MYSQL_INC_DIRS}" if test -z "${MYSQL_LIB_DIRS}" ; then ORIG_LIBS=$LIBS LIBS="$LIBS -L/usr/lib" AC_CHECK_LIB(xml,xmlCreateFileParserCtxt) if test -z "${HAVE_LIBxml}" ; then echo "Cannot find libxml" exit 1; else echo "Using libmysql from ${LIBS}" fi fi USE_MYSQL="USE_MYSQL=1" MYSQL_DEPENDS="lib/libProps.so" else MYSQL_DEPENDS="" fi AC_SUBST(MYSQL_DEPENDS) TOP=`pwd` MV=mv if test "${enable_embed}" = "yes" ; then EMBED="lib/libggobi.so" fi GGOBI_ROOT=`pwd` AC_SUBST(GGOBI_ROOT) AC_SUBST(EMBED) AC_SUBST(MV) AC_SUBST(TOP) AC_SUBST(XML_UTILS) AC_SUBST(USE_XML) AC_SUBST(XML_CFLAG_DEFINES) AC_SUBST(USE_MYSQL) if test -n "${USE_XML}" ; then SUPPORTS_XML="yes" else SUPPORTS_XML="no" fi AC_SUBST(SUPPORTS_XML) AC_SUBST(XML_SRC) AC_SUBST(MYSQL_SRC) AC_SUBST(XML_INC_DIRS) AC_SUBST(XML_LIB_DIRS) AC_SUBST(XML_LIB_DIRS_PATH) AC_SUBST(MYSQL_INC_DIRS) AC_SUBST(MYSQL_LIB_DIRS) AC_SUBST(GGOBI_HOME) AC_SUBST(INSTALL_DIR) AC_SUBST(PACKAGES) AC_SUBST(R_PKG_DIR) AC_SUBST(R_BIN) AC_SUBST(MAJOR_VERSION) AC_SUBST(MINOR_VERSION) AC_SUBST(PATCH_LEVEL) AC_SUBST(GTK_CONFIG) if test -n "${enable_debug}" && test "${enable_debug}" != "no" ; then SRC_DEBUG=-g fi AC_SUBST(SRC_DEBUG) SRC_CFLAGS="-I${TOP}/include" SRC_LIBS="-L${TOP}/lib -lggobi" AC_SUBST(SRC_CFLAGS) AC_SUBST(SRC_LIBS) AC_SUBST(PIC_CFLAG) AC_SUBST(SHLIB_LDFLAGS) AC_SUBST(LO_DIR) AC_SUBST(OS_INFO) AC_SUBST(GGOBI_VERSION_STRING) AC_SUBST(GGOBI_RELEASE_DATE) dnl These go into config.h as #define entries. AC_DEFINE_UNQUOTED(GGOBI_VERSION_STRING, "$GGOBI_VERSION_STRING") AC_DEFINE_UNQUOTED(GGOBI_RELEASE_DATE, "$GGOBI_RELEASE_DATE") AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION) AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION) AC_DEFINE_UNQUOTED(PATCH_LEVEL, $PATCH_LEVEL) AC_CONFIG_HEADER(src/config.h) AC_OUTPUT(Makeconf GNUmakefile src/GNUmakefile gtkext/src/GNUmakefile bin/setLD.csh bin/setLD.bsh bin/ggobi bin/ggobi-config bugTemplate) chmod +x bin/ggobi chmod +x bin/ggobi-config