copy.c: Remove "Dest" variable to CopyElementLowLevel() function
[geda-pcb/pcjc2.git] / autogen.sh
blob0de878c93d30fa541dad8a2df42153f6c67582f2
1 #! /bin/sh
3 # Run the various GNU autotools to bootstrap the build
4 # system. Should only need to be done once.
6 # for now avoid using bash as not everyone has that installed
7 CONFIG_SHELL=/bin/sh
8 export CONFIG_SHELL
10 ############################################################################
12 # autopoint (gettext)
15 echo "Checking autopoint version..."
16 ver=`autopoint --version | awk '{print $NF; exit}'`
17 ap_maj=`echo $ver | sed 's;\..*;;g'`
18 ap_min=`echo $ver | sed -e 's;^[0-9]*\.;;g' -e 's;\..*$;;g'`
19 ap_teeny=`echo $ver | sed -e 's;^[0-9]*\.[0-9]*\.;;g'`
20 echo " $ver"
22 case $ap_maj in
24 if test $ap_min -lt 14 ; then
25 echo "You must have gettext >= 0.14.0 but you seem to have $ver"
26 exit 1
29 esac
30 echo "Running autopoint..."
31 autopoint --force || exit 1
33 ############################################################################
35 # intltoolize (intltool)
38 echo "Checking intltoolize version..."
39 it_ver=`intltoolize --version | awk '{print $NF; exit}'`
40 it_maj=`echo $it_ver | sed 's;\..*;;g'`
41 it_min=`echo $it_ver | sed -e 's;^[0-9]*\.;;g' -e 's;\..*$;;g'`
42 it_teeny=`echo $it_ver | sed -e 's;^[0-9]*\.[0-9]*\.;;g'`
43 echo " $it_ver"
45 case $it_maj in
47 if test $it_min -lt 35 ; then
48 echo "You must have intltool >= 0.35.0 but you seem to have $it_ver"
49 exit 1
52 esac
53 echo "Running intltoolize..."
54 echo "no" | intltoolize --force --copy --automake || exit 1
56 echo "Patching some intltoolize output"
58 # both intltoolize and autopoint create a po/Makefile.in.in, this can't be good...
59 # but intltoolize seems to have some bugs in it. In particular, XGETTEXT and MSGFMT
60 # are set in the Makefile but not passed down when calling MSGMERGE or GENPOT.
61 # This defeats specifying the path to xgettext and msgfmt. Also
62 # we don't have a ChangeLog in the po/ directory right now so don't let
63 # intltool try to include it in the distfile.
65 mv po/Makefile.in.in po/Makefile.in.in.orig
66 sed \
67 -e 's/^MSGMERGE *=/MSGMERGE = XGETTEXT=\${XGETTEXT} MSGFMT=\${MSGFMT} /g' \
68 -e 's/^GENPOT *=/GENPOT = XGETTEXT=\${XGETTEXT} MSGFMT=\${MSGFMT} /g' \
69 -e 's/ChangeLog//g' \
70 po/Makefile.in.in.orig > po/Makefile.in.in
72 # Add rule for .res file processing
73 echo "
74 %.res.h: %.res
75 \$(INTLTOOL_EXTRACT) --type=gettext/quoted $^" >> po/Makefile.in.in
77 rm -f po/Makefile.in.in.orig
79 ############################################################################
81 # automake/autoconf stuff
84 echo "Running aclocal..."
85 aclocal -I m4 $ACLOCAL_FLAGS || exit 1
86 echo "Done with aclocal"
88 echo "Running autoheader..."
89 autoheader || exit 1
90 echo "Done with autoheader"
92 echo "Running automake..."
93 automake -a -c --foreign || exit 1
94 echo "Done with automake"
96 echo "Running autoconf..."
97 autoconf || exit 1
98 echo "Done with autoconf"
100 ############################################################################
102 # finish up
105 echo "You must now run configure"
107 echo "All done with autogen.sh"