comparison mupdf-source/thirdparty/tesseract/autogen.sh @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 #!/bin/sh
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
6 # Unless required by applicable law or agreed to in writing, software
7 # distributed under the License is distributed on an "AS IS" BASIS,
8 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9 # See the License for the specific language governing permissions and
10 # limitations under the License.
11
12 # This is a simple script which is meant to help developers
13 # better deal with the GNU autotools, specifically:
14 #
15 # aclocal
16 # libtoolize
17 # autoconf
18 # autoheader
19 # automake
20 #
21 # The whole thing is quite complex...
22 #
23 # The idea is to run this collection of tools on a single platform,
24 # typically the main development platform, running a recent version of
25 # autoconf. In theory, if we had these tools on each platform where we
26 # ever expected to port the software, we would never need to checkin
27 # more than a few autotools configuration files. However, the whole
28 # idea is to generate a configure script and associated files in a way
29 # that is portable across platforms, so we *have* to check in a whole
30 # bunch of files generated by all these tools.
31
32 # The real source files are:
33 #
34 # acinclude.m4 (used by aclocal)
35 # configure.ac (main autoconf file)
36 # Makefile.am, */Makefile.am (automake config files)
37 #
38 # All the rest is auto-generated.
39
40 if [ "$1" = "clean" ]; then
41 echo "Cleaning..."
42 rm configure aclocal.m4
43 rm m4/l*
44 rm config/*
45 rmdir config
46 find . -iname "Makefile.in" -type f -exec rm '{}' +
47 fi
48
49 bail_out()
50 {
51 echo
52 echo " Something went wrong, bailing out!"
53 echo
54 exit 1
55 }
56
57 # Prevent any errors that might result from failing to properly invoke
58 # `libtoolize` or `glibtoolize,` whichever is present on your system,
59 # from occurring by testing for its existence and capturing the absolute path to
60 # its location for caching purposes prior to using it later on in 'Step 2:'
61 if command -v libtoolize >/dev/null 2>&1; then
62 LIBTOOLIZE="$(command -v libtoolize)"
63 elif command -v glibtoolize >/dev/null 2>&1; then
64 LIBTOOLIZE="$(command -v glibtoolize)"
65 else
66 echo "Unable to find a valid copy of libtoolize or glibtoolize in your PATH!"
67 bail_out
68 fi
69
70 # --- Step 1: Generate aclocal.m4 from:
71 # . acinclude.m4
72 # . config/*.m4 (these files are referenced in acinclude.m4)
73
74 mkdir -p config
75
76 echo "Running aclocal"
77 aclocal -I config || bail_out
78
79 # --- Step 2:
80
81 echo "Running $LIBTOOLIZE"
82 $LIBTOOLIZE -f -c || bail_out
83 $LIBTOOLIZE --automake || bail_out
84
85 # Run aclocal a 2nd time because glibtoolize created additional m4 files.
86 echo "Running aclocal"
87 aclocal -I config || bail_out
88
89 # --- Step 3: Generate configure and include/miaconfig.h from:
90 # . configure.ac
91 #
92
93 echo "Running autoconf"
94 autoconf || bail_out
95
96 if grep -q PKG_CHECK_MODULES configure; then
97 # The generated configure is invalid because pkg-config is unavailable.
98 rm configure
99 echo "Missing pkg-config. Check the build requirements."
100 bail_out
101 fi
102
103 # --- Step 4: Generate config.h.in from:
104 # . configure.ac (look for AM_CONFIG_HEADER tag or AC_CONFIG_HEADER tag)
105
106 echo "Running autoheader"
107 autoheader -f || bail_out
108
109 # --- Step 5: Generate Makefile.in, src/Makefile.in, and a whole bunch of
110 # files in config (config.guess, config.sub, depcomp,
111 # install-sh, missing, mkinstalldirs) plus COPYING and
112 # INSTALL from:
113 # . Makefile.am
114 # . src/Makefile.am
115 #
116 # Using --add-missing --copy makes sure that, if these files are missing,
117 # they are copied from the system so they can be used in a distribution.
118
119 echo "Running automake --add-missing --copy"
120 automake --add-missing --copy --warnings=all || bail_out
121
122 echo ""
123 echo "All done."
124 echo "To build the software now, do something like:"
125 echo ""
126 echo "$ ./configure [--enable-debug] [...other options]"