Skip to content

Instantly share code, notes, and snippets.

View nfarring's full-sized avatar

Nathan Farrington nfarring

View GitHub Profile
@nfarring
nfarring / gist:704717
Created November 18, 2010 07:18
Console output when compiling Thrift 0.6.0-dev with the C++, Python, and Perl languages.
(Helios-archlinux)[nfarring@thanos thrift]$ PY_PREFIX=$VIRTUAL_ENV PERL_PREFIX=$VIRTUAL_ENV ./configure --prefix=$VIRTUAL_ENV --without-java --without-ruby --without-php --without-php_extension --without-erlangchecking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
@nfarring
nfarring / gist:654573
Created October 29, 2010 22:32
Remove all .svn subdirectories.
find . -name .svn -exec rm -rf {} \;
@nfarring
nfarring / gitall.sh
Created October 28, 2010 19:57
Iterates through all of the git repos in the current directory and performs some git operation. The default is 'git status'.
#!/usr/bin/env bash
GITCMD=status
if [[ -n $1 ]]; then
GITCMD=$1
fi
echo
for dir in `ls`; do
(if [[ -d "$dir" && -d "$dir/.git" ]]; then
@nfarring
nfarring / build_python_wrapper_library_with_swig.sh
Created October 28, 2010 17:58
This script manually builds a Python wrapper library for a C library. There is an easier/better way to do this using distutils.
#!/usr/bin/env bash
#
# Generate my_python_library_wrap.c and MyPythonLibrary.py
#
swig -python my_python_library.i
#
# Generate _MyPythonLibrary.so
#
gcc `python-config --cflags --ldflags` -I/path/to/my/c/library/headers -L/path/to/my/c/library -lmy_c_library my_python_library_wrap.c -fPIC -shared -o _MyPythonLibrary.so
@nfarring
nfarring / CMakeLists.txt
Created October 28, 2010 17:51
Example of how *not* to generate a Python wrapper library from a C library using CMake. Instead, CMake should only be used to build and install the C library, and distutils should be used for the Python wrapper library.
find_package(PythonLibs)
if(PYTHONLIBS_FOUND)
include_directories(${PYTHON_INCLUDE_PATH})
find_package(SWIG REQUIRED)
if(SWIG_FOUND)
include(${SWIG_USE_FILE})
#set(CMAKE_SWIG_FLAGS "")
#set_source_files_properties(my_swig_file.i
# PROPERTIES SWIG_FLAGS "")
#
@nfarring
nfarring / Toolchain-ELDK-4.2-ppc_85xx.cmake
Created October 22, 2010 02:24
A CMake toolchain file for using the ELDK 4.2 to target the MPC85xx processor family.
# This is a CMake toolchain file to configure CMake to use the ELDK 4.2
# cross-compiler for the Embedded PowerPC MPC85xx family. This file
# assumes that the ELDK is installed to /opt/eldk-4.2.
#
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-ELDK-4.2-ppc_85xx.cmake
#
# Reference: http://www.cmake.org/Wiki/CmakeEldk
#
# The name of the target operating system.
SET(CMAKE_SYSTEM_NAME Linux)
@nfarring
nfarring / Toolchain-ELDK-4.1-ppc_85xx.cmake
Created October 22, 2010 02:16
A CMake toolchain file for using the ELDK 4.1 to target the MPC85xx processor family.
# This is a CMake toolchain file to configure CMake to use the ELDK 4.1
# cross-compiler for the Embedded PowerPC MPC85xx family.
#
# Usage: cmake -DCMAKE_TOOLCHAIN_FILE=Toolchain-ELDK-4.1-ppc_85xx.cmake
#
# Reference: http://www.cmake.org/Wiki/CmakeEldk
#
SET(ELDKBASE $ENV{ELDKBASE})
SET(ELDKROOT $ENV{ELDKROOT})
SET(ELDKLOCAL $ENV{ELDKLOCAL})