tizen 2.0
[external/popt.git] / configure.ac
1 AC_PREREQ(2.57)
2 AC_INIT(popt, 1.16, popt-devel@rpm5.org)
3 AC_CONFIG_SRCDIR([popt.h])
4 AC_CONFIG_HEADERS([config.h])
5 AC_CANONICAL_TARGET
6
7 dnl Must come before AM_INIT_AUTOMAKE.
8 dnl AC_CONFIG_AUX_DIR([build-aux])
9 AC_CONFIG_MACRO_DIR([m4])
10 AM_INIT_AUTOMAKE([foreign -Wall])
11 AM_MAINTAINER_MODE
12
13 # Library code modified:                              REVISION++
14 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
15 # Interfaces added:                             AGE++
16 # Interfaces removed:                           AGE=0
17 AC_SUBST(LT_CURRENT, 0)
18 AC_SUBST(LT_REVISION, 0)
19 AC_SUBST(LT_AGE, 8)
20
21 ALL_LINGUAS="cs da de eo es fi fr ga gl hu id is it ja ko lv nb nl pl pt ro ru sk sl sv th tr uk vi wa zh_TW zh_CN"
22
23 AC_PROG_CC_STDC
24 AC_PROG_CC
25
26 AC_PROG_INSTALL
27 AC_PROG_LIBTOOL
28
29 dnl if CC is gcc, we can rebuild the dependencies (since the depend rule
30 dnl requires gcc).  If it's not, don't rebuild dependencies -- use what was
31 dnl shipped with RPM.
32 if test X"$GCC" = "Xyes"; then
33     CFLAGS="$CFLAGS -Wall -W"
34     TARGET="depend allprogs"
35 else
36     TARGET="everything"
37     dnl let the Makefile know that we're done with `depend', since we don't
38     dnl have gcc we're not going to rebuild our dependencies at all.
39     echo >.depend-done
40 fi
41 AC_SUBST(TARGET)
42
43 CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT"
44
45 AC_GCC_TRADITIONAL
46 AC_SYS_LARGEFILE
47
48 AC_ISC_POSIX
49 AM_C_PROTOTYPES
50
51 AC_CHECK_HEADERS(float.h fnmatch.h glob.h langinfo.h libintl.h mcheck.h unistd.h)
52
53 # For some systems we know that we have ld_version scripts.
54 # Use it then as default.
55 have_ld_version_script=no
56 case "${host}" in
57     *-*-linux*)
58         have_ld_version_script=yes
59         ;;
60     *-*-gnu*)
61         have_ld_version_script=yes
62         ;;
63 esac
64 AC_ARG_ENABLE([ld-version-script],
65               AC_HELP_STRING([--enable-ld-version-script],
66                              [enable/disable use of linker version script.
67                               (default is system dependent)]),
68               [have_ld_version_script=$enableval],
69               [ : ] )
70 AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes")
71
72 AC_ARG_ENABLE(build-gcov,
73     AS_HELP_STRING([--enable-build-gcov], [build POPT instrumented for gcov]), [dnl
74     if test ".$enableval" = .yes; then
75         if test ".`$CC --version 2>&1 | grep 'GCC'`" != .; then
76             dnl # GNU GCC (usually "gcc")
77             CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
78         fi
79     fi
80 ])
81
82 AC_CHECK_FUNC(setreuid, [], [
83     AC_CHECK_LIB(ucb, setreuid, [if echo $LIBS | grep -- -lucb >/dev/null ;then :; else LIBS="$LIBS -lc -lucb" USEUCB=y;fi])
84 ])
85 AC_CHECK_FUNCS(getuid geteuid iconv mtrace __secure_getenv setregid stpcpy strerror vasprintf srandom)
86
87 AM_GNU_GETTEXT([external])
88 AM_ICONV_LINK
89
90 popt_sysconfdir="${sysconfdir}"
91 eval "popt_sysconfdir=\"${popt_sysconfdir}\"" # expand contained ${prefix}
92 AC_DEFINE_UNQUOTED([POPT_SYSCONFDIR], ["$popt_sysconfdir"], [Full path to default POPT configuration directory])
93
94
95 # Define a (hope) portable Libs pkgconfig directive that 
96 # - Don't harm if the default library search path include ${libdir}
97 #   (https://bugzilla.novell.com/show_bug.cgi?id=529921)
98 # - Don't require a not upstream patch to pkgconfig
99 #   (https://bugs.freedesktop.org/show_bug.cgi?id=16095)
100 popt_pkgconfig_libs='-L${libdir} -lpopt'
101 case "${host}" in
102     *-*-linux*)
103         case "${libdir}" in
104             /usr/lib|/usr/lib64|/lib|/lib64)
105                    popt_pkgconfig_libs='-lpopt'
106                 ;;
107                 *)
108                 popt_pkgconfig_libs='-L${libdir} -lpopt'
109         ;;
110         esac
111       ;;
112     *-*-gnu*)
113         case "${libdir}" in
114             /usr/lib|/usr/lib64|/lib|/lib64)
115                    popt_pkgconfig_libs='-lpopt'
116                 ;;
117                 *)
118                 popt_pkgconfig_libs='-L${libdir} -lpopt'
119         ;;
120         esac
121       ;;
122 esac
123 AC_SUBST([POPT_PKGCONFIG_LIBS],"$popt_pkgconfig_libs")
124
125 POPT_SOURCE_PATH="`pwd`"
126 AC_DEFINE_UNQUOTED(POPT_SOURCE_PATH, "$POPT_SOURCE_PATH",
127         [Full path to popt top_srcdir.])
128 AC_SUBST(POPT_SOURCE_PATH)
129
130 AC_CONFIG_SUBDIRS()
131 AC_CONFIG_FILES([ po/Makefile.in m4/Makefile
132     Doxyfile Makefile popt.pc popt.spec test-poptrc
133     auto/Makefile auto/desc auto/types
134 ])
135 AC_OUTPUT