Skip to content

Instantly share code, notes, and snippets.

@binki
Last active January 30, 2016 03:54
Show Gist options
  • Save binki/a920fe0e4933208b02bb to your computer and use it in GitHub Desktop.
Save binki/a920fe0e4933208b02bb to your computer and use it in GitHub Desktop.
diff --git a/configure.in b/configure.in
index 67acee0..dc98c90 100644
--- a/configure.in
+++ b/configure.in
@@ -43,22 +43,20 @@ AC_ARG_WITH([localdir],
withval="/usr/pkg"
elif test -d /opt/lib ; then
withval="/opt"
- else
- with_extra_libdir="no"
fi
- elif test -d "$withval" ; then
+ fi
+
+ if test "x$withval" != "x" && \
+ test -d "$withval"; then
with_extra_libdir="yes"
else
with_extra_libdir="no"
fi
- if test "x$withval" != "x" ; then
+ if test "x$with_extra_libdir" = "xyes" ; then
LIBS="-L$withval/lib $LIBS"
CFLAGS="-I$withval/include/ $CFLAGS"
localdir=$withdir
- with_extra_libdir="yes"
- else
- with_extra_libdir="no"
fi
],[
if test "x$withval" = "x" ; then
@@ -68,19 +66,21 @@ AC_ARG_WITH([localdir],
withval="/usr/pkg"
elif test -d /opt/lib ; then
withval="/opt"
- else
- with_extra_libdir="no"
fi
fi
- if test "x$withval" != "x" ; then
- LIBS="-L$withval/lib $LIBS"
- CFLAGS="-I$withval/include/ $CFLAGS"
- localdir=$withdir
+ if test "x$withval" != "x" && \
+ test -d "$withval"; then
with_extra_libdir="yes"
else
with_extra_libdir="no"
fi
+
+ if test "x$with_extra_libdir" = "xyes" ; then
+ LIBS="-L$withval/lib $LIBS"
+ CFLAGS="-I$withval/include/ $CFLAGS"
+ localdir=$withdir
+ fi
])
AC_MSG_RESULT([$with_extra_libdir, $withval])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment