1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
AC_DEFUN(AC_CHECK_C_COMPILER,
[
AC_ARG_ENABLE(debug,[ --enable-debug enables debug symbols [default=no]],
[
if test $enableval = "no"; dnl
then
kde_use_debug_code="no"
kde_use_debug_define=yes
else
kde_use_debug_code="yes"
kde_use_debug_define=no
fi
],
[kde_use_debug_code="no"
kde_use_debug_define=no
])
dnl Just for configure --help
AC_ARG_ENABLE(dummyoption,[ --disable-debug disables debug output and debug symbols [default=no]],[],[])
AC_ARG_ENABLE(strict,[ --enable-strict compiles with strict compiler options (may not work!)],
[
if test $enableval = "no"; then
kde_use_strict_options="no"
else
kde_use_strict_options="yes"
fi
], [kde_use_strict_options="no"])
AC_ARG_ENABLE(profile,[ --enable-profile creates profiling infos [default=no]],
[kde_use_profiling=$enableval],
[kde_use_profiling="no"]
)
dnl this prevents stupid AC_PROG_CC to add "-g" to the default CFLAGS
CFLAGS=" $CFLAGS"
AC_PROG_CC
if test "$GCC" = "yes"; then
if test "$kde_use_debug_code" = "yes"; then
CFLAGS="-g -O2 $CFLAGS"
case $host in
*-*-linux-gnu)
CFLAGS="-ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE=500 -D_BSD_SOURCE $CFLAGS"
;;
esac
else
CFLAGS="-O2 $CFLAGS"
fi
fi
if test "$kde_use_debug_define" = "yes"; then
CFLAGS="-DNDEBUG $CFLAGS"
fi
case "$host" in
*-*-sysv4.2uw*) CFLAGS="-D_UNIXWARE $CFLAGS";;
*-*-sysv5uw7*) CFLAGS="-D_UNIXWARE7 $CFLAGS";;
esac
if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
LDFLAGS=""
fi
if test "$kde_use_profiling" = "yes"; then
KDE_CHECK_COMPILER_FLAG(pg,
[
CFLAGS="-pg $CFLAGS"
])
fi
USE_EXCEPTIONS=
AC_SUBST(USE_EXCEPTIONS)
dnl obsolete macro - provided to keep things going
USE_RTTI=
AC_SUBST(USE_RTTI)
AC_PROG_CPP
# the following is to allow programs, that are known to
# have problems when compiled with -O2
if test -n "$CFLAGS"; then
kde_safe_IFS=$IFS
IFS=" "
NOOPT_CFLAGS=""
for i in $CFLAGS; do
case $i in
-O*)
;;
*)
NOOPT_CFLAGS="$NOOPT_CFLAGS $i"
;;
esac
done
IFS=$kde_safe_IFS
fi
AC_SUBST(NOOPT_CFLAGS)
KDE_CHECK_FINAL
ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDEV_ADD_DEPENDENCIES]), [])
KDE_CXXFLAGS=
AC_SUBST(KDE_CXXFLAGS)
])
AC_DEFUN(KDEV_ADD_DEPENDENCIES,
[
[A]M_DEPENDENCIES(CC)
])
dnl just a wrapper to clean up configure.in only for c projects
AC_DEFUN(KDEV_PROG_LIBTOOL,
[
AC_REQUIRE([AC_CHECK_C_COMPILER])
AC_REQUIRE([AC_ENABLE_SHARED])
AC_REQUIRE([AC_ENABLE_STATIC])
AC_REQUIRE([AC_LIBTOOL_DLOPEN])
AC_LANG_SAVE
AC_LANG_C
AC_OBJEXT
AC_EXEEXT
AC_LANG_RESTORE
AM_PROG_LIBTOOL
AC_LIBTOOL_SETUP
LIBTOOL_SHELL="/bin/sh ./libtool"
# LIBTOOL="$LIBTOOL --silent"
])
|