diff options
-rw-r--r-- | Makefile.in | 9 | ||||
-rwxr-xr-x | configure | 16 |
2 files changed, 21 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in index d30b795..48a80a1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,6 +19,7 @@ # configuration flags PREFIX=@PREFIX@ +LIBDIR=@LIBDIR@ SUFFIX=@SUFFIX@ SQLITE=@SQLITE@ BITS=@BITS@ @@ -26,15 +27,17 @@ MARK64=@MARK64@ RPATH=@RPATH@ VERSION=1.0 -LIB=lib$(MARK64) +LIB=$(shell basename $(LIBDIR)) BIN=bin LOCALSTATE=var/pseudo -LIBDIR=$(PREFIX)/$(LIB) BINDIR=$(PREFIX)/$(BIN) LOCALSTATEDIR=$(PREFIX)/$(LOCALSTATE) CFLAGS_BASE=-pipe -std=gnu99 -Wall -W -Wextra -CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE -m$(BITS) +CFLAGS_CODE=-fPIC -D_LARGEFILE64_SOURCE -D_ATFILE_SOURCE +ifneq ($(BITS),) + CFLAGS_CODE += -m$(BITS) +endif CFLAGS_DEFS=-DPSEUDO_PREFIX='"$(PREFIX)"' -DPSEUDO_SUFFIX='"$(SUFFIX)"' -DPSEUDO_BINDIR='"$(BIN)"' -DPSEUDO_LIBDIR='"$(LIB)"' -DPSEUDO_LOCALSTATEDIR='"$(LOCALSTATE)"' -DPSEUDO_VERSION='"$(VERSION)"' CFLAGS_DEBUG=-O2 -g CFLAGS_SQL=-L$(SQLITE)/lib -I$(SQLITE)/include $(RPATH) @@ -19,14 +19,16 @@ # # not a real configure script... opt_prefix= +opt_libdir= opt_suffix= -opt_bits=32 +opt_bits= opt_sqlite=/usr usage() { echo >&2 "usage:" echo >&2 " configure --prefix=..." + echo >&2 " [--libdir=...]" echo >&2 " [--suffix=...]" echo >&2 " [--with-sqlite=...]" echo >&2 " [--with-rpath=...|--without-rpath]" @@ -41,6 +43,9 @@ do --prefix=*) opt_prefix=${arg#--prefix=} ;; + --libdir=*) + opt_libdir=${arg#--libdir=} + ;; --with-sqlite=*) opt_sqlite=${arg#--with-sqlite=} # assign new value if unset @@ -75,6 +80,14 @@ if [ -z "$opt_prefix" ]; then usage fi +if [ -n "$opt_bits" ] && [ -n "$opt_libdir" ]; then + echo >&2 "Can not specify both --libdir and --bits" + exit 1 +fi +if [ -z "$opt_libdir" ]; then + opt_libdir=$opt_prefix/lib$opt_mark64 +fi + if [ ! -f "${opt_sqlite}/include/sqlite3.h" ]; then echo >&2 "SQLite3 headers not found in at ${opt_sqlite}/include/sqlite3.h. Please check that SQLite3 and SQLite3 headers are installed." exit 1 @@ -93,6 +106,7 @@ fi sed -e ' s,@PREFIX@,'"$opt_prefix"',g + s,@LIBDIR@,'"$opt_libdir"',g s,@SUFFIX@,'"$opt_suffix"',g s,@SQLITE@,'"$opt_sqlite"',g s!@RPATH@!'"$opt_rpath"'!g |