mirror of https://github.com/vitalif/e2fsprogs
Fix Darwin/Mac OS X support to fetch the ethernet address in the uuid library.
parent
39595ce86c
commit
84ea6e70b7
|
@ -5272,7 +5272,7 @@ test -n "$BUILD_CC" && break
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
for ac_hdr in stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disk.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h netinet/in.h
|
for ac_hdr in stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disk.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h net/if_dl.h netinet/in.h
|
||||||
do
|
do
|
||||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||||
|
@ -5945,16 +5945,51 @@ fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
echo $ac_n "checking whether struct sockaddr contains sa_len""... $ac_c" 1>&6
|
||||||
|
echo "configure:5951: checking whether struct sockaddr contains sa_len" >&5
|
||||||
|
if eval "test \"`echo '$''{'e2fsprogs_cv_sockaddr_sa_len'+set}'`\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
#line 5956 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
struct sockaddr sa;
|
||||||
|
sa.sa_len;
|
||||||
|
; return 0; }
|
||||||
|
EOF
|
||||||
|
if { (eval echo configure:5966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||||
|
rm -rf conftest*
|
||||||
|
e2fsprogs_cv_sockaddr_sa_len=yes
|
||||||
|
else
|
||||||
|
echo "configure: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
rm -rf conftest*
|
||||||
|
e2fsprogs_cv_sockaddr_sa_len=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$ac_t""$e2fsprogs_cv_sockaddr_sa_len" 1>&6
|
||||||
|
if test $e2fsprogs_cv_sockaddr_sa_len = yes; then
|
||||||
|
cat >> confdefs.h <<EOF
|
||||||
|
#define HAVE_SA_LEN 1
|
||||||
|
EOF
|
||||||
|
|
||||||
fi
|
fi
|
||||||
for ac_func in chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc
|
for ac_func in chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc
|
||||||
do
|
do
|
||||||
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
|
||||||
echo "configure:5953: checking for $ac_func" >&5
|
echo "configure:5988: checking for $ac_func" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 5958 "configure"
|
#line 5993 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* System header to define __stub macros and hopefully few prototypes,
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
which can conflict with char $ac_func(); below. */
|
which can conflict with char $ac_func(); below. */
|
||||||
|
@ -5977,7 +6012,7 @@ $ac_func();
|
||||||
|
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:5981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:6016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_func_$ac_func=yes"
|
eval "ac_cv_func_$ac_func=yes"
|
||||||
else
|
else
|
||||||
|
@ -6003,7 +6038,7 @@ done
|
||||||
|
|
||||||
SOCKET_LIB=''
|
SOCKET_LIB=''
|
||||||
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
|
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
|
||||||
echo "configure:6007: checking for socket in -lsocket" >&5
|
echo "configure:6042: checking for socket in -lsocket" >&5
|
||||||
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
|
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
|
||||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -6011,7 +6046,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lsocket $LIBS"
|
LIBS="-lsocket $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6015 "configure"
|
#line 6050 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -6022,7 +6057,7 @@ int main() {
|
||||||
socket()
|
socket()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:6026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:6061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -6045,7 +6080,7 @@ fi
|
||||||
|
|
||||||
DLOPEN_LIB=''
|
DLOPEN_LIB=''
|
||||||
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
|
||||||
echo "configure:6049: checking for dlopen in -ldl" >&5
|
echo "configure:6084: checking for dlopen in -ldl" >&5
|
||||||
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
|
||||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -6053,7 +6088,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-ldl $LIBS"
|
LIBS="-ldl $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6057 "configure"
|
#line 6092 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -6064,7 +6099,7 @@ int main() {
|
||||||
dlopen()
|
dlopen()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:6068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:6103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -6090,12 +6125,12 @@ fi
|
||||||
|
|
||||||
|
|
||||||
echo $ac_n "checking for optreset""... $ac_c" 1>&6
|
echo $ac_n "checking for optreset""... $ac_c" 1>&6
|
||||||
echo "configure:6094: checking for optreset" >&5
|
echo "configure:6129: checking for optreset" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_have_optreset'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_have_optreset'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6099 "configure"
|
#line 6134 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
EOF
|
EOF
|
||||||
|
@ -6186,20 +6221,20 @@ fi
|
||||||
|
|
||||||
|
|
||||||
echo $ac_n "checking whether linker accepts -static""... $ac_c" 1>&6
|
echo $ac_n "checking whether linker accepts -static""... $ac_c" 1>&6
|
||||||
echo "configure:6190: checking whether linker accepts -static" >&5
|
echo "configure:6225: checking whether linker accepts -static" >&5
|
||||||
if eval "test \"`echo '$''{'ac_cv_e2fsprogs_use_static'+set}'`\" = set"; then
|
if eval "test \"`echo '$''{'ac_cv_e2fsprogs_use_static'+set}'`\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
|
SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 6196 "configure"
|
#line 6231 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
int main() {
|
int main() {
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:6203: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:6238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
ac_cv_e2fsprogs_use_static=yes
|
ac_cv_e2fsprogs_use_static=yes
|
||||||
else
|
else
|
||||||
|
|
18
configure.in
18
configure.in
|
@ -586,7 +586,7 @@ if test $cross_compiling = no; then
|
||||||
else
|
else
|
||||||
AC_CHECK_PROGS(BUILD_CC, gcc cc)
|
AC_CHECK_PROGS(BUILD_CC, gcc cc)
|
||||||
fi
|
fi
|
||||||
AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disk.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h netinet/in.h)
|
AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disk.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h net/if_dl.h netinet/in.h)
|
||||||
AC_FUNC_VPRINTF
|
AC_FUNC_VPRINTF
|
||||||
dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
|
dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
|
||||||
dnl is not decleared.
|
dnl is not decleared.
|
||||||
|
@ -701,6 +701,22 @@ if test "$e2fsprogs_cv_struct_st_flags" = yes; then
|
||||||
AC_DEFINE(HAVE_STAT_FLAGS)
|
AC_DEFINE(HAVE_STAT_FLAGS)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
dnl
|
||||||
|
dnl Check for the presence of SA_LEN
|
||||||
|
dnl
|
||||||
|
AC_MSG_CHECKING(whether struct sockaddr contains sa_len)
|
||||||
|
AC_CACHE_VAL(e2fsprogs_cv_sockaddr_sa_len,
|
||||||
|
[AC_TRY_COMPILE([#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
],
|
||||||
|
[struct sockaddr sa;
|
||||||
|
sa.sa_len;],
|
||||||
|
e2fsprogs_cv_sockaddr_sa_len=yes,e2fsprogs_cv_sockaddr_sa_len=no)])
|
||||||
|
AC_MSG_RESULT([$]e2fsprogs_cv_sockaddr_sa_len)
|
||||||
|
if test $e2fsprogs_cv_sockaddr_sa_len = yes; then
|
||||||
|
AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len])
|
||||||
|
fi
|
||||||
|
dnl
|
||||||
AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc)
|
AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc)
|
||||||
dnl
|
dnl
|
||||||
dnl Check to see if -lsocket is required (solaris) to make something
|
dnl Check to see if -lsocket is required (solaris) to make something
|
||||||
|
|
|
@ -43,6 +43,9 @@
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_NET_IF_DL_H
|
||||||
|
#include <net/if_dl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "uuidP.h"
|
#include "uuidP.h"
|
||||||
|
|
||||||
|
@ -117,7 +120,10 @@ static int get_node_id(unsigned char *node_id)
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int n, i;
|
int n, i;
|
||||||
unsigned char *a;
|
unsigned char *a;
|
||||||
|
#if defined(HAVE_NET_IF_DL_H) && defined(AF_LINK)
|
||||||
|
struct sockaddr_dl *sdlp;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* BSD 4.4 defines the size of an ifreq to be
|
* BSD 4.4 defines the size of an ifreq to be
|
||||||
* max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len
|
* max(sizeof(ifreq), sizeof(ifreq.ifr_name)+ifreq.ifr_addr.sa_len
|
||||||
|
@ -146,7 +152,7 @@ static int get_node_id(unsigned char *node_id)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
n = ifc.ifc_len;
|
n = ifc.ifc_len;
|
||||||
for (i = 0; i < n; i+= ifreq_size(*ifr) ) {
|
for (i = 0; i < n; i+= ifreq_size(*ifrp) ) {
|
||||||
ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
|
ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
|
||||||
strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
|
strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
|
||||||
#ifdef SIOCGIFHWADDR
|
#ifdef SIOCGIFHWADDR
|
||||||
|
@ -158,6 +164,12 @@ static int get_node_id(unsigned char *node_id)
|
||||||
if (ioctl(sd, SIOCGENADDR, &ifr) < 0)
|
if (ioctl(sd, SIOCGENADDR, &ifr) < 0)
|
||||||
continue;
|
continue;
|
||||||
a = (unsigned char *) ifr.ifr_enaddr;
|
a = (unsigned char *) ifr.ifr_enaddr;
|
||||||
|
#else
|
||||||
|
#if defined(HAVE_NET_IF_DL_H) && defined(AF_LINK)
|
||||||
|
sdlp = (struct sockaddr_dl *) &ifrp->ifr_addr;
|
||||||
|
if ((sdlp->sdl_family != AF_LINK) || (sdlp->sdl_alen < 6))
|
||||||
|
continue;
|
||||||
|
a = (unsigned char *) &sdlp->sdl_data[sdlp->sdl_nlen];
|
||||||
#else
|
#else
|
||||||
/*
|
/*
|
||||||
* XXX we don't have a way of getting the hardware
|
* XXX we don't have a way of getting the hardware
|
||||||
|
@ -165,6 +177,7 @@ static int get_node_id(unsigned char *node_id)
|
||||||
*/
|
*/
|
||||||
close(sd);
|
close(sd);
|
||||||
return 0;
|
return 0;
|
||||||
|
#endif /* HAVE_NET_IF_DL_H && AF_LINK */
|
||||||
#endif /* SIOCGENADDR */
|
#endif /* SIOCGENADDR */
|
||||||
#endif /* SIOCGIFHWADDR */
|
#endif /* SIOCGIFHWADDR */
|
||||||
if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])
|
if (!a[0] && !a[1] && !a[2] && !a[3] && !a[4] && !a[5])
|
||||||
|
|
Loading…
Reference in New Issue