Modified configure script behavior. Remove flags.

It has been changed to behave more like an autoconf-generated
configure script. Please see --help for more information.
Some options have been removed including --cflags and --compiler.
Other options have been renamed and have different semantics
now (headers and library specify full path).
ck_pring
Samy Al Bahra 14 years ago
parent d4c9641c83
commit 4bbdb7e30d

@ -16,22 +16,22 @@ regressions:
@echo ---[ Regressions have built successfully. @echo ---[ Regressions have built successfully.
install: all install: all
mkdir -p $(PREFIX)/$(LIBRARY) || exit mkdir -p $(LIBRARY) || exit
mkdir -p $(PREFIX)/$(HEADERS) || exit mkdir -p $(HEADERS) || exit
cp src/libck* $(PREFIX)/$(LIBRARY) || exit cp src/libck* $(LIBRARY) || exit
chmod 744 $(PREFIX)/$(LIBRARY)/libck* || exit chmod 744 $(LIBRARY)/libck* || exit
cp include/*.h $(PREFIX)/$(HEADERS) || exit cp include/*.h $(HEADERS) || exit
chmod 644 $(PREFIX)/$(HEADERS)/ck_*.h || exit chmod 644 $(HEADERS)/ck_*.h || exit
mkdir -p $(PREFIX)/$(HEADERS)/gcc || exit mkdir -p $(HEADERS)/gcc || exit
cp -r include/gcc/* $(PREFIX)/$(HEADERS)/gcc || exit cp -r include/gcc/* $(HEADERS)/gcc || exit
chmod 755 $(PREFIX)/$(HEADERS)/gcc chmod 755 $(HEADERS)/gcc
chmod 644 $(PREFIX)/$(HEADERS)/gcc/ck_*.h $(PREFIX)/$(HEADERS)/gcc/*/ck_*.h || exit chmod 644 $(HEADERS)/gcc/ck_*.h $(HEADERS)/gcc/*/ck_*.h || exit
uninstall: uninstall:
rm -f $(PREFIX)/$(LIBRARY)/libck* rm -f $(LIBRARY)/libck*
rm -f $(PREFIX)/$(HEADERS)/ck_*.h rm -f $(HEADERS)/ck_*.h
rm -f $(PREFIX)/$(HEADERS)/gcc/ck_*.h rm -f $(HEADERS)/gcc/ck_*.h
rm -f $(PREFIX)/$(HEADERS)/gcc/*/ck_*.h rm -f $(HEADERS)/gcc/*/ck_*.h
clean: clean:
make -C src clean make -C src clean

67
configure vendored

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# #
# Copyright © 2009, 2010 Samy Al Bahra. # Copyright © 2009-2011 Samy Al Bahra.
# Copyright © 2011 Devon H. O'Dell <devon.odell@gmail.com> # Copyright © 2011 Devon H. O'Dell <devon.odell@gmail.com>
# All rights reserved. # All rights reserved.
# #
@ -32,11 +32,9 @@ GENERATE_FILE="build/ck.build"
EXIT_SUCCESS=0 EXIT_SUCCESS=0
EXIT_FAILURE=1 EXIT_FAILURE=1
MAINTAINER='sbahra@repnop.org'
BUILD="$PWD/build/ck.build" BUILD="$PWD/build/ck.build"
CFLAGS="$CFLAGS -Wall -I../include -pipe"
PREFIX=${PREFIX:-"/usr/local"} PREFIX=${PREFIX:-"/usr/local"}
HEADERS=${HEADERS:-"include"}
LIBRARY=${LIBRARY:-"lib"}
export CFLAGS export CFLAGS
export PREFIX export PREFIX
@ -87,37 +85,50 @@ generate()
$1 > $2 $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 for option in $*; do
value=`echo "$option" | sed -e 's/^[^=]*=\(.*\)/\1/'` value=`echo "$option" | sed -e 's/^[^=]*=\(.*\)/\1/'`
case "$option" in case "$option" in
--help) --help)
echo "./configure" echo "Usage: ./configure [OPTIONS]"
echo " --cflags=N Compilation flags" echo
echo " --compiler=N Use compiler \"N\"" echo "The following options may be used for cross-building."
echo " --headers=N Headers subdirectory (default is \"${HEADERS}\")" echo " --profile=N Use custom build profile (use in conjunction with \$CC)"
echo " --library=N Libraries subdirectory (default is \"${LIBRARY}\")" echo
echo " --prefix=N Installs library files in \"N\"" echo "The following options may be used to modify installation behavior."
echo " --profile=N Use build profile \"N\"" 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 exit $EXIT_SUCCESS
;; ;;
--profile=*) --profile=*)
PROFILE=$value PROFILE=$value
;; ;;
--compiler=*)
CC=$value
;;
--prefix=*) --prefix=*)
PREFIX=$value PREFIX=$value
;; ;;
--cflags=*) --includedir=*)
CFLAGS="$CFLAGS $value"
;;
--headers=*)
HEADERS=$value HEADERS=$value
;; ;;
--library=*) --libdir=*)
LIBRARY=$value LIBRARY=$value
;; ;;
*) *)
@ -127,11 +138,19 @@ for option in $*; do
esac esac
done done
HEADERS=${HEADERS:-"${PREFIX}/include"}
LIBRARY=${LIBRARY:-"${PREFIX}/lib"}
if test "$PROFILE"; then if test "$PROFILE"; then
printf "Using user-specified profile....." 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 if test ! -f build/ck.build.$PROFILE; then
echo "failed [$PROFILE]"; echo "failed [$PROFILE]"
exit $EXIT_FAILURE exit $EXIT_FAILURE
fi fi
@ -141,6 +160,7 @@ if test "$PROFILE"; then
generate build/regressions.build.in build/regressions.build generate build/regressions.build.in build/regressions.build
generate Makefile.in Makefile generate Makefile.in Makefile
echo "success" echo "success"
generate_stdout
exit $EXIT_SUCCESS exit $EXIT_SUCCESS
fi fi
@ -262,12 +282,6 @@ esac
assert "$PLATFORM" "$PLATFORM" "unsupported" 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. # Platform will be used as a macro.
PROFILE="${PROFILE:-$PLATFORM}" PROFILE="${PROFILE:-$PLATFORM}"
PLATFORM="__${PLATFORM}__" PLATFORM="__${PLATFORM}__"
@ -324,3 +338,4 @@ generate build/regressions.build.in build/regressions.build
generate Makefile.in Makefile generate Makefile.in Makefile
echo "success" echo "success"
generate_stdout

Loading…
Cancel
Save