PROJECT=glaze
PROJECT_BLURB="a shiny way to wrap OpenGL"
+MAJOR=0
+MINOR=0
+RELEASE=0
+VERSION=${MAJOR}.${MINOR}.${RELEASE}
+
srcdir=$(dirname "$0")
# For a non-srcdir configure invocation (such as ../configure), create
if ${CC} -m32 -o arch-minimal arch-minimal.c > /dev/null 2>&1
then
printf "Yes.\n"
+
+ printf " Target directory for 32-bit targets... "
+
+ lib32_dir=$(gcc -m32 --print-multiarch)
+ printf "${lib32_dir}\n"
+
else
printf "No.\n"
have_m32=No
if ${CC} -m64 -o arch-minimal arch-minimal.c > /dev/null 2>&1
then
printf "Yes.\n"
+
+ printf " Target directory for 64-bit targets... "
+
+ lib64_dir=$(gcc -m64 --print-multiarch)
+ printf "${lib64_dir}\n"
+
else
printf "No.\n"
have_m64=No
LDFLAGS = ${LDFLAGS}
# Flags to enable warnings when using the C compiler
-WARN_CFLAGS=${WARN_CFLAGS}
+WARN_CFLAGS = ${WARN_CFLAGS}
# The prefix to which ${PROJECT} should be installed
PREFIX = ${PREFIX}
# The directory to which executables should be installed
-BINDIR = ${BINDIR:=\$(PREFIX)/bin}
+BINDIR = ${BINDIR:-\$(PREFIX)/bin}
# The directory to which libraries should be installed
-LIBDIR = ${LIBDIR:=\$(PREFIX)/lib}
+LIBDIR = ${LIBDIR:-\$(PREFIX)/lib}
# The directory to which headers should be installed
-INCLUDEDIR = ${INCLUDEDIR:=\$(PREFIX)/include}
+INCLUDEDIR = ${INCLUDEDIR:-\$(PREFIX)/include}
# Whether compiler can create 32 or 64-bit binaries
COMPILER_SUPPORTS_32 = ${have_m32}
+LIB32_DIR = lib/${lib32_dir}
COMPILER_SUPPORTS_64 = ${have_m64}
+LIB64_DIR = lib/${lib64_dir}
+
+# Version information for glaze library
+MAJOR = ${MAJOR}
+MINOR = ${MINOR}
+RELEASE = ${RELEASE}
+VERSION = ${VERSION}
+
+EOF
+
+# construct the glaze.pc file
+cat > glaze.pc <<EOF
+prefix=${PREFIX}
+exec_prefix=\${prefix}
+libdir=${LIBDIR:-\${exec_prefix\}/lib}
+includedir=${INCLUDEDIR:-\${prefix\}/include}
+
+Name: ${PROJECT}
+Description: ${PROJECT_BLURB}
+Version: ${VERSION}
+Libs: -L\${libdir} -lglaze
+Cflags: -I\${includedir}/glaze
EOF