dnl Process this file with autoconf to produce a configure script. AC_REVISION($Revision: 1.42.2.8 $) AC_PREREQ(2.53) AC_INIT(tulip, 1.2.5) AC_CONFIG_SRCDIR(library/tulip/include/tulip/SuperGraph.h) AM_INIT_AUTOMAKE(1.6 dist-bzip2) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE dnl version for libraries name (e.g. libtulip-1.2.so.x.x.x) TULIP_VERSION=1.2 AC_SUBST(TULIP_VERSION) dnl autoheader templates for config.h.in AH_TOP( #ifndef CONFIG_H #define CONFIG_H #if (__GNUC__ < 3) #define STL_EXT_NS std #define _DEPRECATED #else #define STL_EXT_NS __gnu_cxx #define _DEPRECATED __attribute__ ((deprecated)) #endif ) AH_BOTTOM( #endif //CONFIG_H ) dnl Checks for programs. dnl ensure CXXFLAGS is defined before calling AC_PROG_CXX CXXFLAGS=${CXXFLAGS} AC_LANG(C++) dnl uses C++ compiler and preprocessor for tests AC_PROG_CXX AC_PROG_CXXCPP dnl lex/yacc needed by thirdparty/lp_solve AC_PROG_YACC AM_PROG_LEX dnl AC_LIBTOOL_DLOPEN AC_LIBTOOL_PICMODE(no) AC_PROG_LIBTOOL dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC dnl not all gcc 2.95 based systems have the sstream header but strstream AC_CHECK_HEADERS(sstream,[], [ AC_MSG_NOTICE(generating a compatible sstream header) echo "// DO NOT MODIFY! This file is generated." > sstream echo "#ifndef __SSTREAM" >> sstream echo "#define __SSTREAM" >> sstream echo "#ifndef HAVE_SSTREAM" >> sstream echo "#include " >> sstream echo "#include " >> sstream echo "namespace std" >> sstream echo " {" >> sstream echo " class stringstream : public strstream" >> sstream echo " {" >> sstream echo " public:" >> sstream echo " stringstream() : strstream() { }" >> sstream echo " virtual ~stringstream() { }" >> sstream echo " string str()" >> sstream echo " {" >> sstream echo " *this << '\0';" >> sstream echo " char *tmp = strstream::str();" >> sstream echo " string retval(tmp);" >> sstream echo " strstream::freeze(0);" >> sstream echo " return retval;" >> sstream echo " }" >> sstream echo " };" >> sstream echo " }" >> sstream echo "#endif // HAVE_SSTREAM" >> sstream echo "#endif // __SSTREAM" >> sstream ] ) dnl Checks for X11, OpenGL, Qt AC_PATH_X AC_PATH_QT AC_PATH_QT_UIC AC_PATH_QT_MOC AC_PATH_GL dnl debug flag AC_ARG_ENABLE(debug, [ --enable-debug Compilation flags to allow debugging], CXXFLAGS="-O0 -Wall -g -pipe ${CXXFLAGS}", CXXFLAGS="-DNDEBUG -DQT_NO_DEBUG -O2 -pipe ${CXXFLAGS}" ) dnl check if we build tlprender, option and presence of OSMesa AC_ARG_ENABLE(tlprender, [ --disable-tlprender Disable compilation of tlprender (tlprender requires OSMesa)], CONFIGURE_tlprender="", CONFIGURE_tlprender="tlprender" ) if test ${CONFIGURE_tlprender} != "" then AC_CHECK_HEADERS(GL/osmesa.h, [], [CONFIGURE_tlprender="" AC_MSG_WARN([OSMesa header not found, will not build tlprender]) ]) fi if test ${CONFIGURE_tlprender} != "" then AC_CHECK_LIB(OSMesa, OSMesaCreateContext, [AC_DEFINE(HAVE_LIBOSMESA, 1, [libOSMesa present])], [CONFIGURE_tlprender="" AC_MSG_WARN([OSMesa library not found, will not build tlprender])], [${GL_INCLUDES} ${GL_LDFLAGS} ${LIB_GL}]) fi AC_SUBST(CONFIGURE_tlprender) # define TLP_INCLUDE, TLP_LDFLAGS, ... # it is *very* important to use top_srcdir for INCLUDE and top_builddir for LDFLAGS, # otherwise the target 'distcheck' will fail TULIP_INCLUDE='-I$(top_srcdir)/library/tulip/include -I$(top_srcdir)/library/tulip-geo/include' TULIP_LDFLAGS='-L$(top_builddir)/library/tulip/src -ltulip' TULIP_OGL_INCLUDE='-I$(top_srcdir)/library/tulip-ogl/include' TULIP_OGL_LDFLAGS='-L$(top_builddir)/library/tulip-ogl/src -ltulip-ogl' TULIP_QT_INCLUDE='-I$(top_srcdir)/library/tulip-qt/include' TULIP_QT_LDFLAGS='-L$(top_builddir)/library/tulip-qt/src -ltulip-qt' TULIP_PLUGINPATH='$(top_builddir)/plugins' TULIP_QTDESIGNERPLUGIN='$(top_builddir)/library/tulip-qt/.libs' AC_SUBST(TULIP_INCLUDE) AC_SUBST(TULIP_LDFLAGS) AC_SUBST(TULIP_OGL_INCLUDE) AC_SUBST(TULIP_OGL_LDFLAGS) AC_SUBST(TULIP_QT_INCLUDE) AC_SUBST(TULIP_QT_LDFLAGS) AC_SUBST(TULIP_QTDESIGNERPLUGIN) dnl Checks for library functions. LIB_IMAGES_LDFLAGS="" AC_CHECK_LIB(png, png_create_write_struct, [LIB_IMAGES_LDFLAGS="${LIB_IMAGES_LDFLAGS} -lpng" AC_DEFINE(HAVE_LIBPNG, 1, [libpng present]) PNG=true ]) AM_CONDITIONAL(PNG, test x$PNG = xtrue) AC_CHECK_LIB(jpeg, jpeg_std_error, [LIB_IMAGES_LDFLAGS="${LIB_IMAGES_LDFLAGS} -ljpeg" AC_DEFINE(HAVE_LIBJPEG, 1, [libjpeg present]) JPEG=true ]) AM_CONDITIONAL(JPEG, test x$JPEG = xtrue) AC_SUBST(LIB_IMAGES_LDFLAGS) dnl dnl configure thirdparty libraries and sets flags dnl AC_CONFIG_SUBDIRS(thirdparty/gle) LIBGLE_INCLUDE='-I$(top_srcdir)/thirdparty/gle/src' LIBGLE_LDFLAGS='-L$(top_builddir)/thirdparty/gle/src -lgle' AC_SUBST(LIBGLE_INCLUDE) AC_SUBST(LIBGLE_LDFLAGS) dnl gzstream ldflag points to top_srcdir dnl because it is a no_inst target and 'distcheck' makes the difference GZSTREAM_INCLUDE='-I$(top_srcdir)/thirdparty/gzstream' GZSTREAM_LDFLAGS=' $(top_srcdir)/thirdparty/gzstream/libgzstream.a ' AC_SUBST(GZSTREAM_INCLUDE) AC_SUBST(GZSTREAM_LDFLAGS) dnl ********** AC_OUTPUT( ${PACKAGE}-${VERSION}.spec:tulip.spec.in tulip-config Makefile library/Makefile library/tulip/Makefile library/tulip/include/Makefile library/tulip/src/Makefile library/tulip/examples/Makefile library/tulip/examples/Tutorial1/Makefile library/tulip-ogl/Makefile library/tulip-ogl/bitmaps/Makefile library/tulip-ogl/include/Makefile library/tulip-ogl/src/Makefile library/tulip-geo/Makefile library/tulip-geo/include/Makefile library/tulip-qt/Makefile library/tulip-qt/designer/Makefile library/tulip-qt/include/Makefile library/tulip-qt/src/Makefile thirdparty/Makefile thirdparty/gzstream/Makefile thirdparty/lp_solve/Makefile software/Makefile software/Tulip/Makefile software/Tulip/include/Makefile software/Tulip/src/Makefile software/Tulip/bitmaps/Makefile software/Tulip/designer/Makefile software/tlprender/Makefile software/tlprender/include/Makefile software/tlprender/src/Makefile software/bin/tulip software/bin/Makefile plugins/Makefile plugins/layout/Makefile plugins/metric/Makefile plugins/clustering/Makefile plugins/selection/Makefile plugins/import/Makefile plugins/export/Makefile plugins/sizes/Makefile plugins/colors/Makefile plugins/int/Makefile plugins/string/Makefile plugins/glyph/Makefile samples/Makefile samples/gml/Makefile samples/tlp/Makefile samples/posets/Makefile samples/matrix/Makefile, [chmod +x tulip-config] )