1 #------------------------------------------------------------------------------
2 # The GNUconfigure macro does the following:
3 # update config.guess and config.sub.
4 # regenerate all autoconf/automake files
5 # optionally change to a directory (make the directory if requested).
6 # run configure with correct prefix, platform, and CFLAGS.
7 # optionally restore current directory.
9 # Based on autogen.sh from GNOME and orginal GNUconfigure
12 CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS; \
13 LDFLAGS="${LDFLAGS:-'%{-s:-s}'}" ; export LDFLAGS; \
14 %{-C:_mydir="`pwd`"; %{-M: %{__mkdir} -p %{-C*};} cd %{-C*}} \
15 dirs="`find ${_mydir} -name configure.in -print`"; export dirs; \
16 for coin in `echo ${dirs}` \
18 dr=`dirname ${coin}`; \
19 if test -f ${dr}/NO-AUTO-GEN; then \
22 macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < ${coin}`; \
24 aclocalinclude="${ACLOCAL_FLAGS}"; \
25 for k in ${macrodirs}; do \
26 if test -d ${k}; then \
27 aclocalinclude="${aclocalinclude} -I ${k}"; \
29 ## echo "**Warning**: No such directory \`${k}'. Ignored." \
32 if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then \
33 if grep "sed.*POTFILES" configure.in >/dev/null; then \
34 : do nothing -- we still have an old unmodified configure.in \
36 test -r ${dr}/aclocal.m4 || touch ${dr}/aclocal.m4; \
37 echo "no" | gettextize --force --copy; \
38 test -r ${dr}/aclocal.m4 && %{__chmod} u+w ${dr}/aclocal.m4; \
41 if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then \
42 %{__libtoolize} --force --copy; \
44 aclocal ${aclocalinclude}; \
45 if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then \
48 echo "Running automake --gnu ${am_opt} ..."; \
49 %{__automake} --add-missing --gnu ${am_opt}; \
54 %{-C:${_mydir}}%{!-C:.}/configure %{_target_platform} --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} --infodir=%{_infodir} %* ; \
55 %{-C:cd ${_mydir}; unset _mydir}
57 #-----------------------------------------------------------------
59 LDFLAGS="${LDFLAGS}%{!?debug: -s}" ; export LDFLAGS ; \
60 CFLAGS="${CFLAGS:-%optflags}%{?debug: -g -O}" ; export CFLAGS ; \
61 CXXFLAGS="${CXXFLAGS:-%optflags}%{?debug: -g -O}" ; export CXXFLAGS ; \
62 FFLAGS="${FFLAGS:-%optflags}%{?debug: -g -O}" ; export FFLAGS ; \
63 unset LINGUAS || : ; \
64 ./configure %{_target_platform} \
66 --exec-prefix=%{_exec_prefix} \
68 --sbindir=%{_sbindir} \
69 --sysconfdir=%{_sysconfdir} \
70 --datadir=%{_datadir} \
71 --includedir=%{_includedir} \
73 --libexecdir=%{_libexecdir} \
74 --localstatedir=%{_localstatedir} \
75 --sharedstatedir=%{_sharedstatedir} \
77 --infodir=%{_infodir} }
79 # Location of autoconf macros
80 %_aclocaldir %(aclocal --print-ac-dir)
82 # Fixed location of top applink dir
83 %_applnkdir /usr/X11R6/share/applnk
86 %date %(LC_ALL="C" date +"%a %b %d %Y")
89 %tmpdir %(echo "${TMPDIR:-/tmp}")
91 # Example files, programs, scripts...
92 %_examplesdir /usr/src/examples
94 # Find-requires and directories excluded from auto-req
95 %_noautoreqdir %{_defaultdocdir} %{_examplesdir}
97 #%__find_requires_pre /usr/lib/rpm/find-requires-pre %{_noautoreqdir}
98 #%__find_requires_core /usr/lib/rpm/find-requires
99 #%__find_requires_post /usr/lib/rpm/find-requires-post
100 #%__find_requires %{__find_requires_pre} | %{__find_requires_core} | %{__find_requires_post}
102 # If non-empty "debug" macro defined, add "dbg" suffix to release number
103 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
105 # remove .comment and .note from ELFs
106 %__spec_install_post %{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ] ; then /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; fi