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 if [ -n "$LINGUAS" ]; then unset LINGUAS; fi; \
60 LDFLAGS="${LDFLAGS}%{!?debug: -s}" ; export LDFLAGS ; \
61 CFLAGS="${CFLAGS:-%optflags}%{?debug: -g -O}" ; export CFLAGS ; \
62 CXXFLAGS="${CXXFLAGS:-%optflags}%{?debug: -g -O}" ; export CXXFLAGS ; \
63 FFLAGS="${FFLAGS:-%optflags}%{?debug: -g -O}" ; export FFLAGS ; \
64 unset LINGUAS || : ; \
65 ./configure %{_target_platform} \
67 --exec-prefix=%{_exec_prefix} \
69 --sbindir=%{_sbindir} \
70 --sysconfdir=%{_sysconfdir} \
71 --datadir=%{_datadir} \
72 --includedir=%{_includedir} \
74 --libexecdir=%{_libexecdir} \
75 --localstatedir=%{_localstatedir} \
76 --sharedstatedir=%{_sharedstatedir} \
78 --infodir=%{_infodir} }
80 # Location of autoconf macros
81 %_aclocaldir %(aclocal --print-ac-dir)
83 # Fixed location of top applink dir
84 %_applnkdir /usr/X11R6/share/applnk
87 %date %(LC_ALL="C" date +"%a %b %d %Y")
90 %tmpdir %(echo "${TMPDIR:-/tmp}")
92 # Example files, programs, scripts...
93 %_examplesdir /usr/src/examples
95 # Find-requires and directories excluded from auto-req
96 %_noautoreqdir %{_defaultdocdir} %{_examplesdir}
98 #%__find_requires_pre /usr/lib/rpm/find-requires-pre %{_noautoreqdir}
99 #%__find_requires_core /usr/lib/rpm/find-requires
100 #%__find_requires_post /usr/lib/rpm/find-requires-post
101 #%__find_requires %{__find_requires_pre} | %{__find_requires_core} | %{__find_requires_post}
103 # If non-empty "debug" macro defined, add "dbg" suffix to release number
104 %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
106 # remove .comment and .note from ELFs
107 %__spec_install_post %{?debug:#}if [ -x /usr/lib/rpm/remove-unneeded-elf-sections ] ; then /usr/lib/rpm/remove-unneeded-elf-sections %{buildroot}; fi