lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [6/9] Remove Charmonizer from repo
Date Mon, 10 Mar 2014 20:40:10 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Core/Util.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Util.c b/charmonizer/src/Charmonizer/Core/Util.c
deleted file mode 100644
index 575e0db..0000000
--- a/charmonizer/src/Charmonizer/Core/Util.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <errno.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Core/Util.h"
-
-/* Global verbosity setting. */
-int chaz_Util_verbosity = 1;
-
-void
-chaz_Util_write_file(const char *filename, const char *content) {
-    FILE *fh = fopen(filename, "w+");
-    size_t content_len = strlen(content);
-    if (fh == NULL) {
-        chaz_Util_die("Couldn't open '%s': %s", filename, strerror(errno));
-    }
-    fwrite(content, sizeof(char), content_len, fh);
-    if (fclose(fh)) {
-        chaz_Util_die("Error when closing '%s': %s", filename,
-                      strerror(errno));
-    }
-}
-
-char*
-chaz_Util_slurp_file(const char *file_path, size_t *len_ptr) {
-    FILE   *const file = fopen(file_path, "r");
-    char   *contents;
-    size_t  len;
-    long    check_val;
-
-    /* Sanity check. */
-    if (file == NULL) {
-        chaz_Util_die("Error opening file '%s': %s", file_path,
-                      strerror(errno));
-    }
-
-    /* Find length; return NULL if the file has a zero-length. */
-    len = chaz_Util_flength(file);
-    if (len == 0) {
-        *len_ptr = 0;
-        return NULL;
-    }
-
-    /* Allocate memory and read the file. */
-    contents = (char*)malloc(len * sizeof(char) + 1);
-    if (contents == NULL) {
-        chaz_Util_die("Out of memory at %d, %s", __FILE__, __LINE__);
-    }
-    contents[len] = '\0';
-    check_val = fread(contents, sizeof(char), len, file);
-
-    /* Weak error check, because CRLF might result in fewer chars read. */
-    if (check_val <= 0) {
-        chaz_Util_die("Tried to read %d characters of '%s', got %d", (int)len,
-                      file_path, check_val);
-    }
-
-    /* Set length pointer for benefit of caller. */
-    *len_ptr = check_val;
-
-    /* Clean up. */
-    if (fclose(file)) {
-        chaz_Util_die("Error closing file '%s': %s", file_path,
-                      strerror(errno));
-    }
-
-    return contents;
-}
-
-long
-chaz_Util_flength(void *file) {
-    FILE *f = (FILE*)file;
-    const long bookmark = ftell(f);
-    long check_val;
-    long len;
-
-    /* Seek to end of file and check length. */
-    check_val = fseek(f, 0, SEEK_END);
-    if (check_val == -1) {
-        chaz_Util_die("fseek error : %s\n", strerror(errno));
-    }
-    len = ftell(f);
-    if (len == -1) { chaz_Util_die("ftell error : %s\n", strerror(errno)); }
-
-    /* Return to where we were. */
-    check_val = fseek(f, bookmark, SEEK_SET);
-    if (check_val == -1) {
-        chaz_Util_die("fseek error : %s\n", strerror(errno));
-    }
-
-    return len;
-}
-
-char*
-chaz_Util_strdup(const char *string) {
-    size_t len = strlen(string);
-    char *copy = (char*)malloc(len + 1);
-    strncpy(copy, string, len);
-    copy[len] = '\0';
-    return copy;
-}
-
-char*
-chaz_Util_join(const char *sep, ...) {
-    va_list args;
-    const char *string;
-    char *result, *p;
-    size_t sep_len = strlen(sep);
-    size_t size;
-    int i;
-
-    /* Determine result size. */
-    va_start(args, sep);
-    size = 1;
-    string = va_arg(args, const char*);
-    for (i = 0; string; ++i) {
-        if (i != 0) { size += sep_len; }
-        size += strlen(string);
-        string = va_arg(args, const char*);
-    }
-    va_end(args);
-
-    result = (char*)malloc(size);
-
-    /* Create result string. */
-    va_start(args, sep);
-    p = result;
-    string = va_arg(args, const char*);
-    for (i = 0; string; ++i) {
-        size_t len;
-        if (i != 0) {
-            memcpy(p, sep, sep_len);
-            p += sep_len;
-        }
-        len = strlen(string);
-        memcpy(p, string, len);
-        p += len;
-        string = va_arg(args, const char*);
-    }
-    va_end(args);
-
-    *p = '\0';
-
-    return result;
-}
-
-void
-chaz_Util_die(const char* format, ...) {
-    va_list args;
-    va_start(args, format);
-    vfprintf(stderr, format, args);
-    va_end(args);
-    fprintf(stderr, "\n");
-    exit(1);
-}
-
-void
-chaz_Util_warn(const char* format, ...) {
-    va_list args;
-    va_start(args, format);
-    vfprintf(stderr, format, args);
-    va_end(args);
-    fprintf(stderr, "\n");
-}
-
-int
-chaz_Util_remove_and_verify(const char *file_path) {
-    /* Attempt to delete the file.  If it's gone after the attempt, return
-     * success, whether or not it was there to begin with.
-     * (ENOENT is POSIX not C89, but let's go with it for now.) */
-    int result = chaz_OS_remove(file_path);
-    if (result || errno == ENOENT) {
-        return 1;
-    }
-
-    /* Issue a warning and return failure. */
-    chaz_Util_warn("Failed to remove '%s': %s at %s line %d",
-                   file_path, strerror(errno), __FILE__, __LINE__);
-    return 0;
-}
-
-int
-chaz_Util_can_open_file(const char *file_path) {
-    FILE *garbage_fh;
-
-    /* Use fopen as a portable test for the existence of a file. */
-    garbage_fh = fopen(file_path, "r");
-    if (garbage_fh == NULL) {
-        return 0;
-    }
-    else {
-        fclose(garbage_fh);
-        return 1;
-    }
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Core/Util.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Core/Util.h b/charmonizer/src/Charmonizer/Core/Util.h
deleted file mode 100644
index cde04d0..0000000
--- a/charmonizer/src/Charmonizer/Core/Util.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Chaz/Core/Util.h -- miscellaneous utilities.
- */
-
-#ifndef H_CHAZ_UTIL
-#define H_CHAZ_UTIL 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stddef.h>
-#include <stdarg.h>
-
-extern int chaz_Util_verbosity;
-
-/* Open a file (truncating if necessary) and write [content] to it.  Util_die() if
- * an error occurs.
- */
-void
-chaz_Util_write_file(const char *filename, const char *content);
-
-/* Read an entire file into memory.
- */
-char*
-chaz_Util_slurp_file(const char *file_path, size_t *len_ptr);
-
-/* Return a newly allocated copy of a NULL-terminated string.
- */
-char*
-chaz_Util_strdup(const char *string);
-
-/* Join a NULL-terminated list of strings using a separator.
- */
-char*
-chaz_Util_join(const char *sep, ...);
-
-/* Get the length of a file (may overshoot on text files under DOS).
- */
-long
-chaz_Util_flength(void *file);
-
-/* Print an error message to stderr and exit.
- */
-void
-chaz_Util_die(const char *format, ...);
-
-/* Print an error message to stderr.
- */
-void
-chaz_Util_warn(const char *format, ...);
-
-/* Attept to delete a file.  Return true if the file is gone, whether or not
- * it was there to begin with.  Issue a warning and return false if the file
- * still exists.
- */
-int
-chaz_Util_remove_and_verify(const char *file_path);
-
-/* Attempt to open a file for reading, then close it immediately.
- */
-int
-chaz_Util_can_open_file(const char *file_path);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_UTIL */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe.c b/charmonizer/src/Charmonizer/Probe.c
deleted file mode 100644
index 68b972b..0000000
--- a/charmonizer/src/Charmonizer/Probe.c
+++ /dev/null
@@ -1,184 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Charmonizer/Probe.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/ConfWriterC.h"
-#include "Charmonizer/Core/ConfWriterPerl.h"
-#include "Charmonizer/Core/ConfWriterPython.h"
-#include "Charmonizer/Core/ConfWriterRuby.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/OperatingSystem.h"
-
-int
-chaz_Probe_parse_cli_args(int argc, const char *argv[],
-                          struct chaz_CLIArgs *args) {
-    int i;
-    int output_enabled = 0;
-
-    /* Zero out args struct. */
-    memset(args, 0, sizeof(struct chaz_CLIArgs));
-
-    /* Parse most args. */
-    for (i = 1; i < argc; i++) {
-        const char *arg = argv[i];
-        if (strcmp(arg, "--") == 0) {
-            /* From here on out, everything will be a compiler flag. */
-            i++;
-            break;
-        }
-        if (strcmp(arg, "--enable-c") == 0) {
-            args->charmony_h = 1;
-            output_enabled = 1;
-        }
-        else if (strcmp(arg, "--enable-perl") == 0) {
-            args->charmony_pm = 1;
-            output_enabled = 1;
-        }
-        else if (strcmp(arg, "--enable-python") == 0) {
-            args->charmony_py = 1;
-            output_enabled = 1;
-        }
-        else if (strcmp(arg, "--enable-ruby") == 0) {
-            args->charmony_rb = 1;
-            output_enabled = 1;
-        }
-        else if (strcmp(arg, "--enable-makefile") == 0) {
-            args->write_makefile = 1;
-        }
-        else if (strcmp(arg, "--enable-coverage") == 0) {
-            args->code_coverage = 1;
-        }
-        else if (memcmp(arg, "--cc=", 5) == 0) {
-            if (strlen(arg) > CHAZ_PROBE_MAX_CC_LEN - 5) {
-                fprintf(stderr, "Exceeded max length for compiler command");
-                exit(1);
-            }
-            strcpy(args->cc, arg + 5);
-        }
-    } /* preserve value of i */
-
-    /* Accumulate compiler flags. */
-    for (; i < argc; i++) {
-        const char *arg = argv[i];
-        size_t new_len = strlen(arg) + strlen(args->cflags) + 2;
-        if (new_len >= CHAZ_PROBE_MAX_CFLAGS_LEN) {
-            fprintf(stderr, "Exceeded max length for compiler flags");
-            exit(1);
-        }
-        strcat(args->cflags, " ");
-        strcat(args->cflags, arg);
-    }
-
-    /* Process CHARM_VERBOSITY environment variable. */
-    {
-        const char *verbosity_env = getenv("CHARM_VERBOSITY");
-        if (verbosity_env && strlen(verbosity_env)) {
-            args->verbosity = strtol(verbosity_env, NULL, 10);
-        }
-    }
-
-    /* Validate. */
-    if (!strlen(args->cc) || !output_enabled) {
-        return false;
-    }
-
-    return true;
-}
-
-void
-chaz_Probe_die_usage(void) {
-    fprintf(stderr,
-            "Usage: ./charmonize --cc=CC_COMMAND [--enable-c] "
-            "[--enable-perl] [--enable-python] [--enable-ruby] -- CFLAGS\n");
-    exit(1);
-}
-
-void
-chaz_Probe_init(struct chaz_CLIArgs *args) {
-    int output_enabled = 0;
-
-    {
-        /* Process CHARM_VERBOSITY environment variable. */
-        const char *verbosity_env = getenv("CHARM_VERBOSITY");
-        if (verbosity_env && strlen(verbosity_env)) {
-            chaz_Util_verbosity = strtol(verbosity_env, NULL, 10);
-        }
-    }
-
-    /* Dispatch other initializers. */
-    chaz_OS_init();
-    chaz_CC_init(args->cc, args->cflags);
-    chaz_ConfWriter_init();
-    chaz_HeadCheck_init();
-    chaz_Make_init();
-
-    /* Enable output. */
-    if (args->charmony_h) {
-        chaz_ConfWriterC_enable();
-        output_enabled = true;
-    }
-    if (args->charmony_pm) {
-        chaz_ConfWriterPerl_enable();
-        output_enabled = true;
-    }
-    if (args->charmony_py) {
-        chaz_ConfWriterPython_enable();
-        output_enabled = true;
-    }
-    if (args->charmony_rb) {
-        chaz_ConfWriterRuby_enable();
-        output_enabled = true;
-    }
-    if (!output_enabled) {
-        fprintf(stderr, "No output formats enabled\n");
-        exit(1);
-    }
-
-    if (chaz_Util_verbosity) { printf("Initialization complete.\n"); }
-}
-
-void
-chaz_Probe_clean_up(void) {
-    if (chaz_Util_verbosity) { printf("Cleaning up...\n"); }
-
-    /* Dispatch various clean up routines. */
-    chaz_ConfWriter_clean_up();
-    chaz_CC_clean_up();
-    chaz_Make_clean_up();
-
-    if (chaz_Util_verbosity) { printf("Cleanup complete.\n"); }
-}
-
-int
-chaz_Probe_gcc_version_num(void) {
-    return chaz_CC_gcc_version_num();
-}
-
-const char*
-chaz_Probe_gcc_version(void) {
-    return chaz_CC_gcc_version_num() ? chaz_CC_gcc_version() : NULL;
-}
-
-int
-chaz_Probe_msvc_version_num(void) {
-    return chaz_CC_msvc_version_num();
-}

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe.h b/charmonizer/src/Charmonizer/Probe.h
deleted file mode 100644
index 6323503..0000000
--- a/charmonizer/src/Charmonizer/Probe.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#ifndef H_CHAZ
-#define H_CHAZ 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-#include <stdio.h>
-
-#define CHAZ_PROBE_MAX_CC_LEN 100
-#define CHAZ_PROBE_MAX_CFLAGS_LEN 2000
-
-struct chaz_CLIArgs {
-    char cc[CHAZ_PROBE_MAX_CC_LEN + 1];
-    char cflags[CHAZ_PROBE_MAX_CFLAGS_LEN + 1];
-    int  charmony_h;
-    int  charmony_pm;
-    int  charmony_py;
-    int  charmony_rb;
-    int  verbosity;
-    int  write_makefile;
-    int  code_coverage;
-};
-
-/* Parse command line arguments, initializing and filling in the supplied
- * `args` struct.
- *
- *     APP_NAME --cc=CC_COMMAND
- *              [--enable-c]
- *              [--enable-perl]
- *              [--enable-python]
- *              [--enable-ruby]
- *              [-- [CFLAGS]]
- *
- * @return true if argument parsing proceeds without incident, false if
- * unexpected arguments are encountered or values are missing or invalid.
- */
-int
-chaz_Probe_parse_cli_args(int argc, const char *argv[],
-                          struct chaz_CLIArgs *args);
-
-/* Exit after printing usage instructions to stderr.
- */
-void
-chaz_Probe_die_usage(void);
-
-/* Set up the Charmonizer environment.
- *
- * If the environment variable CHARM_VERBOSITY has been set, it will be
- * processed at this time:
- *
- *      0 - silent
- *      1 - normal
- *      2 - debugging
- */
-void
-chaz_Probe_init(struct chaz_CLIArgs *args);
-
-/* Clean up the Charmonizer environment -- deleting tempfiles, etc.  This
- * should be called only after everything else finishes.
- */
-void
-chaz_Probe_clean_up(void);
-
-/* Return an integer version of the GCC version number which is
- * (10000 * __GNU_C__ + 100 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__).
- */
-int
-chaz_Probe_gcc_version_num(void);
-
-/* If the compiler is GCC (or claims compatibility), return an X.Y.Z string
- * version of the GCC version; otherwise, return NULL.
- */
-const char*
-chaz_Probe_gcc_version(void);
-
-/* Return the integer version of MSVC defined by _MSC_VER
- */
-int
-chaz_Probe_msvc_version_num(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* Include guard. */
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/AtomicOps.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/AtomicOps.c b/charmonizer/src/Charmonizer/Probe/AtomicOps.c
deleted file mode 100644
index 49c974a..0000000
--- a/charmonizer/src/Charmonizer/Probe/AtomicOps.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/AtomicOps.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-
-static int
-chaz_AtomicOps_osatomic_cas_ptr(void) {
-    static const char osatomic_casptr_code[] =
-        CHAZ_QUOTE(  #include <libkern/OSAtomic.h>                                  )
-        CHAZ_QUOTE(  #include <libkern/OSAtomic.h>                                  )
-        CHAZ_QUOTE(  int main() {                                                   )
-        CHAZ_QUOTE(      int  foo = 1;                                              )
-        CHAZ_QUOTE(      int *foo_ptr = &foo;                                       )
-        CHAZ_QUOTE(      int *target = NULL;                                        )
-        CHAZ_QUOTE(      OSAtomicCompareAndSwapPtr(NULL, foo_ptr, (void**)&target); )
-        CHAZ_QUOTE(      return 0;                                                  )
-        CHAZ_QUOTE(  }                                                              );
-     return chaz_CC_test_compile(osatomic_casptr_code);
-}
-
-void
-chaz_AtomicOps_run(void) {
-    chaz_ConfWriter_start_module("AtomicOps");
-
-    if (chaz_HeadCheck_check_header("libkern/OSAtomic.h")) {
-        chaz_ConfWriter_add_def("HAS_LIBKERN_OSATOMIC_H", NULL);
-
-        /* Check for OSAtomicCompareAndSwapPtr, introduced in later versions
-         * of OSAtomic.h. */
-        if (chaz_AtomicOps_osatomic_cas_ptr()) {
-            chaz_ConfWriter_add_def("HAS_OSATOMIC_CAS_PTR", NULL);
-        }
-    }
-    if (chaz_HeadCheck_check_header("sys/atomic.h")) {
-        chaz_ConfWriter_add_def("HAS_SYS_ATOMIC_H", NULL);
-    }
-    if (chaz_HeadCheck_check_header("windows.h")
-        && chaz_HeadCheck_check_header("intrin.h")
-       ) {
-        chaz_ConfWriter_add_def("HAS_INTRIN_H", NULL);
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/AtomicOps.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/AtomicOps.h b/charmonizer/src/Charmonizer/Probe/AtomicOps.h
deleted file mode 100644
index 548e822..0000000
--- a/charmonizer/src/Charmonizer/Probe/AtomicOps.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/AtomicOps.h
- */
-
-#ifndef H_CHAZ_ATOMICOPS
-#define H_CHAZ_ATOMICOPS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the AtomicOps module.
- *
- * These following symbols will be defined if the associated headers are
- * available:
- *
- * HAS_LIBKERN_OSATOMIC_H  <libkern/OSAtomic.h> (Mac OS X)
- * HAS_SYS_ATOMIC_H        <sys/atomic.h>       (Solaris)
- * HAS_INTRIN_H            <intrin.h>           (Windows)
- *
- * This symbol is defined if OSAtomicCompareAndSwapPtr is available:
- *
- * HAS_OSATOMIC_CAS_PTR
- */
-void chaz_AtomicOps_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_ATOMICOPS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Booleans.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Booleans.c b/charmonizer/src/Charmonizer/Probe/Booleans.c
deleted file mode 100644
index 942e36b..0000000
--- a/charmonizer/src/Charmonizer/Probe/Booleans.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Probe/Booleans.h"
-
-void
-chaz_Booleans_run(void) {
-    int has_stdbool = chaz_HeadCheck_check_header("stdbool.h");
-
-    chaz_ConfWriter_start_module("Booleans");
-
-    if (has_stdbool) {
-        chaz_ConfWriter_add_def("HAS_STDBOOL_H", NULL);
-        chaz_ConfWriter_add_sys_include("stdbool.h");
-    }
-    else {
-        chaz_ConfWriter_append_conf(
-            "#if (defined(CHY_EMPLOY_BOOLEANS) && !defined(__cplusplus))\n"
-            "  typedef int bool;\n"
-            "  #ifndef true\n"
-            "    #define true 1\n"
-            "  #endif\n"
-            "  #ifndef false\n"
-            "    #define false 0\n"
-            "  #endif\n"
-            "#endif\n");
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Booleans.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Booleans.h b/charmonizer/src/Charmonizer/Probe/Booleans.h
deleted file mode 100644
index e14f31b..0000000
--- a/charmonizer/src/Charmonizer/Probe/Booleans.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/Booleans.h -- bool type.
- *
- * If stdbool.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedef will be defined:
- *
- * bool
- *
- * These symbols will be defined if they are not already:
- *
- * true
- * false
- */
-
-#ifndef H_CHAZ_BOOLEANS
-#define H_CHAZ_BOOLEANS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the Booleans module.
- */
-void chaz_Booleans_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_BOOLEANS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/BuildEnv.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/BuildEnv.c b/charmonizer/src/Charmonizer/Probe/BuildEnv.c
deleted file mode 100644
index 4f55514..0000000
--- a/charmonizer/src/Charmonizer/Probe/BuildEnv.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Probe/BuildEnv.h"
-
-void
-chaz_BuildEnv_run(void) {
-    chaz_CFlags *extra_cflags = chaz_CC_get_extra_cflags();
-    const char  *extra_cflags_string = chaz_CFlags_get_string(extra_cflags);
-
-    chaz_ConfWriter_start_module("BuildEnv");
-
-    chaz_ConfWriter_add_def("CC", chaz_CC_get_cc());
-    chaz_ConfWriter_add_def("CFLAGS", chaz_CC_get_cflags());
-    chaz_ConfWriter_add_def("EXTRA_CFLAGS", extra_cflags_string);
-
-    chaz_ConfWriter_end_module();
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/BuildEnv.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/BuildEnv.h b/charmonizer/src/Charmonizer/Probe/BuildEnv.h
deleted file mode 100644
index f2c1670..0000000
--- a/charmonizer/src/Charmonizer/Probe/BuildEnv.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/BuildEnv.h -- Build environment.
- *
- * Capture various information about the build environment, including the C
- * compiler's interface, the shell, the operating system, etc.
- *
- * The following symbols will be defined:
- *
- * CC - String representation of the C compiler executable.
- * CFLAGS - C compiler flags.
- * EXTRA_CFLAGS - Extra C compiler flags.
- */
-
-#ifndef H_CHAZ_BUILDENV
-#define H_CHAZ_BUILDENV
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the BuildEnv module.
- */
-void chaz_BuildEnv_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_BUILDENV */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/DirManip.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/DirManip.c b/charmonizer/src/Charmonizer/Probe/DirManip.c
deleted file mode 100644
index c6465d7..0000000
--- a/charmonizer/src/Charmonizer/Probe/DirManip.c
+++ /dev/null
@@ -1,204 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/OperatingSystem.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Probe/DirManip.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static struct {
-    int  mkdir_num_args;
-    char mkdir_command[7];
-} chaz_DirManip = { 0, "" };
-
-/* Source code for rmdir. */
-static int
-chaz_DirManip_compile_posix_mkdir(const char *header) {
-    static const char posix_mkdir_code[] =
-        CHAZ_QUOTE(  #include <%s>                                      )
-        CHAZ_QUOTE(  int main(int argc, char **argv) {                  )
-        CHAZ_QUOTE(      if (argc != 2) { return 1; }                   )
-        CHAZ_QUOTE(      if (mkdir(argv[1], 0777) != 0) { return 2; }   )
-        CHAZ_QUOTE(      return 0;                                      )
-        CHAZ_QUOTE(  }                                                  );
-    char code_buf[sizeof(posix_mkdir_code) + 30];
-    int mkdir_available;
-    if (strlen(header) > 25) {
-        chaz_Util_die("Header name too long: '%s'", header);
-    }
-
-    /* Attempt compilation. */
-    sprintf(code_buf, posix_mkdir_code, header);
-    mkdir_available = chaz_CC_test_compile(code_buf);
-
-    /* Set vars on success. */
-    if (mkdir_available) {
-        strcpy(chaz_DirManip.mkdir_command, "mkdir");
-        if (strcmp(header, "direct.h") == 0) {
-            chaz_DirManip.mkdir_num_args = 1;
-        }
-        else {
-            chaz_DirManip.mkdir_num_args = 2;
-        }
-    }
-
-    return mkdir_available;
-}
-
-static int
-chaz_DirManip_compile_win_mkdir(void) {
-    static const char win_mkdir_code[] =
-        CHAZ_QUOTE(  #include <direct.h>                                )
-        CHAZ_QUOTE(  int main(int argc, char **argv) {                  )
-        CHAZ_QUOTE(      if (argc != 2) { return 1; }                   )
-        CHAZ_QUOTE(      if (_mkdir(argv[1]) != 0) { return 2; }        )
-        CHAZ_QUOTE(      return 0;                                      )
-        CHAZ_QUOTE(  }                                                  );
-    int mkdir_available;
-
-    mkdir_available = chaz_CC_test_compile(win_mkdir_code);
-    if (mkdir_available) {
-        strcpy(chaz_DirManip.mkdir_command, "_mkdir");
-        chaz_DirManip.mkdir_num_args = 1;
-    }
-    return mkdir_available;
-}
-
-static void
-chaz_DirManip_try_mkdir(void) {
-    if (chaz_HeadCheck_check_header("windows.h")) {
-        if (chaz_DirManip_compile_win_mkdir())               { return; }
-        if (chaz_DirManip_compile_posix_mkdir("direct.h"))   { return; }
-    }
-    if (chaz_DirManip_compile_posix_mkdir("sys/stat.h")) { return; }
-}
-
-static int
-chaz_DirManip_compile_rmdir(const char *header) {
-    static const char rmdir_code[] =
-        CHAZ_QUOTE(  #include <%s>                                      )
-        CHAZ_QUOTE(  int main(int argc, char **argv) {                  )
-        CHAZ_QUOTE(      if (argc != 2) { return 1; }                   )
-        CHAZ_QUOTE(      if (rmdir(argv[1]) != 0) { return 2; }         )
-        CHAZ_QUOTE(      return 0;                                      )
-        CHAZ_QUOTE(  }                                                  );
-    char code_buf[sizeof(rmdir_code) + 30];
-    int rmdir_available;
-    if (strlen(header) > 25) {
-        chaz_Util_die("Header name too long: '%s'", header);
-    }
-    sprintf(code_buf, rmdir_code, header);
-    rmdir_available = chaz_CC_test_compile(code_buf);
-    return rmdir_available;
-}
-
-static void
-chaz_DirManip_try_rmdir(void) {
-    if (chaz_DirManip_compile_rmdir("unistd.h"))   { return; }
-    if (chaz_DirManip_compile_rmdir("dirent.h"))   { return; }
-    if (chaz_DirManip_compile_rmdir("direct.h"))   { return; }
-}
-
-void
-chaz_DirManip_run(void) {
-    const char *dir_sep = chaz_OS_dir_sep();
-    int remove_zaps_dirs = false;
-    int has_dirent_h = chaz_HeadCheck_check_header("dirent.h");
-    int has_direct_h = chaz_HeadCheck_check_header("direct.h");
-    int has_dirent_d_namlen = false;
-    int has_dirent_d_type   = false;
-
-    chaz_ConfWriter_start_module("DirManip");
-    chaz_DirManip_try_mkdir();
-    chaz_DirManip_try_rmdir();
-
-    /* Header checks. */
-    if (has_dirent_h) {
-        chaz_ConfWriter_add_def("HAS_DIRENT_H", NULL);
-    }
-    if (has_direct_h) {
-        chaz_ConfWriter_add_def("HAS_DIRECT_H", NULL);
-    }
-
-    /* Check for members in struct dirent. */
-    if (has_dirent_h) {
-        has_dirent_d_namlen = chaz_HeadCheck_contains_member(
-                                  "struct dirent", "d_namlen",
-                                  "#include <sys/types.h>\n#include <dirent.h>"
-                              );
-        if (has_dirent_d_namlen) {
-            chaz_ConfWriter_add_def("HAS_DIRENT_D_NAMLEN", NULL);
-        }
-        has_dirent_d_type = chaz_HeadCheck_contains_member(
-                                "struct dirent", "d_type",
-                                "#include <sys/types.h>\n#include <dirent.h>"
-                            );
-        if (has_dirent_d_type) {
-            chaz_ConfWriter_add_def("HAS_DIRENT_D_TYPE", NULL);
-        }
-    }
-
-    if (chaz_DirManip.mkdir_num_args == 2) {
-        /* It's two args, but the command isn't "mkdir". */
-        char scratch[50];
-        if (strlen(chaz_DirManip.mkdir_command) > 30) {
-            chaz_Util_die("Command too long: '%s'", chaz_DirManip.mkdir_command);
-        }
-        sprintf(scratch, "%s(_dir, _mode)", chaz_DirManip.mkdir_command);
-        chaz_ConfWriter_add_def("makedir(_dir, _mode)", scratch);
-        chaz_ConfWriter_add_def("MAKEDIR_MODE_IGNORED", "0");
-    }
-    else if (chaz_DirManip.mkdir_num_args == 1) {
-        /* It's one arg... mode arg will be ignored. */
-        char scratch[50];
-        if (strlen(chaz_DirManip.mkdir_command) > 30) {
-            chaz_Util_die("Command too long: '%s'", chaz_DirManip.mkdir_command);
-        }
-        sprintf(scratch, "%s(_dir)", chaz_DirManip.mkdir_command);
-        chaz_ConfWriter_add_def("makedir(_dir, _mode)", scratch);
-        chaz_ConfWriter_add_def("MAKEDIR_MODE_IGNORED", "1");
-    }
-
-    if (strcmp(dir_sep, "\\") == 0) {
-        chaz_ConfWriter_add_def("DIR_SEP", "\"\\\\\"");
-        chaz_ConfWriter_add_def("DIR_SEP_CHAR", "'\\\\'");
-    }
-    else {
-        char scratch[5];
-        sprintf(scratch, "\"%s\"", dir_sep);
-        chaz_ConfWriter_add_def("DIR_SEP", scratch);
-        sprintf(scratch, "'%s'", dir_sep);
-        chaz_ConfWriter_add_def("DIR_SEP_CHAR", scratch);
-    }
-
-    /* See whether remove works on directories. */
-    chaz_OS_mkdir("_charm_test_remove_me");
-    if (0 == remove("_charm_test_remove_me")) {
-        remove_zaps_dirs = true;
-        chaz_ConfWriter_add_def("REMOVE_ZAPS_DIRS", NULL);
-    }
-    chaz_OS_rmdir("_charm_test_remove_me");
-
-    chaz_ConfWriter_end_module();
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/DirManip.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/DirManip.h b/charmonizer/src/Charmonizer/Probe/DirManip.h
deleted file mode 100644
index 55b3ecb..0000000
--- a/charmonizer/src/Charmonizer/Probe/DirManip.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/DirManip.h
- */
-
-#ifndef H_CHAZ_DIRMANIP
-#define H_CHAZ_DIRMANIP
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The DirManip module exports or aliases symbols related to directory and file
- * manipulation.
- *
- * Defined if the header files dirent.h and direct.h are available, respectively:
- *
- * HAS_DIRENT_H
- * HAS_DIRECT_H
- *
- * Defined if struct dirent has these members.
- *
- * HAS_DIRENT_D_NAMLEN
- * HAS_DIRENT_D_TYPE
- *
- * The "makedir" macro will be aliased to the POSIX-specified two-argument
- * "mkdir" interface:
- *
- * makedir
- *
- * On some systems, the second argument to makedir will be ignored, in which
- * case this symbol will be true; otherwise, it will be false: (TODO: This
- * isn't verified and may sometimes be incorrect.)
- *
- * MAKEDIR_MODE_IGNORED
- *
- * String representing the system's directory separator:
- *
- * DIR_SEP
- *
- * True if the remove() function removes directories, false otherwise:
- *
- * REMOVE_ZAPS_DIRS
- */
-void chaz_DirManip_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_DIR_SEP */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Floats.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Floats.c b/charmonizer/src/Charmonizer/Probe/Floats.c
deleted file mode 100644
index 6c3969d..0000000
--- a/charmonizer/src/Charmonizer/Probe/Floats.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/Floats.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void
-chaz_Floats_run(void) {
-    chaz_ConfWriter_start_module("Floats");
-
-    chaz_ConfWriter_append_conf(
-        "typedef union { unsigned char c[4]; float f; } chy_floatu32;\n"
-        "typedef union { unsigned char c[8]; double d; } chy_floatu64;\n"
-        "#ifdef CHY_BIG_END\n"
-        "static const chy_floatu32 chy_f32inf\n"
-        "    = { { 0x7F, 0x80, 0, 0 } };\n"
-        "static const chy_floatu32 chy_f32neginf\n"
-        "    = { { 0xFF, 0x80, 0, 0 } };\n"
-        "static const chy_floatu32 chy_f32nan\n"
-        "    = { { 0x7F, 0xC0, 0, 0 } };\n"
-        "static const chy_floatu64 chy_f64inf\n"
-        "    = { { 0x7F, 0xF0, 0, 0, 0, 0, 0, 0 } };\n"
-        "static const chy_floatu64 chy_f64neginf\n"
-        "    = { { 0xFF, 0xF0, 0, 0, 0, 0, 0, 0 } };\n"
-        "static const chy_floatu64 chy_f64nan\n"
-        "    = { { 0x7F, 0xF8, 0, 0, 0, 0, 0, 0 } };\n"
-        "#else /* BIG_END */\n"
-        "static const chy_floatu32 chy_f32inf\n"
-        "    = { { 0, 0, 0x80, 0x7F } };\n"
-        "static const chy_floatu32 chy_f32neginf\n"
-        "    = { { 0, 0, 0x80, 0xFF } };\n"
-        "static const chy_floatu32 chy_f32nan\n"
-        "    = { { 0, 0, 0xC0, 0x7F } };\n"
-        "static const chy_floatu64 chy_f64inf\n"
-        "    = { { 0, 0, 0, 0, 0, 0, 0xF0, 0x7F } };\n"
-        "static const chy_floatu64 chy_f64neginf\n"
-        "    = { { 0, 0, 0, 0, 0, 0, 0xF0, 0xFF } };\n"
-        "static const chy_floatu64 chy_f64nan\n"
-        "    = { { 0, 0, 0, 0, 0, 0, 0xF8, 0x7F } };\n"
-        "#endif /* BIG_END */\n"
-    );
-    chaz_ConfWriter_add_def("F32_INF", "(chy_f32inf.f)");
-    chaz_ConfWriter_add_def("F32_NEGINF", "(chy_f32neginf.f)");
-    chaz_ConfWriter_add_def("F32_NAN", "(chy_f32nan.f)");
-    chaz_ConfWriter_add_def("F64_INF", "(chy_f64inf.d)");
-    chaz_ConfWriter_add_def("F64_NEGINF", "(chy_f64neginf.d)");
-    chaz_ConfWriter_add_def("F64_NAN", "(chy_f64nan.d)");
-
-    chaz_ConfWriter_end_module();
-}
-
-const char*
-chaz_Floats_math_library(void) {
-    static const char sqrt_code[] =
-        CHAZ_QUOTE(  #include <math.h>                              )
-        CHAZ_QUOTE(  #include <stdio.h>                             )
-        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
-        CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
-        CHAZ_QUOTE(      return 0;                                  )
-        CHAZ_QUOTE(  }                                              );
-    chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
-    char        *output = NULL;
-    size_t       output_len;
-
-    output = chaz_CC_capture_output(sqrt_code, &output_len);
-    if (output != NULL) {
-        /* Linking against libm not needed. */
-        free(output);
-        return NULL;
-    }
-
-    chaz_CFlags_add_external_library(temp_cflags, "m");
-    output = chaz_CC_capture_output(sqrt_code, &output_len);
-    chaz_CFlags_clear(temp_cflags);
-
-    if (output == NULL) {
-        chaz_Util_die("Don't know how to use math library.");
-    }
-
-    free(output);
-    return "m";
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Floats.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Floats.h b/charmonizer/src/Charmonizer/Probe/Floats.h
deleted file mode 100644
index 2f71e9e..0000000
--- a/charmonizer/src/Charmonizer/Probe/Floats.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/Floats.h -- floating point types.
- *
- * The following symbols will be created if the platform supports IEEE 754
- * floating point types:
- *
- * F32_NAN
- * F32_INF
- * F32_NEGINF
- * F64_NAN
- * F64_INF
- * F64_NEGINF
- *
- * TODO: Actually test to see whether IEEE 754 is supported, rather than just
- * lying about it.
- */
-
-#ifndef H_CHAZ_FLOATS
-#define H_CHAZ_FLOATS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Run the Floats module.
- */
-void
-chaz_Floats_run(void);
-
-/* Return the name of the math library to link against or NULL.
- */
-const char*
-chaz_Floats_math_library(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_FLOATS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/FuncMacro.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/FuncMacro.c b/charmonizer/src/Charmonizer/Probe/FuncMacro.c
deleted file mode 100644
index 762602c..0000000
--- a/charmonizer/src/Charmonizer/Probe/FuncMacro.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/FuncMacro.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Probe for ISO func macro. */
-static int
-chaz_FuncMacro_probe_iso() {
-    static const char iso_func_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                )
-        CHAZ_QUOTE(  int main() {                      )
-        CHAZ_QUOTE(      printf("%s", __func__);       )
-        CHAZ_QUOTE(      return 0;                     )
-        CHAZ_QUOTE(  }                                 );
-    size_t output_len;
-    char *output;
-    int success = false;
-
-    output = chaz_CC_capture_output(iso_func_code, &output_len);
-    if (output != NULL && strncmp(output, "main", 4) == 0) {
-        success = true;
-    }
-    free(output);
-
-    return success;
-}
-
-static int
-chaz_FuncMacro_probe_gnu() {
-    /* Code for verifying GNU func macro. */
-    static const char gnu_func_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                )
-        CHAZ_QUOTE(  int main() {                      )
-        CHAZ_QUOTE(      printf("%s", __FUNCTION__);   )
-        CHAZ_QUOTE(      return 0;                     )
-        CHAZ_QUOTE(  }                                 );
-    size_t output_len;
-    char *output;
-    int success = false;
-
-    output = chaz_CC_capture_output(gnu_func_code, &output_len);
-    if (output != NULL && strncmp(output, "main", 4) == 0) {
-        success = true;
-    }
-    free(output);
-
-    return success;
-}
-
-/* Attempt to verify inline keyword. */
-static char*
-chaz_FuncMacro_try_inline(const char *keyword, size_t *output_len) {
-    static const char inline_code[] =
-        CHAZ_QUOTE(  #include <stdio.h>                )
-        CHAZ_QUOTE(  static %s int foo() { return 1; } )
-        CHAZ_QUOTE(  int main() {                      )
-        CHAZ_QUOTE(      printf("%%d", foo());         )
-        CHAZ_QUOTE(      return 0;                     )
-        CHAZ_QUOTE(  }                                 );
-    char code[sizeof(inline_code) + 30];
-    sprintf(code, inline_code, keyword);
-    return chaz_CC_capture_output(code, output_len);
-}
-
-static void
-chaz_FuncMacro_probe_inline(void) {
-    static const char* inline_options[] = {
-        "__inline",
-        "__inline__",
-        "inline"
-    };
-    const int num_inline_options = sizeof(inline_options) / sizeof(void*);
-    int has_inline = false;
-    int i;
-
-    for (i = 0; i < num_inline_options; i++) {
-        const char *inline_option = inline_options[i];
-        size_t output_len;
-        char *output = chaz_FuncMacro_try_inline(inline_option, &output_len);
-        if (output != NULL) {
-            has_inline = true;
-            chaz_ConfWriter_add_def("INLINE", inline_option);
-            free(output);
-            break;
-        }
-    }
-    if (!has_inline) {
-        chaz_ConfWriter_add_def("INLINE", NULL);
-    }
-}
-
-void
-chaz_FuncMacro_run(void) {
-    int has_funcmac      = false;
-    int has_iso_funcmac  = false;
-    int has_gnuc_funcmac = false;
-
-    chaz_ConfWriter_start_module("FuncMacro");
-
-    /* Check for func macros. */
-    if (chaz_FuncMacro_probe_iso()) {
-        has_funcmac     = true;
-        has_iso_funcmac = true;
-    }
-    if (chaz_FuncMacro_probe_gnu()) {
-        has_funcmac      = true;
-        has_gnuc_funcmac = true;
-    }
-
-    /* Write out common defines. */
-    if (has_funcmac) {
-        const char *macro_text = has_iso_funcmac
-                                 ? "__func__"
-                                 : "__FUNCTION__";
-        chaz_ConfWriter_add_def("HAS_FUNC_MACRO", NULL);
-        chaz_ConfWriter_add_def("FUNC_MACRO", macro_text);
-    }
-
-    /* Write out specific defines. */
-    if (has_iso_funcmac) {
-        chaz_ConfWriter_add_def("HAS_ISO_FUNC_MACRO", NULL);
-    }
-    if (has_gnuc_funcmac) {
-        chaz_ConfWriter_add_def("HAS_GNUC_FUNC_MACRO", NULL);
-    }
-
-    /* Check for inline keyword. */
-    chaz_FuncMacro_probe_inline();
-
-    chaz_ConfWriter_end_module();
-}
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/FuncMacro.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/FuncMacro.h b/charmonizer/src/Charmonizer/Probe/FuncMacro.h
deleted file mode 100644
index bf3b7b2..0000000
--- a/charmonizer/src/Charmonizer/Probe/FuncMacro.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/FuncMacro.h
- */
-
-#ifndef H_CHAZ_FUNC_MACRO
-#define H_CHAZ_FUNC_MACRO
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the FuncMacro module.
- *
- * If __func__ successfully resolves, this will be defined:
- *
- * HAS_ISO_FUNC_MACRO
- *
- * If __FUNCTION__ successfully resolves, this will be defined:
- *
- * HAS_GNUC_FUNC_MACRO
- *
- * If one or the other succeeds, these will be defined:
- *
- * HAS_FUNC_MACRO
- * FUNC_MACRO
- *
- * The "inline" keyword will also be probed for.  If it is available, the
- * following macro will be defined to "inline", otherwise it will be defined
- * to nothing.
- *
- * INLINE
- */
-void chaz_FuncMacro_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_FUNC_MACRO */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Headers.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Headers.c b/charmonizer/src/Charmonizer/Probe/Headers.c
deleted file mode 100644
index 69103ef..0000000
--- a/charmonizer/src/Charmonizer/Probe/Headers.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/Headers.h"
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#define CHAZ_HEADERS_MAX_KEEPERS 200
-
-static struct {
-    int keeper_count;
-    const char *keepers[CHAZ_HEADERS_MAX_KEEPERS + 1];
-} chaz_Headers = { 0, { NULL } };
-
-/* Add a header to the keepers array.
- */
-static void
-chaz_Headers_keep(const char *header_name);
-
-/* Transform "header.h" into "CHY_HAS_HEADER_H, storing the result into
- * `buffer`.
- */
-static void
-chaz_Headers_encode_affirmation(const char *header_name, char *buffer,
-                                size_t buf_size);
-
-/* Probe for all C89 headers. */
-static void
-chaz_Headers_probe_c89(void);
-
-/* Probe for all POSIX headers. */
-static void
-chaz_Headers_probe_posix(void);
-
-/* Prove for selected Windows headers. */
-static void
-chaz_Headers_probe_win(void);
-
-int
-chaz_Headers_check(const char *header_name) {
-    return chaz_HeadCheck_check_header(header_name);
-}
-
-void
-chaz_Headers_run(void) {
-    int i;
-
-    chaz_ConfWriter_start_module("Headers");
-
-    chaz_Headers_probe_posix();
-    chaz_Headers_probe_c89();
-    chaz_Headers_probe_win();
-
-    /* One-offs. */
-    if (chaz_HeadCheck_check_header("pthread.h")) {
-        chaz_Headers_keep("pthread.h");
-    }
-
-    /* Append the config with every header detected so far. */
-    for (i = 0; chaz_Headers.keepers[i] != NULL; i++) {
-        char aff_buf[200];
-        chaz_Headers_encode_affirmation(chaz_Headers.keepers[i], aff_buf, 200);
-        chaz_ConfWriter_add_def(aff_buf, NULL);
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-static void
-chaz_Headers_keep(const char *header_name) {
-    if (chaz_Headers.keeper_count >= CHAZ_HEADERS_MAX_KEEPERS) {
-        chaz_Util_die("Too many keepers -- increase MAX_KEEPER_COUNT");
-    }
-    chaz_Headers.keepers[chaz_Headers.keeper_count++] = header_name;
-    chaz_Headers.keepers[chaz_Headers.keeper_count]   = NULL;
-}
-
-static void
-chaz_Headers_encode_affirmation(const char *header_name, char *buffer, size_t buf_size) {
-    char *buf, *buf_end;
-    size_t len = strlen(header_name) + sizeof("HAS_");
-    if (len + 1 > buf_size) {
-        chaz_Util_die("Buffer too small: %lu", (unsigned long)buf_size);
-    }
-
-    /* Start off with "HAS_". */
-    strcpy(buffer, "HAS_");
-
-    /* Transform one char at a time. */
-    for (buf = buffer + sizeof("HAS_") - 1, buf_end = buffer + len;
-         buf < buf_end;
-         header_name++, buf++
-        ) {
-        if (*header_name == '\0') {
-            *buf = '\0';
-            break;
-        }
-        else if (isalnum(*header_name)) {
-            *buf = toupper(*header_name);
-        }
-        else {
-            *buf = '_';
-        }
-    }
-}
-
-static void
-chaz_Headers_probe_c89(void) {
-    const char *c89_headers[] = {
-        "assert.h",
-        "ctype.h",
-        "errno.h",
-        "float.h",
-        "limits.h",
-        "locale.h",
-        "math.h",
-        "setjmp.h",
-        "signal.h",
-        "stdarg.h",
-        "stddef.h",
-        "stdio.h",
-        "stdlib.h",
-        "string.h",
-        "time.h",
-        NULL
-    };
-    int i;
-
-    /* Test for all c89 headers in one blast. */
-    if (chaz_HeadCheck_check_many_headers((const char**)c89_headers)) {
-        chaz_ConfWriter_add_def("HAS_C89", NULL);
-        chaz_ConfWriter_add_def("HAS_C90", NULL);
-        for (i = 0; c89_headers[i] != NULL; i++) {
-            chaz_Headers_keep(c89_headers[i]);
-        }
-    }
-    /* Test one-at-a-time. */
-    else {
-        for (i = 0; c89_headers[i] != NULL; i++) {
-            if (chaz_HeadCheck_check_header(c89_headers[i])) {
-                chaz_Headers_keep(c89_headers[i]);
-            }
-        }
-    }
-}
-
-static void
-chaz_Headers_probe_posix(void) {
-    const char *posix_headers[] = {
-        "cpio.h",
-        "dirent.h",
-        "fcntl.h",
-        "grp.h",
-        "pwd.h",
-        "regex.h",
-        "sys/stat.h",
-        "sys/times.h",
-        "sys/types.h",
-        "sys/utsname.h",
-        "sys/wait.h",
-        "tar.h",
-        "termios.h",
-        "unistd.h",
-        "utime.h",
-        NULL
-    };
-    int i;
-
-    /* Try for all POSIX headers in one blast. */
-    if (chaz_HeadCheck_check_many_headers((const char**)posix_headers)) {
-        chaz_ConfWriter_add_def("HAS_POSIX", NULL);
-        for (i = 0; posix_headers[i] != NULL; i++) {
-            chaz_Headers_keep(posix_headers[i]);
-        }
-    }
-    /* Test one-at-a-time. */
-    else {
-        for (i = 0; posix_headers[i] != NULL; i++) {
-            if (chaz_HeadCheck_check_header(posix_headers[i])) {
-                chaz_Headers_keep(posix_headers[i]);
-            }
-        }
-    }
-}
-
-
-static void
-chaz_Headers_probe_win(void) {
-    const char *win_headers[] = {
-        "io.h",
-        "windows.h",
-        "process.h",
-        NULL
-    };
-    int i;
-
-    /* Test for all Windows headers in one blast */
-    if (chaz_HeadCheck_check_many_headers((const char**)win_headers)) {
-        for (i = 0; win_headers[i] != NULL; i++) {
-            chaz_Headers_keep(win_headers[i]);
-        }
-    }
-    /* Test one-at-a-time. */
-    else {
-        for (i = 0; win_headers[i] != NULL; i++) {
-            if (chaz_HeadCheck_check_header(win_headers[i])) {
-                chaz_Headers_keep(win_headers[i]);
-            }
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Headers.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Headers.h b/charmonizer/src/Charmonizer/Probe/Headers.h
deleted file mode 100644
index 340048a..0000000
--- a/charmonizer/src/Charmonizer/Probe/Headers.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/Headers.h
- */
-
-#ifndef H_CHAZ_HEADERS
-#define H_CHAZ_HEADERS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include <stdio.h>
-#include "Charmonizer/Core/Defines.h"
-
-/* Check whether a particular header file is available.  The test-compile is
- * only run the first time a given request is made.
- */
-int
-chaz_Headers_check(const char *header_name);
-
-/* Run the Headers module.
- *
- * Exported symbols:
- *
- * If HAS_C89 is declared, this system has all the header files described in
- * Ansi C 1989.  HAS_C90 is a synonym.  (It would be surprising if they are
- * not defined, because Charmonizer itself assumes C89.)
- *
- * HAS_C89
- * HAS_C90
- *
- * One symbol is exported for each C89 header file:
- *
- * HAS_ASSERT_H
- * HAS_CTYPE_H
- * HAS_ERRNO_H
- * HAS_FLOAT_H
- * HAS_LIMITS_H
- * HAS_LOCALE_H
- * HAS_MATH_H
- * HAS_SETJMP_H
- * HAS_SIGNAL_H
- * HAS_STDARG_H
- * HAS_STDDEF_H
- * HAS_STDIO_H
- * HAS_STDLIB_H
- * HAS_STRING_H
- * HAS_TIME_H
- *
- * One symbol is exported for every POSIX header present, and HAS_POSIX is
- * exported if they're all there.
- *
- * HAS_POSIX
- *
- * HAS_CPIO_H
- * HAS_DIRENT_H
- * HAS_FCNTL_H
- * HAS_GRP_H
- * HAS_PWD_H
- * HAS_SYS_STAT_H
- * HAS_SYS_TIMES_H
- * HAS_SYS_TYPES_H
- * HAS_SYS_UTSNAME_H
- * HAS_WAIT_H
- * HAS_TAR_H
- * HAS_TERMIOS_H
- * HAS_UNISTD_H
- * HAS_UTIME_H
- *
- * If pthread.h is available, this will be exported:
- *
- * HAS_PTHREAD_H
- */
-void
-chaz_Headers_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_HEADERS */
-
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Integers.c
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Integers.c b/charmonizer/src/Charmonizer/Probe/Integers.c
deleted file mode 100644
index aec09b5..0000000
--- a/charmonizer/src/Charmonizer/Probe/Integers.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-#include "Charmonizer/Core/HeaderChecker.h"
-#include "Charmonizer/Core/Compiler.h"
-#include "Charmonizer/Core/ConfWriter.h"
-#include "Charmonizer/Core/Util.h"
-#include "Charmonizer/Probe/Integers.h"
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-/* Determine endian-ness of this machine.
- */
-static int
-chaz_Integers_machine_is_big_endian(void);
-
-static const char chaz_Integers_sizes_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                        )
-    CHAZ_QUOTE(  int main () {                             )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(char));     )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(short));    )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(int));      )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(long));     )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(void*));    )
-    CHAZ_QUOTE(      printf("%d ", (int)sizeof(size_t));   )
-    CHAZ_QUOTE(      return 0;                             )
-    CHAZ_QUOTE(  }                                         );
-
-static const char chaz_Integers_type64_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                        )
-    CHAZ_QUOTE(  int main()                                )
-    CHAZ_QUOTE(  {                                         )
-    CHAZ_QUOTE(      printf("%%d", (int)sizeof(%s));       )
-    CHAZ_QUOTE(      return 0;                             )
-    CHAZ_QUOTE(  }                                         );
-
-static const char chaz_Integers_literal64_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                        )
-    CHAZ_QUOTE(  #define big 9000000000000000000%s         )
-    CHAZ_QUOTE(  int main()                                )
-    CHAZ_QUOTE(  {                                         )
-    CHAZ_QUOTE(      int truncated = (int)big;             )
-    CHAZ_QUOTE(      printf("%%d\n", truncated);           )
-    CHAZ_QUOTE(      return 0;                             )
-    CHAZ_QUOTE(  }                                         );
-
-static const char chaz_Integers_u64_to_double_code[] =
-    CHAZ_QUOTE(  #include <stdio.h>                        )
-    CHAZ_QUOTE(  int main()                                )
-    CHAZ_QUOTE(  {                                         )
-    CHAZ_QUOTE(      unsigned %s int_num = 0;              )
-    CHAZ_QUOTE(      double float_num;                     )
-    CHAZ_QUOTE(      float_num = (double)int_num;          )
-    CHAZ_QUOTE(      printf("%%f\n", float_num);           )
-    CHAZ_QUOTE(      return 0;                             )
-    CHAZ_QUOTE(  }                                         );
-
-void
-chaz_Integers_run(void) {
-    char *output;
-    size_t output_len;
-    int sizeof_char       = -1;
-    int sizeof_short      = -1;
-    int sizeof_int        = -1;
-    int sizeof_ptr        = -1;
-    int sizeof_long       = -1;
-    int sizeof_long_long  = -1;
-    int sizeof___int64    = -1;
-    int sizeof_size_t     = -1;
-    int has_8             = false;
-    int has_16            = false;
-    int has_32            = false;
-    int has_64            = false;
-    int has_long_long     = false;
-    int has___int64       = false;
-    int has_inttypes      = chaz_HeadCheck_check_header("inttypes.h");
-    int has_stdint        = chaz_HeadCheck_check_header("stdint.h");
-    int can_convert_u64_to_double = true;
-    char i32_t_type[10];
-    char i32_t_postfix[10];
-    char u32_t_postfix[10];
-    char i64_t_type[10];
-    char i64_t_postfix[10];
-    char u64_t_postfix[10];
-    char code_buf[1000];
-    char scratch[50];
-
-    chaz_ConfWriter_start_module("Integers");
-
-    /* Document endian-ness. */
-    if (chaz_Integers_machine_is_big_endian()) {
-        chaz_ConfWriter_add_def("BIG_END", NULL);
-    }
-    else {
-        chaz_ConfWriter_add_def("LITTLE_END", NULL);
-    }
-
-    /* Record sizeof() for several common integer types. */
-    output = chaz_CC_capture_output(chaz_Integers_sizes_code, &output_len);
-    if (output != NULL) {
-        char *ptr     = output;
-        char *end_ptr = output;
-
-        sizeof_char   = strtol(ptr, &end_ptr, 10);
-        ptr           = end_ptr;
-        sizeof_short  = strtol(ptr, &end_ptr, 10);
-        ptr           = end_ptr;
-        sizeof_int    = strtol(ptr, &end_ptr, 10);
-        ptr           = end_ptr;
-        sizeof_long   = strtol(ptr, &end_ptr, 10);
-        ptr           = end_ptr;
-        sizeof_ptr    = strtol(ptr, &end_ptr, 10);
-        ptr           = end_ptr;
-        sizeof_size_t = strtol(ptr, &end_ptr, 10);
-
-        free(output);
-    }
-
-    /* Determine whether long longs are available. */
-    sprintf(code_buf, chaz_Integers_type64_code, "long long");
-    output = chaz_CC_capture_output(code_buf, &output_len);
-    if (output != NULL) {
-        has_long_long    = true;
-        sizeof_long_long = strtol(output, NULL, 10);
-        free(output);
-    }
-
-    /* Determine whether the __int64 type is available. */
-    sprintf(code_buf, chaz_Integers_type64_code, "__int64");
-    output = chaz_CC_capture_output(code_buf, &output_len);
-    if (output != NULL) {
-        has___int64 = true;
-        sizeof___int64 = strtol(output, NULL, 10);
-        free(output);
-    }
-
-    /* Figure out which integer types are available. */
-    if (sizeof_char == 1) {
-        has_8 = true;
-    }
-    if (sizeof_short == 2) {
-        has_16 = true;
-    }
-    if (sizeof_int == 4) {
-        has_32 = true;
-        strcpy(i32_t_type, "int");
-        strcpy(i32_t_postfix, "");
-        strcpy(u32_t_postfix, "U");
-    }
-    else if (sizeof_long == 4) {
-        has_32 = true;
-        strcpy(i32_t_type, "long");
-        strcpy(i32_t_postfix, "L");
-        strcpy(u32_t_postfix, "UL");
-    }
-    if (sizeof_long == 8) {
-        has_64 = true;
-        strcpy(i64_t_type, "long");
-    }
-    else if (sizeof_long_long == 8) {
-        has_64 = true;
-        strcpy(i64_t_type, "long long");
-    }
-    else if (sizeof___int64 == 8) {
-        has_64 = true;
-        strcpy(i64_t_type, "__int64");
-    }
-
-    /* Probe for 64-bit literal syntax. */
-    if (has_64 && sizeof_long == 8) {
-        strcpy(i64_t_postfix, "L");
-        strcpy(u64_t_postfix, "UL");
-    }
-    else if (has_64) {
-        sprintf(code_buf, chaz_Integers_literal64_code, "LL");
-        output = chaz_CC_capture_output(code_buf, &output_len);
-        if (output != NULL) {
-            strcpy(i64_t_postfix, "LL");
-            free(output);
-        }
-        else {
-            sprintf(code_buf, chaz_Integers_literal64_code, "i64");
-            output = chaz_CC_capture_output(code_buf, &output_len);
-            if (output != NULL) {
-                strcpy(i64_t_postfix, "i64");
-                free(output);
-            }
-            else {
-                chaz_Util_die("64-bit types, but no literal syntax found");
-            }
-        }
-        sprintf(code_buf, chaz_Integers_literal64_code, "ULL");
-        output = chaz_CC_capture_output(code_buf, &output_len);
-        if (output != NULL) {
-            strcpy(u64_t_postfix, "ULL");
-            free(output);
-        }
-        else {
-            sprintf(code_buf, chaz_Integers_literal64_code, "Ui64");
-            output = chaz_CC_capture_output(code_buf, &output_len);
-            if (output != NULL) {
-                strcpy(u64_t_postfix, "Ui64");
-                free(output);
-            }
-            else {
-                chaz_Util_die("64-bit types, but no literal syntax found");
-            }
-        }
-    }
-
-    /* Write out some conditional defines. */
-    if (has_inttypes) {
-        chaz_ConfWriter_add_def("HAS_INTTYPES_H", NULL);
-    }
-    if (has_stdint) {
-        chaz_ConfWriter_add_def("HAS_STDINT_H", NULL);
-    }
-    if (has_long_long) {
-        chaz_ConfWriter_add_def("HAS_LONG_LONG", NULL);
-    }
-    if (has___int64) {
-        chaz_ConfWriter_add_def("HAS___INT64", NULL);
-    }
-
-    /* Write out sizes. */
-    sprintf(scratch, "%d", sizeof_char);
-    chaz_ConfWriter_add_def("SIZEOF_CHAR", scratch);
-    sprintf(scratch, "%d", sizeof_short);
-    chaz_ConfWriter_add_def("SIZEOF_SHORT", scratch);
-    sprintf(scratch, "%d", sizeof_int);
-    chaz_ConfWriter_add_def("SIZEOF_INT", scratch);
-    sprintf(scratch, "%d", sizeof_long);
-    chaz_ConfWriter_add_def("SIZEOF_LONG", scratch);
-    sprintf(scratch, "%d", sizeof_ptr);
-    chaz_ConfWriter_add_def("SIZEOF_PTR", scratch);
-    sprintf(scratch, "%d", sizeof_size_t);
-    chaz_ConfWriter_add_def("SIZEOF_SIZE_T", scratch);
-    if (has_long_long) {
-        sprintf(scratch, "%d", sizeof_long_long);
-        chaz_ConfWriter_add_def("SIZEOF_LONG_LONG", scratch);
-    }
-    if (has___int64) {
-        sprintf(scratch, "%d", sizeof___int64);
-        chaz_ConfWriter_add_def("SIZEOF___INT64", scratch);
-    }
-
-    /* Write affirmations. */
-    if (has_8) {
-        chaz_ConfWriter_add_def("HAS_INT8_T", NULL);
-    }
-    if (has_16) {
-        chaz_ConfWriter_add_def("HAS_INT16_T", NULL);
-    }
-    if (has_32) {
-        chaz_ConfWriter_add_def("HAS_INT32_T", NULL);
-    }
-    if (has_64) {
-        chaz_ConfWriter_add_def("HAS_INT64_T", NULL);
-    }
-
-    /* Create macro for promoting pointers to integers. */
-    if (has_64) {
-        if (sizeof_ptr == 8) {
-            chaz_ConfWriter_add_def("PTR_TO_I64(ptr)",
-                                    "((int64_t)(uint64_t)(ptr))");
-        }
-        else {
-            chaz_ConfWriter_add_def("PTR_TO_I64(ptr)",
-                                    "((int64_t)(uint32_t)(ptr))");
-        }
-    }
-
-    /* Create macro for converting uint64_t to double. */
-    if (has_64) {
-        /*
-         * Determine whether unsigned 64-bit integers can be converted to
-         * double. Older MSVC versions don't support this conversion.
-         */
-        sprintf(code_buf, chaz_Integers_u64_to_double_code, i64_t_type);
-        output = chaz_CC_capture_output(code_buf, &output_len);
-        if (output != NULL) {
-            chaz_ConfWriter_add_def("U64_TO_DOUBLE(num)", "((double)(num))");
-            free(output);
-        }
-        else {
-            chaz_ConfWriter_add_def(
-                "U64_TO_DOUBLE(num)",
-                "((num) & UINT64_C(0x8000000000000000) ? "
-                "(double)(int64_t)((num) & UINT64_C(0x7FFFFFFFFFFFFFFF)) + "
-                "9223372036854775808.0 : "
-                "(double)(int64_t)(num))");
-        }
-    }
-
-    chaz_ConfWriter_end_module();
-
-    /* Integer typedefs. */
-
-    chaz_ConfWriter_start_module("IntegerTypes");
-
-    if (has_stdint) {
-        chaz_ConfWriter_add_sys_include("stdint.h");
-    }
-    else {
-        /* We support only the following subset of stdint.h
-         *   int8_t
-         *   int16_t
-         *   int32_t
-         *   int64_t
-         *   uint8_t
-         *   uint16_t
-         *   uint32_t
-         *   uint64_t
-         */
-        if (has_8) {
-            chaz_ConfWriter_add_global_typedef("signed char", "int8_t");
-            chaz_ConfWriter_add_global_typedef("unsigned char", "uint8_t");
-        }
-        if (has_16) {
-            chaz_ConfWriter_add_global_typedef("signed short", "int16_t");
-            chaz_ConfWriter_add_global_typedef("unsigned short", "uint16_t");
-        }
-        if (has_32) {
-            chaz_ConfWriter_add_global_typedef(i32_t_type, "int32_t");
-            sprintf(scratch, "unsigned %s", i32_t_type);
-            chaz_ConfWriter_add_global_typedef(scratch, "uint32_t");
-        }
-        if (has_64) {
-            chaz_ConfWriter_add_global_typedef(i64_t_type, "int64_t");
-            sprintf(scratch, "unsigned %s", i64_t_type);
-            chaz_ConfWriter_add_global_typedef(scratch, "uint64_t");
-        }
-    }
-
-    chaz_ConfWriter_end_module();
-
-    /* Integer limits. */
-
-    chaz_ConfWriter_start_module("IntegerLimits");
-
-    if (has_stdint) {
-        chaz_ConfWriter_add_sys_include("stdint.h");
-    }
-    else {
-        /* We support only the following subset of stdint.h
-         *   INT8_MAX
-         *   INT16_MAX
-         *   INT32_MAX
-         *   INT64_MAX
-         *   INT8_MIN
-         *   INT16_MIN
-         *   INT32_MIN
-         *   INT64_MIN
-         *   UINT8_MAX
-         *   UINT16_MAX
-         *   UINT32_MAX
-         *   UINT64_MAX
-         *   SIZE_MAX
-         */
-        if (has_8) {
-            chaz_ConfWriter_add_global_def("INT8_MAX", "127");
-            chaz_ConfWriter_add_global_def("INT8_MIN", "-128");
-            chaz_ConfWriter_add_global_def("UINT8_MAX", "255");
-        }
-        if (has_16) {
-            chaz_ConfWriter_add_global_def("INT16_MAX", "32767");
-            chaz_ConfWriter_add_global_def("INT16_MIN", "-32768");
-            chaz_ConfWriter_add_global_def("UINT16_MAX", "65535");
-        }
-        if (has_32) {
-            chaz_ConfWriter_add_global_def("INT32_MAX", "2147483647");
-            chaz_ConfWriter_add_global_def("INT32_MIN", "(-INT32_MAX-1)");
-            chaz_ConfWriter_add_global_def("UINT32_MAX", "4294967295U");
-        }
-        if (has_64) {
-            sprintf(scratch, "9223372036854775807%s", i64_t_postfix);
-            chaz_ConfWriter_add_global_def("INT64_MAX", scratch);
-            chaz_ConfWriter_add_global_def("INT64_MIN", "(-INT64_MAX-1)");
-            sprintf(scratch, "18446744073709551615%s", u64_t_postfix);
-            chaz_ConfWriter_add_global_def("UINT64_MAX", scratch);
-        }
-        chaz_ConfWriter_add_global_def("SIZE_MAX", "((size_t)-1)");
-    }
-
-    chaz_ConfWriter_end_module();
-
-    /* Integer literals. */
-
-    chaz_ConfWriter_start_module("IntegerLiterals");
-
-    if (has_stdint) {
-        chaz_ConfWriter_add_sys_include("stdint.h");
-    }
-    else {
-        /* We support only the following subset of stdint.h
-         *   INT32_C
-         *   INT64_C
-         *   UINT32_C
-         *   UINT64_C
-         */
-        if (has_32) {
-            if (strcmp(i32_t_postfix, "") == 0) {
-                chaz_ConfWriter_add_global_def("INT32_C(n)", "n");
-            }
-            else {
-                sprintf(scratch, "n##%s", i32_t_postfix);
-                chaz_ConfWriter_add_global_def("INT32_C(n)", scratch);
-            }
-            sprintf(scratch, "n##%s", u32_t_postfix);
-            chaz_ConfWriter_add_global_def("UINT32_C(n)", scratch);
-        }
-        if (has_64) {
-            sprintf(scratch, "n##%s", i64_t_postfix);
-            chaz_ConfWriter_add_global_def("INT64_C(n)", scratch);
-            sprintf(scratch, "n##%s", u64_t_postfix);
-            chaz_ConfWriter_add_global_def("UINT64_C(n)", scratch);
-        }
-    }
-
-    chaz_ConfWriter_end_module();
-
-    /* Integer format strings. */
-
-    chaz_ConfWriter_start_module("IntegerFormatStrings");
-
-    if (has_inttypes) {
-        chaz_ConfWriter_add_sys_include("inttypes.h");
-    }
-    else {
-        /* We support only the following subset of inttypes.h
-         *   PRId64
-         *   PRIu64
-         */
-        if (has_64) {
-            int i;
-            const char *options[] = {
-                "ll",
-                "l",
-                "L",
-                "q",  /* Some *BSDs */
-                "I64", /* Microsoft */
-                NULL,
-            };
-
-            /* Buffer to hold the code, and its start and end. */
-            static const char format_64_code[] =
-                CHAZ_QUOTE(  #include <stdio.h>                            )
-                CHAZ_QUOTE(  int main() {                                  )
-                CHAZ_QUOTE(      printf("%%%su", 18446744073709551615%s);  )
-                CHAZ_QUOTE(      return 0;                                 )
-                CHAZ_QUOTE( }                                              );
-
-            for (i = 0; options[i] != NULL; i++) {
-                /* Try to print 2**64-1, and see if we get it back intact. */
-                sprintf(code_buf, format_64_code, options[i], u64_t_postfix);
-                output = chaz_CC_capture_output(code_buf, &output_len);
-
-                if (output != NULL
-                    && strcmp(output, "18446744073709551615") == 0
-                   ) {
-                    sprintf(scratch, "\"%sd\"", options[i]);
-                    chaz_ConfWriter_add_global_def("PRId64", scratch);
-                    sprintf(scratch, "\"%su\"", options[i]);
-                    chaz_ConfWriter_add_global_def("PRIu64", scratch);
-                    free(output);
-                    break;
-                }
-            }
-        }
-    }
-
-    chaz_ConfWriter_end_module();
-}
-
-static int
-chaz_Integers_machine_is_big_endian(void) {
-    long one = 1;
-    return !(*((char*)(&one)));
-}
-
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/3dc812ab/charmonizer/src/Charmonizer/Probe/Integers.h
----------------------------------------------------------------------
diff --git a/charmonizer/src/Charmonizer/Probe/Integers.h b/charmonizer/src/Charmonizer/Probe/Integers.h
deleted file mode 100644
index 54ca630..0000000
--- a/charmonizer/src/Charmonizer/Probe/Integers.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You 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.
- */
-
-/* Charmonizer/Probe/Integers.h -- info about integer types and sizes.
- *
- * One or the other of these will be defined, depending on whether the
- * processor is big-endian or little-endian.
- *
- * BIG_END
- * LITTLE_END
- *
- * These will always be defined:
- *
- * SIZEOF_CHAR
- * SIZEOF_SHORT
- * SIZEOF_INT
- * SIZEOF_LONG
- * SIZEOF_PTR
- *
- * If long longs are available these symbols will be defined:
- *
- * HAS_LONG_LONG
- * SIZEOF_LONG_LONG
- *
- * Similarly, with the __int64 type (the sizeof is included for completeness):
- *
- * HAS___INT64
- * SIZEOF___INT64
- *
- * If the inttypes.h or stdint.h header files are available, these may be
- * defined:
- *
- * HAS_INTTYPES_H
- * HAS_STDINT_H
- *
- * If stdint.h is is available, it will be pound-included in the configuration
- * header.  If it is not, the following typedefs and macros will be defined if
- * possible:
- *
- * int8_t
- * int16_t
- * int32_t
- * int64_t
- * uint8_t
- * uint16_t
- * uint32_t
- * uint64_t
- * INT8_MAX
- * INT16_MAX
- * INT32_MAX
- * INT64_MAX
- * INT8_MIN
- * INT16_MIN
- * INT32_MIN
- * INT64_MIN
- * UINT8_MAX
- * UINT16_MAX
- * UINT32_MAX
- * UINT64_MAX
- * SIZE_MAX
- * INT32_C
- * INT64_C
- * UINT32_C
- * UINT64_C
- *
- * If inttypes.h is is available, it will be pound-included in the
- * configuration header.  If it is not, the following macros will be defined if
- * possible:
- *
- * PRId64
- * PRIu64
- *
- * Availability of integer types is indicated by which of these are defined:
- *
- * HAS_INT8_T
- * HAS_INT16_T
- * HAS_INT32_T
- * HAS_INT64_T
- *
- * If 64-bit integers are available, this macro will promote pointers to i64_t
- * safely.
- *
- * PTR_TO_I64(ptr)
- */
-
-#ifndef H_CHAZ_INTEGERS
-#define H_CHAZ_INTEGERS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-
-/* Run the Integers module.
- */
-void chaz_Integers_run(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* H_CHAZ_INTEGERS */
-
-
-


Mime
View raw message