1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(libconfig, 1.6, hyperrealm@gmail.com, libconfig,
4 [http://www.hyperrealm.com/main.php?s=libconfig])
5 AC_CONFIG_AUX_DIR([aux-build])
6 AC_CONFIG_MACRO_DIR([m4])
9 AM_CONFIG_HEADER(ac_config.h)
11 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
13 AC_MSG_NOTICE([libconfig - made with pride in California])
16 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
18 # Enable GNU extensions.
23 dnl Checks for programs.
31 if test Z"$LEX" != Zflex; then
33 *******************************************************************
34 You do not seem to have flex. While flex is not required to build
35 libconfig, you may need it to regenerate the lexer if you change
37 *******************************************************************
42 if test Z"$YACC" != "Zbison -y"; then
44 *******************************************************************
45 You do not seem to have bison. While bison is not required to build
46 libconfig, you may need it to regenerate the parser if you change
48 *******************************************************************
52 AC_MSG_CHECKING([for compiler switch to enable full C/C++ warnings]);
54 dnl Checks for libraries
56 dnl Enable warnings, if we can determine an appropriate switch...
60 warn_c_sw="-Wall -Wshadow -Wextra -Wdeclaration-after-statement -Wno-unused-parameter"
61 warn_cxx_sw="-Wall -Wshadow -Wextra -Wno-unused-parameter";;
67 if test -n "${warn_c_sw}";
69 CFLAGS="${CFLAGS} ${warn_c_sw}";
70 CXXFLAGS="${CXXFLAGS} ${warn_cxx_sw}";
71 AC_MSG_RESULT([${warn_c_sw}, ${warn_cxx_sw}])
73 AC_MSG_RESULT([(cannot determine)])
77 dnl Checks for header files.
79 AC_CHECK_HEADERS(unistd.h stdint.h xlocale.h)
81 dnl Checks for typedefs, structures, and compiler characteristics.
84 dnl Checks for functions
86 AC_CHECK_FUNCS([newlocale uselocale freelocale])
93 AS_HELP_STRING([--disable-cxx], [Disable building of the C++ library]),
94 [if test "$enableval" = "no"; then docxx="no"; fi],
100 AM_CONDITIONAL(BUILDCXX, test x$docxx = xyes)
104 AC_ARG_ENABLE(examples,
105 AS_HELP_STRING([--disable-examples], [Disable building of the example programs]),
106 [if test "$enableval" = "no"; then doexamples="no"; fi],
112 AM_CONDITIONAL(BUILDEXAMPLES, test x$doexamples = xyes)
114 dnl Check for MinGW. Workaround for libtool's DLL_EXPORT stupidity.
117 *-*-cygwin* | *-*-mingw*)
121 AM_CONDITIONAL(GNU_WIN, test x$gnuwin = xyes)
123 dnl Checks for library functions.
130 lib/libconfigConfig.cmake
131 lib/libconfig++Config.cmake
135 examples/c++/Makefile