Commit e2c8fc0fb731112aaed61863b3f4f11e86e209ee

Ramiro Polla 2007-06-29T20:50:05

Add option to specify include and lib folder Patch by VĂ­ctor Paesa

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"