1 # Process this file with autoconf to produce a configure script.
2 # This is the configuration file for the tango system.
3 # To process this file into a runnable shell-script, please run
4 # the script `bootstrap' which is found in the same directory as
7 # For extensive help on autoconf, automake, and libtool, please
8 # consult the infofiles by running the `info' program, or by typing
9 # M-x info in your favourite editor (emacs)
11 # For information on how to build and use an autoconfiscated
12 # project, please consult
13 # http://sources.redhat.com/autobook/autobook/autobook.html
14 # which is an online version of the Gnu Autoconf, Automake, and Libtool
15 # book by Vaughan, Elliston, Tromey, and Taylor
17 # What follows is the configuration, and comments to the macros used
19 # AC_INIT initializes autoconf, The first argument is the
20 # packagename, the second is the version used for the tar file,
21 # the third is an email address for bug reports (shouldn't be necessary),
22 # and the fourth argument is
23 AC_INIT(Tango,9.2.5a,info@tango-controls.org,tango)
24 AC_CONFIG_AUX_DIR(config)
25 AC_CONFIG_MACRO_DIR([m4])
27 # Tells autoconf that we want at least version 2.53 of autoconf to
28 # create configure from configure.ac
34 # Lets the revision tag from cvs or rcs propagate into the
35 # configure script, handy for debugging.
36 AC_REVISION($Revision$)
38 # AM_INIT_AUTOMAKE sets up automake which is used to generate
39 # Makefile.in from Makefile.am
41 AM_SILENT_RULES([yes])
43 # Tells automake to use `ac_config.h.tmp' to stash all the #defines
44 # that result from a run of configure.
45 # The name is .tmp since I must change the PACKAGE_ definitions because
46 # of omniORBS installation of their version of this file.
47 AC_CONFIG_HEADERS(ac_config.h.tmp)
50 # -version-info CURRENT[:REVISION[:AGE]]
51 # From the libtool documentation (info libtool)
52 # So, libtool library versions are described by three integers:
55 # The most recent interface number that this library implements.
58 # The implementation number of the CURRENT interface.
61 # The difference between the newest and oldest interfaces that this
62 # library implements. In other words, the library implements all the
63 # interface numbers in the range from number `CURRENT - AGE' to
68 # Checks for programs.
80 if test "$CXX" = "c++" -o "$CXX" = "g++"
82 gcc_AC_HAVE_GCC_VERSION(3,2,0)
83 if test "x$ac_cv_gcc_version_3_2_0" = "xno"; then
84 AC_MSG_ERROR([Not supported gcc release. Should be 3.2.0 or above. Please update !],-1)
88 # Check if compiler support C++11
90 AX_CXX_COMPILE_STDCXX_11([noext],[optional])
92 # Check if Java interpreter is there
94 AC_ARG_ENABLE([java],AC_HELP_STRING([--enable-java],[enable installation of Java applications]),
97 AC_ARG_ENABLE([mariadb],AC_HELP_STRING([--enable-mariadb],[enable mariadb instead of mysql]),
98 [enable_mariadb=yes],[enable_mariadb=no])
101 AC_HELP_STRING([--with-java],[path to java interpreter]),
102 [JAVA=${with_java}], [with_java=yes])
104 if test "x$enable_java" = "xyes" ; then
105 if test "x$with_java" = "xno" -o -z "$with_java"; then
109 if test "x$with_java" = "xyes"; then
110 AC_PATH_PROG(JAVA,java,"notfound")
112 if test "x$JAVA" != "xnotfound"; then
113 java_AC_HAVE_JAVA_VERSION($JAVA,1,7)
114 if test "x$ac_cv_java_version_1_7" = "xno"; then
115 AC_MSG_WARN([Not supported java release. Should be 1.7.x or above. Java will be disabled for this build!])
130 # Define a conditional variable to enable or disable installation
131 # of java applications. The variable is used in the Makefiles.
134 AM_CONDITIONAL(TANGO_JAVA_ENABLED, test x"$enable_java" != x"no")
136 # Check if doxygen is there
138 AC_ARG_WITH([doxygen],
139 AC_HELP_STRING([--with-doxygen],[path to doxygen utility]),
140 [DOXYGEN=${with_doxygen}],
141 [AC_PATH_PROG(DOXYGEN,doxygen)])
143 if test -z "$DOXYGEN"; then
144 DOXYGEN=NOT_INSTALLED
147 # Check if lyx is there
150 AC_HELP_STRING([--with-lyx],[path to LyX utility]),
152 [AC_PATH_PROG(LYX,lyx)])
154 if test -z "$LYX"; then
158 AM_CONDITIONAL(TANGO_LYX_ENABLED, test x"$LYX" != x"false")
160 # Check if fig2dev is there
162 AC_ARG_WITH([fig2dev],
163 AC_HELP_STRING([--with-fig2dev],[path to fig2dev utility]),
164 [FIG2DEV=${with_fig2dev}],
165 [AC_PATH_PROG(FIG2DEV,fig2dev)])
167 if test -z "$FIG2DEV"; then
171 AM_CONDITIONAL(TANGO_FIG2DEV_ENABLED, test x"$FIG2DEV" != x"false")
172 AM_CONDITIONAL(TANGO_DOC_ENABLED, test x"$LYX" != x"false" && test x"$FIG2DEV" != x"false")
175 # Use libtool which facilitates the creation of shared libraries
178 # check for the presence of zlib
181 # This macro checks for omniorb and sets various defines, please
182 # consult config/RSSH_CHECK_OMNIORB for more details
189 AC_ARG_WITH(zmq, AC_HELP_STRING([--with-zmq],[prefix to ZMQ installation]) ,\
190 ZMQ_PREFIX=${with_zmq} , ZMQ_PREFIX=/usr/local )
192 PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${ZMQ_PREFIX}/lib/pkgconfig
194 PKG_CHECK_MODULES([LIBZMQ], [libzmq >= 4.0.5],[],AC_MSG_ERROR(Missing ZMQ library - Use --with-zmq configure option or add directory containing libzmq.pc to PKG_CONFIG_PATH environment variable))
195 ZMQ_VERSION=`eval pkg-config --modversion libzmq`
196 ZMQ_ROOT=`eval pkg-config --variable=prefix libzmq`
199 # We need to define some stuff for threads and stubs
203 AC_DEFINE(_REENTRANT,1,"Needed for threads on Linux")
204 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
207 AC_DEFINE(_REENTRANT,1,"Needed for threads on darwin")
208 CXXFLAGS="$CXXFLAGS -D_REENTRANT -D__darwin__"
212 # condition used in the Makefile of the Tango library
213 AM_CONDITIONAL(DARWIN_ENABLED,test x"$DARWIN" = x"yes" )
216 # we want to include the omniORB stubs into the tango library
217 CXXFLAGS="$CXXFLAGS -DOMNI_UNLOADABLE_STUBS"
221 AC_CHECK_LIB(dl, dlopen)
223 AC_CHECK_LIB(nsl, svc_pollfd)
224 # checks for libposix4
225 AC_CHECK_LIB(posix4, nanosleep)
226 # checks for libpthread
227 AC_CHECK_LIB(pthread, pthread_create)
228 # checks for libsocket
229 AC_CHECK_LIB(socket, getprotobyname)
231 # Checks for header files.
233 AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h)
235 # Some hack for testing if we have sstream or not.
238 if test "x$GCC" = "xyes"; then
239 case `$CC --version 2>/dev/null` in
240 [[12]].*) use_sstream=no ;;
241 *) use_sstream=yes ;;
244 if test "x$use_sstream" = "xyes"; then
247 # This needs to be worked on!!
249 if test "x$use_sstream" = "xno"; then
252 AC_CHECK_HEADER(strstream, AC_DEFINE(HAVE_STRSTREAM,1,""))
255 # Checks for typedefs, structures, and compiler characteristics.
263 # Checks for library functions.
267 AC_CHECK_FUNCS(gethostname gettimeofday exit tolower)
268 AC_CXX_HAVE_CLASS_STRSTREAM
270 # check for the presence of the mysql program, needed when doing the
271 # install of the DataBaseds server. You can tweak the connection
272 # with some --with variables. ./configure --help will, uhm, help you.
274 AC_ARG_ENABLE([dbserver],AC_HELP_STRING([--enable-dbserver],[enable installation of Tango database server]),
275 [],[enable_dbserver=yes])
276 enable_db_schema_create=no
278 AC_ARG_WITH(tango-rc-file, AC_HELP_STRING([--with-tango-rc-file],[location of the tango rc file (default /etc/tangorc)]), TANGO_RC_FILE=${with_tango_rc_file}, TANGO_RC_FILE=/etc/tangorc)
279 AC_DEFINE_UNQUOTED(TANGO_RC_FILE, "$TANGO_RC_FILE", The tango rc file name and location)
280 AC_SUBST(TANGO_RC_FILE)
282 # Hacks to provide the name for the tango
283 # database. I havent found any other way to provide these arguments.
284 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)
286 # Here we define these constants so that they're reachable from c programs
287 AC_DEFINE_UNQUOTED(TANGO_DB_NAME, "$TANGO_DB_NAME", The tango database name)
289 # Here we propagate the constants into the makefiles.
290 AC_SUBST(TANGO_DB_NAME)
292 if test "x$enable_mariadb" != "xyes" ; then
294 AS_IF([test "x$enable_dbserver" = "xyes"], [
296 # We need libmysqlclient to compile
297 # finds it for us. Abort if no mysqlclientlibs are found
300 if test "x$MYSQLCLIENT_CFLAGS" = "x"
302 AC_MSG_WARN(No libmysqlclient libs found)
306 DB_LDFLAGS=${MYSQLCLIENT_LDFLAGS}
307 DB_LDLIBS=${MYSQLCLIENT_LIBS}
308 DB_CFLAGS=${MYSQLCLIENT_CFLAGS}
310 AC_PATH_PROG(MYSQL, mysql, nocommand)
311 MYSQL_VERSION=not_found
313 if test "x$MYSQL" != "xnocommand"; then
314 mysql_AC_HAVE_MYSQL_VERSION($MYSQL,5,5)
315 if test "x$ac_cv_mysql_version_5_5" = "xno"; then
316 AC_MSG_WARN([Not supported mysql release. Should be 5.5.x or above. Please update !],-1)
317 enable_db_schema_create=no
320 enable_db_schema_create=yes
323 enable_db_schema_create=no
327 # check for a database schema update
329 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
331 AC_ARG_ENABLE([dbcreate],AC_HELP_STRING([--enable-dbcreate],[enable an creation of the Tango database schema]),
332 [],[enable_dbcreate=yes])
333 enable_db_schema_create=$enable_dbcreate
335 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
342 if test "x$MYSQL_VERSION" != "xnot_found"; then
343 DB_VERSION=${MYSQL_VERSION}
347 AS_IF([test "x$enable_dbserver" = "xyes"], [
349 # We need libmysqlclient to compile
350 # finds it for us. Abort if no mysqlclientlibs are found
352 AM_PATH_MARIADBCLIENT
353 if test "x$MARIADBCLIENT_CFLAGS" = "x"
355 AC_MSG_WARN(No libmariadbclient libs found)
359 DB_LDFLAGS=${MARIADBCLIENT_LDFLAGS}
360 DB_LDLIBS=${MARIADBCLIENT_LIBS}
361 DB_CFLAGS=${MARIADBCLIENT_CFLAGS}
363 AC_PATH_PROG(MYSQL, mysql, nocommand)
364 MARIADB_VERSION=not_found
366 if test "x$MYSQL" != "xnocommand"; then
367 mariadb_AC_HAVE_MARIADB_VERSION($MYSQL,10,0)
368 if test "x$ac_cv_mariadb_version_10_0" = "xno"; then
369 AC_MSG_WARN([Not supported mariadb release. Should be 10.0.x or above. Please update !],-1)
370 enable_db_schema_create=no
373 enable_db_schema_create=yes
376 enable_db_schema_create=no
380 # check for a database schema update
382 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
384 AC_ARG_ENABLE([dbcreate],AC_HELP_STRING([--enable-dbcreate],[enable an creation of the Tango database schema]),
385 [],[enable_dbcreate=yes])
386 enable_db_schema_create=$enable_dbcreate
388 AS_IF([test "x$enable_db_schema_create" = "xyes"], [
395 if test "x$MARIADB_VERSION" != "xnot_found"; then
396 DB_VERSION=${MARIADB_VERSION}
406 # Build the jpeg library compilation option
409 AC_ARG_ENABLE([jpegmmx],
410 [AS_HELP_STRING([--disable-jpegmmx],[disable jpeg mmx optimization])],
411 [],[enable_jpegmmx=yes])
413 JPEG_LIB_CXXFLAGS="-D_TANGO_LIB"
414 JPEG_MMX_LIB_CXXFLAGS="-D_TANGO_LIB"
416 if test "x$enable_jpegmmx" != xno; then
419 JPEG_LIB_CXXFLAGS="-D_TANGO_LIB -DJPG_USE_ASM"
420 JPEG_MMX_LIB_CXXFLAGS="-D_TANGO_LIB -mmmx -DJPG_USE_ASM"
425 AC_SUBST(JPEG_LIB_CXXFLAGS)
426 AC_SUBST(JPEG_MMX_LIB_CXXFLAGS)
428 # Define a conditional variables to enable or disable installation
429 # of the database server and the database schema creation.
430 # The variables are used in the Makefiles.
433 AM_CONDITIONAL(TANGO_DB_SERVER_ENABLED, test x"$enable_dbserver" = x"yes")
434 AM_CONDITIONAL(TANGO_DB_CREATE_ENABLED, test x"$enable_db_schema_create" = x"yes")
439 AC_SUBST(VERSION_INFO)
441 DATADIR=`eval echo $datadir`
442 DATADIR=`eval echo $DATADIR`
449 AC_SUBST(JNI_INCL_DIRS)
451 # This is a hack to change PACKAGE_ #defines into TANGO_PACKAGE
452 AC_CONFIG_COMMANDS(ac_config.h,
453 sed s/PACKAGE/TANGO_PACKAGE/g <ac_config.h.tmp>ac_config.h)
455 # configure log4tango sub-package
456 AC_CONFIG_SUBDIRS(lib/cpp/log4tango)
458 # All the Makefiles to be generated.
464 lib/cpp/server/Makefile
465 lib/cpp/server/idl/Makefile
466 lib/cpp/server/jpeg/Makefile
467 lib/cpp/server/jpeg_mmx/Makefile
468 lib/cpp/client/Makefile
469 lib/cpp/client/helpers/Makefile
472 cppserver/database/Makefile
473 cppserver/database/create_db.sql
474 cppserver/database/create_db.sh
475 cppserver/database/my.cnf
476 cppserver/database/stored_proc.sql
477 cppserver/database/create_db_tables.sql
478 cppserver/database/update_db.sh
479 cppserver/database/update_db.sql
480 cppserver/database/update_db8.sql
481 cppserver/database/update_db7.sql
482 cppserver/database/rem_history.sql
483 cppserver/starter/Makefile
484 cppserver/tangotest/Makefile
485 cppserver/AbstractClass/Makefile
486 cppserver/AbstractClass/AccessControl/Makefile
487 cppserver/tangoaccesscontrol/Makefile
489 utils/tango_admin/Makefile
496 doc/src/ds_writing/Makefile
497 doc/src/ds_model/Makefile
498 doc/src/dance/Makefile
499 doc/src/java_api/Makefile
500 doc/src/java_api/picture/Makefile
501 doc/src/gen_api/Makefile
502 doc/src/advanced/Makefile
504 pogo/templates/Makefile
505 pogo/preferences/Makefile
506 pogo/templates/cpp/Makefile)
510 Configuration ($PACKAGE):
512 Source code location: ${srcdir}
514 Compiler: ${ac_ct_CC},${ac_ct_CXX}
516 OMNIORB PATH: ${OMNI_ROOT}
517 OMNIORB VERSION: ${OMNI_VERSION}
519 ZMQ PATH: ${ZMQ_ROOT}
520 ZMQ VERSION: ${ZMQ_VERSION}
522 JAVA PATH: ${with_java}
523 JAVA VERSION: ${JAVA_VERSION}
525 ${DB_NAME} CLIENT LIB: ${DB_LDFLAGS} ${DB_LDLIBS}
526 ${DB_NAME} VERSION: ${DB_VERSION}
527 ${DB_NAME} CONNECTION: ${MYSQL_CONNECTION}
530 libraries: ${enable_lib}
531 java application: ${enable_java}
532 access control server: ${enable_dbserver}
533 database server: ${enable_dbserver}
534 database schema create: ${enable_db_schema_create}
536 Please check whether the configuration I detected matches what you