1 dnl Process this file with autoconf to produce a configure script.
2 dnl This is the configuration file for the tango system.
3 dnl To process this file into a runnable shell-script, please run
4 dnl the script `bootstrap' which is found in the same directory as
7 dnl For extensive help on autoconf, automake, and libtool, please
8 dnl consult the infofiles by running the `info' program, or by typing
9 dnl M-x info in your favourite editor (emacs)
11 dnl For information on how to build and use an autoconfiscated
12 dnl project, please consult
13 dnl http://sources.redhat.com/autobook/autobook/autobook.html
14 dnl which is an online version of the Gnu Autoconf, Automake, and Libtool
15 dnl book by Vaughan, Elliston, Tromey, and Taylor
17 dnl What follows is the configuration, and comments to the macros used
19 dnl AC_INIT initializes autoconf, The first argument is the
20 dnl packagename, the second is the version used for the tar file,
21 dnl the third is an email address for bug reports (shouldn't be necessary),
22 dnl and the fourth argument is
23 AC_INIT(Tango,6.1.1,tango@esrf.fr,tango)
25 dnl Tells autoconf that we want at least version 2.53 of autoconf to
26 dnl create configure from configure.in
29 dnl Lets the revision tag from cvs or rcs propagate into the
30 dnl configure script, handy for debugging.
31 AC_REVISION($Revision$)
33 dnl Tells autoconf to use the directory `config' to stash its files and
34 dnl look for additional macros.
35 AC_CONFIG_AUX_DIR(config)
37 dnl AM_INIT_AUTOMAKE sets up automake which is used to generate
38 dnl Makefile.in from Makefile.am
39 AM_INIT_AUTOMAKE($PACKAGE_TARNAME, $PACKAGE_VERSION)
41 dnl Tells automake to use `ac_config.h.tmp' to stash all the #defines
42 dnl that result from a run of configure.
43 dnl The name is .tmp since I must change the PACKAGE_ definitions because
44 dnl of omniORBS installation of their version of this file.
45 AM_CONFIG_HEADER(ac_config.h.tmp)
48 dnl -version-info CURRENT[:REVISION[:AGE]]
49 dnl From the libtool documentation (info libtool)
50 dnl So, libtool library versions are described by three integers:
53 dnl The most recent interface number that this library implements.
56 dnl The implementation number of the CURRENT interface.
59 dnl The difference between the newest and oldest interfaces that this
60 dnl library implements. In other words, the library implements all the
61 dnl interface numbers in the range from number `CURRENT - AGE' to
66 dnl Checks for programs.
67 AC_PROG_CXX dnl check for a c++ compiler
68 AC_PROG_CXXCPP dnl check for a c++ preprocessor
69 AC_PROG_CPP dnl check for a c preprocessor
70 AC_PROG_AWK dnl check for awk
71 AC_PROG_INSTALL dnl check for an install program
72 AC_PROG_LN_S dnl check if ln supports the -s switch
73 AC_PROG_MAKE_SET dnl check if make sets $(MAKE)
76 dnl Change ld and ar if we're using sunpro compiler
77 dnl Might as well disable static compiling on solaris
78 dnl since it doesn't work with sunpro at the moment.
81 if test "x$rssh_cv_check_sunpro_cc" = "xyes"; then
88 if test "$CXX" = "c++" -o "$CXX" = "g++"
90 gcc_AC_HAVE_GCC_VERSION(3,2,0)
91 if test "x$ac_cv_gcc_version_3_2_0" = "xno"; then
92 AC_MSG_ERROR([Not supported gcc release. Should be 3.2.0 or above. Please update !],-1)
97 dnl if test "$CXX" = "c++" -o "$CXX" = "g++"
99 dnl gcc_AC_HAVE_GCC_VERSION(3,2,0)
100 dnl if test "x$ac_cv_gcc_version_3_2_0" = "xno"; then
101 dnl AC_MSG_ERROR([Not supported gcc release. Should be 3.2.0 or above. Please update !],-1)
105 dnl Check if Java interpreter is there
107 AC_ARG_ENABLE([java],AC_HELP_STRING([--enable-java],[enable installation of Java applications]),
108 [],[enable_java=yes])
111 AC_HELP_STRING([--with-java],[path to java interpreter]),
112 [JAVA=${with_java}], [with_java=yes])
113 if test "x$enable_java" = "xyes" ; then
114 if test "x$with_java" = "xno" -o -z "$with_java"; then
118 if test "x$with_java" = "xyes"; then
119 AC_PATH_PROG(JAVA,java)
121 java_AC_HAVE_JAVA_VERSION($JAVA,1,5)
122 if test "x$ac_cv_java_version_1_5" = "xno"; then
123 AC_MSG_WARN([Not supported java release. Should be 1.5.x or above. Java will be disabled for this build!])
134 dnl Define a conditional variable to enable or disable installation
135 dnl of java applications. The variable is used in the Makefiles.
138 AM_CONDITIONAL(TANGO_JAVA_ENABLED, test x"$enable_java" != x"no")
141 dnl Check if doxygen is there
143 AC_ARG_WITH([doxygen],
144 AC_HELP_STRING([--with-doxygen],[path to doxygen utility]),
145 [DOXYGEN=${with_doxygen}],
146 [AC_PATH_PROG(DOXYGEN,doxygen)])
148 if test -z "$DOXYGEN"; then
149 DOXYGEN=NOT_INSTALLED
153 dnl Use libtool which facilitates the creation of shared libraries
156 dnl Taurel didn't want -g nor -0, so we blank it.
159 dnl Checks for Python. Comment in if needed
162 dnl check for the presence of zlib
165 dnl This macro checks for omniorb and sets various defines, please
166 dnl consult config/RSSH_CHECK_OMNIORB for more details
172 CXXFLAGS=$IDLCXXFLAGS
176 dnl We abort the configuration if we haven't found a CORBA_H file.
177 if test "x$CORBA_H" = "x"
179 AC_MSG_ERROR("Please install omniorb or use --with-omni to indicate its location")
182 dnl This macro checks for omninotify and sets various defines, please
183 dnl consult config/RSSH_CHECK_OMNINOTIFY for more details
184 dnl RSSH_CHECK_OMNINOTIFY
186 dnl We abort the configuration if we haven't found a OMNINOTIFY_H file.
187 dnl if test "x$OMNINOTIFY_H" = "x"
189 dnl AC_MSG_ERROR("Please install omniNotify or use --with-omniNotify to indicate its location")
192 dnl We need to define some stuff for threads and stubs
196 AC_DEFINE(_POSIX_PTHREAD_SEMANTICS,1,"Needed for threads on solaris")
197 CXXFLAGS="$CXXFLAGS -D_POSIX_PTHREAD_SEMANTICS"
200 AC_DEFINE(_REENTRANT,1,"Needed for threads on Linux")
201 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
204 AC_DEFINE(_REENTRANT,1,"Needed for threads on darwin")
205 CXXFLAGS="$CXXFLAGS -D_REENTRANT -D__darwin__"
209 dnl condition used in the Makefile of the Tango library
210 AM_CONDITIONAL(DARWIN_ENABLED,test x"$DARWIN" = x"yes" )
213 dnl we want to include the omniORB stubs into the tango library
214 CXXFLAGS="$CXXFLAGS -DOMNI_UNLOADABLE_STUBS"
218 AC_CHECK_LIB(dl, dlopen)
219 dnl checks for libnsl
220 AC_CHECK_LIB(nsl, svc_pollfd)
221 dnl checks for libposix4
222 AC_CHECK_LIB(posix4, nanosleep)
223 dnl checks for libpthread
224 AC_CHECK_LIB(pthread, pthread_create)
225 dnl checks for libsocket
226 AC_CHECK_LIB(socket, getprotobyname)
228 dnl Checks for header files.
230 AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h)
232 dnl Some hack for testing if we have sstream or not.
235 if test "x$GCC" = "xyes"; then
236 case `$CC --version 2>/dev/null` in
237 [[12]].*) use_sstream=no ;;
238 *) use_sstream=yes ;;
241 if test "x$use_sstream" = "xyes"; then
244 dnl This needs to be worked on!!
246 if test "x$use_sstream" = "xno"; then
249 AC_CHECK_HEADER(strstream, AC_DEFINE(HAVE_STRSTREAM,1,""))
252 dnl Checks for typedefs, structures, and compiler characteristics.
260 dnl Checks for library functions.
264 AC_CHECK_FUNCS(gethostname gettimeofday exit tolower)
265 AC_CXX_HAVE_CLASS_STRSTREAM
267 dnl check for the presence of the mysql program, needed when doing the
268 dnl install of the DataBaseds server. You can tweak the connection
269 dnl with some --with variables. ./configure --help will, uhm, help you.
271 AC_ARG_ENABLE([dbserver],AC_HELP_STRING([--enable-dbserver],[enable installation of Tango database server]),
272 [],[enable_dbserver=yes])
273 enable_db_schema_create=no
275 AS_IF([test "x$enable_dbserver" = "xyes"], [
277 dnl We need libmysqlclient to compile
278 dnl finds it for us. Abort if no mysqlclientlibs are found
281 if test "x$MYSQLCLIENT_CFLAGS" = "x"
283 AC_MSG_WARN(No libmysqlclient libs found)
287 AC_PATH_PROG(MYSQL, mysql, nocommand)
288 MYSQL_VERSION=not_found
290 if test "$MYSQL" != nocommand; then
291 mysql_AC_HAVE_MYSQL_VERSION($MYSQL,5,0)
292 if test "x$ac_cv_mysql_version_5_0" = "xno"; then
293 AC_MSG_WARN([Not supported mysql release. Should be 5.0.x or above. Please update !],-1)
294 enable_db_schema_create=no
296 enable_db_schema_create=yes
299 enable_db_schema_create=no
303 dnl check for a database schema update
305 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
307 AC_ARG_ENABLE([dbcreate],AC_HELP_STRING([--enable-dbcreate],[enable an creation of the Tango database schema]),
308 [],[enable_dbcreate=yes])
309 enable_db_schema_create=$enable_dbcreate
311 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
315 dnl Hacks to provide the name for the tango
316 dnl database. I havent found any other way to provide these arguments.
317 AC_ARG_WITH(tango-db-name, AC_HELP_STRING([--with-tango-db-name],[the name of the tango database (default tango)]), TANGO_DB_NAME=${with_tango_db_name}, TANGO_DB_NAME=tango)
319 dnl Here we define these constants so that they're reachable from c programs
320 AC_DEFINE_UNQUOTED(TANGO_DB_NAME, "$TANGO_DB_NAME", The tango database name)
322 dnl Here we propagate the constants into the makefiles.
323 AC_SUBST(TANGO_DB_NAME)
328 dnl Define a conditional variables to enable or disable installation
329 dnl of the database server and the database schema creation.
330 dnl The variables are used in the Makefiles.
333 AM_CONDITIONAL(TANGO_DB_SERVER_ENABLED, test x"$enable_dbserver" = x"yes")
334 AM_CONDITIONAL(TANGO_DB_CREATE_ENABLED, test x"$enable_db_schema_create" = x"yes")
339 AC_SUBST(VERSION_INFO)
341 DATADIR=`eval echo $datadir`
342 DATADIR=`eval echo $DATADIR`
348 dnl This is a hack to change PACKAGE_ #defines into TANGO_PACKAGE
349 AC_CONFIG_COMMANDS(ac_config.h,
350 sed s/PACKAGE/TANGO_PACKAGE/g <ac_config.h.tmp>ac_config.h)
352 dnl configure log4tango sub-package
353 AC_CONFIG_SUBDIRS(lib/cpp/log4tango)
355 dnl All the Makefiles to be generated.
360 lib/cpp/server/Makefile
361 lib/cpp/server/idl/Makefile
362 lib/cpp/client/Makefile
363 lib/cpp/client/helpers/Makefile
365 cppserver/database/Makefile
366 cppserver/database/create_db.sql
367 cppserver/database/create_db.sh
368 cppserver/database/my.cnf
369 cppserver/database/stored_proc.sql
370 cppserver/database/create_db_tables.sql
371 cppserver/database/update_db.sql
372 cppserver/starter/Makefile
373 cppserver/tangotest/Makefile
375 utils/notifd2db/Makefile
389 scripts/synopticappli
393 templates/pogo/cpp/Makefile)
397 Configuration ($PACKAGE):
399 Source code location: ${srcdir}
401 Compiler: ${ac_ct_CC},${ac_ct_CXX}
403 OMNIORB PATH: ${OMNI_ROOT}
404 OMNIORB VERSION: ${OMNI_VERSION}
406 JAVA PATH: ${with_java}
407 JAVA VERSION: ${JAVA_VERSION}
409 MYSQL CLIENT LIB: ${MYSQLCLIENT_LDFLAGS} ${MYSQLCLIENT_LIBS}
410 MYSQL VERSION: ${MYSQL_VERSION}
411 MYSQL CONNECTION: ${MYSQL_CONNECTION}
414 libraries: ${enable_lib}
415 java application: ${enable_java}
416 database server: ${enable_dbserver}
417 database schema create: ${enable_db_schema_create}
419 Please check whether the configuration I detected matches what you
422 ATTENTION: To run the new database server you must have MySQL 5.x installed
423 and to update your database schema with the update_db.sql script!