Fix build by removing auto generated files
[platform/upstream/libconfig.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2
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])
7 AC_CANONICAL_TARGET
8 AM_INIT_AUTOMAKE
9 AM_CONFIG_HEADER(ac_config.h)
10
11 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12
13 AC_MSG_NOTICE([libconfig - made with pride in California])
14 sleep 3
15
16 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
17
18 # Enable GNU extensions.
19 AC_GNU_SOURCE
20
21 LT_INIT()
22
23 dnl Checks for programs.
24 AC_PROG_CC
25 AM_PROG_CC_C_O
26 AC_PROG_CXX
27 AC_LIBTOOL_WIN32_DLL
28 AC_PROG_LIBTOOL
29
30 AM_PROG_LEX
31 if test Z"$LEX" != Zflex; then
32 cat <<EOF
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
36 the scanner.l file.
37 *******************************************************************
38 EOF
39 fi
40
41 AC_PROG_YACC
42 if test Z"$YACC" != "Zbison -y"; then
43 cat <<EOF
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
47 the grammar.y file.
48 *******************************************************************
49 EOF
50 fi
51
52 AC_MSG_CHECKING([for compiler switch to enable full C/C++ warnings]);
53
54 dnl Checks for libraries
55
56 dnl Enable warnings, if we can determine an appropriate switch...
57 case "${CC}" in
58
59 gcc)
60         warn_c_sw="-Wall -Wshadow -Wextra -Wdeclaration-after-statement -Wno-unused-parameter"
61         warn_cxx_sw="-Wall -Wshadow -Wextra -Wno-unused-parameter";;
62 *)
63         warn_cxx_sw=""
64         warn_c_sw="";;
65 esac
66
67 if test -n "${warn_c_sw}";
68 then
69         CFLAGS="${CFLAGS} ${warn_c_sw}";
70         CXXFLAGS="${CXXFLAGS} ${warn_cxx_sw}";
71         AC_MSG_RESULT([${warn_c_sw}, ${warn_cxx_sw}])
72 else
73         AC_MSG_RESULT([(cannot determine)])
74 fi;
75
76
77 dnl Checks for header files.
78 AC_HEADER_STDC
79 AC_CHECK_HEADERS(unistd.h stdint.h xlocale.h)
80
81 dnl Checks for typedefs, structures, and compiler characteristics.
82 AC_C_CONST
83
84 dnl Checks for functions
85
86 AC_CHECK_FUNCS([newlocale uselocale freelocale])
87
88 dnl Package options
89
90 docxx=yes
91
92 AC_ARG_ENABLE(cxx,
93 AS_HELP_STRING([--disable-cxx], [Disable building of the C++ library]),
94 [if test "$enableval" = "no"; then docxx="no"; fi],
95 [
96 docxx=yes
97 ]
98 )
99
100 AM_CONDITIONAL(BUILDCXX, test x$docxx = xyes)
101
102 doexamples=yes
103
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],
107 [
108 doexamples=yes
109 ]
110 )
111
112 AM_CONDITIONAL(BUILDEXAMPLES, test x$doexamples = xyes)
113
114 dnl Check for MinGW. Workaround for libtool's DLL_EXPORT stupidity.
115
116 case "$target" in
117         *-*-cygwin* | *-*-mingw*)
118                 gnuwin=yes;;
119 esac
120
121 AM_CONDITIONAL(GNU_WIN, test x$gnuwin = xyes)
122
123 dnl Checks for library functions.
124
125 AC_OUTPUT(
126         Makefile
127         lib/Makefile
128         lib/libconfig.pc
129         lib/libconfig++.pc
130         lib/libconfigConfig.cmake
131         lib/libconfig++Config.cmake
132         doc/Makefile
133         examples/Makefile
134         examples/c/Makefile
135         examples/c++/Makefile
136         tinytest/Makefile
137         tests/Makefile
138         libconfig.spec
139         )