diff --git a/Makefile.in b/Makefile.in index 930598a..1e06b85 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,22 +16,22 @@ regressions: @echo ---[ Regressions have built successfully. install: all - mkdir -p $(PREFIX)/$(LIBRARY) || exit - mkdir -p $(PREFIX)/$(HEADERS) || exit - cp src/libck* $(PREFIX)/$(LIBRARY) || exit - chmod 744 $(PREFIX)/$(LIBRARY)/libck* || exit - cp include/*.h $(PREFIX)/$(HEADERS) || exit - chmod 644 $(PREFIX)/$(HEADERS)/ck_*.h || exit - mkdir -p $(PREFIX)/$(HEADERS)/gcc || exit - cp -r include/gcc/* $(PREFIX)/$(HEADERS)/gcc || exit - chmod 755 $(PREFIX)/$(HEADERS)/gcc - chmod 644 $(PREFIX)/$(HEADERS)/gcc/ck_*.h $(PREFIX)/$(HEADERS)/gcc/*/ck_*.h || exit + mkdir -p $(LIBRARY) || exit + mkdir -p $(HEADERS) || exit + cp src/libck* $(LIBRARY) || exit + chmod 744 $(LIBRARY)/libck* || exit + cp include/*.h $(HEADERS) || exit + chmod 644 $(HEADERS)/ck_*.h || exit + mkdir -p $(HEADERS)/gcc || exit + cp -r include/gcc/* $(HEADERS)/gcc || exit + chmod 755 $(HEADERS)/gcc + chmod 644 $(HEADERS)/gcc/ck_*.h $(HEADERS)/gcc/*/ck_*.h || exit uninstall: - rm -f $(PREFIX)/$(LIBRARY)/libck* - rm -f $(PREFIX)/$(HEADERS)/ck_*.h - rm -f $(PREFIX)/$(HEADERS)/gcc/ck_*.h - rm -f $(PREFIX)/$(HEADERS)/gcc/*/ck_*.h + rm -f $(LIBRARY)/libck* + rm -f $(HEADERS)/ck_*.h + rm -f $(HEADERS)/gcc/ck_*.h + rm -f $(HEADERS)/gcc/*/ck_*.h clean: make -C src clean diff --git a/configure b/configure index 88d6ca0..d8b6fdf 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright © 2009, 2010 Samy Al Bahra. +# Copyright © 2009-2011 Samy Al Bahra. # Copyright © 2011 Devon H. O'Dell # All rights reserved. # @@ -32,11 +32,9 @@ GENERATE_FILE="build/ck.build" EXIT_SUCCESS=0 EXIT_FAILURE=1 +MAINTAINER='sbahra@repnop.org' BUILD="$PWD/build/ck.build" -CFLAGS="$CFLAGS -Wall -I../include -pipe" PREFIX=${PREFIX:-"/usr/local"} -HEADERS=${HEADERS:-"include"} -LIBRARY=${LIBRARY:-"lib"} export CFLAGS export PREFIX @@ -87,37 +85,50 @@ generate() $1 > $2 } +generate_stdout() +{ + + echo + echo " PROFILE = $PROFILE" + echo " CC = $CC" + echo " Additional CFLAGS = $CFLAGS" + echo + echo "Headers will be installed in $HEADERS" + echo "Libraries will be installed in $LIBRARY" +} for option in $*; do value=`echo "$option" | sed -e 's/^[^=]*=\(.*\)/\1/'` case "$option" in --help) - echo "./configure" - echo " --cflags=N Compilation flags" - echo " --compiler=N Use compiler \"N\"" - echo " --headers=N Headers subdirectory (default is \"${HEADERS}\")" - echo " --library=N Libraries subdirectory (default is \"${LIBRARY}\")" - echo " --prefix=N Installs library files in \"N\"" - echo " --profile=N Use build profile \"N\"" + echo "Usage: ./configure [OPTIONS]" + echo + echo "The following options may be used for cross-building." + echo " --profile=N Use custom build profile (use in conjunction with \$CC)" + echo + echo "The following options may be used to modify installation behavior." + echo " --includedir=N Headers directory (default is ${PREFIX}/include)" + echo " --libdir=N Libraries directory (default is ${PREFIX}/lib)" + echo " --prefix=N Installs library files in N (default is $PREFIX)" + echo + echo "The following environment variables may be used:" + echo " CC C compiler command" + echo " CFLAGS C compiler flags" + echo + echo "Report bugs to ${MAINTAINER}." exit $EXIT_SUCCESS ;; --profile=*) PROFILE=$value ;; - --compiler=*) - CC=$value - ;; --prefix=*) PREFIX=$value ;; - --cflags=*) - CFLAGS="$CFLAGS $value" - ;; - --headers=*) + --includedir=*) HEADERS=$value ;; - --library=*) + --libdir=*) LIBRARY=$value ;; *) @@ -127,11 +138,19 @@ for option in $*; do esac done +HEADERS=${HEADERS:-"${PREFIX}/include"} +LIBRARY=${LIBRARY:-"${PREFIX}/lib"} + if test "$PROFILE"; then printf "Using user-specified profile....." + if test -z "$CC"; then + echo "failed [specify compiler]" + exit $EXIT_FAILURE + fi + if test ! -f build/ck.build.$PROFILE; then - echo "failed [$PROFILE]"; + echo "failed [$PROFILE]" exit $EXIT_FAILURE fi @@ -141,6 +160,7 @@ if test "$PROFILE"; then generate build/regressions.build.in build/regressions.build generate Makefile.in Makefile echo "success" + generate_stdout exit $EXIT_SUCCESS fi @@ -262,12 +282,6 @@ esac assert "$PLATFORM" "$PLATFORM" "unsupported" -if test "$ENVIRONMENT" -eq 32; then - CFLAGS="-m32 $CFLAGS" -elif test "$ENVIRONMENT" -eq 64; then - CFLAGS="-m64 $CFLAGS" -fi - # Platform will be used as a macro. PROFILE="${PROFILE:-$PLATFORM}" PLATFORM="__${PLATFORM}__" @@ -324,3 +338,4 @@ generate build/regressions.build.in build/regressions.build generate Makefile.in Makefile echo "success" +generate_stdout