mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-01-14 07:43:40 +01:00
Merge pull request #241 from dwvisser/autoconf-files-analyzer
Autoconf files analyzer Former-commit-id: f8e364d31b9a40abfef67ef93d91cb65527be217
This commit is contained in:
@@ -252,6 +252,7 @@ public class App {
|
||||
final boolean archiveDisabled = cli.isArchiveDisabled();
|
||||
final boolean pyDistDisabled = cli.isPythonDistributionDisabled();
|
||||
final boolean pyPkgDisabled = cli.isPythonPackageDisabled();
|
||||
final boolean autoconfDisabled = cli.isAutoconfDisabled();
|
||||
final boolean assemblyDisabled = cli.isAssemblyDisabled();
|
||||
final boolean nuspecDisabled = cli.isNuspecDisabled();
|
||||
final boolean centralDisabled = cli.isCentralDisabled();
|
||||
@@ -317,6 +318,7 @@ public class App {
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_ARCHIVE_ENABLED, !archiveDisabled);
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_PYTHON_DISTRIBUTION_ENABLED, !pyDistDisabled);
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_PYTHON_PACKAGE_ENABLED, !pyPkgDisabled);
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_AUTOCONF_ENABLED, !autoconfDisabled);
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_NUSPEC_ENABLED, !nuspecDisabled);
|
||||
Settings.setBoolean(Settings.KEYS.ANALYZER_ASSEMBLY_ENABLED, !assemblyDisabled);
|
||||
|
||||
|
||||
@@ -335,6 +335,10 @@ public final class CliParser {
|
||||
final Option disablePythonPackageAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_PY_PKG)
|
||||
.withDescription("Disable the Python Package Analyzer.").create();
|
||||
|
||||
final Option disableAutoconfAnalyzer = OptionBuilder
|
||||
.withLongOpt(ARGUMENT.DISABLE_AUTOCONF)
|
||||
.withDescription("Disable the Autoconf Analyzer.").create();
|
||||
|
||||
final Option disableCentralAnalyzer = OptionBuilder.withLongOpt(ARGUMENT.DISABLE_CENTRAL)
|
||||
.withDescription("Disable the Central Analyzer. If this analyzer is disabled it is likely you also want to disable "
|
||||
+ "the Nexus Analyzer.")
|
||||
@@ -380,6 +384,7 @@ public final class CliParser {
|
||||
.addOption(disableAssemblyAnalyzer)
|
||||
.addOption(disablePythonDistributionAnalyzer)
|
||||
.addOption(disablePythonPackageAnalyzer)
|
||||
.addOption(disableAutoconfAnalyzer)
|
||||
.addOption(disableNuspecAnalyzer)
|
||||
.addOption(disableCentralAnalyzer)
|
||||
.addOption(disableNexusAnalyzer)
|
||||
@@ -487,6 +492,15 @@ public final class CliParser {
|
||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_PY_PKG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the disableAutoconf command line argument was specified.
|
||||
*
|
||||
* @return true if the disableAutoconf command line argument was specified; otherwise false
|
||||
*/
|
||||
public boolean isAutoconfDisabled() {
|
||||
return (line != null) && line.hasOption(ARGUMENT.DISABLE_AUTOCONF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the disableNexus command line argument was specified.
|
||||
*
|
||||
@@ -936,6 +950,10 @@ public final class CliParser {
|
||||
* Disables the Python Package Analyzer.
|
||||
*/
|
||||
public static final String DISABLE_PY_PKG = "disablePyPkg";
|
||||
/**
|
||||
* Disables the Autoconf Analyzer.
|
||||
*/
|
||||
public static final String DISABLE_AUTOCONF = "disableAutoconf";
|
||||
/**
|
||||
* Disables the Assembly Analyzer.
|
||||
*/
|
||||
|
||||
@@ -25,6 +25,7 @@ Short | Argument Name | Paramete
|
||||
| \-\-updateonly | | If set only the update phase of dependency-check will be executed; no scan will be executed and no report will be generated. |
|
||||
| \-\-disablePyDist | | Sets whether the Python Distribution Analyzer will be used. | false
|
||||
| \-\-disablePyPkg | | Sets whether the Python Package Analyzer will be used. | false
|
||||
| \-\-disableAutoconf | | Sets whether the Autoconf Analyzer will be used. | false
|
||||
| \-\-disableArchive | | Sets whether the Archive Analyzer will be used. | false
|
||||
| \-\-zipExtensions | \<strings\> | A comma-separated list of additional file extensions to be treated like a ZIP file, the contents will be extracted and analyzed. |
|
||||
| \-\-disableJar | | Sets whether the Jar Analyzer will be used. | false
|
||||
|
||||
@@ -0,0 +1,253 @@
|
||||
/*
|
||||
* This file is part of dependency-check-core.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Copyright (c) 2015 Institute for Defense Analyses. All Rights Reserved.
|
||||
*/
|
||||
package org.owasp.dependencycheck.analyzer;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.owasp.dependencycheck.Engine;
|
||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||
import org.owasp.dependencycheck.dependency.Confidence;
|
||||
import org.owasp.dependencycheck.dependency.Dependency;
|
||||
import org.owasp.dependencycheck.dependency.EvidenceCollection;
|
||||
import org.owasp.dependencycheck.utils.Settings;
|
||||
import org.owasp.dependencycheck.utils.UrlStringUtils;
|
||||
|
||||
/**
|
||||
* Used to analyze Autoconf input files named configure.ac or configure.in.
|
||||
* Files simply named "configure" are also analyzed, assuming they are generated
|
||||
* by Autoconf, and contain certain special package descriptor variables.
|
||||
*
|
||||
* @author Dale Visser <dvisser@ida.org>
|
||||
* @see <a href="https://www.gnu.org/software/autoconf/">Autoconf - GNU Project - Free Software Foundation (FSF)</a>
|
||||
*/
|
||||
public class AutoconfAnalyzer extends AbstractFileTypeAnalyzer {
|
||||
|
||||
/**
|
||||
* Autoconf output filename.
|
||||
*/
|
||||
private static final String CONFIGURE = "configure";
|
||||
|
||||
/**
|
||||
* Autoconf input filename.
|
||||
*/
|
||||
private static final String CONFIGURE_IN = "configure.in";
|
||||
|
||||
/**
|
||||
* Autoconf input filename.
|
||||
*/
|
||||
private static final String CONFIGURE_AC = "configure.ac";
|
||||
|
||||
/**
|
||||
* The name of the analyzer.
|
||||
*/
|
||||
private static final String ANALYZER_NAME = "Autoconf Analyzer";
|
||||
|
||||
/**
|
||||
* The phase that this analyzer is intended to run in.
|
||||
*/
|
||||
private static final AnalysisPhase ANALYSIS_PHASE = AnalysisPhase.INFORMATION_COLLECTION;
|
||||
|
||||
/**
|
||||
* The set of file extensions supported by this analyzer.
|
||||
*/
|
||||
private static final Set<String> EXTENSIONS = newHashSet("ac", "in",
|
||||
CONFIGURE);
|
||||
|
||||
/**
|
||||
* Matches AC_INIT variables in the output configure script.
|
||||
*/
|
||||
private static final Pattern PACKAGE_VAR = Pattern.compile(
|
||||
"PACKAGE_(.+?)='(.*?)'", Pattern.DOTALL | Pattern.CASE_INSENSITIVE);
|
||||
|
||||
/**
|
||||
* Matches AC_INIT statement in configure.ac file.
|
||||
*/
|
||||
private static final Pattern AC_INIT_PATTERN;
|
||||
static {
|
||||
// each instance of param or sep_param has a capture group
|
||||
final String param = "\\[{0,2}(.+?)\\]{0,2}";
|
||||
final String sep_param = "\\s*,\\s*" + param;
|
||||
// Group 1: Package
|
||||
// Group 2: Version
|
||||
// Group 3: optional
|
||||
// Group 4: Bug report address (if it exists)
|
||||
// Group 5: optional
|
||||
// Group 6: Tarname (if it exists)
|
||||
// Group 7: optional
|
||||
// Group 8: URL (if it exists)
|
||||
AC_INIT_PATTERN = Pattern.compile(String.format(
|
||||
"AC_INIT\\(%s%s(%s)?(%s)?(%s)?\\s*\\)", param, sep_param,
|
||||
sep_param, sep_param, sep_param), Pattern.DOTALL
|
||||
| Pattern.CASE_INSENSITIVE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of file EXTENSIONS supported by this analyzer.
|
||||
*
|
||||
* @return a list of file EXTENSIONS supported by this analyzer.
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getSupportedExtensions() {
|
||||
return EXTENSIONS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the analyzer.
|
||||
*
|
||||
* @return the name of the analyzer.
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return ANALYZER_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the phase that the analyzer is intended to run in.
|
||||
*
|
||||
* @return the phase that the analyzer is intended to run in.
|
||||
*/
|
||||
public AnalysisPhase getAnalysisPhase() {
|
||||
return ANALYSIS_PHASE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the key used in the properties file to reference the analyzer's
|
||||
* enabled property.
|
||||
*
|
||||
* @return the analyzer's enabled property setting key
|
||||
*/
|
||||
@Override
|
||||
protected String getAnalyzerEnabledSettingKey() {
|
||||
return Settings.KEYS.ANALYZER_PYTHON_DISTRIBUTION_ENABLED;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void analyzeFileType(Dependency dependency, Engine engine)
|
||||
throws AnalysisException {
|
||||
final File actualFile = dependency.getActualFile();
|
||||
final String name = actualFile.getName();
|
||||
if (name.startsWith(CONFIGURE)) {
|
||||
final File parent = actualFile.getParentFile();
|
||||
final String parentName = parent.getName();
|
||||
dependency.setDisplayFileName(parentName + "/" + name);
|
||||
final boolean isOutputScript = CONFIGURE.equals(name);
|
||||
if (isOutputScript || CONFIGURE_AC.equals(name)
|
||||
|| CONFIGURE_IN.equals(name)) {
|
||||
final String contents = getFileContents(actualFile);
|
||||
if (!contents.isEmpty()) {
|
||||
if (isOutputScript) {
|
||||
extractConfigureScriptEvidence(dependency, name,
|
||||
contents);
|
||||
} else {
|
||||
gatherEvidence(dependency, name, contents);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// copy, alter and set in case some other thread is iterating over
|
||||
final List<Dependency> deps = new ArrayList<Dependency>(
|
||||
engine.getDependencies());
|
||||
deps.remove(dependency);
|
||||
engine.setDependencies(deps);
|
||||
}
|
||||
}
|
||||
|
||||
private void extractConfigureScriptEvidence(Dependency dependency,
|
||||
final String name, final String contents) {
|
||||
final Matcher matcher = PACKAGE_VAR.matcher(contents);
|
||||
while (matcher.find()) {
|
||||
final String variable = matcher.group(1);
|
||||
final String value = matcher.group(2);
|
||||
if (!value.isEmpty()) {
|
||||
if (variable.endsWith("NAME")) {
|
||||
dependency.getProductEvidence().addEvidence(name, variable,
|
||||
value, Confidence.HIGHEST);
|
||||
} else if ("VERSION".equals(variable)) {
|
||||
dependency.getVersionEvidence().addEvidence(name, variable,
|
||||
value, Confidence.HIGHEST);
|
||||
} else if ("BUGREPORT".equals(variable)) {
|
||||
dependency.getVendorEvidence().addEvidence(name, variable,
|
||||
value, Confidence.HIGH);
|
||||
} else if ("URL".equals(variable)) {
|
||||
dependency.getVendorEvidence().addEvidence(name, variable,
|
||||
value, Confidence.HIGH);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String getFileContents(final File actualFile)
|
||||
throws AnalysisException {
|
||||
String contents = "";
|
||||
try {
|
||||
contents = FileUtils.readFileToString(actualFile).trim();
|
||||
} catch (IOException e) {
|
||||
throw new AnalysisException(
|
||||
"Problem occured while reading dependency file.", e);
|
||||
}
|
||||
return contents;
|
||||
}
|
||||
|
||||
private void gatherEvidence(Dependency dependency, final String name,
|
||||
String contents) {
|
||||
final Matcher matcher = AC_INIT_PATTERN.matcher(contents);
|
||||
if (matcher.find()) {
|
||||
final EvidenceCollection productEvidence = dependency
|
||||
.getProductEvidence();
|
||||
productEvidence.addEvidence(name, "Package", matcher.group(1),
|
||||
Confidence.HIGHEST);
|
||||
dependency.getVersionEvidence().addEvidence(name,
|
||||
"Package Version", matcher.group(2), Confidence.HIGHEST);
|
||||
final EvidenceCollection vendorEvidence = dependency
|
||||
.getVendorEvidence();
|
||||
if (null != matcher.group(3)) {
|
||||
vendorEvidence.addEvidence(name, "Bug report address",
|
||||
matcher.group(4), Confidence.HIGH);
|
||||
}
|
||||
if (null != matcher.group(5)) {
|
||||
productEvidence.addEvidence(name, "Tarname", matcher.group(6),
|
||||
Confidence.HIGH);
|
||||
}
|
||||
if (null != matcher.group(7)) {
|
||||
final String url = matcher.group(8);
|
||||
if (UrlStringUtils.isUrl(url)) {
|
||||
vendorEvidence.addEvidence(name, "URL", url,
|
||||
Confidence.HIGH);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the file type analyzer.
|
||||
*
|
||||
* @throws Exception
|
||||
* thrown if there is an exception during initialization
|
||||
*/
|
||||
@Override
|
||||
protected void initializeFileTypeAnalyzer() throws Exception {
|
||||
// No initialization needed.
|
||||
}
|
||||
}
|
||||
@@ -13,4 +13,5 @@ org.owasp.dependencycheck.analyzer.NexusAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.NuspecAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.AssemblyAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.PythonDistributionAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.PythonPackageAnalyzer
|
||||
org.owasp.dependencycheck.analyzer.AutoconfAnalyzer
|
||||
@@ -0,0 +1,190 @@
|
||||
/*
|
||||
* This file is part of dependency-check-core.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Copyright (c) 2015 Institute for Defense Analyses. All Rights Reserved.
|
||||
*/
|
||||
package org.owasp.dependencycheck.analyzer;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.owasp.dependencycheck.BaseTest;
|
||||
import org.owasp.dependencycheck.analyzer.exception.AnalysisException;
|
||||
import org.owasp.dependencycheck.dependency.Dependency;
|
||||
|
||||
/**
|
||||
* Unit tests for AutoconfAnalyzer. The test resources under autoconf/ were
|
||||
* obtained from outside open source software projects. Links to those projects
|
||||
* are given below.
|
||||
*
|
||||
* @author Dale Visser <dvisser@ida.org>
|
||||
* @see <a href="http://readable.sourceforge.net/">Readable Lisp S-expressions
|
||||
* Project</a>
|
||||
* @see <a href="https://gnu.org/software/binutils/">GNU Binutils</a>
|
||||
* @see <a href="https://gnu.org/software/ghostscript/">GNU Ghostscript</a>
|
||||
*/
|
||||
public class AutoconfAnalyzerTest extends BaseTest {
|
||||
|
||||
/**
|
||||
* The analyzer to test.
|
||||
*/
|
||||
AutoconfAnalyzer analyzer;
|
||||
|
||||
private void assertCommonEvidence(Dependency result, String product,
|
||||
String version, String vendor) {
|
||||
assertProductAndVersion(result, product, version);
|
||||
assertTrue("Expected vendor evidence to contain \"" + vendor + "\".",
|
||||
result.getVendorEvidence().toString().contains(vendor));
|
||||
}
|
||||
|
||||
private void assertProductAndVersion(Dependency result, String product,
|
||||
String version) {
|
||||
assertTrue("Expected product evidence to contain \"" + product + "\".",
|
||||
result.getProductEvidence().toString().contains(product));
|
||||
assertTrue("Expected version evidence to contain \"" + version + "\".",
|
||||
result.getVersionEvidence().toString().contains(version));
|
||||
}
|
||||
|
||||
/**
|
||||
* Correctly setup the analyzer for testing.
|
||||
*
|
||||
* @throws Exception
|
||||
* thrown if there is a problem
|
||||
*/
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
analyzer = new AutoconfAnalyzer();
|
||||
analyzer.setFilesMatched(true);
|
||||
analyzer.initialize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleanup the analyzer's temp files, etc.
|
||||
*
|
||||
* @throws Exception
|
||||
* thrown if there is a problem
|
||||
*/
|
||||
@After
|
||||
public void tearDown() throws Exception {
|
||||
analyzer.close();
|
||||
analyzer = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether expected evidence is gathered from Ghostscript's
|
||||
* configure.ac.
|
||||
*
|
||||
* @throws AnalysisException
|
||||
* is thrown when an exception occurs.
|
||||
*/
|
||||
@Test
|
||||
public void testAnalyzeConfigureAC1() throws AnalysisException {
|
||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(
|
||||
this, "autoconf/ghostscript/configure.ac"));
|
||||
analyzer.analyze(result, null);
|
||||
assertCommonEvidence(result, "ghostscript", "8.62.0", "gnu");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether expected evidence is gathered from Readable's configure.ac.
|
||||
*
|
||||
* @throws AnalysisException
|
||||
* is thrown when an exception occurs.
|
||||
*/
|
||||
@Test
|
||||
public void testAnalyzeConfigureAC2() throws AnalysisException {
|
||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(
|
||||
this, "autoconf/readable-code/configure.ac"));
|
||||
analyzer.analyze(result, null);
|
||||
assertReadableCodeEvidence(result);
|
||||
}
|
||||
|
||||
private void assertReadableCodeEvidence(final Dependency result) {
|
||||
assertCommonEvidence(result, "readable", "1.0.7", "dwheeler");
|
||||
final String url = "http://readable.sourceforge.net/";
|
||||
assertTrue("Expected product evidence to contain \"" + url + "\".",
|
||||
result.getVendorEvidence().toString().contains(url));
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether expected evidence is gathered from GNU Binutil's configure.
|
||||
*
|
||||
* @throws AnalysisException
|
||||
* is thrown when an exception occurs.
|
||||
*/
|
||||
@Test
|
||||
public void testAnalyzeConfigureScript() throws AnalysisException {
|
||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(
|
||||
this, "autoconf/binutils/configure"));
|
||||
analyzer.analyze(result, null);
|
||||
assertProductAndVersion(result, "binutils", "2.25.51");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether expected evidence is gathered from GNU Ghostscript's
|
||||
* configure.
|
||||
*
|
||||
* @throws AnalysisException
|
||||
* is thrown when an exception occurs.
|
||||
*/
|
||||
@Test
|
||||
public void testAnalyzeReadableConfigureScript() throws AnalysisException {
|
||||
final Dependency result = new Dependency(BaseTest.getResourceAsFile(
|
||||
this, "autoconf/readable-code/configure"));
|
||||
analyzer.analyze(result, null);
|
||||
assertReadableCodeEvidence(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of getName method, of {@link AutoconfAnalyzer}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetName() {
|
||||
assertEquals("Analyzer name wrong.", "Autoconf Analyzer",
|
||||
analyzer.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of {@link AutoconfAnalyzer#getSupportedExtensions}.
|
||||
*/
|
||||
@Test
|
||||
public void testGetSupportedExtensions() {
|
||||
final String[] expected = { "ac", "in", "configure" };
|
||||
assertEquals("Supported extensions should just have the following: "
|
||||
+ StringUtils.join(expected, ", "),
|
||||
new HashSet<String>(Arrays.asList(expected)),
|
||||
analyzer.getSupportedExtensions());
|
||||
}
|
||||
|
||||
/**
|
||||
* Test of {@link AutoconfAnalyzer#supportsExtension}.
|
||||
*/
|
||||
@Test
|
||||
public void testSupportsExtension() {
|
||||
assertTrue("Should support \"ac\" extension.",
|
||||
analyzer.supportsExtension("ac"));
|
||||
assertTrue("Should support \"in\" extension.",
|
||||
analyzer.supportsExtension("in"));
|
||||
assertTrue("Should support \"configure\" extension.",
|
||||
analyzer.supportsExtension("configure"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,283 @@
|
||||
/* config.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Check that config.h is #included before system headers
|
||||
(this works only for glibc, but that should be enough). */
|
||||
#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
|
||||
# error config.h must be #included before system headers
|
||||
#endif
|
||||
#define __CONFIG_H__ 1
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define to 1 if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Should ar and ranlib use -D behavior by default? */
|
||||
#undef DEFAULT_AR_DETERMINISTIC
|
||||
|
||||
/* Should strings use -a behavior by default? */
|
||||
#undef DEFAULT_STRINGS_ALL
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Suffix used for executables, if any. */
|
||||
#undef EXECUTABLE_SUFFIX
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define to 1 if you have the declaration of `environ', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_ENVIRON
|
||||
|
||||
/* Define to 1 if you have the declaration of `fprintf', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_FPRINTF
|
||||
|
||||
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_GETC_UNLOCKED
|
||||
|
||||
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_GETENV
|
||||
|
||||
/* Is the prototype for getopt in <unistd.h> in the expected format? */
|
||||
#undef HAVE_DECL_GETOPT
|
||||
|
||||
/* Define to 1 if you have the declaration of `sbrk', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_SBRK
|
||||
|
||||
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_STPCPY
|
||||
|
||||
/* Define to 1 if you have the declaration of `strnlen', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_STRNLEN
|
||||
|
||||
/* Define to 1 if you have the declaration of `strstr', and to 0 if you don't.
|
||||
*/
|
||||
#undef HAVE_DECL_STRSTR
|
||||
|
||||
/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
|
||||
don't. */
|
||||
#undef HAVE_DECL_VSNPRINTF
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Does the platform use an executable suffix? */
|
||||
#undef HAVE_EXECUTABLE_SUFFIX
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `getc_unlocked' function. */
|
||||
#undef HAVE_GETC_UNLOCKED
|
||||
|
||||
/* Does <utime.h> define struct utimbuf? */
|
||||
#undef HAVE_GOOD_UTIME_H
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if the system has the type `long long'. */
|
||||
#undef HAVE_LONG_LONG
|
||||
|
||||
/* Define if mbstate_t exists in wchar.h. */
|
||||
#undef HAVE_MBSTATE_T
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mkdtemp' function. */
|
||||
#undef HAVE_MKDTEMP
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define to 1 if you have the `sbrk' function. */
|
||||
#undef HAVE_SBRK
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define to 1 if you have the `setmode' function. */
|
||||
#undef HAVE_SETMODE
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strcoll' function. */
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Is the type time_t defined in <time.h>? */
|
||||
#undef HAVE_TIME_T_IN_TIME_H
|
||||
|
||||
/* Is the type time_t defined in <sys/types.h>? */
|
||||
#undef HAVE_TIME_T_IN_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the `utimes' function. */
|
||||
#undef HAVE_UTIMES
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#undef HAVE_WINDOWS_H
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `long long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at runtime.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if you can safely include both <string.h> and <strings.h>. */
|
||||
#undef STRING_WITH_STRINGS
|
||||
|
||||
/* Configured target name. */
|
||||
#undef TARGET
|
||||
|
||||
/* Define to 1 if user symbol names have a leading underscore, 0 if not. */
|
||||
#undef TARGET_PREPENDS_UNDERSCORE
|
||||
|
||||
/* Use b modifier when opening binary files? */
|
||||
#undef USE_BINARY_FOPEN
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
17018
dependency-check-core/src/test/resources/autoconf/binutils/configure
vendored
Executable file
17018
dependency-check-core/src/test/resources/autoconf/binutils/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,517 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl
|
||||
dnl Copyright (C) 2012-2015 Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This file 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 3 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,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
dnl GNU 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; see the file COPYING3. If not see
|
||||
dnl <http://www.gnu.org/licenses/>.
|
||||
dnl
|
||||
|
||||
AC_PREREQ(2.59)
|
||||
m4_include([../bfd/version.m4])
|
||||
AC_INIT([binutils], BFD_VERSION)
|
||||
AC_CONFIG_SRCDIR(ar.c)
|
||||
|
||||
AC_CANONICAL_TARGET
|
||||
AC_ISC_POSIX
|
||||
|
||||
AM_INIT_AUTOMAKE
|
||||
|
||||
AC_PROG_CC
|
||||
AC_GNU_SOURCE
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
LT_INIT
|
||||
ACX_LARGEFILE
|
||||
|
||||
AC_ARG_ENABLE(targets,
|
||||
[ --enable-targets alternative target configurations],
|
||||
[case "${enableval}" in
|
||||
yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
|
||||
;;
|
||||
no) enable_targets= ;;
|
||||
*) enable_targets=$enableval ;;
|
||||
esac])dnl
|
||||
|
||||
AC_ARG_ENABLE(deterministic-archives,
|
||||
[AS_HELP_STRING([--enable-deterministic-archives],
|
||||
[ar and ranlib default to -D behavior])], [
|
||||
if test "${enableval}" = no; then
|
||||
default_ar_deterministic=0
|
||||
else
|
||||
default_ar_deterministic=1
|
||||
fi], [default_ar_deterministic=0])
|
||||
|
||||
AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
|
||||
[Should ar and ranlib use -D behavior by default?])
|
||||
|
||||
AC_ARG_ENABLE(default-strings-all,
|
||||
[AS_HELP_STRING([--disable-default-strings-all],
|
||||
[strings defaults to --data behavior])], [
|
||||
if test "${enableval}" = no; then
|
||||
default_strings_all=0
|
||||
else
|
||||
default_strings_all=1
|
||||
fi], [default_strings_all=1])
|
||||
|
||||
AC_DEFINE_UNQUOTED(DEFAULT_STRINGS_ALL, $default_strings_all,
|
||||
[Should strings use -a behavior by default?])
|
||||
|
||||
AM_BINUTILS_WARNINGS
|
||||
|
||||
AC_CONFIG_HEADERS(config.h:config.in)
|
||||
|
||||
AH_VERBATIM([00_CONFIG_H_CHECK],
|
||||
[/* Check that config.h is #included before system headers
|
||||
(this works only for glibc, but that should be enough). */
|
||||
#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
|
||||
# error config.h must be #included before system headers
|
||||
#endif
|
||||
#define __CONFIG_H__ 1])
|
||||
|
||||
if test -z "$target" ; then
|
||||
AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
|
||||
fi
|
||||
if test -z "$host" ; then
|
||||
AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
|
||||
fi
|
||||
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
|
||||
ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr"
|
||||
ZW_GNU_GETTEXT_SISTER_DIR
|
||||
AM_PO_SUBDIRS
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AM_CONDITIONAL(GENINSRC_NEVER, false)
|
||||
AC_EXEEXT
|
||||
if test -n "$EXEEXT"; then
|
||||
AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
|
||||
[Does the platform use an executable suffix?])
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
|
||||
[Suffix used for executables, if any.])
|
||||
|
||||
# host-specific stuff:
|
||||
|
||||
HDEFINES=
|
||||
|
||||
. ${srcdir}/../bfd/configure.host
|
||||
|
||||
AC_SUBST(HDEFINES)
|
||||
AR=${AR-ar}
|
||||
AC_SUBST(AR)
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_INSTALL
|
||||
|
||||
BFD_CC_FOR_BUILD
|
||||
|
||||
DEMANGLER_NAME=c++filt
|
||||
case "${host}" in
|
||||
*-*-go32* | *-*-msdos*)
|
||||
DEMANGLER_NAME=cxxfilt
|
||||
esac
|
||||
AC_SUBST(DEMANGLER_NAME)
|
||||
|
||||
AC_CHECK_SIZEOF([long])
|
||||
AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
|
||||
|
||||
AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h wchar.h)
|
||||
AC_HEADER_SYS_WAIT
|
||||
ACX_HEADER_STRING
|
||||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
|
||||
AC_CHECK_FUNC([mkstemp],
|
||||
AC_DEFINE([HAVE_MKSTEMP], 1,
|
||||
[Define to 1 if you have the `mkstemp' function.]))
|
||||
AC_CHECK_FUNC([mkdtemp],
|
||||
AC_DEFINE([HAVE_MKDTEMP], 1,
|
||||
[Define to 1 if you have the `mkdtemp' function.]))
|
||||
AC_MSG_CHECKING([for mbstate_t])
|
||||
AC_TRY_COMPILE([#include <wchar.h>],
|
||||
[mbstate_t teststate;],
|
||||
have_mbstate_t=yes, have_mbstate_t=no)
|
||||
AC_MSG_RESULT($have_mbstate_t)
|
||||
if test x"$have_mbstate_t" = xyes; then
|
||||
AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
|
||||
fi
|
||||
|
||||
# Some systems have frexp only in -lm, not in -lc.
|
||||
AC_SEARCH_LIBS(frexp, m)
|
||||
|
||||
AM_LC_MESSAGES
|
||||
|
||||
AC_MSG_CHECKING(for time_t in time.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
|
||||
bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
|
||||
if test $bu_cv_decl_time_t_time_h = yes; then
|
||||
AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
|
||||
[Is the type time_t defined in <time.h>?])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for time_t in sys/types.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
|
||||
bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
|
||||
if test $bu_cv_decl_time_t_types_h = yes; then
|
||||
AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
|
||||
[Is the type time_t defined in <sys/types.h>?])
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
|
||||
AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
|
||||
bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
|
||||
if test $bu_cv_decl_getopt_unistd_h = yes; then
|
||||
AC_DEFINE([HAVE_DECL_GETOPT], 1,
|
||||
[Is the prototype for getopt in <unistd.h> in the expected format?])
|
||||
fi
|
||||
|
||||
# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
|
||||
# by default.
|
||||
AC_MSG_CHECKING([for utime.h])
|
||||
AC_CACHE_VAL(bu_cv_header_utime_h,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
|
||||
#ifdef HAVE_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
#include <utime.h>],
|
||||
[struct utimbuf s;])],
|
||||
bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
|
||||
AC_MSG_RESULT($bu_cv_header_utime_h)
|
||||
if test $bu_cv_header_utime_h = yes; then
|
||||
AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
|
||||
fi
|
||||
|
||||
AC_CHECK_DECLS([environ, fprintf, getc_unlocked, getenv,
|
||||
sbrk, snprintf, stpcpy, strnlen, strstr, vsnprintf])
|
||||
|
||||
# Link in zlib if we can. This allows us to read compressed debug
|
||||
# sections. This is used only by readelf.c (objdump uses bfd for
|
||||
# reading compressed sections).
|
||||
AM_ZLIB
|
||||
|
||||
BFD_BINARY_FOPEN
|
||||
|
||||
# target-specific stuff:
|
||||
|
||||
# Canonicalize the secondary target names.
|
||||
if test -n "$enable_targets"; then
|
||||
for targ in `echo $enable_targets | sed 's/,/ /g'`
|
||||
do
|
||||
result=`$ac_config_sub $targ 2>/dev/null`
|
||||
if test -n "$result"; then
|
||||
canon_targets="$canon_targets $result"
|
||||
else
|
||||
# Allow targets that config.sub doesn't recognize, like "all".
|
||||
canon_targets="$canon_targets $targ"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(iconv.h)
|
||||
AM_ICONV
|
||||
|
||||
all_targets=false
|
||||
BUILD_NLMCONV=
|
||||
NLMCONV_DEFS=
|
||||
BUILD_SRCONV=
|
||||
BUILD_DLLTOOL=
|
||||
DLLTOOL_DEFS=
|
||||
DLLTOOL_DEFAULT=
|
||||
BUILD_WINDRES=
|
||||
BUILD_WINDMC=
|
||||
BUILD_DLLWRAP=
|
||||
BUILD_MISC=
|
||||
BUILD_INSTALL_MISC=
|
||||
OBJDUMP_DEFS=
|
||||
OBJDUMP_PRIVATE_VECTORS=
|
||||
OBJDUMP_PRIVATE_OFILES=
|
||||
od_vectors=
|
||||
|
||||
for targ in $target $canon_targets
|
||||
do
|
||||
if test "x$targ" = "xall"; then
|
||||
all_targets=true
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
BUILD_SRCONV='$(SRCONV_PROG)'
|
||||
NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
|
||||
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
|
||||
od_vectors="$od_vectors objdump_private_desc_xcoff"
|
||||
else
|
||||
case $targ in
|
||||
changequote(,)dnl
|
||||
i[3-7]86*-*-netware*)
|
||||
changequote([,])dnl
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
|
||||
;;
|
||||
alpha*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
|
||||
;;
|
||||
powerpc*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
|
||||
;;
|
||||
sparc*-*-netware*)
|
||||
BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
|
||||
NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
|
||||
;;
|
||||
esac
|
||||
|
||||
case $targ in
|
||||
*-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
|
||||
esac
|
||||
|
||||
case $targ in
|
||||
arm-epoc-pe*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
arm-*-pe*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
x86_64-*-mingw* | x86_64-*-cygwin*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
|
||||
changequote([,])dnl
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
|
||||
;;
|
||||
changequote(,)dnl
|
||||
i[3-7]86-*-interix)
|
||||
changequote([,])dnl
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
|
||||
;;
|
||||
changequote(,)dnl
|
||||
powerpc*-aix5.[01])
|
||||
changequote([,])dnl
|
||||
;;
|
||||
changequote(,)dnl
|
||||
powerpc*-aix[5-9].*)
|
||||
changequote([,])dnl
|
||||
OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
|
||||
;;
|
||||
powerpc*-*-pe* | powerpc*-*-cygwin*)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
|
||||
case "$BUILD_INSTALL_MISC" in
|
||||
*embedspu*) ;;
|
||||
*) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
|
||||
esac
|
||||
;;
|
||||
sh*-*-pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
spu-*-*)
|
||||
BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
|
||||
;;
|
||||
mips*-*-pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
mcore-*-pe)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
;;
|
||||
mcore-*-elf)
|
||||
BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
|
||||
if test -z "$DLLTOOL_DEFAULT"; then
|
||||
DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
|
||||
fi
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
|
||||
;;
|
||||
mep-*)
|
||||
OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Add objdump private vectors.
|
||||
case $targ in
|
||||
avr-*-*)
|
||||
od_vectors="$od_vectors objdump_private_desc_elf32_avr"
|
||||
;;
|
||||
powerpc-*-aix*)
|
||||
od_vectors="$od_vectors objdump_private_desc_xcoff"
|
||||
;;
|
||||
*-*-darwin*)
|
||||
od_vectors="$od_vectors objdump_private_desc_mach_o"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
# Uniq objdump private vector, build objdump target ofiles.
|
||||
od_files=
|
||||
f=""
|
||||
for i in $od_vectors ; do
|
||||
case " $f " in
|
||||
*" $i "*) ;;
|
||||
*)
|
||||
f="$f $i"
|
||||
OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
|
||||
case $i in
|
||||
objdump_private_desc_elf32_avr)
|
||||
od_files="$od_files od-elf32_avr" ;;
|
||||
objdump_private_desc_xcoff)
|
||||
od_files="$od_files od-xcoff" ;;
|
||||
objdump_private_desc_mach_o)
|
||||
od_files="$od_files od-macho" ;;
|
||||
*) AC_MSG_ERROR(*** unknown private vector $i) ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Uniq objdump target ofiles
|
||||
f=""
|
||||
for i in $od_files ; do
|
||||
case " $f " in
|
||||
*" $i "*) ;;
|
||||
*)
|
||||
f="$f $i"
|
||||
OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
|
||||
|
||||
if test "${with_windres+set}" = set; then
|
||||
BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
|
||||
fi
|
||||
|
||||
if test "${with_windmc+set}" = set; then
|
||||
BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
|
||||
fi
|
||||
|
||||
OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
|
||||
|
||||
AC_SUBST(NLMCONV_DEFS)
|
||||
AC_SUBST(BUILD_NLMCONV)
|
||||
AC_SUBST(BUILD_SRCONV)
|
||||
AC_SUBST(BUILD_DLLTOOL)
|
||||
AC_SUBST(DLLTOOL_DEFS)
|
||||
AC_SUBST(BUILD_WINDRES)
|
||||
AC_SUBST(BUILD_WINDMC)
|
||||
AC_SUBST(BUILD_DLLWRAP)
|
||||
AC_SUBST(BUILD_MISC)
|
||||
AC_SUBST(BUILD_INSTALL_MISC)
|
||||
AC_SUBST(OBJDUMP_DEFS)
|
||||
AC_SUBST(OBJDUMP_PRIVATE_OFILES)
|
||||
|
||||
AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
|
||||
|
||||
targ=$target
|
||||
. $srcdir/../bfd/config.bfd
|
||||
if test "x$targ_underscore" = "xyes"; then
|
||||
UNDERSCORE=1
|
||||
else
|
||||
UNDERSCORE=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
|
||||
[Define to 1 if user symbol names have a leading underscore, 0 if not.])
|
||||
|
||||
# Emulation
|
||||
targ=$target
|
||||
. ${srcdir}/configure.tgt
|
||||
EMULATION=$targ_emul
|
||||
EMULATION_VECTOR=$targ_emul_vector
|
||||
|
||||
AC_SUBST(EMULATION)
|
||||
AC_SUBST(EMULATION_VECTOR)
|
||||
|
||||
# Required for html and install-html
|
||||
AC_SUBST(datarootdir)
|
||||
AC_SUBST(docdir)
|
||||
AC_SUBST(htmldir)
|
||||
AC_SUBST(pdfdir)
|
||||
|
||||
AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
|
||||
AC_OUTPUT
|
||||
File diff suppressed because it is too large
Load Diff
4971
dependency-check-core/src/test/resources/autoconf/readable-code/configure
vendored
Executable file
4971
dependency-check-core/src/test/resources/autoconf/readable-code/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,481 @@
|
||||
# configure.ac - configuration for "readable" project.
|
||||
# For more information on the project, see: http://readable.sourceforge.net.
|
||||
# For autotools info, see: http://www.dwheeler.com/autotools
|
||||
|
||||
# Copyright (C) 2007-2013 by David A. Wheeler and Alan Manuel K. Gloria.
|
||||
#
|
||||
# This software is released as open source software under the "MIT" license:
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this software and associated documentation files (the "Software"),
|
||||
# to deal in the Software without restriction, including without limitation
|
||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
# and/or sell copies of the Software, and to permit persons to whom the
|
||||
# Software is furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
# OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
# This "configure" script tries to "automagically" configure the software
|
||||
# for the user's system.
|
||||
# In general we will try to generate a "configure" that will
|
||||
# "work with what we have" but warn if major components aren't available.
|
||||
# We'll check for file existence for convenience (most users will configure
|
||||
# for their OWN system). We'll also provide override mechanisms to skip that,
|
||||
# to support generation for other systems (cross-"compiling").
|
||||
|
||||
|
||||
# Version numbers generally follow the Semantic Versioning convention
|
||||
# (MAJOR.MINOR.PATCH) as documented here: http://semver.org/
|
||||
# Pre-release values DO NOT INCLUDE a hyphen,
|
||||
# because hyphens are specifically forbidden by RPM-based tools
|
||||
# (used by Red Hat Enterprise Linux, Fedora, CentOS, SuSE, etc.).
|
||||
|
||||
# Initialize, but use more options. Note parameter brackets and whitespace.
|
||||
# TO CHANGE THE VERSION NUMBER: Edit readable-simple.spec, readable.spec,
|
||||
# readable.asd, possibly ChangeLog, and the line below:
|
||||
AC_INIT([readable], [1.0.7], [dwheeler@dwheeler.com],
|
||||
[readable], [http://readable.sourceforge.net/])
|
||||
AC_COPYRIGHT(
|
||||
[[Copyright (C) 2007-2014 by David A. Wheeler and Alan Manuel K. Gloria.
|
||||
This software is Free/libre/open source software and is
|
||||
released under the "MIT" license.]])
|
||||
|
||||
# Force autoconf to be more recent.
|
||||
AC_PREREQ([2.63])
|
||||
# Safety check - list a source file that wouldn't be in other projects:
|
||||
AC_CONFIG_SRCDIR([src/kernel.scm])
|
||||
# Put autotools auxiliary files in a subdir, so they don't clutter top dir:
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
|
||||
# Enable "automake" to simplify creating makefiles:
|
||||
AM_INIT_AUTOMAKE([1.11 -Wall -Werror])
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
|
||||
# Supporting shell functions
|
||||
is_empty () {
|
||||
test "x$1" = "x"
|
||||
}
|
||||
|
||||
is_enabled () { # Return TRUE if $1 has non-no value; empty considered enabled
|
||||
test "x$1" != "xno"
|
||||
}
|
||||
|
||||
is_permitted () { # Return TRUE if $1 has non-no value; empty = permitted
|
||||
test "x$1" != "xno"
|
||||
}
|
||||
|
||||
is_no_or_empty () {
|
||||
if "x$1" = "xno" ; then
|
||||
true
|
||||
elif test "x$1" = "x" ; then
|
||||
true
|
||||
else
|
||||
false
|
||||
fi
|
||||
}
|
||||
|
||||
# Report if given a "useful" value (something other than yes, no, or empty)
|
||||
is_useful () {
|
||||
if test "x$1" = "xyes" ; then
|
||||
false
|
||||
elif test "x$1" = "xno" ; then
|
||||
false
|
||||
elif test "x$1" = "x" ; then
|
||||
false
|
||||
else
|
||||
true
|
||||
fi
|
||||
}
|
||||
|
||||
# We generate HTML files from markdown files. By default we do this
|
||||
# using the markdown2.py file (MIT license), copied from:
|
||||
# https://raw.github.com/trentm/python-markdown2/master/lib/markdown2.py
|
||||
# We have our own copy in our directory so we can be certain to have one.
|
||||
# Users can use MARKDOWN=... or --markdown=... to use their own.
|
||||
default_markdown_command='python "$(srcdir)/markdown2.py" -x link-patterns --link-patterns-file markdown-urls'
|
||||
|
||||
|
||||
# Create arguments for configure:
|
||||
AC_ARG_WITH([guile],
|
||||
[AS_HELP_STRING([[--with-guile[=COMMAND] / --without-guile]],
|
||||
[require/disable guile; many tools use guile (default: auto-detect).])],
|
||||
[GUILE="$withval"])
|
||||
|
||||
AC_ARG_ENABLE([guile-readline],
|
||||
[AS_HELP_STRING([--enable-guile-readline / --disable-guile-readline],
|
||||
[require/disable readline support within guile (default: auto-detect)])])
|
||||
|
||||
AC_ARG_WITH([scsh],
|
||||
[AS_HELP_STRING([[--with-scsh[=COMMAND] / --without-scsh]],
|
||||
[require/disable support for scsh (default: auto-detect).])],
|
||||
[SCSH="$withval"])
|
||||
|
||||
AC_ARG_WITH([common-lisp],
|
||||
[AS_HELP_STRING([[--with-common-lisp[=DIR] / --without-common-lisp]],
|
||||
[require/disable Common Lisp library source code install to directory DIR (default: install to $(datadir)/common-lisp).])],
|
||||
[COMMON_LISP_LIB_DIR="$withval"])
|
||||
|
||||
AC_ARG_WITH([clisp],
|
||||
[AS_HELP_STRING([[--with-clisp[=COMMAND] / --without-clisp]],
|
||||
[require/disable support for clisp (default: auto-detect). This requires general Common Lisp support. COMMAND sets CLISP])],
|
||||
[CLISP="$withval"])
|
||||
|
||||
AC_ARG_WITH([sbcl],
|
||||
[AS_HELP_STRING([[--with-sbcl[=COMMAND] / --without-sbcl]],
|
||||
[require/disable support for sbcl (default: auto-detect).])],
|
||||
[SBCL="$withval"])
|
||||
|
||||
AC_ARG_WITH([register-cl-source],
|
||||
[AS_HELP_STRING([[--with-register-cl-source[=COMMAND] / --without-register-cl-source]],
|
||||
[require/disable support for the utility to register Common Lisp source (default: auto-detect for register-common-lisp-source program in PATH).])],
|
||||
[REGISTER_COMMON_LISP_SOURCE="$withval"])
|
||||
|
||||
AC_ARG_WITH([unregister-cl-source],
|
||||
[AS_HELP_STRING([[--with-unregister-cl-source[=COMMAND] / --without-unregister-cl-source]],
|
||||
[require/disable support for unregistering Common Lisp source (default: auto-detect. If register-cl-source is 'no', this is too)])],
|
||||
[UNREGISTER_COMMON_LISP_SOURCE="$withval"])
|
||||
|
||||
AC_ARG_WITH([markdown],
|
||||
[AS_HELP_STRING(
|
||||
[[--with-markdown[=COMMAND] | --without-markdown]],
|
||||
[require/forbid translating markdown into HTML (default: Use included markdown2 implementation, which uses Python).])],
|
||||
[MARKDOWN="$withval"])
|
||||
|
||||
# Other special environment variables/command-line variables
|
||||
AC_ARG_VAR([BIN_ENV],
|
||||
[Command to run env (default: auto-detect, often /usr/bin/env)])
|
||||
AC_ARG_VAR([EXPECT], [Command to run expect (default: auto-detect)])
|
||||
AC_ARG_VAR([GUILE_SITE],
|
||||
[Guile site directory (default: auto-detect; often /usr/share/guile/site)])
|
||||
|
||||
|
||||
# Sanity check all AC_ARG_WITH, AC_ARG_VAR, and AC_ARG_ENABLE variables
|
||||
# so they don't begin with "-" or space. Then we can use "test" without
|
||||
# "x" prefixes, even on systems that aren't POSIX 2008.
|
||||
# Many autoconf files have text of the form test "x$variable" because
|
||||
# variable might begin with "-"; POSIX 2008 systems can handle this when
|
||||
# there are <=3 arguments, but a non-compliant system could get it wrong.
|
||||
m4_ifdef([AS_VAR_COPY], [
|
||||
for input_variable in \
|
||||
with_guile GUILE \
|
||||
with_guile_readline \
|
||||
with_scsh SCSH \
|
||||
with_common_lisp COMMON_LISP_LIB_DIR \
|
||||
with_clisp CLISP \
|
||||
with_sbcl SBCL \
|
||||
with_register_cl_source REGISTER_COMMON_LISP_SOURCE \
|
||||
with_unregister_cl_source UNREGISTER_COMMON_LISP_SOURCE \
|
||||
with_markdown MARKDOWN \
|
||||
BIN_ENV EXPECT GUILE_SITE
|
||||
do
|
||||
AS_VAR_COPY([received_value], [$input_variable])
|
||||
AS_CASE(["$received_value"],
|
||||
[[[-\ ]*]],
|
||||
[AC_MSG_ERROR([Input $input_variable begins with dash or space: $received_value])])
|
||||
done
|
||||
])
|
||||
|
||||
# If registering is forceably disabled, disable unregistering to match
|
||||
AS_IF([test "$with_register_cl_source" = "no"],
|
||||
[with_unregister_cl_source=no])
|
||||
|
||||
# It doesn't make sense to provide a "useful" value for these:
|
||||
AS_IF([is_useful "$enable_guile_readline"],
|
||||
[AC_MSG_ERROR([enable-guile-readline must be 'yes', 'no', or no value])])
|
||||
|
||||
# Sanity-check combinations of argument values.
|
||||
AS_IF([test "$with_guile" = no && test "$with_common_lisp" = no],
|
||||
[AC_MSG_WARN([Both --without-guile and --without-common-lisp specified, little to do])])
|
||||
AS_IF([test "$with_common_lisp" = no && test "$with_clisp" = yes],
|
||||
[AC_MSG_ERROR([clisp requires Common Lisp support])])
|
||||
AS_IF([test "$with_common_lisp" = no && test "$with_sbcl" = yes],
|
||||
[AC_MSG_ERROR([sbcl requires Common Lisp support])])
|
||||
|
||||
|
||||
# Setup basics
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_MKDIR_P
|
||||
AC_PROG_SED
|
||||
|
||||
AC_PATH_PROG([BIN_ENV], [env])
|
||||
AS_IF([is_empty "$BIN_ENV"],
|
||||
[AC_MSG_ERROR([No executable "env" available.])])
|
||||
|
||||
# Is this a normal install, or a "make distcheck"? We need to disable
|
||||
# the tests in a "make distcheck" that won't work.
|
||||
is_make_distcheck=no
|
||||
AS_CASE([$prefix],
|
||||
[*/_inst],
|
||||
[AC_MSG_NOTICE([[Prefix ends in /_inst; this is a 'make distcheck'.]])
|
||||
is_make_distcheck=yes])
|
||||
AM_CONDITIONAL([IS_MAKE_DISTCHECK], [is_enabled "$is_make_distcheck"])
|
||||
AC_MSG_CHECKING([final decision IS_MAKE_DISTCHECK (running "make distcheck"?)])
|
||||
AM_COND_IF([IS_MAKE_DISTCHECK], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
### GUILE ###
|
||||
|
||||
# For purposes of configuration, do we have a working guile?
|
||||
AS_IF([is_permitted "$with_guile"],
|
||||
[AS_IF([is_useful "$GUILE"], [:], [AC_PATH_PROG([GUILE],[guile])])
|
||||
AS_IF([is_useful "$GUILE"],
|
||||
[AC_SUBST([GUILE])
|
||||
:])])
|
||||
AM_CONDITIONAL([HAVE_GUILE], [is_useful "$GUILE"])
|
||||
AC_MSG_CHECKING([final decision HAVE_GUILE])
|
||||
AM_COND_IF([HAVE_GUILE], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
# If we have guile, configure it.
|
||||
GUILE_READLINE_AVAILABLE=no
|
||||
AM_COND_IF([HAVE_GUILE],
|
||||
[# Guile provides autoconf macros in guile.m4, but they require guile-config.
|
||||
# Sadly, guile-config doesn't come standard on all "guile" packages on all
|
||||
# distros, so using guile-config would make our package harder to install.
|
||||
# Instead, we implement these searches directly, making our package
|
||||
# much easier to install.
|
||||
# Since we aren't linking into guile, this isn't hard to do.
|
||||
|
||||
# Determine Guile's "site" directory, where libraries are stored.
|
||||
# Guile's autoconf macro "GUILE_SITE_DIR" sets GUILE_SITE to the value of
|
||||
# the site directory, but as noted above, users often don't have
|
||||
# the guile autoconf macros installed. In addition,
|
||||
# GUILE_SITE_DIR doesn't honor the $prefix value anyway, which causes
|
||||
# "make distcheck" to always fail, making GUILE_SITE_DIR problematic:
|
||||
# http://lists.gnu.org/archive/html/guile-user/2009-01/msg00049.html
|
||||
# http://lists.gnu.org/archive/html/guile-user/2009-01/msg00048.html
|
||||
# We use:
|
||||
# 1. GUILE_SITE if not empty. Otherwise,
|
||||
# 2. If it's a normal install (not a "make distcheck"), and
|
||||
# guile reports a non-empty value, use that value. Otherwise,
|
||||
# 3. Use the value '${datarootdir}/guile/site'
|
||||
AS_IF([is_empty "$GUILE_SITE"],
|
||||
[AC_MSG_NOTICE([No GUILE_SITE value has been forceably set.])
|
||||
AM_COND_IF([IS_MAKE_DISTCHECK], [],
|
||||
[# Query the guile interpreter directly to find guile site directory
|
||||
AC_MSG_CHECKING([asking guile for its site directory])
|
||||
GUILE_SITE=`[$GUILE] -q -c "(display (%site-dir))"`
|
||||
AC_MSG_RESULT([$GUILE_SITE])])])
|
||||
AS_IF([is_empty "$GUILE_SITE"],
|
||||
[# GUILE_SITE *still* has no value. We must be in a "make distcheck"
|
||||
# or we were unable to get a useful value from Guile.
|
||||
AC_MSG_NOTICE([[Setting GUILE_SITE using datarootdir (which uses prefix)]])
|
||||
GUILE_SITE='${datarootdir}/guile/site'])
|
||||
# Add spaces at end to make results line up in the usual situation:
|
||||
AC_MSG_CHECKING([[Guile site directory (GUILE_SITE) ]])
|
||||
AC_MSG_RESULT([$GUILE_SITE])
|
||||
|
||||
# Determine if "readline" is available in guile.
|
||||
AC_MSG_CHECKING([if (ice-9 readline) is available])
|
||||
AS_IF([is_permitted "$enable_guile_readline"],
|
||||
[[$GUILE] -q \
|
||||
-c "(use-modules (ice-9 readline)) (exit ((lambda () 0)))" \
|
||||
> /dev/null 2>&1
|
||||
GUILE_READLINE_AVAILABLE=$?
|
||||
AS_IF([test "$GUILE_READLINE_AVAILABLE" = "0"],
|
||||
[GUILE_READLINE_AVAILABLE=yes],
|
||||
[GUILE_READLINE_AVAILABLE=no])])
|
||||
AC_MSG_RESULT([$GUILE_READLINE_AVAILABLE])
|
||||
AS_IF([test "$GUILE_READLINE_AVAILABLE" = "no" && \
|
||||
test "$enable_guile_readline" = "yes"],
|
||||
[AC_MSG_ERROR([Guile readline required but unavailable.])])
|
||||
|
||||
# Determine if guile can handle cond...else. This is standard Scheme,
|
||||
# and chicken Scheme complains if you use cond...#t. Sadly,
|
||||
# guile 1.6 doesn't support it. So we'll try to use it; if it fails,
|
||||
# we will set PATCH_COND_ELSE to a program that fixes it.
|
||||
# Normally PATCH_COND_ELSE is ":", which is a no-op.
|
||||
AC_MSG_CHECKING([if (cond...else) is supported in guile])
|
||||
AS_IF([[$GUILE] -q \
|
||||
-c '(cond (#f (display "bad")) (else (display "good")))' \
|
||||
> /dev/null 2>&1],
|
||||
[AC_MSG_RESULT([yes])
|
||||
PATCH_COND_ELSE=':'],
|
||||
[AC_MSG_RESULT([no])
|
||||
PATCH_COND_ELSE='$(srcdir)/patch_cond_else'])
|
||||
AC_SUBST([PATCH_COND_ELSE])
|
||||
|
||||
|
||||
AS_IF([is_permitted "$with_scsh"],
|
||||
[AS_IF([is_useful "$SCSH"], [], [AC_PATH_PROG([SCSH],[scsh])])
|
||||
AS_IF([is_useful "$SCSH"],
|
||||
[AC_SUBST([SCSH])
|
||||
:])])
|
||||
])
|
||||
AC_SUBST([GUILE_READLINE_AVAILABLE])
|
||||
AM_CONDITIONAL([HAVE_SCSH], [is_useful "$SCSH"])
|
||||
AC_MSG_CHECKING([final decision HAVE_SCSH])
|
||||
AM_COND_IF([HAVE_SCSH], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
AM_COND_IF([HAVE_GUILE], [],
|
||||
[# We do not have guile.
|
||||
AS_IF([test "$with_guile" = "yes"],
|
||||
[AC_MSG_ERROR([guile required but unavailable.])])
|
||||
AM_COND_IF([HAVE_SCSH],
|
||||
[AC_MSG_ERROR([guile unavailable yet scsh given forced value.])])])
|
||||
AM_COND_IF([HAVE_SCSH], [],
|
||||
[AS_IF([test "$with_scsh" = "yes"],
|
||||
[AC_MSG_ERROR([scsh required but unavailable.])])])
|
||||
|
||||
|
||||
### COMMON LISP ###
|
||||
|
||||
# Common Lisp by itself just installs to a directory, so we'll
|
||||
# always do it if permitted to do so:
|
||||
echo >&2
|
||||
AS_IF([is_permitted "$with_common_lisp"],
|
||||
[with_common_lisp=yes
|
||||
AC_MSG_NOTICE([Installing Common Lisp's library source code into a directory.])
|
||||
AS_IF([is_useful "$COMMON_LISP_LIB_DIR"], [],
|
||||
[COMMON_LISP_LIB_DIR='$(datadir)/common-lisp'
|
||||
AS_IF([test "$prefix" = "/usr"], [],
|
||||
[AC_MSG_WARN([Prefix is not /usr; ensure ASDF configuration looks here.])])])
|
||||
AC_MSG_CHECKING([Common Lisp lib dir (COMMON_LISP_LIB_DIR)])
|
||||
AC_MSG_RESULT([$COMMON_LISP_LIB_DIR])
|
||||
AC_SUBST([COMMON_LISP_LIB_DIR])
|
||||
|
||||
AS_IF([is_permitted "$with_register_cl_source"],
|
||||
[AS_IF([is_useful "$REGISTER_COMMON_LISP_SOURCE"], [], [AC_PATH_PROG([REGISTER_COMMON_LISP_SOURCE],[register-common-lisp-source])])
|
||||
AS_IF([is_useful "$REGISTER_COMMON_LISP_SOURCE"],
|
||||
[AC_SUBST([REGISTER_COMMON_LISP_SOURCE])
|
||||
:])])
|
||||
|
||||
AS_IF([is_permitted "$with_unregister_cl_source"],
|
||||
[AS_IF([is_useful "$UNREGISTER_COMMON_LISP_SOURCE"], [], [AC_PATH_PROG([UNREGISTER_COMMON_LISP_SOURCE],[unregister-common-lisp-source])])
|
||||
AS_IF([is_useful "$UNREGISTER_COMMON_LISP_SOURCE"],
|
||||
[AC_SUBST([UNREGISTER_COMMON_LISP_SOURCE])
|
||||
:])])
|
||||
|
||||
# We'll use LN_S to install Common Lisp ASDF files:
|
||||
AC_PROG_LN_S])
|
||||
AM_CONDITIONAL([INSTALL_COMMON_LISP_LIB], [is_enabled "$with_common_lisp"])
|
||||
AC_MSG_CHECKING([final decision INSTALL_COMMON_LISP_LIB])
|
||||
AC_MSG_RESULT([$with_common_lisp])
|
||||
|
||||
AM_CONDITIONAL([HAVE_REGISTER_COMMON_LISP_SOURCE],
|
||||
[is_useful "$REGISTER_COMMON_LISP_SOURCE"])
|
||||
AC_MSG_CHECKING([final decision HAVE_REGISTER_COMMON_LISP_SOURCE])
|
||||
AM_COND_IF([HAVE_REGISTER_COMMON_LISP_SOURCE],
|
||||
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
AM_CONDITIONAL([HAVE_UNREGISTER_COMMON_LISP_SOURCE],
|
||||
[is_useful "$UNREGISTER_COMMON_LISP_SOURCE"])
|
||||
AC_MSG_CHECKING([final decision HAVE_UNREGISTER_COMMON_LISP_SOURCE])
|
||||
AM_COND_IF([HAVE_UNREGISTER_COMMON_LISP_SOURCE],
|
||||
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
# If Common Lisp won't be installed, clisp and sbcl possibilities are limited.
|
||||
AM_COND_IF([INSTALL_COMMON_LISP_LIB], [],
|
||||
[AS_IF([is_no_or_empty "$with_clisp"],
|
||||
[with_clisp=no],
|
||||
[AC_MSG_ERROR([Common Lisp not available yet clisp required])])
|
||||
AS_IF([is_no_or_empty "$with_sbcl"],
|
||||
[with_sbcl=no],
|
||||
[AC_MSG_ERROR([Common Lisp not available yet sbcl required])])])
|
||||
|
||||
# Check clisp
|
||||
have_clisp_working_asdf=no
|
||||
announce_make_clisp_asdf=no
|
||||
AS_IF([is_permitted "$with_clisp"],
|
||||
[AS_IF([is_useful "$CLISP"], [], [AC_PATH_PROG([CLISP],[clisp])])
|
||||
AS_IF([is_useful "$CLISP"],
|
||||
[AC_SUBST([CLISP])
|
||||
AC_MSG_CHECKING([if (require "asdf") is available in clisp])
|
||||
echo '(require "asdf")' > asdf-check.lisp
|
||||
[$CLISP] asdf-check.lisp > /dev/null 2>&1
|
||||
AS_IF([test "$?" = 0],
|
||||
[have_clisp_working_asdf=yes],
|
||||
[announce_make_clisp_asdf=yes])
|
||||
AC_MSG_RESULT([$have_clisp_working_asdf])
|
||||
rm -f asdf-check.lisp],
|
||||
[AS_IF([test "$with_clisp" = yes],
|
||||
[AC_MSG_ERROR([clisp required but not found])])])])
|
||||
AM_CONDITIONAL([HAVE_CLISP], [is_enabled "$have_clisp_working_asdf"])
|
||||
AC_MSG_CHECKING([final decision HAVE_CLISP])
|
||||
AC_MSG_RESULT([$have_clisp_working_asdf])
|
||||
|
||||
# Check sbcl.
|
||||
AS_IF([is_permitted "$with_sbcl"],
|
||||
[AS_IF([is_useful "$SBCL"], [], [AC_PATH_PROG([SBCL],[sbcl])])
|
||||
AS_IF([is_useful "$SBCL"],
|
||||
[AC_SUBST([SBCL])
|
||||
:])])
|
||||
AM_CONDITIONAL([HAVE_SBCL], [is_useful "$SBCL"])
|
||||
AC_MSG_CHECKING([final decision HAVE_SBCL])
|
||||
AM_COND_IF([HAVE_SBCL], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
AM_COND_IF([HAVE_SBCL], [],
|
||||
[AS_IF([test "$with_sbcl" = "yes"],
|
||||
[AC_MSG_ERROR([sbcl required but unavailable.])])])
|
||||
|
||||
|
||||
|
||||
### Other stuff ###
|
||||
echo >&2
|
||||
|
||||
# If users have not specified their own markdown processor,
|
||||
# we'll try to use the pre-supplied markdown2 implementation.
|
||||
# In that case, we'll look for python (which is required for markdown2).
|
||||
# Markdown2 only requires a very old version of Python and it works with 3.
|
||||
# Developers will need a more modern version of Python to use
|
||||
# get-from-wiki, but get-from-wiki is a developer convenience
|
||||
# (not a user command) so we won't worry about that here.
|
||||
AS_IF([is_permitted "$with_markdown"],
|
||||
[AS_IF([is_useful "$MARKDOWN"],
|
||||
[AC_MSG_CHECKING([Markdown command])
|
||||
AC_MSG_RESULT([$MARKDOWN])],
|
||||
[MARKDOWN="$default_markdown_command"
|
||||
AC_MSG_CHECKING([default markdown command])
|
||||
AC_MSG_RESULT([$MARKDOWN])
|
||||
AM_PATH_PYTHON([2.4], [],
|
||||
[AS_IF([test "$with_markdown" = yes],
|
||||
[AC_MSG_ERROR([Python not found, and markdown2 required.])])
|
||||
with_markdown=no
|
||||
AC_MSG_WARN([Python not found, and markdown2 requires it. HTML generation disabled])])])])
|
||||
|
||||
AM_CONDITIONAL([HAVE_MARKDOWN], [is_permitted "$with_markdown"])
|
||||
AM_COND_IF([HAVE_MARKDOWN],
|
||||
[AC_SUBST([MARKDOWN])
|
||||
:])
|
||||
AC_MSG_CHECKING([final decision HAVE_MARKDOWN])
|
||||
AM_COND_IF([HAVE_MARKDOWN], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
|
||||
|
||||
|
||||
AM_COND_IF([HAVE_GUILE],
|
||||
[AC_PATH_PROG([EXPECT], [expect])
|
||||
AS_IF([is_empty "$EXPECT"],
|
||||
[echo >&2
|
||||
AC_MSG_WARN([[expect not found; please install expect, or many command-line tools will fail]])
|
||||
echo >&2
|
||||
# Set EXPECT to a plausible value, in case it's installed later
|
||||
# or a later PATH makes "expect" visible.
|
||||
# An empty value is *certain* to fail later.
|
||||
EXPECT="$BIN_ENV expect"])])
|
||||
|
||||
|
||||
# Emit key warnings LAST, so users are more likely to notice them.
|
||||
AM_COND_IF([HAVE_GUILE], [],
|
||||
[echo >&2
|
||||
AC_MSG_WARN([GUILE NOT AVAILABLE. Tools implemented with guile will not be available.])])
|
||||
|
||||
AS_IF([test "$announce_make_clisp_asdf" = yes],
|
||||
[echo >&2
|
||||
AC_MSG_WARN([CLISP FOUND, but clisp cannot currently invoke ASDF.])
|
||||
AC_MSG_NOTICE([Thus, clisp support is currently disabled.])
|
||||
AC_MSG_NOTICE([Run 'make clisp-asdf' to configure clisp to use ASDF for this user.])])
|
||||
|
||||
echo >&2
|
||||
|
||||
# Perhaps check for: (more) programs, libraries, header files, types,
|
||||
# structures, compiler characteristics, library functions, system services.
|
||||
|
||||
# Do final output.
|
||||
AC_OUTPUT
|
||||
|
||||
@@ -185,6 +185,10 @@ public final class Settings {
|
||||
* The properties key for whether the Python Package analyzer is enabled.
|
||||
*/
|
||||
public static final String ANALYZER_PYTHON_PACKAGE_ENABLED = "analyzer.python.package.enabled";
|
||||
/**
|
||||
* The properties key for whether the Autoconf analyzer is enabled.
|
||||
*/
|
||||
public static final String ANALYZER_AUTOCONF_ENABLED = "analyzer.autoconf.enabled";
|
||||
/**
|
||||
* The properties key for whether the .NET Assembly analyzer is enabled.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user