acinclude.m4 0000664 0001750 0001750 00000005517 14751072121 012541 0 ustar janla64 janla64 # acinclude.m4
#************************************************************************
#
# Part of the dvipng distribution
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this program. If not, see
# .
#
# Copyright (C) 2002-2015,2019 Jan-Ã…ke Larsson
#
#************************************************************************
dnl
dnl MAKEINFO_CHECK_MACRO( MACRO, [ACTION-IF-FOUND
dnl [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN([MAKEINFO_CHECK_MACRO],
[if test -n "$MAKEINFO" -a "$makeinfo" != ":"; then
AC_MSG_CHECKING([for @$1{}])
echo \\\\input texinfo > conftest.texi
echo @$1{test} >> conftest.texi
if $MAKEINFO conftest.texi > /dev/null 2> /dev/null; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
ifelse([$3], , :, [$3])
fi
rm -f conftest.texi conftest.info
fi
])
dnl
dnl MAKEINFO_CHECK_MACROS( MACRO ... [, ACTION-IF-FOUND
dnl [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN([MAKEINFO_CHECK_MACROS],
[for ac_macro in $1; do
MAKEINFO_CHECK_MACRO($ac_macro, $2,
[MAKEINFO_MACROS="-D no-$ac_macro $MAKEINFO_MACROS"
$3])dnl
done
AC_SUBST(MAKEINFO_MACROS)
])
dnl
dnl Check for enc, cmap, sfd formats
dnl
AC_DEFUN([AC_HAS_KPSE_ENC_FORMATS],
[AC_MSG_CHECKING([for kpse_enc_format])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include
#include ]], [[kpse_enc_format;kpse_cmap_format;kpse_sfd_format]])],[AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_KPSE_ENC_FORMATS, 1,
[Define to 1 if your kpathsea has kpse_enc_format])],[AC_MSG_RESULT(no)])])
dnl
dnl Check devices for GS
dnl AC_GS_HAS_DEVICE(DEVICE,ACTION-IF-FAILED)
dnl
AC_DEFUN([AC_GS_HAS_DEVICE],
[AC_MSG_CHECKING([whether $GS has the $1 device])
if $GS -h | grep $1 >/dev/null; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
$2
fi
])
dnl
dnl GS_CHECK_DEVICES
dnl
AC_DEFUN([GS_CHECK_DEVICES],
[GS_WARN=""
AC_GS_HAS_DEVICE(pngalpha,
[GS_WARN="Your EPS inclusions will be cropped to the
boundingbox, and rendered on an opaque background.
Upgrade GhostScript to avoid this."
AC_GS_HAS_DEVICE(png16m,
[GS_WARN="Your EPS inclusions may not work.
Upgrade/install GhostScript to avoid this."])])
if test -n "$GS_WARN"; then
AC_MSG_WARN([$GS_WARN])
fi
])
aclocal.m4 0000664 0001750 0001750 00000032165 14747712062 012221 0 ustar janla64 janla64 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant .
dnl Copyright © 2012-2015 Dan Nicholson
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see .])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
m4_include([acinclude.m4])
ChangeLog 0000664 0001750 0001750 00000074010 14747705002 012122 0 ustar janla64 janla64 2025-02-02 Jan-Åke Larsson
Release 1.18
2025-02-02 Jan-Åke Larsson
Adapt to autoconf 2.71
2025-02-02 Jan-Åke Larsson
Do not try to render Postscript special that only is PS comments
2025-02-02 Jan-Åke Larsson
Fix division by zero error if DVI magnification too large
2021-03-13 Jan-Åke Larsson
Prevent division-by-zero, and make image-file not found error message more informative
2020-01-05 Jan-Åke Larsson
Release 1.17
2019-11-29 Jan-Åke Larsson
Fix typo that cause PK files to fail
2019-07-03 Jan-Åke Larsson
Fix format for gamma interactive printout. Add credit.
2019-07-01 Jan-Åke Larsson
Fix segfault when starting interactive mode without DVI. Thanks to Ahzo for finding the issue.
2019-06-29 Jan-Åke Larsson
Revert change for acinclude.m4, and add test for strncasecmp
2019-06-27 Jan-Åke Larsson
Remove segfault for invalid color names
2019-04-06 Jan-Åke Larsson
Release 1.16
2019-04-06 Jan-Åke Larsson
Check for a possible integer addition overflow
Check bounds for mmap access
Update copyright notice
2019-02-26 Jan-Åke Larsson
Add sentence on disabling Freetype for identical output on different platforms.
Amend FT2 test, move remaining local scripts to acinclude.m4, regenerate aclocal.m4
2015-03-28 Jan-Åke Larsson
Add const where needed
Don't re-define pipe and snprintf
Test for and use texlive_gs_init()
Use WIN32 _spawnlp
Use char* in debug printout calculations
Don't use basename, ignore case, and use correct directory delimiter
2015-03-05 Jan-Åke Larsson
Change libgd download address
2015-03-02 Jan-Åke Larsson
Remove datarootdir configure warning, adjust distclean target
Remove texi2pod.pl, we only use that for building the man page
Remove cvs remnants
Adjust distclean target
2015-03-01 Jan-Åke Larsson
* RELEASE: Release 1.15
* color.c, config.h.in, configure.ac, dvi.c, dvipng.h, misc.c,
pk.c, set.c, sfd.c, tfm.c, vf.c: Remove references to kpathsea
xmalloc, and enable non-GNU malloc
* dvi.c: Fix long sleep interval in --follow
* INSTALL, Makefile.in, README, config.h.in, configure.ac, draw.c,
dvipng.1, dvipng.c, dvipng.h, dvipng.texi, font.c, fontmap.c,
install.texi, miktex.h, misc.c, readme.texi, t1.c: Remove support
for the now dead libt1
* special.c: Use
* color.c: Fix segfault at missing xcolor.sty
* set.c: Added check for out of memory in libgd allocate
2012-09-15 Jan-Åke Larsson
* ft.c: Add warning for missing target_light hinting
2012-09-15 Jan-Åke Larsson
* dvipng.c: Use return value of fgets better
2010-12-17 Jan-Åke Larsson
* COPYING.gd: Inclusion of the gd copyright notice
2010-12-14 Jan-Åke Larsson
* RELEASE: Spell correctly
2010-12-06 Jan-Åke Larsson
* special.c: Warn when --norawps hinders output
* dvipng.texi: Document usage of a fallback
* Makefile.in: Add www directory
2010-10-23 Jan-Åke Larsson
* dvipng.1, RELEASE: Prepare for 1.14
2010-10-22 Jan-Åke Larsson
* configure.ac: Prepare for 1.14
* special.c: Tidy up the three different calls to gs on different
systems.
* dvipng.texi: Some adjustments, document handling of raw
PostScript
2010-10-21 Jan-Åke Larsson
* special.c: Code cleanup
2010-10-14 Jan-Åke Larsson
* dvipng.h (malloc): Put malloc def first
* special.c (ps2png): Ensure one and only one showpage, and do it
in PostScript instead of in C as suggested by Akira's previous patch
2010-10-02 Peter Breitenlohner
* special.c (ps2png): Drop unused 'bool showpage' for WIN32.
2010-10-01 Jan-Åke Larsson
* special.c: Add heuristics to ignore non-rendering specials from
hyperref
2010-09-30 Jan-Åke Larsson
* special.c, misc.c, dvipng.h, dvipng.texi: Add option to not try
converting raw PostScript
2010-09-29 Jan-Åke Larsson
* special.c (ps2png): Reap zombies
* papersiz.c: Fix bug in length decoder
2010-09-22 Jan-Åke Larsson
* color.c, enc.c, fontmap.c, misc.c, sfd.c: Handle CRLF correctly
2010-09-20 Akira Kakuto
* special.c (ps2png): fix WIN32 bug that dvipng.exe waits
infinitely for some kind of eps files.
2010-03-17 Jan-Ake Larsson
* Release 1.13
* misc.c: Correct copyright year
* RELEASE: Prepare for 1.13
2010-03-17 Peter Breitenlohner
* configure.ac: Check for kpse_set_program_name() as used in
dvipng.c instead of kpse_set_progname().
Support WIN32 builds (native or MinGW32).
* dvipng.h (min, max): Always undefine before defining.
* dvi.c: For WIN32 use Sleep(1000) instead of sleeep(1).
* misc.c: #include depends on HAVE_MMAP.
* dvipng.h, font.c, misc.c: For mmap code use '#ifdef WIN32'
instead of '#ifdef MIKTEX'.
* special.c: WIN32 specific replacement for fork and pipe, using
code from Akira Kakuto, (e-mail from 23 Feb 2010 23:33:58).
2010-03-17 Jan-Ake Larsson
* test_dvipng.tex: Don't use mathptmx
* color.c, dvi.c, dvipng.h, fontmap.c, misc.c, papersiz.c,
ppagelist.c, special.c: Avoid compiler warnings
* dvipng.texi, configure.ac: Prepare for 1.13
* draw.c, dvipng.h, set.c, vf.c: Adjust glyph-index bounds
test. Remove possible segfault from isprint().
2010-02-11 Jan-Ake Larsson
* color.c, draw.c, dvi.c, enc.c, font.c, fontmap.c, ft.c,
papersiz.c, pk.c, ppagelist.c, set.c, sfd.c, special.c, t1.c:
Declare functions used only in one file as static to avoid
warnings when compiling with 'gcc --Wmissing-prototypes',
suggested by Peter Breitenlohner
2010-01-28 Jan-Ake Larsson
* draw.c, dvipng.h, dvipng.texi, misc.c: Add width reporting
2009-04-14 Jan-Ake Larsson
* fontmap.c: Make the thing build without FT2
2009-03-28 Jan-Ake Larsson
* config.h.in: Remove the last remnants of alloca
2009-03-26 Jan-Ake Larsson
* configure.ac, dvipng.h: Remove the last remnants of alloca
* draw.c, font.c, ft.c, pk.c, t1.c, vf.c: Make the name element of
the font struct a pointer, not an array
* dvi.c, ppagelist.c: Change error msg to mention malloc
* color.c, enc.c, pk.c, set.c, sfd.c, special.c, tfm.c: Don't use
alloca
2009-03-25 Jan-Ake Larsson
* config.h.in, configure.ac: Check for libgen.h, not libgen
* special.c: Put declarations before code
* color.c, dvipng.h, fontmap.c, ft.c, misc.c, pk.c, set.c, t1.c,
tfm.c: Exchange #if for #ifdef
2009-02-23 Jan-Ake Larsson
* Release 1.12
* INSTALL, README, install.texi, readme.texi, special.c: Correct
date for copyright
* RELEASE, configure.ac, dvipng.1, dvipng.texi: Prepare for 1.12
2009-01-23 Jan-Ake Larsson
* special.c: Keep transparent background in rescaled included
bitmaps
2008-06-04 Jan-Ake Larsson
* special.c: Add the color PostScript prologue
2008-06-03 Jan-Ake Larsson
* dvipng.h, special.c: Support xcolor PostScript prologue
* color.c: Support x11nam.def, fix handling of xcolor
multiple-model color values, and xcolor PostScript prologue
2008-06-02 Jan-Ake Larsson
* special.c: Some (most?) literal PostScript specials seem to
depend on tex.pro and possibly special.pro, always load these
* configure.ac: Fix gs checks
* misc.c: Correct last mmap element
2008-05-27 Jan-Ake Larsson
* readme.texi: Mention new color models in xcolor
* color.c: Adjust for new version of xcolor, mainly color prefixes
2008-05-14 Jan-Ake Larsson
* Release 1.11
* configure.ac, dvipng.1, dvipng.texi, RELEASE: Prepare for 1.11
* special.c: Fix PS inclusion regression
2008-05-09 Jan-Ake Larsson
* Release 1.10
* RELEASE: Prepare for 1.10
2008-05-08 Jan-Ake Larsson
* special.c: Add warning about DVI code in PS environment
2008-05-07 Jan-Ake Larsson
* README, readme.texi: Mention gs interpreter lib in TODO
* aclocal.m4, configure.ac: Move gs device check so that it can be
called from different points
2008-05-05 Jan-Ake Larsson
* draw.c, dvi.c, dvipng.h: Revert creation of dvi command struct
* draw.c, dvi.c: Init dvi command struct
* draw.c, dvi.c, dvipng.h: Create dvi command struct
* special.c: Rearrange code
* color.c, dvipng.h, enc.c, fontmap.c, misc.c, pk.c, sfd.c,
special.c, tfm.c, vf.c: Change name of fmmap struct element
2008-04-29 Jan-Ake Larsson
* dvipng.1: Prepare for 1.10
* configure.ac: Prepare for 1.10, check for gdImageCreateJpeg
* aclocal.m4: Cosmetic changes
* special.c: Change to HAVE_...JPEG
* dvipng.h: Remove c++ comment
* dvipng.texi: Prepare for 1.10. Use 'active' in the 'preview'
package, remove unused text
* Makefile.in:
Install dvipng.1 from the tarball, mark maintainer targets
2008-02-08 Jan-Ake Larsson
* Makefile.in, INSTALL, README, color.c, commands.h, configure.ac,
* draw.c, dvi.c, dvipng.1, dvipng.c, dvipng.h, dvipng.texi, enc.c,
* font.c, fontmap.c, ft.c, install.texi, macros.texi, miktex.h,
* misc.c, papersiz.c, pk.c, ppagelist.c, readme.texi, set.c, sfd.c,
* special.c, t1.c, test_dvipng.tex, tfm.c, vf.c, COPYING,
* COPYING.LESSER: Change to LGPLv3
* install.texi:
* README:
* dvipng.texi: Add blurb about MediaWiki, and cosmetic changes
2008-01-10 Jan-Ake Larsson
* set.c: Correct typo
2007-12-12 Jan-Ake Larsson
* special.c: Correct header test, add proper ps::[start] and
ps::[end] detection, add code to make tikz/pgf dvips (~PostScript)
specials work
2007-10-26 Jan-Ake Larsson
* draw.c:
* dvi.c:
* special.c: Change DVIGetCommand so that the command is
zero-terminated. This simplifies string operations on specials and
makes the length argument to SetSpecial unnecessary. Handle
preview-bop-hook correctly
* special.c: Simplify PostScript header and multi-special
handling
* color.c:
* draw.c:
* dvi.c:
* dvipng.h:
* font.c:
* ft.c:
* misc.c:
* set.c:
* special.c:
* t1.c: Split the flags variable into page_flags, option_flags and
dvi->flags
* dvi.c:
* dvipng.c: dvi->flags resets now when the dvi is reopened
2007-08-06 Jan-Ake Larsson
* ft.c:
* misc.c:
* t1.c:
* tfm.c:
* vf.c: Memory fixes
2007-07-24 Jan-Ake Larsson
* special.c: Fix PostScript header usage
2007-07-22 Jan-Ake Larsson
* misc.c: Change version info slightly
* ft.c: Change debug info slightly
2007-07-21 Jan-Ake Larsson
* special.c: Rewrite to allow for raw PostScript specials, also
use PostScript headers
* dvipng.h:
* dvi.c: Add read-ahead for PostScript specials
* config.h.in:
* configure.ac: Add test for gd pointer->image conversion
2007-03-19 Jan-Ake Larsson
* draw.c: Better handling of glyph index bounds
* set.c: Check bounds for glyph index
2006-12-11 Jan-Ake Larsson
* readme.texi: Fix TODO, mention MediaWiki
* dvipng.h: Fix for alloca under AIX
* Makefile.in: mkinstalldirs is in $(srcdir)
2006-11-11 Jan-Ake Larsson
* Release 1.9
* INSTALL:
* README: Update for 1.9
* Makefile.in: Make the test fail if fonts not found
* configure.ac: Don't use "which". Add info about the selfauto
stuff. Report if CJK support present
* test_dvipng.tex: Remove the (intentional) failing special
2006-11-07 Jan-Ake Larsson
* fontmap.c: Don't warn if ttfonts.map is missing, fix pointer
* Makefile.in: Adjust manpage target so manual intervention isn't
needed anymore
* dvipng.1: Update manpage
* dvipng.texi: Update for 1.9
* COPYING, Makefile.in, color.c, commands.h, configure.ac, draw.c,
dvi.c, dvipng.c, dvipng.h, dvipng.texi, enc.c, font.c, fontmap.c,
ft.c, macros.texi, miktex.h, miktex.mak, misc.c, papersiz.c, pk.c,
ppagelist.c, set.c, sfd.c, special.c, t1.c, test_dvipng.tex,
tfm.c, vf.c: Update FSF address
* fontmap.c: Add ttfonts.map to the searched font maps
* RELEASE: Prepare for 1.9
2006-11-02 Jan-Ake Larsson
* dvipng.texi: Nitpicking on bitmapped graphics
2006-10-13 Jan-Ake Larsson
* readme.texi: Add note about subfont (CJK) support
* install.texi: Add that FreeType2 is needed for subfont (CJK) support
2006-10-12 Jan-Ake Larsson
* readme.texi: Fix todo
2006-10-11 Jan-Ake Larsson
* sfd.c: Change && to || so that multiple subfonts work
* ft.c: Adjust debug output
* configure.ac: Add sfd.o
2006-10-04 Jan-Ake Larsson
* configure.ac: Prepare for 1.9
* sfd.c: Only look for subfont file on recent kpathsea
* dvipng.c, ft.c, fontmap.c, dvipng.h: Prepare for subfonts (CJK)
* sfd.c: Added. Used for subfonts (CJK)
* configure.ac: Change wording of gs helptext
* ft.c: Adjust debug message, and encoding selection
* special.c: Adjust debug messages
* dvipng.texi: Document the --strict option
* dvipng.c: Fix timer
* Makefile.in: Add dist target, simplify distclean
* fontmap.c: Remove segfault occuring for non-existent font
2006-08-08 Jan-Ake Larsson
* special.c: Make showpage flag static
* special.c:
Fix bug with -dSAFER and non-. paths, and bug with pngalpha and
background color
2006-05-17 Jan-Ake Larsson
* fontmap.c: Rearrange, simplify, speed up
2006-05-16 Jan-Ake Larsson
* ft.c: FT_LOAD_TARGET_LIGHT does not work in some cases, fall
back to FT_LOAD_NO_HINTING
2006-05-08 Jan-Ake Larsson
* dvipng.texi: Add credit
* Makefile.in: add www target
* README:
* readme.texi: Update capabilities info and preview-latex link
2006-03-30 Jan-Ake Larsson
* Release 1.8
* RELEASE: Update for 1.8
* set.c:
* readme.texi:
* install.texi:
* ft.c:
* dvi.c:
* draw.c:
* README:
* INSTALL: Update copyright
2006-03-29 Jan-Ake Larsson
* dvipng.1:
* dvipng.texi: Document new switch, new PostScript inclusion,
rearrange and adjust
* misc.c:
* INSTALL:
* README:
* install.texi:
* readme.texi: Minimal documentation adjustments
2006-03-27 Jan-Ake Larsson
* ft.c: Change to FT_LOAD_TARGET_LIGHT
* draw.c: Fix segfault in debug mode
* aclocal.m4: Make sure the kpse_enc_format test fails for the
right reason only
2006-02-27 Jan-Ake Larsson
* special.c: Use gs' pngalpha device, render without clipping,
adjust image position
* set.c: Simplify code, make color cache (page-)persistent
* draw.c: Reset new flag
* misc.c: New switch, remove some old switches from fast-help, use
new flag name
* dvipng.h: New flags
* configure.ac:
* config.h.in: Simplify gd tests
* configure.ac:
* aclocal.m4: Check gs devices
2006-02-10 Jan-Ake Larsson
* special.c: Use execlp for gs call
2006-02-03 Jan-Ake Larsson
* special.c:
Revert message about file type, debug information is enough
* special.c: Warn for nonexistent image decoder
2006-02-01 Jan-Ake Larsson
* special.c: Warn with file type when unable to load included image
* special.c: Read the first byte of file to be included and
compare with magic number
2006-01-31 Jan-Ake Larsson
* special.c: Temporary version, just try the different image
decoders and see
* special.c: Use correct variables
2006-01-29 Jan-Ake Larsson
* special.c: Add code to check image access permission
2006-01-28 Jan-Ake Larsson
* special.c: Simplify some code
* papersiz.c: Fix rounding error for length calculation
2006-01-26 Jan-Ake Larsson
* color.c: Fix typo that gave a segfault
* config.h.in: Remove unneeded function check
* configure.ac: Update for 1.8, remove unneeded function check
* dvipng.h: Switch debug numbers to coincide with the manual
* misc.c: Remove isdigit
* special.c: Add code to include PNG, JPEG and GIF images
2006-01-12 Jan-Ake Larsson
* special.c: Add a space in message
* misc.c: Do more tests for numeric-parameter options
* dvi.c: Outfilename: only remove .dvi extension, not others
2005-10-11 Jan-Ake Larsson
* Release 1.7
* INSTALL: Typographic changes
* README:
* RELEASE:
* configure.ac:
* dvipng.1:
* dvipng.texi: Adjust for 1.7
* install.texi: Insert space
* miktex.h: Adjust for 1.7, I am uncertain which of the new calls
are available in the MIKTeX environment
* readme.texi: Remove reference to my old laptop
2005-09-30 Jan-Ake Larsson
* config.h.in, configure.ac, ft.c:
Only use FT_Library_Version if available
2005-07-05 jalar
* Makefile.in: Enable srcdir != builddir
2005-07-04 jalar
* font.c: Add length check for font name
2005-06-28 Jan-Ake Larsson
* special.c: Read preview-latex version
2005-06-27 Jan-Ake Larsson
* Release 1.6
* RELEASE: Report what fixes have been done
* dvipng.texi: Document xcolor adaptations
* misc.c: Add 'Transparent' in the quick-help
* special.c: Cosmetics, do a _small_ message for bop-hook redef
2005-06-16 Jan-Ake Larsson
* dvipng.h:
* dvipng.c:
* color.c: Revamp colorname interpreter for xcolor
2005-06-14 Jan-Ake Larsson
* misc.c: Adjust MIKTeX stuff
2005-06-13 Jan-Ake Larsson
* color.c: Don't use strtok, adjust for xcolor
* special.c: Don't use strtok
2005-04-25 Jan-Ake Larsson
* config.h.in:
* configure.ac:
* set.c: Don't do alpha blending in truecolor mode, write alpha
channel to file
2005-04-20 Jan-Ake Larsson
* dvipng.texi: Add Credits
2005-04-19 Jan-Ake Larsson
* dvipng.h: Fix for sys/types.h conflict in old IRIX systems
* special.c: Adjust tightpage test
2005-04-04 Jan-Ake Larsson
* special.c: Make tightpage option backwards compatible
* RELEASE: Prepare for 1.6
* dvipng.1: Regenerate man page
* configure.ac:
* dvipng.texi:
* miktex.h: Update version info
* configure.ac:
* dvipng.texi:
* README:
* readme.texi: Update mailing list address
* configure.ac:
* config.h.in:
* special.c: Simplify string search
2005-04-03 Jan-Ake Larsson
* special.c: Try to detect all preview-latex versions tightpage
code
2005-03-02 Jan-Ake Larsson
* set.c: Remove extra debug printout
* t1.c: Sizes are given in big points in T1lib, in TeX points in
DVI files
* ft.c: Sizes are given in big points in FreeType, in TeX points
in DVI files
* dvipng.h: Fix boolean type again
2005-02-10 Jan-Ake Larsson
* config.h.in:
* configure.ac:
* dvipng.texi:
* dvipng.h:
* misc.c:
* set.c: Add proper alpha channel
2005-02-04 Jan-Ake Larsson
* color.c:
* draw.c:
* dvi.c:
* dvipng.c:
* font.c:
* ft.c:
* misc.c:
* papersiz.c:
* pk.c:
* set.c:
* special.c:
* t1.c:
* tfm.c:
* vf.c: Cosmetic changes to warnings and fatals
* Release 1.5
* RELEASE: Prepare for 1.5
* INSTALL:
* Makefile.in:
* README:
* color.c:
* commands.h:
* configure.ac:
* draw.c:
* dvi.c:
* dvipng.1:
* dvipng.c:
* dvipng.h:
* dvipng.texi:
* enc.c:
* font.c:
* fontmap.c:
* ft.c:
* install.texi:
* macros.texi:
* miktex.h:
* misc.c:
* papersiz.c:
* pk.c:
* ppagelist.c:
* readme.texi:
* set.c:
* special.c:
* t1.c:
* test_dvipng.tex:
* tfm.c:
* vf.c: Update Copyright, set version 1.5
2005-02-03 Jan-Ake Larsson
* draw.c:
* dvipng.h:
* set.c: Fix bug in --picky mode
2005-01-27 Jan-Ake Larsson
* dvipng.c: Restore --mfmode and --bdpi functionality
2005-01-25 Jan-Ake Larsson
* color.c: Fix segfault when trying to find nonexisting dvipsnam
color
* dvipng.c: Make dvipsnam colors available on command line
2004-12-10 Jan-Ake Larsson
* Release 1.4
* RELEASE:
* configure.ac:
* dvipng.1:
* dvipng.texi: Set version 1.4
* README: Fix formatting
* misc.c: Use mmap test. Hopefully, it will fail on ULTRIX, mmap
only works on character special devices (and not on regular files)
2004-12-02 Jan-Ake Larsson
* config.h.in:
* configure.ac:
* dvipng.h: Move int64_t and uint64_t tests entirely to autoconf
* dvi.c: Fix signedness
2004-11-30 Jan-Ake Larsson
* misc.c: Fix NULL dereference.
2004-11-25 Jan-Ake Larsson
* Release 1.3
* Makefile.in, README, dvipng.1, readme.texi: Fix dvigif
installation and docs
* INSTALL:
* README: Add license
* dvipng.c: Remove duplicate copyright
* config.h.in:
* configure.ac: Add some tests
* dvipng.1:
* dvipng.texi: Add some minor things
2004-11-24 Jan-Ake Larsson
* config.h.in:
* configure.ac: Test for 64-bit types.
* dvipng.h: Use char* arithmetic, not void*. And enable use of
gcc -ansi -pedantic.
* special.c: Don't use C++ comments.
* papersiz.c: Rewrite
* draw.c:
* dvi.c:
* font.c:
* ft.c:
* misc.c:
* pk.c:
* tfm.c:
* vf.c: Fix signedness
2004-11-15 Reiner Steib
* draw.c, dvipng.c, enc.c, font.c, ft.c, pk.c, special.c, t1.c:
Don't use C++ comments.
2004-11-05 David Kastrup
* Makefile.in (install-dvigif): Don't fail if dvigif already
exists.
2004-11-02 Jan-Åke Larsson
* dvipng.h: Fix boolean type
2004-11-01 Jan-Åke Larsson
* RELEASE: Update for 1.3
* dvipng.h: Load alloca.h when available
* font.c:
* fontmap.c: Remove inline
* Makefile.in:
* commands.h:
* config.h.in:
* configure.ac:
* install.texi:
* macros.texi:
* miktex.h:
* readme.texi:
* test_dvipng.tex: Add copyright notice
* color.c:
* draw.c:
* dvi.c:
* dvipng.c:
* dvipng.h:
* enc.c:
* font.c:
* fontmap.c:
* ft.c:
* misc.c:
* papersiz.c:
* pk.c:
* ppagelist.c:
* set.c:
* special.c:
* t1.c:
* tfm.c:
* vf.c: Change c-in-a-circle to (C)
2004-10-27 Jan-Åke Larsson
* dvipng.1:
* dvipng.texi: Amend docs
* misc.c: Amend helptext
2004-10-26 Jan-Åke Larsson
* set.c:
* misc.c:
* dvipng.h: Change background transparency
* configure.ac: Bump version, add test for libz
2004-10-07 Jan-Åke Larsson
* dvipng.texi: document change in -o switch
2004-10-06 Jan-Åke Larsson
* set.c: Allow longer pagenumbers in output file (e.g., %06d)
2004-08-18 Jan-Åke Larsson
* Release 1.2
* RELEASE: Change for 1.2
* config.h.in: Update
* dvipng.1: change help text
* dvipng.texi: update mailing list text. And version.
* README:
* readme.texi: update info and todo list
* draw.c, misc.c, dvipng.c, dvipng.h:
Add an intermediate exit status
2004-08-17 Jan-Åke Larsson
* misc.c: add --gamma switch
* special.c: Fix comment
* set.c:
* dvipng.h: new Gamma function
* configure.ac: libm is needed by new gamma code
* dvipng.1:
* dvipng.texi: document new switches
* draw.c: change name of picky flag
* special.c: do not call ghostscript when switch given
* misc.c: add picky and ghostscript switches
* dvipng.h: add picky and ghostscript flags
2004-08-06 Jan-Åke Larsson
* dvipng.texi: Document --png, --gif, and --picky
* .cvsignore: Add *.gif
* Makefile.in: Install 'dvigif' if we have GIF support
* configure.ac: Test for gdImageGif and 'ln -s'
* config.h.in: GIF support
* set.c: GIF writing
* misc.c: basename fixes, --png and --gif fixes,
--no-image-on-warn changes name to --picky
* dvi.c: basename fixes
* dvipng.h: Portability fixes, add GIF image flag
2004-08-02 Jan-Åke Larsson
* draw.c: Fix behaviour of --no-image-on-warn
2004-07-01 Jan-Åke Larsson
* miktex.mak: New, for MIKTeX
* dvi.c:
* dvipng.c:
* dvipng.h:
* special.c: Adjust for MIKTeX
* color.c:
* enc.c:
* font.c:
* fontmap.c:
* misc.c:
* pk.c:
* tfm.c:
* vf.c: Move file-mmapping to misc.c, adjust it for MIKTeX
2004-06-29 Jan-Åke Larsson
* configure.ac:
* dvipng.h: inttypes.h not available on all platforms
* special.c: Remove snprintf, not available on certain platforms
2004-06-27 Jan-Åke Larsson
* dvipng.c: Fix case of missing font libs
* fontmap.c: Remove debug printf
* draw.c: Fix for case of absent font lib(s), correct typo
2004-06-24 Jan-Åke Larsson
* fontmap.c:
* pk.c:
* vf.c: More memory fixes
2004-06-21 Jan-Åke Larsson
* config.h.in:
* configure.ac: Test for stdbool, munmap and strtol
* test_dvipng.tex: Change color test
* dvipng.h:
* misc.c:
* ppagelist.c: Fix -r switch
* dvipng.h:
* font.c:
* misc.c:
* ppagelist.c:
* special.c:
* t1.c:
* tfm.c: Use stdbool
* color.c:
* dvi.c:
* dvipng.c:
* dvipng.h:
* enc.c:
* font.c:
* fontmap.c:
* ppagelist.c:
* special.c: Fix memory leak(s)
* color.c:
* draw.c:
* dvi.c:
* dvipng.h:
* misc.c:
* set.c:
* special.c: Fix color stack
* draw.c:
* dvipng.h:
* ft.c:
* pk.c:
* set.c:
* t1.c:
* tfm.c:
* vf.c: Simplify char structs
* color.c:
* draw.c:
* dvi.c:
* dvipng.c:
* dvipng.h:
* enc.c:
* font.c:
* fontmap.c:
* ft.c:
* misc.c:
* papersiz.c:
* pk.c:
* ppagelist.c:
* set.c:
* special.c:
* t1.c:
* tfm.c:
* vf.c: Add copyright notice
2004-05-31 Jan-Åke Larsson
* dvipng.1:
* configure.ac:
* RELEASE:
* INSTALL: Release 1.1
2004-05-26 Jan-Åke Larsson
* special.c: Handle source specials
* test_dvipng.tex: Add failing special and color test
* dvipng.c: Adjust coment about SELFAUTO...
* dvi.c: Fix possible overflow
2004-05-24 Jan-Åke Larsson
* misc.c: Remove -t, it is not implemented yet
* dvipng.h: Undef malloc, if defined
2004-05-18 Jan-Åke Larsson
* dvipng.texi: Fix build
2004-05-14 Jan-Åke Larsson
* config.h.in: Use more tests
* dvipng.1: Add documentation
* dvipng.texi: Fix build. Revert to four-argument @node, my
makeinfo cannot handle the one-argument form (yet).
2004-05-11 Jan-Åke Larsson
* configure.ac: More tests
2004-05-09 Jan-Åke Larsson
* install.texi: T1lib docs
* dvipng.1:
* dvipng.texi: Add documentation, and spellcheck
* special.c:
* color.c: Make colors work again.
2004-05-08 David Kastrup
* Create new ChangeLog for dvipng
2004-05-05 Jan-Åke Larsson
* fontmap.c: Use both kpse_fontmap_format and
_dvips_header_
* enc.c: Use configure test
* configure.ac: Add test for kpse_enc_format, reorder gd
and png tests
* aclocal.m4: Add test for kpse_enc_format
* special.c: More informative warnings
2004-05-04 Jan-Åke Larsson
* enc.c:
Use the new kpathsea search format kpse_enc_format if available,
otherwise use kpse_tex_ps_header_format
* fontmap.c:
Fix new kpathsea search type kpse_fontmap_format, use
kpse_dvips_config_format if not available
* ft.c: Fix sizing
* draw.c: Simplify LoadT1 call
* t1.c: Shorten call, fix sizing
* dvipng.h: Simplify char-storing structure
2004-05-03 Jan-Åke Larsson
* fontmap.c, font.c, t1.c, ft.c:
Fix for ps fonts not in psfontmap
2004-05-02 Jan-Åke Larsson
* Makefile.in:
* config.h.in:
* configure.ac:
* draw.c:
* dvipng.c:
* dvipng.h:
* enc.c:
* font.c:
* fontmap.c:
* ft.c:
* t1.c:
* misc.c: Add t1lib support
2004-04-05 Jan-Åke Larsson
* dvipng.1:
* readme.texi:
* dvipng.texi:
* Makefile.in: Add man page
2004-03-27 Jan-Åke Larsson
* dvipng.texi: Fix debug documentations
* dvipng.c: Dont fail on --mode without --bdpi, output a warning.
2004-03-26 Jan-Åke Larsson
* papersiz.c: Remove compiler warning
* dvipng.texi:
* misc.c: Change year
2004-03-25 Jan-Åke Larsson
* special.c: Revert change, not only resolution but also
offset is needed when generating png from ps
* misc.c: Change helptext
* configure.ac: Change version number
* README: Checkin updated README
* pk.c:
* ft.c: Speed up color cache
* dvipng.texi: Add info on resolution, change version number
2004-03-24 Jan-Åke Larsson
* special.c: Fix missing 'showpage' and a memory leak
* font.c: Adjust error message
* dvipng.h:
* ft.c:
* pk.c: Change ink darkness map
* draw.c: Output page numbers more often. If the user has a
slow terminal he's to blame himself, not me.
* tfm.c: Include alloca.h if present
2004-03-23 Jan-Åke Larsson
* dvipng.texi: Adjust for the new -D option
2004-03-19 dakas
* RELEASE: Remove spurious blanks.
2004-03-19 Jan-Åke Larsson
* RELEASE: Update, shorten
2004-03-18 Jan-Åke Larsson
* RELEASE:
* dvi.c:
* dvipng.c:
* dvipng.h:
* font.c:
* misc.c:
* papersiz.c:
* special.c: Change the behaviour of the -D switch
2004-03-08 Jan-Åke Larsson
* font.c: Don't retry on PK generation failure
2004-03-02 David Kastrup
* dvi.c (DVIOpen): Fix a buffer overrun error.
ChangeLog.0 0000664 0001750 0001750 00000046124 14737210011 012253 0 ustar janla64 janla64 2004-01-16 Jan-Åke Larsson
* font.c: fix compile without FT2
2004-01-12 Jan-Ake Larsson
* RELEASE: Prepare for 0.9
* misc.c: Enable --expand-bbox
* color.c:
* draw.c:
* dvipng.h:
* font.c:
* misc.c:
* special.c: Enable --no-image-on-warn
* draw.c:
* dvi.c:
* dvipng.c:
* dvipng.h:
* readme.texi:
* special.c: Fix tightpage behaviour
2004-01-09 Jan-Ake Larsson
* special.c: Add preview-latex's "tightpage" code
2004-01-08 Jan-Ake Larsson
* dvipng.texi:
* configure.ac: Prepare for 0.9
* Makefile.in: clean target
2004-01-07 Jan-Ake Larsson
* color.c:
* draw.c:
* dvi.c:
* dvipng.c:
* dvipng.h:
* enc.c:
* font.c:
* fontmap.c:
* ft.c:
* pk.c:
* set.c:
* special.c:
* tfm.c:
* vf.c: Speedup DEBUG
* pk.c: Fix subpixel offsets
* dvipng.c:
* dvipng.h:
* font.c:
* misc.c:
* set.c:
* special.c: Fix flags
* draw.c: Fix bbox
* dvipng.h: Adjust for freetype >= 2.1.6
2003-12-15 Jan-Ake Larsson
* tfm.c:
* fontmap.c:
* font.c: Fix freeeeeeeeeing
2003-12-08 Jan-Ake Larsson
* dvipng.texi:
* configure.ac:
* RELEASE: Prepare for 0.8
* ft.c: Fix debug output
* draw.c:
* dvipng.h:
* dvipng.texi:
* misc.c: Add --height option
* test_dvipng.tex: A nice equation is true. Behave!
2003-12-07 Jan-Ake Larsson
* enc.c: Encodings are _ps_header_s
2003-12-05 Jan-Åke Larsson
* misc.c:
* dvipng.texi:
* dvipng.h:
* draw.c: Change --baseline to --depth
2003-12-01 Jan-Ake Larsson
* draw.c:
* dvipng.h:
* misc.c: Change to physical pagenumbers, instead of DVI
pagenumbers. DVI pagenumbers will be indicated on STDOUT if they
differ from physical pagenumbers, but the numbering of PNG files
is physical pagenumbers. Old behaviour can be chosen with the
option -dvinum.
* ppagelist.c:
* misc.c:
* dvipng.texi: Make negative pages render. Now -pp handles
negative pages gracefully too. Remove -pp code taken from dvips.
2003-11-30 Jan-Ake Larsson
* draw.c:
* dvipng.c:
* dvipng.h:
* font.c:
* ft.c:
* misc.c:
* pk.c:
* set.c:
* tfm.c:
* vf.c: Include alloca.h when necessary, start preparing
transition to subpixel rendering, do proper cleanup on exit
2003-11-18 Jan-Åke Larsson
* enc.c: Fix bug
* ft.c:
* tfm.c:
* font.c:
* dvipng.h: Add fallback from FT to PK
2003-11-14 Jan-Åke Larsson
* Makefile.in: Use $DESTDIR
2003-11-06 Jan-Åke Larsson
* special.c: Fix postscript inclusion: placement and
background color
2003-10-17 Jan-Åke Larsson
* misc.c:
* font.c:
* dvipng.texi:
* dvipng.h: Add option for freetype activation
* configure.ac: Add message when freetype is present
* ft.c: Apparently FreeType hinting is a no-no. Load glyphs
with FT_LOAD_NO_HINTING. Only then output is acceptable.
2003-10-15 Jan-Åke Larsson
* fontmap.c: Remove erroneous match
2003-10-13 Jan-Åke Larsson
* font.c: Fix font searching order
* RELEASE: Prepare for 0.7
* fontmap.c:
* psfontmap.c:
* configure.ac: Rename psfontmap.c to fontmap.c
2003-10-08 Jan-Ake Larsson
* psfontmap.c: Add third bare word: encoding
2003-10-07 Jan-Ake Larsson
* misc.c:
* dvipng.texi: Allow for -- on options
* configure.ac: Prepare for 0.7
* Makefile.in: Adjust hint
* configure.ac:
* config.h.in: Fix helptext in config.h.in
* test_dvipng.tex: Add some tests for ligatures and sizes
2003-10-03 Jan-Åke Larsson
* readme.texi: Document new font support and switches
* psfontmap.c: Redesign psfontmap loading to use the syntax
from dvips' docs
* font.c: Enhance TrueType font finding
* draw.c: Warn if setting char from null font
* dvipng.h:
* color.c: Load and use psnames.def
2003-09-28 Jan-Ake Larsson
* misc.c: Warn for all bad options
2003-09-24 Jan-Ake Larsson
* dvipng.texi:
* install.texi:
* misc.c: Fix documentation
2003-09-23 Jan-Ake Larsson
* ft.c:
* enc.c:
* dvipng.h: Only load encodings once
2003-09-18 Jan-Åke Larsson
* draw.c:
* dvipng.h:
* misc.c: Add -baseline switch
2003-09-17 Jan-Ake Larsson
* font.c: Remove compiler warning
* config.h.in:
* psfontmap.c:
* dvipng.c:
* configure.ac: Fix SELFAUTO... variables if dvipng is not
being installed in main texmf tree. This will make it find config
files and fonts anyway.
2003-09-16 Jan-Ake Larsson
* tfm.c:
* psfontmap.c:
* ft.c:
* enc.c: Added for postscript font handling with freetype
* font.c: Use freetype font loading
* dvipng.h: Add freetype-related types and declarations,
and simplify glyph rendering
* pk.c: Simplify glyph rendering
* dvipng.c: Init freetype
* dvi.c: Fix strlen bugs
* draw.c: Add FONT_TYPE_FT drawing
* configure.ac:
* config.h.in:
* Makefile.in: Adjust for freetype things
2003-08-29 Jan-Åke Larsson
* special.c: fix color handling
* dvipng.c: Increase TIMING output
* misc.c:
* draw.c: small speedups
* dvipng.h:
* configure.ac:
* config.h.in:
* Makefile.in: Change handling of the DEBUG and TIMING
flags
2003-08-26 Jan-Åke Larsson
* RELEASE, dvipng.texi, configure.ac:
prepare for 0.6
* Makefile.in: another install-docs fix
2003-08-13 Jan-Åke Larsson
* configure.ac: new test (ps inclusion speedup)
* draw.c: simplify preprocessor processing, fix SetSpecial
call
* special.c: speedup for ps image inclusion, fix SetSpecial
call
* Makefile.in: fix install-docs
2003-08-04 Jan-Åke Larsson
* special.c: Argh!, fix compilation for non-truecolor version
* dvipng.h: Argh!, fix image cache
* dvipng.texi:
* configure.ac:
* RELEASE: Prepare for 0.5
* misc.c:
* dvipng.h:
* set.c: Add preliminary truecolor support
* pk.c: Benchmark truecolor rendering, no real code change
* special.c:
* misc.c:
* dvipng.h: Add preliminary image cacheing
* draw.c: Small adjustments
2003-07-30 Jan-Åke Larsson
* draw.c: Fix two bugs so that bounding box again is
correct
* configure.ac: configuration printout improved
2003-07-02 Jan-Åke Larsson
* dvipng.h: Add prototypes
* draw.c: minor change
* RELEASE: prepare for 0.4
2003-07-01 Jan-Åke Larsson
* draw.c, set.c:
Fix rules (again), this time taking maxdrift into account.
* pk.c: Unfortunately gdImageColorResolveAlpha only works
on truecolor images. Some other day, then. I did fix the
performance of PROPER_OVERSTRIKE, though.
* readme.texi: Add todo
2003-06-30 Jan-Åke Larsson
* dvipng.texi: small fixes
* vf.c: Speedup macro start/end
* set.c: Handle offset in draw.c only, allow choice of
compression if gd can do this
* pk.c: Handle overstrike, either with gd alpha level, if
support exists for that, or "manually". The latter is active if
PROPER_OVERSTRIKE is #defined, currently yes, at roughly 5%
performance loss.
* misc.c: -z option: choose compression if gd can do this
* dvipng.h: Proper rounding, gd bells and whistles
* draw.c: Allow drift a la dvitype, maxdrift=1, handle
offset here only, speedup vf macro start/end
* config.h.in:
* configure.ac: New tests for gd bells and whistles
* Makefile.in: Clean README
* .cvsignore: More files
2003-06-23 Jan-Åke Larsson
* configure.ac:
* config.h.in: Added tests for newly added C code
* Makefile.in:
* dvipng.texi: Reflect move of readme
* README:
* readme.texi: Moved from README to readme.texi
2003-06-19 Jan-Åke Larsson
* special.c: Fix crash on file not found
* set.c: Code reformatting
* misc.c: Fix switches, and send warnings/errors to stderr.
* vf.c:
* pk.c:
* draw.c: Include header only used in this file, here.
* commands.h: Make draw.c compile without -DDEBUG
* Makefile.in: Use --disable-debug, fix docs
generation/install, and add 'test' target.
* README: Update info
* configure.ac: Add --disable-debug
* install.texi: Minor changes
* dvipng.texi: Document difference between -pp and -p + -l
* dvipng.h: Fix FreeBSD non-C99 header issue
2003-06-12 Jan-Åke Larsson
* Makefile.in: Fix SunOS make suffix rule wierdness
* color.c: Change comment
* dvi.c (DVIOpen): bugfix ".dvi" completion
* dvipng.h (PIXROUND): Round down instead of up, SetRule
now has its own rounding mechanism
* set.c (SetRule): Refine rule drawing, make sure rule is
inside bounding box
2003-06-10 Jan-Åke Larsson
* README:
* RELEASE:
* Makefile.in:
* configure.ac:
* dvipng.texi: Prepare for 0.3
* vf.c:
* set.c:
* pk.c:
* font.c:
* dvi.c:
* draw.c: simplify DEBUG_PRINT
* configure.ac: Look for gs
* special.c: Fixes to gs interaction
* set.c: Enable -o for output file, no segfault on empty
image, reposition rule to match dvips
* draw.c: simplify DEBUG_PRINT macro
* dvi.c:
* misc.c: Enable -o for output file
* dvipng.h: Enable -o for output file, simplify DEBUG_PRINT
macro
2003-04-17 Jan-Ake Larsson
* install.texi:
* dvipng.texi: Rewrite stuff
* dvipng.h: New debug flag
* configure.ac:
* config.h.in: Configure GS_PATH
* special.c: No tempfiles anymore. Communicate with child
through two pipes.
* configure.ac:
* Makefile.in: Make docs
2003-04-15 Jan-Åke Larsson
* macros.texi: Added
* install.texi, dvipng.texi: Initial version
2003-03-28 Jan-Åke Larsson
* README:
* RELEASE: Release 0.2, PostScript type1 font support and
PostScript inclusion.
* configure.ac: Added configure error message about where
to find libgd.
* dvipng.h:
* draw.c (DrawCommand):
* special.c (SetSpecial): Postscript inclusion now works.
* misc.c (DecodeArgs): Fix --help message
* COPYING:
* RELEASE:
* README: Added files to repository
2003-03-12 Jan-Åke Larsson
* dvi.c (DVIFollowToggle):
* misc.c (DecodeArgs):
* dvipng.h: Added '-follow' switch, and code that
implements a follow mode.
2003-02-27 Jan-Åke Larsson
* draw.c (DrawPages):
* misc.c (Message): Speed up slightly when not in DEBUG
mode.
* misc.c (DecodeArgs): Adjust copyright notice.
* set.c (SetRule): Reposition rules, one dot up.
2003-01-30 Jan-Åke Larsson
* Makefile.in:
* configure.ac: Fix includes and linking
* draw.c:
* font.c:
* pk.c:
* vf.c:
* dvipng.h (font_entry): remove unnamed union
* dvipng.h: simplify includes
2003-01-15 Jan-Ake Larsson
* misc.c: Use autoconf's stuff, use atoi, fix warning
message
* dvipng.c:
* dvipng.h: Localize position and spacing to draw.c. Fix
timing
* pk.c:
* set.c:
* special.c:
* vf.c:
* draw.c: Localize position and spacing to draw.c
* configure.ac: Require gd and kpathsea
2002-12-03 Jan-Ake Larsson
* draw.c: unfinished change: repairing
* draw.c:
* font.c:
* vf.c: use void* in function call
* dvipng.h:
* draw.c:
* color.c:
* set.c: change names of some functions
* dvipng.h:
* draw.c:
* dvi.c:
* ppagelist.c: make dvi data more local
* .cvsignore:
* dvipng.h:
* special.c:
* font.c:
* misc.c:
* dvipng.c:
* configure.ac:
* config.h.in:
* Makefile.in: autoconfiscate
2002-11-07 Jan-Ake Larsson
* dvipng.h:
* dvipng.c (main):
* dvi.c (DVIReOpen): Don't re-init, re-open
2002-10-31 Jan-Ake Larsson
* dvipng.h:
* dvi.c: Remove globals and Reopen DVI on change (check
mtime)
* dvipng.c: Reopen DVI on change (check mtime)
2002-10-30 Jan-Ake Larsson
* pk.c: Declaration moved here from dvipng.h
* Makefile: No io.c, no pagequeue.c but ppagelist.c
* dvipng.h: Rearranged, some new declarations
* dvipng.c (main): minor changes
* draw.c (DoPages): use new page-finding mechanisms
* dvi.c: outfilename handling fixed, page-finding
mechanisms added.
* misc.c: Ppagelist handling improved, outfilename now
works, added functionality from io.c
* ppagelist.c: Added. Functionality slightly different from
pagequeue.c
* pagequeue.c: Revamped. Functionality changed and moved to
ppagelist.c
* io.c: Removed. Functionality in misc.c
* .cvsignore: Additions
2002-10-24 Jan-Ake Larsson
* dvipng.c (main):
* dvipng.h:
* misc.c (DecodeString): Improve stdin parser
2002-10-21 Jan-Ake Larsson
* dvipng.h: Remove globals, fix message output
* vf.c (SetVF, InitVF),
* font.c (FontDef),
* draw.c (DrawCommand): Bugfix VF handling, fix message
output
* pk.c (SetPK, InitPK),
* dvi.c (DVIOpen): Fix message output
* papersiz.c: use int32_t, fix overflow
* misc.c (DecodeArgs, Message): Fix -d option, remove
globals, fix message output
2002-10-16 Jan-Ake Larsson
* dvipng.h: Remove globals
* dvipng.c (main): Remove globals, improve stdin parser
* misc.c (DecodeArgs): remove globals, fix helptext
* pagequeue.c (FindQdPage, QueuePage, QueueParse):
remove globals
* dvi.c (FindPage): Remove unnecessary test
* draw.c (DoPages): Do more normal read-ahead
2002-10-15 Jan-Ake Larsson
* pk.c, font.c: Minor change
* misc.c: Simplify, remove (some) globals, fix helptext
* pagequeue.c, dvipng.h, dvipng.c,
dvi.c, draw.c: Simplify, remove (some) globals
2002-10-14 Jan-Ake Larsson
* misc.c, dvipng.h, draw.c:
Added '-T tight' switch
2002-10-11 Angus Leeming
* draw.c:
* dvi.c:
* dvipng.[ch]:
* font.c:
* io.c:
* misc.c:
* pagequeue.c:
* papersiz.c:
* pk.c:
* set.c:
* special.c:
* vf.c: remove function prototype macros.
* dvi.c (DVIGetCommand, CommandLength):
* set.c (SetChar): add a 'break' to the end of the switch
statements (prevents a warning with gcc 3.2).
2002-10-11 Jan-Ake Larsson
* special.c: Fix DEBUG, prototypes, and code pruning
* vf.c, set.c, pk.c, io.c,
font.c, draw.c: Fix DEBUG
* misc.c, dvi.c, pagequeue.c,
dvipng.h, dvipng.c: Fix pagelist and DEBUG
2002-09-20 Jan-Ake Larsson
* dvipng.h: change font structures, add dvi struct, remove old
global variables, include relevant bits of config.h, restructure
somewhat
* dvipng.c: remove explicit vf stack
* special.c: use dvi struct
* misc.c: minor changes
* io.c: close file descriptors, not FILE pointers.
* draw.c: simplify, remove explicit vf stack.
* set.c: use dvi struct, remove explicit dvi stack.
* vf.c: use mmap, remove explicit vf stack.
* pk.c: use mmap
* font.c: enable dvi struct, prepare for mmap (file descriptors,
not FILE pointers), explicit vf stack removed.
* dvi.c: use dvi struct
* Makefile: config.h removed
* config.h, klibtool, klibtool.config: removed.
2002-08-30 Jan-Ake Larsson
* dvi.c: fix bug in STRSIZE zap
* vf.c: simplify, fix debug info, zap STRSIZE limit
* misc.c: Fix background transparency
* dvipng.h, draw.c: Fix FormFeed bug (outfilename
wrong)
* set.c: Fix FormFeed bug (outfilename wrong), and background
transparency
2002-08-29 Jan-Ake Larsson
* dvipng.h: type changes, dvi-io abstraction
* color.c: comment changed
* dvipng.c: dvi-io abstraction
* font.c: type changes, STRSIZE killed
* io.c: ReadCommand and CommandLength moved to dvi.c, preparations
for mmap
* set.c: type changes
* vf.c, pk.c: prepare for mmap, type changes
* pagequeue.c: type change
* misc.c: dvi fopen moved to dvi.c, type changes
* Makefile: pagelist.o gone, dvi.o new
* draw.c: SetVF moved to vf.c, type and dvi-io abstraction
changes
* commands.h: added length and debug texts
* dvi.c: Functionality moved from pagelist.c and misc.c to
dvi.c. Still needs work, but is initial stab at proper abstraction
of dvi-reading stuff. STRSIZE killed.
* pagelist.c: Functionality moved to dvi.c
* special.c: DoSpecial now takes a const char* argument, as
opposed to before.
2002-08-19 Jan-Ake Larsson
* misc.c: Added -mode switch
2002-08-14 Jan-Ake Larsson
* dvipng.h: VF additions, general cleanup
* dvipng.c: Small adjustments connected to the VF support
* config.h: Remove unnecessary things
* pagelist.c: Simplifications
* color.c: Comment changed
* special.c, set.c: Scale always equal h/v
* Makefile: Make vf.o
* io.c: Start pre-conversion to mmap. Much still to be done.
* misc.c, set.c, font.c, pk.c, draw.c: Adjust for VF support
* vf.c: VF support added to dvipng
2002-06-24 Jan-Ake Larsson
* Makefile: Cleaned. Vacuumed, in fact.
2002-06-19 Jan-Ake Larsson
* pagelist.c: remove Debug bug (!)
2002-06-13 Jan-Ake Larsson
* Makefile: new object files
* special.c, set.c, dvipng.h: cleanup
* misc.c (ActualFactor): moved to font.c + cleanup
* font.c (ActualFactor): moved here from misc.c
* draw.c, dvipng.c, pagelist.c: functionality from dvipng.c spread
to these three
* pagequeue.c, pages.c: functionality moved from pages.c to
pagequeue.c
* commands.h: minor adjustments
2002-06-12 Jan-Ake Larsson
* special.c: on unimplemented \special, give pixel position
* misc.c: Bugfix + literal response on stdin interface
* font.c, dvipng.h: Font handling fixed
* dvipng.c: prompt on stdin interface
2002-06-11 Jan-Ake Larsson
* set.c (SetChar): load chars on PASS_DRAW
-T -O bug fixed
2002-06-11 Jan-Ake Larsson
* set.c: Cleanup. Still buggy wrt -O, though.
* Makefile: DEBUG on for now, postamble.? removed
* postamble.c: Postamble is no longer read
* pages.c: Improve page handling: now a queue, not an unordered
set
* font.c: Improve font handling: search for fonts only when used
* dvipng.h: Cleanup
* dvipng.c: Major rewrite: page handling improved
* misc.c: Fix DVI init + cleanup
2002-05-30 Jan-Ake Larsson
* misc.c: Transparent border: '-bd'
* dvipng.h, set.c: Tiding up + transparent border
* dvipng.c, font.c: Tidying up
2002-05-29 Jan-Ake Larsson
* color.c: Fix cmyk->rgb.
* misc.c: Add '-fg' and '-bg'.
* font.c: Tidy up
2002-05-29 Jan-Ake Larsson
* dvipng.h: Tidying up, and new global vars
* io.c: Tidying up
* papersiz.c: Pagesize matters, adapted from dvips
* pages.c: Page choosing, from dvips. Not sufficient for our
purposes, but a start
* dvipng.c, color.c, Makefile, misc.c, set.c: Changed to make
pagesize (-T), offset (-O), page choosing (-pp), and output file
(-o) work.
2002-05-27 Jan-Ake Larsson
* pk.c: Changed comments
* .cvsignore, special.c, set.c, postamble.c, pk.c, misc.c, io.c,
font.c, dvipng.c, color.c, commands.h, dvipng.h: Initial version
* config.h, Makefile: Initial version, to be replaced by
autoconf'ism
* klibtool.config, klibtool: Included for now. To be
removed.
color.c 0000664 0001750 0001750 00000032142 14747675053 011646 0 ustar janla64 janla64 /* color.c */
/************************************************************************
Part of the dvipng distribution
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
.
Copyright (C) 2002-2015,2019 Jan-Åke Larsson
************************************************************************/
#include "dvipng.h"
/*
* Color. We delete and recreate the gdImage for each new page. This
* means that the stack must contain rgb value not color index.
* Besides, the current antialiasing implementation needs rgb anyway.
*/
struct colorname {
struct colorname *next;
char* color;
char name[1];
} *colornamep=NULL,*xcp=NULL;
const char *colordef[]={"xcolor.sty","dvipsnam.def",
"svgnam.def","x11nam.def",NULL};
char *xcpname=NULL;
void initcolor(void)
{
csp = 1;
cstack[0].red=255;
cstack[0].green=255;
cstack[0].blue=255;
cstack[1].red=0;
cstack[1].green=0;
cstack[1].blue=0;
}
static struct colorname * NewColor(const char* prefix, int nprefix,
char* name, int nname,
char* model, int nmodel,
char* values, int nvalues)
{
struct colorname *tmp;
if ((tmp=malloc(sizeof(struct colorname)+3+nprefix+nname+nmodel+nvalues))==NULL)
Fatal("Cannot malloc space for color name");
tmp->color=tmp->name+nprefix+nname+1;
strncpy(tmp->name,prefix,nprefix);
strncpy(tmp->name+nprefix,name,nname);
tmp->name[nprefix+nname]='\0';
strncpy(tmp->color,model,nmodel);
tmp->color[nmodel]=' ';
strncpy(tmp->color+nmodel+1,values,nvalues);
tmp->color[nmodel+nvalues+1]='\0';
model=tmp->color;
while(*model!='\0') {
if (*model==',')
*model=' ';
model++;
}
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR NAME:\t'%s' '%s'",
tmp->name,tmp->color));
return(tmp);
}
#define FINDWORD(s) while(snext=list;
list=tmp;
} else if ((pos+15next=list;
list=tmp;
FINDWORD(pos);
}
} else {
pos++;
while (posnext;
free(xcp);
xcp=next;
}
if (xcpname!=NULL) {
free(xcpname);
xcpname=NULL;
}
}
void ClearColorNames(void)
{
struct colorname *next;
while (colornamep) {
next=colornamep->next;
free(colornamep);
colornamep=next;
}
ClearXColorPrologue();
}
void InitXColorPrologue(const char* name)
{
ClearXColorPrologue();
if ((xcpname=malloc(strlen(name)+1))==NULL)
Fatal("cannot malloc memory for xcolor prologue name");
strcpy(xcpname,name);
}
static struct colorname* LoadXColorPrologue(void)
{
struct colorname *list=NULL,*tmp=NULL;
char *filepath,*pos,*max;
const char *prefix="";
char *name,*values,*model;
int nprefix=0,nname,nvalues,nmodel;
struct filemmap fmmap;
boolean mmapfailed;
filepath=kpse_find_file(xcpname,kpse_program_text_format,false);
if (filepath == NULL)
return NULL;
DEBUG_PRINT(DEBUG_COLOR,("\n OPEN XCOLOR PROLOGUE:\t'%s'", filepath));
mmapfailed = MmapFile(filepath,&fmmap);
free(filepath);
if (mmapfailed)
return NULL;
pos=fmmap.data;
max=fmmap.data+fmmap.size;
while(posnext=list;
list=tmp;
}
}
UnMmapFile(&fmmap);
return(list);
}
#define FTO255(a) ((int) (255*a+0.5))
#define WARN_IF_FAILED(a,b) if (a==b) { page_flags |= PAGE_GAVE_WARN; \
Warning("missing color-specification value, treated as zero"); }
#define SKIPSPACES(s) while(s && *s==' ' && *s!='\0') s++
#define NEXTFLOAT255(c) FTO255(strtod(c,&end)); WARN_IF_FAILED(c,end); c=end
#define NEXTFLOAT(c) strtod(c,&end); WARN_IF_FAILED(c,end); c=end
#define NEXTINT(c) strtol(c,&end,10); WARN_IF_FAILED(c,end); c=end
#define NEXTHEX(c) strtol(c,&end,16); WARN_IF_FAILED(c,end); c=end
void stringrgb(const char* color,int *r,int *g,int *b)
{
char* end;
static int unloaded=0;
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR SPEC:\t'%s' (",color));
SKIPSPACES(color);
if (strcmp(color,"Black")==0) {
*r = *g = *b = 0;
} else if (strcmp(color,"White")==0) {
*r = *g = *b = 255;
} else if (strncmp(color,"gray ",5)==0) {
color+=5;
*r = *g = *b = NEXTFLOAT255(color);
} else if (strncmp(color,"rgb ",4)==0) {
color+=4;
*r = NEXTFLOAT255(color);
*g = NEXTFLOAT255(color);
*b = NEXTFLOAT255(color);
} else if (strncmp(color,"Gray ",5)==0) {
color+=5;
*r = *g = *b = NEXTINT(color);
} else if (strncmp(color,"RGB ",4)==0) {
color+=4;
*r = NEXTINT(color);
*g = NEXTINT(color);
*b = NEXTINT(color);
} else if (strncmp(color,"HTML ",5)==0) {
color+=5;
*b = NEXTHEX(color);
*r = *b/65536;
*g = *b/256;
*b -= *g*256;
*g -= *r*256;
} else if (strncmp(color,"cmy ",4)==0
|| strncmp(color,"cmyk ",5)==0) {
int c,m,y,k;
color+=3;
k=(*color=='k');
if (k)
color++;
c = NEXTFLOAT255(color);
m = NEXTFLOAT255(color);
y = NEXTFLOAT255(color);
if (k)
k = NEXTFLOAT255(color);
*r = c+k<255 ? 255-(c+k) : 0;
*g = m+k<255 ? 255-(m+k) : 0;
*b = y+k<255 ? 255-(y+k) : 0;
} else if (strncmp(color,"hsb ",4)==0
|| strncmp(color,"HSB ",4)==0) {
/* The hsb and HSB models really need more presicion.
Use double and convert back*/
double hu,sa,br,f,R,G,B;
int i;
if (*color=='h') {
color+=4;
hu = NEXTFLOAT(color);
sa = NEXTFLOAT(color);
br = NEXTFLOAT(color);
} else {
color+=4;
hu = (float)NEXTINT(color); hu /= 255;
sa = (float)NEXTINT(color); sa /= 255;
br = (float)NEXTINT(color); br /= 255;
}
i=6*hu;
f=6*hu-i;
switch(i) {
case 0:
R = br*(1-sa*0); G = br*(1-sa*(1-f)); B = br*(1-sa*1); break;
case 1:
R = br*(1-sa*f); G = br*(1-sa*0); B = br*(1-sa*1); break;
case 2:
R = br*(1-sa*1); G = br*(1-sa*0); B = br*(1-sa*(1-f)); break;
case 3:
R = br*(1-sa*1); G = br*(1-sa*f); B = br*(1-sa*0); break;
case 4:
R = br*(1-sa*(1-f)); G = br*(1-sa*1); B = br*(1-sa*0); break;
case 5:
R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*f); break;
default:
R = br*(1-sa*0); G = br*(1-sa*1); B = br*(1-sa*1);
}
*r=FTO255(R);
*g=FTO255(G);
*b=FTO255(B);
} else {
/* Model not found, probably a color name */
struct colorname *tmp;
if (xcp==NULL && xcpname!=NULL)
xcp=LoadXColorPrologue();
tmp=xcp;
while(tmp!=NULL && strcmp(color,tmp->name)!=0)
tmp=tmp->next;
if (tmp==NULL) {
while (colornamep==NULL && colordef[unloaded]!=NULL)
colornamep=LoadColornameFile(colordef[unloaded++]);
tmp=colornamep;
while(tmp!=NULL && strcmp(color,tmp->name)!=0) {
while (tmp->next==NULL && colordef[unloaded]!=NULL)
tmp->next=LoadColornameFile(colordef[unloaded++]);
tmp=tmp->next;
}
}
if (tmp!=NULL) {
/* Found: one-level recursion */
DEBUG_PRINT(DEBUG_COLOR,("\n ---RECURSION--- "))
stringrgb(tmp->color,r,g,b);
} else {
/* Not found, warn */
page_flags |= PAGE_GAVE_WARN;
Warning("unimplemented color specification '%s'",color);
}
}
DEBUG_PRINT(DEBUG_COLOR,("%d %d %d) ",*r,*g,*b))
}
void background(const char* p)
{
stringrgb(p, &cstack[0].red, &cstack[0].green, &cstack[0].blue);
DEBUG_PRINT(DEBUG_COLOR,("\n BACKGROUND:\t(%d %d %d) ",
cstack[0].red, cstack[0].green, cstack[0].blue));
}
void pushcolor(const char * p)
{
if ( ++csp == STACK_SIZE )
Fatal("out of color stack space") ;
stringrgb(p, &cstack[csp].red, &cstack[csp].green, &cstack[csp].blue);
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR PUSH:\t(%d %d %d) ",
cstack[csp].red, cstack[csp].green, cstack[csp].blue))
}
void popcolor(void)
{
if (csp > 1) csp--; /* Last color is global */
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR POP\t"))
}
void resetcolorstack(const char * p)
{
if ( csp > 1 )
Warning("global color change within nested colors");
csp=0;
pushcolor(p) ;
DEBUG_PRINT(DEBUG_COLOR,("\n RESET COLOR:\tbottom of stack:"))
}
void StoreColorStack(struct page_list *tpagep)
{
int i=0;
DEBUG_PRINT(DEBUG_COLOR,("\n STORE COLOR STACK:\t %d ", csp));
tpagep->csp=csp;
while ( i <= csp ) {
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i,
cstack[i].red, cstack[i].green, cstack[i].blue));
tpagep->cstack[i].red = cstack[i].red;
tpagep->cstack[i].green = cstack[i].green;
tpagep->cstack[i].blue = cstack[i].blue;
i++;
}
}
void ReadColorStack(struct page_list *tpagep)
{
int i=0;
DEBUG_PRINT(DEBUG_COLOR,("\n READ COLOR STACK:\t %d ", tpagep->csp));
csp=tpagep->csp;
while ( i <= tpagep->csp ) {
DEBUG_PRINT(DEBUG_COLOR,("\n COLOR STACK:\t %d (%d %d %d) ",i,
cstack[i].red, cstack[i].green, cstack[i].blue));
cstack[i].red = tpagep->cstack[i].red;
cstack[i].green = tpagep->cstack[i].green;
cstack[i].blue = tpagep->cstack[i].blue;
i++;
}
}
void StoreBackgroundColor(struct page_list *tpagep)
{
/* Background color changes affect the _whole_ page */
tpagep->cstack[0].red = cstack[0].red;
tpagep->cstack[0].green = cstack[0].green;
tpagep->cstack[0].blue = cstack[0].blue;
}
commands.h 0000664 0001750 0001750 00000020634 14737210011 012313 0 ustar janla64 janla64 /* commands.h */
/************************************************************************
Part of the dvipng distribution
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
.
Copyright (C) 2002-2008 Jan-Åke Larsson
************************************************************************/
/* DVI COMMANDS */
#define DVIFORMAT 2
#define SETC_000 0 /* typeset character 0 and move right */
#define SETC_127 127 /* typeset character 127 and move right */
#define SET1 128 /* typeset a character and move right */
#define SET2 129 /* ??? */
#define SET3 130 /* ??? */
#define SET4 131 /* ??? */
#define SET_RULE 132 /* typeset a rule and move right */
#define PUT1 133 /* typeset a character */
#define PUT2 134 /* ??? */
#define PUT3 135 /* ??? */
#define PUT4 136 /* ??? */
#define PUT_RULE 137 /* typeset a rule */
#define NOP 138 /* no operation */
#define BOP 139 /* beginning of page */
#define EOP 140 /* ending of page */
#define PUSH 141 /* save the current positions */
#define POP 142 /* restore previous positions */
#define RIGHT1 143 /* move right */
#define RIGHT2 144 /* ??? */
#define RIGHT3 145 /* ??? */
#define RIGHT4 146 /* ??? */
#define W0 147 /* move right by |w| */
#define W1 148 /* move right and set |w| */
#define W2 149 /* ??? */
#define W3 150 /* ??? */
#define W4 151 /* ??? */
#define X0 152 /* move right by |x| */
#define X1 153 /* move right and set |x| */
#define X2 154 /* ??? */
#define X3 155 /* ??? */
#define X4 156 /* ??? */
#define DOWN1 157 /* move down */
#define DOWN2 158 /* ??? */
#define DOWN3 159 /* ??? */
#define DOWN4 160 /* ??? */
#define Y0 161 /* move down by |y| */
#define Y1 162 /* move down and set |y| */
#define Y2 163 /* ??? */
#define Y3 164 /* ??? */
#define Y4 165 /* ??? */
#define Z0 166 /* move down by |z| */
#define Z1 167 /* move down and set |z| */
#define Z2 168 /* ??? */
#define Z3 169 /* ??? */
#define Z4 170 /* ??? */
#define FONT_00 171 /* set current font to 0 */
#define FONT_63 234 /* set current font to 63 */
#define FNT1 235 /* set current font */
#define FNT2 236 /* Same as FNT1, except that arg is 2 bytes */
#define FNT3 237 /* Same as FNT1, except that arg is 3 bytes */
#define FNT4 238 /* Same as FNT1, except that arg is 4 bytes */
#define XXX1 239 /* extension to \.DVI primitives */
#define XXX2 240 /* Like XXX1, but 0<=k<65536 */
#define XXX3 241 /* Like XXX1, but 0<=k<@t$2^{24}$@> */
#define XXX4 242 /* potentially long extension to \.DVI
primitives */
#define FNT_DEF1 243 /* define the meaning of a font number */
#define FNT_DEF2 244 /* ??? */
#define FNT_DEF3 245 /* ??? */
#define FNT_DEF4 246 /* ??? */
#define PRE 247 /* preamble */
#define POST 248 /* postamble beginning */
#define POST_POST 249 /* postamble ending */
/* undefined_commands 250,251,252,253,254,255 */
EXTERN const int8_t dvi_commandlength[256]
#ifdef MAIN
={
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1, /* SETC_000 --- SETC_127 */
2,3,4,5,9, /* SET1 --- SET4, SET_RULE */
2,3,4,5,9, /* PUT1 --- PUT4, PUT_RULE */
1,45,1,1,1, /* NOP, BOP, EOP, PUSH, POP */
2,3,4,5, /* RIGHT1 --- RIGHT4 */
1,2,3,4,5, /* W0 --- W4 */
1,2,3,4,5, /* X0 --- X4 */
2,3,4,5, /* DOWN1 --- DOWN4 */
1,2,3,4,5, /* Y0 --- Y4 */
1,2,3,4,5, /* Z0 --- Z4 */
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,
1,1,1,1, /* FONT_00 --- FONT_63 */
2,3,4,5, /* FNT1 --- FNT4 */
2,3,4,5, /* XXX1 --- XXX4 + special string */
16,17,18,19, /* FNT_DEF1 --- FNT_DEF4 + font name */
15, /* PRE + TeX comment */
29, /* POST */
10, /* POST_POST minimum */
-1,-1,-1,-1,-1,-1 /* undefined */
}
#endif
;
EXTERN const char* dvi_commands[256]
#ifdef MAIN
={
"SETC_000","SETC_001","SETC_002","SETC_003","SETC_004",
"SETC_005","SETC_006","SETC_007","SETC_008","SETC_009",
"SETC_010","SETC_011","SETC_012","SETC_013","SETC_014",
"SETC_015","SETC_016","SETC_017","SETC_018","SETC_019",
"SETC_020","SETC_021","SETC_022","SETC_023","SETC_024",
"SETC_025","SETC_026","SETC_027","SETC_028","SETC_029",
"SETC_030","SETC_031","SETC_032","SETC_033","SETC_034",
"SETC_035","SETC_036","SETC_037","SETC_038","SETC_039",
"SETC_040","SETC_041","SETC_042","SETC_043","SETC_044",
"SETC_045","SETC_046","SETC_047","SETC_048","SETC_049",
"SETC_050","SETC_051","SETC_052","SETC_053","SETC_054",
"SETC_055","SETC_056","SETC_057","SETC_058","SETC_059",
"SETC_060","SETC_061","SETC_062","SETC_063","SETC_064",
"SETC_065","SETC_066","SETC_067","SETC_068","SETC_069",
"SETC_070","SETC_071","SETC_072","SETC_073","SETC_074",
"SETC_075","SETC_076","SETC_077","SETC_078","SETC_079",
"SETC_080","SETC_081","SETC_082","SETC_083","SETC_084",
"SETC_085","SETC_086","SETC_087","SETC_088","SETC_089",
"SETC_090","SETC_091","SETC_092","SETC_093","SETC_094",
"SETC_095","SETC_096","SETC_097","SETC_098","SETC_099",
"SETC_100","SETC_101","SETC_102","SETC_103","SETC_104",
"SETC_105","SETC_106","SETC_107","SETC_108","SETC_109",
"SETC_110","SETC_111","SETC_112","SETC_113","SETC_114",
"SETC_115","SETC_116","SETC_117","SETC_118","SETC_119",
"SETC_120","SETC_121","SETC_122","SETC_123","SETC_124",
"SETC_125","SETC_126","SETC_127",
"SET1","SET2","SET3","SET4","SET_RULE",
"PUT1","PUT2","PUT3","PUT4","PUT_RULE",
"NOP","BOP","EOP","PUSH","POP",
"RIGHT1","RIGHT2","RIGHT3","RIGHT4",
"W0","W1","W2","W3","W4",
"X0","X1","X2","X3","X4",
"DOWN1","DOWN2","DOWN3","DOWN4",
"Y0","Y1","Y2","Y3","Y4",
"Z0","Z1","Z2","Z3","Z4",
"FONT_00","FONT_01","FONT_02","FONT_03","FONT_04",
"FONT_05","FONT_06","FONT_07","FONT_08","FONT_09",
"FONT_10","FONT_11","FONT_12","FONT_13","FONT_14",
"FONT_15","FONT_16","FONT_17","FONT_18","FONT_19",
"FONT_20","FONT_21","FONT_22","FONT_23","FONT_24",
"FONT_25","FONT_26","FONT_27","FONT_28","FONT_29",
"FONT_30","FONT_31","FONT_32","FONT_33","FONT_34",
"FONT_35","FONT_36","FONT_37","FONT_38","FONT_39",
"FONT_40","FONT_41","FONT_42","FONT_43","FONT_44",
"FONT_45","FONT_46","FONT_47","FONT_48","FONT_49",
"FONT_50","FONT_51","FONT_52","FONT_53","FONT_54",
"FONT_55","FONT_56","FONT_57","FONT_58","FONT_59",
"FONT_60","FONT_61","FONT_62","FONT_63",
"FNT1","FNT2","FNT3","FNT4",
"XXX1","XXX2","XXX3","XXX4",
"FNT_DEF1","FNT_DEF2","FNT_DEF3","FNT_DEF4",
"PRE","POST","POST_POST",
"UNDEF_250","UNDEF_251","UNDEF_252","UNDEF_253","UNDEF_254","UNDEF_255"
}
#endif
;
config.guess 0000700 0001750 0001750 00000140512 14747712072 012662 0 ustar janla64 janla64 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2022 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
timestamp='2022-01-09'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to .
# The "shellcheck disable" line above the timestamp inhibits complaints
# about features and limitations of the classic Bourne shell that were
# superseded or lifted in POSIX. However, this script identifies a wide
# variety of pre-POSIX systems that do not have POSIX shells at all, and
# even some reasonably current systems (Solaris 10 as case-in-point) still
# have a pre-POSIX /bin/sh.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
# Just in case it came from the environment.
GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
tmp=
# shellcheck disable=SC2172
trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
set_cc_for_build() {
# prevent multiple calls if $tmp is already set
test "$tmp" && return 0
: "${TMPDIR=/tmp}"
# shellcheck disable=SC2039,SC3028
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
dummy=$tmp/dummy
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
,,) echo "int x;" > "$dummy.c"
for driver in cc gcc c89 c99 ; do
if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD=$driver
break
fi
done
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac
}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case $UNAME_SYSTEM in
Linux|GNU|GNU/*)
LIBC=unknown
set_cc_for_build
cat <<-EOF > "$dummy.c"
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#elif defined(__GLIBC__)
LIBC=gnu
#else
#include
/* First heuristic to detect musl libc. */
#ifdef __DEFINED_va_list
LIBC=musl
#endif
#endif
EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc"
# Second heuristic to detect musl libc.
if [ "$LIBC" = unknown ] &&
command -v ldd >/dev/null &&
ldd --version 2>&1 | grep -q ^musl; then
LIBC=musl
fi
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
if [ "$LIBC" = unknown ]; then
LIBC=gnu
fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
/usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
echo unknown)`
case $UNAME_MACHINE_ARCH in
aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
machine=${arch}${endian}-unknown
;;
*) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
case $UNAME_MACHINE_ARCH in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# Determine ABI tags.
case $UNAME_MACHINE_ARCH in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
GUESS=$machine-${os}${release}${abi-}
;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
;;
*:SecBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
;;
*:MidnightBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
;;
*:ekkoBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
;;
*:SolidBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
;;
*:OS108:*:*)
GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
;;
macppc:MirBSD:*:*)
GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
;;
*:MirBSD:*:*)
GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
;;
*:Sortix:*:*)
GUESS=$UNAME_MACHINE-unknown-sortix
;;
*:Twizzler:*:*)
GUESS=$UNAME_MACHINE-unknown-twizzler
;;
*:Redox:*:*)
GUESS=$UNAME_MACHINE-unknown-redox
;;
mips:OSF1:*.*)
GUESS=mips-dec-osf1
;;
alpha:OSF1:*:*)
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case $ALPHA_CPU_TYPE in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
UNAME_MACHINE=alpha ;;
"EV5 (21164)")
UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
;;
Amiga*:UNIX_System_V:4.0:*)
GUESS=m68k-unknown-sysv4
;;
*:[Aa]miga[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-amigaos
;;
*:[Mm]orph[Oo][Ss]:*:*)
GUESS=$UNAME_MACHINE-unknown-morphos
;;
*:OS/390:*:*)
GUESS=i370-ibm-openedition
;;
*:z/VM:*:*)
GUESS=s390-ibm-zvmoe
;;
*:OS400:*:*)
GUESS=powerpc-ibm-os400
;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
GUESS=arm-acorn-riscix$UNAME_RELEASE
;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
GUESS=arm-unknown-riscos
;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
GUESS=hppa1.1-hitachi-hiuxmpp
;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
case `(/bin/universe) 2>/dev/null` in
att) GUESS=pyramid-pyramid-sysv3 ;;
*) GUESS=pyramid-pyramid-bsd ;;
esac
;;
NILE*:*:*:dcosx)
GUESS=pyramid-pyramid-svr4
;;
DRS?6000:unix:4.0:6*)
GUESS=sparc-icl-nx6
;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) GUESS=sparc-icl-nx7 ;;
esac
;;
s390x:SunOS:*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
;;
sun4H:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-hal-solaris2$SUN_REL
;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris2$SUN_REL
;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
GUESS=i386-pc-auroraux$UNAME_RELEASE
;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
set_cc_for_build
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=sparc-sun-solaris3$SUN_REL
;;
sun4*:SunOS:*:*)
case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
GUESS=sparc-sun-sunos$SUN_REL
;;
sun3*:SunOS:*:*)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case `/bin/arch` in
sun3)
GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
;;
aushp:SunOS:*:*)
GUESS=sparc-auspex-sunos$UNAME_RELEASE
;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
GUESS=m68k-atari-mint$UNAME_RELEASE
;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
GUESS=m68k-milan-mint$UNAME_RELEASE
;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
GUESS=m68k-hades-mint$UNAME_RELEASE
;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
GUESS=m68k-unknown-mint$UNAME_RELEASE
;;
m68k:machten:*:*)
GUESS=m68k-apple-machten$UNAME_RELEASE
;;
powerpc:machten:*:*)
GUESS=powerpc-apple-machten$UNAME_RELEASE
;;
RISC*:Mach:*:*)
GUESS=mips-dec-mach_bsd4.3
;;
RISC*:ULTRIX:*:*)
GUESS=mips-dec-ultrix$UNAME_RELEASE
;;
VAX*:ULTRIX*:*:*)
GUESS=vax-dec-ultrix$UNAME_RELEASE
;;
2020:CLIX:*:* | 2430:CLIX:*:*)
GUESS=clipper-intergraph-clix$UNAME_RELEASE
;;
mips:*:*:UMIPS | mips:*:*:RISCos)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=mips-mips-riscos$UNAME_RELEASE
;;
Motorola:PowerMAX_OS:*:*)
GUESS=powerpc-motorola-powermax
;;
Motorola:*:4.3:PL8-*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
GUESS=powerpc-harris-powermax
;;
Night_Hawk:Power_UNIX:*:*)
GUESS=powerpc-harris-powerunix
;;
m88k:CX/UX:7*:*)
GUESS=m88k-harris-cxux7
;;
m88k:*:4*:R4*)
GUESS=m88k-motorola-sysv4
;;
m88k:*:3*:R3*)
GUESS=m88k-motorola-sysv3
;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
test "$TARGET_BINARY_INTERFACE"x = x
then
GUESS=m88k-dg-dgux$UNAME_RELEASE
else
GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
GUESS=i586-dg-dgux$UNAME_RELEASE
fi
;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
GUESS=m88k-dolphin-sysv3
;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
GUESS=m88k-motorola-sysv3
;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
GUESS=m88k-tektronix-sysv3
;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
GUESS=m68k-tektronix-bsd
;;
*:IRIX*:*:*)
IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
GUESS=mips-sgi-irix$IRIX_REL
;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
GUESS=i386-ibm-aix
;;
ia64:AIX:*:*)
if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
GUESS=$SYSTEM_NAME
else
GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
GUESS=rs6000-ibm-aix3.2.4
else
GUESS=rs6000-ibm-aix3.2
fi
;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if test -x /usr/bin/lslpp ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
GUESS=$IBM_ARCH-ibm-aix$IBM_REV
;;
*:AIX:*:*)
GUESS=rs6000-ibm-aix
;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
GUESS=romp-ibm-bsd4.4
;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
GUESS=rs6000-bull-bosx
;;
DPX/2?00:B.O.S.:*:*)
GUESS=m68k-bull-sysv3
;;
9000/[34]??:4.3bsd:1.*:*)
GUESS=m68k-hp-bsd
;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
GUESS=m68k-hp-bsd4.4
;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
case $UNAME_MACHINE in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case $sc_cpu_version in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case $sc_kernel_bits in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
if test "$HP_ARCH" = ""; then
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if test "$HP_ARCH" = hppa2.0w
then
set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH=hppa2.0w
else
HP_ARCH=hppa64
fi
fi
GUESS=$HP_ARCH-hp-hpux$HPUX_REV
;;
ia64:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
GUESS=ia64-hp-hpux$HPUX_REV
;;
3050*:HI-UX:*:*)
set_cc_for_build
sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
GUESS=unknown-hitachi-hiuxwe2
;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
GUESS=hppa1.1-hp-bsd
;;
9000/8??:4.3bsd:*:*)
GUESS=hppa1.0-hp-bsd
;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
GUESS=hppa1.0-hp-mpeix
;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
GUESS=hppa1.1-hp-osf
;;
hp8??:OSF1:*:*)
GUESS=hppa1.0-hp-osf
;;
i*86:OSF1:*:*)
if test -x /usr/sbin/sysversion ; then
GUESS=$UNAME_MACHINE-unknown-osf1mk
else
GUESS=$UNAME_MACHINE-unknown-osf1
fi
;;
parisc*:Lites*:*:*)
GUESS=hppa1.1-hp-lites
;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
GUESS=c1-convex-bsd
;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
GUESS=c34-convex-bsd
;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
GUESS=c38-convex-bsd
;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
GUESS=c4-convex-bsd
;;
CRAY*Y-MP:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=ymp-cray-unicos$CRAY_REL
;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=t90-cray-unicos$CRAY_REL
;;
CRAY*T3E:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=alphaev5-cray-unicosmk$CRAY_REL
;;
CRAY*SV1:*:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=sv1-cray-unicos$CRAY_REL
;;
*:UNICOS/mp:*:*)
CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
GUESS=craynv-cray-unicosmp$CRAY_REL
;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
;;
sparc*:BSD/OS:*:*)
GUESS=sparc-unknown-bsdi$UNAME_RELEASE
;;
*:BSD/OS:*:*)
GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
;;
arm:FreeBSD:*:*)
UNAME_PROCESSOR=`uname -p`
set_cc_for_build
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
else
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
fi
;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
;;
i*:CYGWIN*:*)
GUESS=$UNAME_MACHINE-pc-cygwin
;;
*:MINGW64*:*)
GUESS=$UNAME_MACHINE-pc-mingw64
;;
*:MINGW*:*)
GUESS=$UNAME_MACHINE-pc-mingw32
;;
*:MSYS*:*)
GUESS=$UNAME_MACHINE-pc-msys
;;
i*:PW*:*)
GUESS=$UNAME_MACHINE-pc-pw32
;;
*:SerenityOS:*:*)
GUESS=$UNAME_MACHINE-pc-serenity
;;
*:Interix*:*)
case $UNAME_MACHINE in
x86)
GUESS=i586-pc-interix$UNAME_RELEASE
;;
authenticamd | genuineintel | EM64T)
GUESS=x86_64-unknown-interix$UNAME_RELEASE
;;
IA64)
GUESS=ia64-unknown-interix$UNAME_RELEASE
;;
esac ;;
i*:UWIN*:*)
GUESS=$UNAME_MACHINE-pc-uwin
;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
GUESS=x86_64-pc-cygwin
;;
prep*:SunOS:5.*:*)
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
GUESS=powerpcle-unknown-solaris2$SUN_REL
;;
*:GNU:*:*)
# the GNU system
GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
arm*:Linux:*:*)
set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
;;
avr32*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
cris:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
crisv32:Linux:*:*)
GUESS=$UNAME_MACHINE-axis-linux-$LIBC
;;
e2k:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
frv:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
hexagon:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:Linux:*:*)
GUESS=$UNAME_MACHINE-pc-linux-$LIBC
;;
ia64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m68*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
mips:Linux:*:* | mips64:Linux:*:*)
set_cc_for_build
IS_GLIBC=0
test x"${LIBC}" = xgnu && IS_GLIBC=1
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef mips
#undef mipsel
#undef mips64
#undef mips64el
#if ${IS_GLIBC} && defined(_ABI64)
LIBCABI=gnuabi64
#else
#if ${IS_GLIBC} && defined(_ABIN32)
LIBCABI=gnuabin32
#else
LIBCABI=${LIBC}
#endif
#endif
#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa64r6
#else
#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
CPU=mipsisa32r6
#else
#if defined(__mips64)
CPU=mips64
#else
CPU=mips
#endif
#endif
#endif
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
MIPS_ENDIAN=
#else
MIPS_ENDIAN=
#endif
#endif
EOF
cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
eval "$cc_set_vars"
test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
mips64el:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
openrisc*:Linux:*:*)
GUESS=or1k-unknown-linux-$LIBC
;;
or32:Linux:*:* | or1k*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
padre:Linux:*:*)
GUESS=sparc-unknown-linux-$LIBC
;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
GUESS=hppa64-unknown-linux-$LIBC
;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
*) GUESS=hppa-unknown-linux-$LIBC ;;
esac
;;
ppc64:Linux:*:*)
GUESS=powerpc64-unknown-linux-$LIBC
;;
ppc:Linux:*:*)
GUESS=powerpc-unknown-linux-$LIBC
;;
ppc64le:Linux:*:*)
GUESS=powerpc64le-unknown-linux-$LIBC
;;
ppcle:Linux:*:*)
GUESS=powerpcle-unknown-linux-$LIBC
;;
riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
s390:Linux:*:* | s390x:Linux:*:*)
GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
;;
sh64*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sh*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
sparc:Linux:*:* | sparc64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
tile*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
vax:Linux:*:*)
GUESS=$UNAME_MACHINE-dec-linux-$LIBC
;;
x86_64:Linux:*:*)
set_cc_for_build
LIBCABI=$LIBC
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_X32 >/dev/null
then
LIBCABI=${LIBC}x32
fi
fi
GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI
;;
xtensa*:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
GUESS=i386-sequent-sysv4
;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx
;;
i*86:XTS-300:*:STOP)
GUESS=$UNAME_MACHINE-unknown-stop
;;
i*86:atheos:*:*)
GUESS=$UNAME_MACHINE-unknown-atheos
;;
i*86:syllable:*:*)
GUESS=$UNAME_MACHINE-pc-syllable
;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
GUESS=i386-unknown-lynxos$UNAME_RELEASE
;;
i*86:*DOS:*:*)
GUESS=$UNAME_MACHINE-pc-msdosdjgpp
;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
GUESS=$UNAME_MACHINE-pc-sysv32
fi
;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
GUESS=i586-pc-msdosdjgpp
;;
Intel:Mach:3*:*)
GUESS=i386-pc-mach3
;;
paragon:*:*:*)
GUESS=i860-intel-osf1
;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
;;
mini*:CTIX:SYS*5:*)
# "miniframe"
GUESS=m68010-convergent-sysv
;;
mc68k:UNIX:SYSTEM5:3.51m)
GUESS=m68k-convergent-sysv
;;
M680?0:D-NIX:5.3:*)
GUESS=m68k-diab-dnix
;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
GUESS=m68k-unknown-lynxos$UNAME_RELEASE
;;
mc68030:UNIX_System_V:4.*:*)
GUESS=m68k-atari-sysv4
;;
TSUNAMI:LynxOS:2.*:*)
GUESS=sparc-unknown-lynxos$UNAME_RELEASE
;;
rs6000:LynxOS:2.*:*)
GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
;;
SM[BE]S:UNIX_SV:*:*)
GUESS=mips-dde-sysv$UNAME_RELEASE
;;
RM*:ReliantUNIX-*:*:*)
GUESS=mips-sni-sysv4
;;
RM*:SINIX-*:*:*)
GUESS=mips-sni-sysv4
;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
GUESS=$UNAME_MACHINE-sni-sysv4
else
GUESS=ns32k-sni-sysv
fi
;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
GUESS=i586-unisys-sysv4
;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
GUESS=hppa1.1-stratus-sysv4
;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
GUESS=i860-stratus-sysv4
;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=$UNAME_MACHINE-stratus-vos
;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
GUESS=hppa1.1-stratus-vos
;;
mc68*:A/UX:*:*)
GUESS=m68k-apple-aux$UNAME_RELEASE
;;
news*:NEWS-OS:6*:*)
GUESS=mips-sony-newsos6
;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if test -d /usr/nec; then
GUESS=mips-nec-sysv$UNAME_RELEASE
else
GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
GUESS=powerpc-be-beos
;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
GUESS=powerpc-apple-beos
;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
GUESS=i586-pc-beos
;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
GUESS=i586-pc-haiku
;;
x86_64:Haiku:*:*)
GUESS=x86_64-unknown-haiku
;;
SX-4:SUPER-UX:*:*)
GUESS=sx4-nec-superux$UNAME_RELEASE
;;
SX-5:SUPER-UX:*:*)
GUESS=sx5-nec-superux$UNAME_RELEASE
;;
SX-6:SUPER-UX:*:*)
GUESS=sx6-nec-superux$UNAME_RELEASE
;;
SX-7:SUPER-UX:*:*)
GUESS=sx7-nec-superux$UNAME_RELEASE
;;
SX-8:SUPER-UX:*:*)
GUESS=sx8-nec-superux$UNAME_RELEASE
;;
SX-8R:SUPER-UX:*:*)
GUESS=sx8r-nec-superux$UNAME_RELEASE
;;
SX-ACE:SUPER-UX:*:*)
GUESS=sxace-nec-superux$UNAME_RELEASE
;;
Power*:Rhapsody:*:*)
GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
;;
*:Rhapsody:*:*)
GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
;;
arm64:Darwin:*:*)
GUESS=aarch64-apple-darwin$UNAME_RELEASE
;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
unknown) UNAME_PROCESSOR=powerpc ;;
esac
if command -v xcode-select > /dev/null 2> /dev/null && \
! xcode-select --print-path > /dev/null 2> /dev/null ; then
# Avoid executing cc if there is no toolchain installed as
# cc will be a stub that puts up a graphical alert
# prompting the user to install developer tools.
CC_FOR_BUILD=no_compiler_found
else
set_cc_for_build
fi
if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# uname -m returns i386 or x86_64
UNAME_PROCESSOR=$UNAME_MACHINE
fi
GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
;;
*:QNX:*:4*)
GUESS=i386-pc-qnx
;;
NEO-*:NONSTOP_KERNEL:*:*)
GUESS=neo-tandem-nsk$UNAME_RELEASE
;;
NSE-*:NONSTOP_KERNEL:*:*)
GUESS=nse-tandem-nsk$UNAME_RELEASE
;;
NSR-*:NONSTOP_KERNEL:*:*)
GUESS=nsr-tandem-nsk$UNAME_RELEASE
;;
NSV-*:NONSTOP_KERNEL:*:*)
GUESS=nsv-tandem-nsk$UNAME_RELEASE
;;
NSX-*:NONSTOP_KERNEL:*:*)
GUESS=nsx-tandem-nsk$UNAME_RELEASE
;;
*:NonStop-UX:*:*)
GUESS=mips-compaq-nonstopux
;;
BS2000:POSIX*:*:*)
GUESS=bs2000-siemens-sysv
;;
DS/*:UNIX_System_V:*:*)
GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
elif test "x${cputype-}" != x; then
UNAME_MACHINE=$cputype
fi
GUESS=$UNAME_MACHINE-unknown-plan9
;;
*:TOPS-10:*:*)
GUESS=pdp10-unknown-tops10
;;
*:TENEX:*:*)
GUESS=pdp10-unknown-tenex
;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
GUESS=pdp10-dec-tops20
;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
GUESS=pdp10-xkl-tops20
;;
*:TOPS-20:*:*)
GUESS=pdp10-unknown-tops20
;;
*:ITS:*:*)
GUESS=pdp10-unknown-its
;;
SEI:*:*:SEIUX)
GUESS=mips-sei-seiux$UNAME_RELEASE
;;
*:DragonFly:*:*)
DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case $UNAME_MACHINE in
A*) GUESS=alpha-dec-vms ;;
I*) GUESS=ia64-dec-vms ;;
V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
GUESS=i386-pc-xenix
;;
i*86:skyos:*:*)
SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
;;
i*86:rdos:*:*)
GUESS=$UNAME_MACHINE-pc-rdos
;;
i*86:Fiwix:*:*)
GUESS=$UNAME_MACHINE-pc-fiwix
;;
*:AROS:*:*)
GUESS=$UNAME_MACHINE-unknown-aros
;;
x86_64:VMkernel:*:*)
GUESS=$UNAME_MACHINE-unknown-esx
;;
amd64:Isilon\ OneFS:*:*)
GUESS=x86_64-unknown-onefs
;;
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
esac
# Do we have a guess based on uname results?
if test "x$GUESS" != x; then
echo "$GUESS"
exit
fi
# No uname command or uname output not recognized.
set_cc_for_build
cat > "$dummy.c" <
#include
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#include
#if defined(_SIZE_T_) || defined(SIGLOST)
#include
#endif
#endif
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
#include
#if defined (BSD)
#if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
#else
#if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#endif
#else
printf ("vax-dec-bsd\n"); exit (0);
#endif
#else
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname un;
uname (&un);
printf ("vax-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
#if defined(_SIZE_T_) || defined(SIGLOST)
struct utsname *un;
uname (&un);
printf ("mips-dec-ultrix%s\n", un.release); exit (0);
#else
printf ("mips-dec-ultrix\n"); exit (0);
#endif
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
echo "$0: unable to guess system type" >&2
case $UNAME_MACHINE:$UNAME_SYSTEM in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <&2 <&2 <