aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2025-05-26 19:13:36 +0000
committerLaurent Bercot <ska@appnovation.com>2025-05-26 19:13:36 +0000
commit1a94345a0ee0b4c012605eebfa37176fdb7f3680 (patch)
tree1668804343233cf29117f0c4ce1c477fb700da3b /configure
parent09a92ebc48da94dfc19c9c5cd8f783130795034e (diff)
downloadmdevd-1a94345a0ee0b4c012605eebfa37176fdb7f3680.tar.gz
Support shlibs on MacOS
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 15 insertions, 6 deletions
diff --git a/configure b/configure
index 894398f..7ff9472 100755
--- a/configure
+++ b/configure
@@ -148,6 +148,7 @@ pkgconfdir='$prefix/lib/pkgconfig'
shebangdir='$bindir'
sysdeps='$prefix/lib/skalibs/sysdeps'
manualsysdeps=false
+shlibext=so
shared=false
static=true
allpic=true
@@ -193,9 +194,9 @@ for arg ; do
--disable-shared|--enable-shared=no) shared=false ;;
--enable-static|--enable-static=yes) static=true ;;
--disable-static|--enable-static=no) static=false ;;
- --enable-allstatic|--enable-allstatic=yes) allstatic=true ;;
- --disable-allstatic|--enable-allstatic=no) allstatic=false ; evenmorestatic=false ;;
- --enable-static-libc|--enable-static-libc=yes) allstatic=true ; evenmorestatic=true ;;
+ --enable-allstatic|--enable-allstatic=yes) static=true ; allstatic=true ;;
+ --disable-allstatic|--enable-allstatic=no) allstatic=false ; evenmorestatic=false ; shared=true ;;
+ --enable-static-libc|--enable-static-libc=yes) static=true ; allstatic=true ; evenmorestatic=true ;;
--disable-static-libc|--enable-static-libc=no) evenmorestatic=false ;;
--enable-all-pic|--enable-all-pic=yes) allpic=true ;;
--disable-all-pic|--enable-all-pic=no) allpic=false ;;
@@ -375,11 +376,18 @@ if test ! -d $sysdeps || test ! -f $sysdeps/target ; then
echo "$0: error: $sysdeps is not a valid sysdeps directory"
exit 1
fi
-if [ "x$target" != "x$(cat $sysdeps/target)" ] ; then
+if test "$target" != "$(cat $sysdeps/target)" ; then
echo "$0: error: target $target does not match the contents of $sysdeps/target"
exit 1
fi
+echo "Shared libraries will be named ..."
+libc="${target##*-}"
+if test "${libc##darwin}" != "$libc" ; then
+ shlibext=dylib
+fi
+echo " ... *.$shlibext"
+
if $allpic ; then
tryflag CPPFLAGS_AUTO -fPIC
fi
@@ -469,16 +477,17 @@ LDFLAGS := ${LDFLAGS}${LDFLAGS_POST:+ }$LDFLAGS_POST
LDFLAGS_SHARED := $LDFLAGS_SHARED
LDFLAGS_NOSHARED :=$LDFLAGS_NOSHARED
CROSS_COMPILE := $cross
+SHLIB_EXT := ${shlibext}
vpath lib%.a$vpaths
-vpath lib%.so$vpathd
+vpath lib%.${shlibext}$vpathd
EOF
if $allstatic ; then
echo ".LIBPATTERNS := lib%.a"
echo "DO_ALLSTATIC := 1"
else
- echo ".LIBPATTERNS := lib%.so"
+ echo ".LIBPATTERNS := lib%.${shlibext}"
echo "DO_ALLSTATIC :="
fi
if $static ; then