Add option to specify include and lib folder Patch by VĂctor Paesa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
diff --git a/Makefile b/Makefile
index a2735c1..abeab7e 100644
--- a/Makefile
+++ b/Makefile
@@ -42,20 +42,20 @@ shared-install:
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp libdl.dll $(DESTDIR)$(PREFIX)/bin
$(STRIP) $(DESTDIR)$(PREFIX)/bin/libdl.dll
- mkdir -p $(DESTDIR)$(PREFIX)/lib
- cp libdl.dll.a $(DESTDIR)$(PREFIX)/lib
- mkdir -p $(DESTDIR)$(PREFIX)/include
- cp dlfcn.h $(DESTDIR)$(PREFIX)/include
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libdl.dll.a $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(incdir)
+ cp dlfcn.h $(DESTDIR)$(incdir)
static-install:
- mkdir -p $(DESTDIR)$(PREFIX)/lib
- cp libdl.a $(DESTDIR)$(PREFIX)/lib
- mkdir -p $(DESTDIR)$(PREFIX)/include
- cp dlfcn.h $(DESTDIR)$(PREFIX)/include
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libdl.a $(DESTDIR)$(libdir)
+ mkdir -p $(DESTDIR)$(incdir)
+ cp dlfcn.h $(DESTDIR)$(incdir)
lib-install:
- mkdir -p $(DESTDIR)$(PREFIX)/lib
- cp libdl.lib $(DESTDIR)$(PREFIX)/lib
+ mkdir -p $(DESTDIR)$(libdir)
+ cp libdl.lib $(DESTDIR)$(libdir)
install: $(INSTALL)
diff --git a/configure b/configure
index f5d8c64..31216a7 100755
--- a/configure
+++ b/configure
@@ -35,6 +35,8 @@ show_help(){
echo
echo " --help print this message"
echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
+ echo " --libdir=DIR install libs in DIR [$PREFIX/lib]"
+ echo " --incdir=DIR install includes in DIR [$PREFIX/include]"
echo " --enable-shared build shared libraries [no]"
echo " --enable-static build static libraries [yes]"
echo " --enable-msvc create msvc-compatible import lib [auto]"
@@ -52,6 +54,8 @@ die_unknown(){
}
PREFIX="/mingw"
+libdir="${PREFIX}/lib"
+incdir="${PREFIX}/include"
cc="gcc"
DEFAULT="msvc
@@ -81,6 +85,12 @@ for opt do
--prefix=*)
PREFIX="$optval"
;;
+ --libdir=*)
+ libdir="$optval"
+ ;;
+ --incdir=*)
+ incdir="$optval"
+ ;;
--cc=*)
cc="$optval"
;;
@@ -135,6 +145,8 @@ fi
echo "# Automatically generated by configure" > config.mak
echo "PREFIX=$PREFIX" >> config.mak
+echo "libdir=$libdir" >> config.mak
+echo "incdir=$incdir" >> config.mak
echo "CC=$cc" >> config.mak
echo "BUILD_SHARED=$shared" >> config.mak
echo "BUILD_STATIC=$static" >> config.mak
@@ -142,6 +154,8 @@ echo "BUILD_MSVC=$msvc" >> config.mak
echo "DO_STRIP=$strip" >> config.mak
echo "prefix: $PREFIX"
+echo "libdir: $libdir"
+echo "incdir: $incdir"
echo "cc: $cc"
echo "static: $static"
echo "shared: $shared"