Skip to content

Commit

Permalink
Avoid using our getopt.h on systems that have their own
Browse files Browse the repository at this point in the history
Our version may not be 100 % compatible or at least not 100 %
optimal for the given system.
  • Loading branch information
vpodzime committed Jul 28, 2023
1 parent bb683d2 commit cc2f364
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ AC_CHECK_HEADERS(net/if_arp.h, , , [AC_INCLUDES_DEFAULT
])

AC_CHECK_HEADERS(getopt.h, [system_getopt_h=1], [system_getopt_h=0])
AM_CONDITIONAL([SYSTEM_GETOPT_H], [test x$system_getopt_h = x1])
AM_CONDITIONAL([NO_SYSTEM_GETOPT_H], [test x$system_getopt_h = x0])
AC_CHECK_HEADERS(utime.h)
AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(sys/time.h)
Expand Down
19 changes: 15 additions & 4 deletions libcfecompat/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,21 @@ AM_CPPFLAGS = -I$(top_srcdir)/libntech/libutils # platform.h
libcfecompat_la_LIBADD = $(LTLIBOBJS)

libcfecompat_la_SOURCES = \
unused.c \
unused.c

EXTRA_DIST = \
cfecompat.h \
compat_getopt.h

if NO_SYSTEM_GETOPT_H
BUILT_SOURCES = getopt.h

getopt.h:
cp $(srcdir)/compat_getopt.h $(srcdir)/getopt.h

libcfecompat_la_SOURCES += \
getopt.c \
getopt1.c

EXTRA_DIST = \
getopt.h \
cfecompat.h
nodist_libcfecompat_la_SOURCES = getopt.h
endif
File renamed without changes.

0 comments on commit cc2f364

Please sign in to comment.