1 AC_DEFUN(AC_CHECK_C_COMPILER,
3 AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
5 if test $enableval = "no"; dnl
7 kde_use_debug_code="no"
8 kde_use_debug_define=yes
10 kde_use_debug_code="yes"
11 kde_use_debug_define=no
14 [kde_use_debug_code="no"
15 kde_use_debug_define=no
18 dnl Just for configure --help
19 AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
21 AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
23 if test $enableval = "no"; then
24 kde_use_strict_options="no"
26 kde_use_strict_options="yes"
28 ], [kde_use_strict_options="no"])
30 AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
31 [kde_use_profiling=$enableval],
32 [kde_use_profiling="no"]
35 dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
40 if test "$GCC" = "yes"; then
41 if test "$kde_use_debug_code" = "yes"; then
42 CFLAGS="-g -O2 $CFLAGS"
45 CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
53 if test "$kde_use_debug_define" = "yes"; then
54 CFLAGS="-DNDEBUG $CFLAGS"
58 *-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
59 *-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
62 if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
66 if test "$kde_use_profiling" = "yes"; then
67 KDE_CHECK_COMPILER_FLAG(pg,
74 AC_SUBST(USE_EXCEPTIONS)
75 dnl obsolete macro - provided to keep things going
81 # the following is to allow programs, that are known to
82 # have problems when compiled with -O2
83 if test -n "$CFLAGS"; then
92 NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
99 AC_SUBST(NOOPT_CFLAGS)
103 ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDEV_ADD_DEPENDENCIES]), [])
106 AC_SUBST(KDE_CXXFLAGS)
109 AC_DEFUN(KDEV_ADD_DEPENDENCIES,
111 [A]M_DEPENDENCIES(CC)
115 dnl just a wrapper to clean up configure.in only for c projects
116 AC_DEFUN(KDEV_PROG_LIBTOOL,
118 AC_REQUIRE([AC_CHECK_C_COMPILER])
119 AC_REQUIRE([AC_ENABLE_SHARED])
120 AC_REQUIRE([AC_ENABLE_STATIC])
122 AC_REQUIRE([AC_LIBTOOL_DLOPEN])
133 LIBTOOL_SHELL="/bin/sh ./libtool"
134 # LIBTOOL="$LIBTOOL --silent"