Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #34 from jgarzik/macos
Browse files Browse the repository at this point in the history
Macos support work
  • Loading branch information
jgarzik authored Feb 25, 2024
2 parents 3500de0 + 8dc78a9 commit 6ad8fea
Show file tree
Hide file tree
Showing 62 changed files with 498 additions and 86 deletions.
2 changes: 1 addition & 1 deletion asa/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist_man_MANS += asa/asa.1

asa_asa_SOURCES = asa/asa.cc
asa_asa_CPPFLAGS = -I$(srcdir)/include
asa_asa_LDADD = $(LIBPU) $(ARGP_LIB)
asa_asa_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)

TESTS += asa/asa-test

Expand Down
2 changes: 1 addition & 1 deletion basename/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bin_PROGRAMS += basename/basename
dist_man_MANS += basename/basename.1

basename_basename_SOURCES = basename/basename.cc
basename_basename_LDADD = $(LIBPU) $(ARGP_LIB)
basename_basename_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
basename_basename_CPPFLAGS = -I$(srcdir)/include

TESTS += basename/basename-test
Expand Down
3 changes: 3 additions & 0 deletions build-aux/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

config.guess~
config.sub~
config.rpath
mkinstalldirs*
install-sh~

2 changes: 1 addition & 1 deletion cat/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += cat/cat
dist_man_MANS += cat/cat.1

cat_cat_SOURCES = cat/cat.cc
cat_cat_LDADD = $(LIBPU) $(ARGP_LIB)
cat_cat_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
cat_cat_CPPFLAGS = -I$(srcdir)/include

TESTS += cat/cat-test
Expand Down
2 changes: 1 addition & 1 deletion chown/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += chown/chown
dist_man_MANS += chown/chown.1

chown_chown_SOURCES = chown/chown.cc
chown_chown_LDADD = $(LIBPU) $(ARGP_LIB)
chown_chown_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
chown_chown_CPPFLAGS = -I$(srcdir)/include

TESTS += chown/chown-test
Expand Down
2 changes: 1 addition & 1 deletion cksum/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += cksum/cksum
dist_man_MANS += cksum/cksum.1

cksum_cksum_SOURCES = cksum/cksum.cc cksum/cksum_crctab.h
cksum_cksum_LDADD = $(LIBPU) $(ARGP_LIB)
cksum_cksum_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
cksum_cksum_CPPFLAGS = -I$(srcdir)/include

TESTS += cksum/cksum-test
Expand Down
2 changes: 1 addition & 1 deletion cmp/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += cmp/cmp
dist_man_MANS += cmp/cmp.1

cmp_cmp_SOURCES = cmp/cmp.cc
cmp_cmp_LDADD = $(LIBPU) $(ARGP_LIB)
cmp_cmp_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
cmp_cmp_CPPFLAGS = -I$(srcdir)/include

TESTS += cmp/cmp-test
Expand Down
2 changes: 1 addition & 1 deletion comm/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += comm/comm
dist_man_MANS += comm/comm.1

comm_comm_SOURCES = comm/comm.cc
comm_comm_LDADD = $(LIBPU) $(ARGP_LIB)
comm_comm_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
comm_comm_CPPFLAGS = -I$(srcdir)/include

TESTS += comm/comm-test
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ dnl Checks for library functions.
ZLIB_LIB=""
CURSES_LIB=""

AC_CHECK_FUNCS(__fsetlocking fgets_unlocked)
AC_CHECK_FUNCS(__fsetlocking fgets_unlocked posix_fadvise)

AC_CHECK_LIB(z,inflate,ZLIB_LIB="-lz",exit 1)
AC_CHECK_LIB(ncurses,setupterm,CURSES_LIB="-lncurses",exit 1)
AC_CHECK_LIB(argp, argp_parse, ARGP_LIB=-largp)

AC_DEFINE(_ISOC99_SOURCE, 1, [ISOC99 source])
AC_DEFINE(_POSIX_SOURCE, 1, [POSIX source])
AC_DEFINE(_DARWIN_C_SOURCE, 1, [Apple Darwin C source])
AC_DEFINE(_POSIX_C_SOURCE, 200809L, [POSIX C source])
AC_DEFINE(_XOPEN_SOURCE, 700, [X/Open source])
AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [X/open extended source])
Expand Down
2 changes: 1 addition & 1 deletion date/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += date/date
dist_man_MANS += date/date.1

date_date_SOURCES = date/date.cc
date_date_LDADD = $(LIBPU) $(ARGP_LIB)
date_date_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
date_date_CPPFLAGS = -I$(srcdir)/include

TESTS += date/date-test
Expand Down
2 changes: 1 addition & 1 deletion df/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += df/df
dist_man_MANS += df/df.1

df_df_SOURCES = df/df.cc
df_df_LDADD = $(LIBPU) $(ARGP_LIB)
df_df_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
df_df_CPPFLAGS = -I$(srcdir)/include

TESTS += df/df-test
Expand Down
2 changes: 1 addition & 1 deletion diff/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += diff/diff
dist_man_MANS += diff/diff.1

diff_diff_SOURCES = diff/diff.cc
diff_diff_LDADD = $(LIBPU) $(ARGP_LIB)
diff_diff_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
diff_diff_CPPFLAGS = -I$(srcdir)/include

TESTS += diff/diff-test
Expand Down
2 changes: 1 addition & 1 deletion dirname/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += dirname/dirname
dist_man_MANS += dirname/dirname.1

dirname_dirname_SOURCES = dirname/dirname.cc
dirname_dirname_LDADD = $(LIBPU) $(ARGP_LIB)
dirname_dirname_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
dirname_dirname_CPPFLAGS = -I$(srcdir)/include

TESTS += dirname/dirname-test
Expand Down
2 changes: 1 addition & 1 deletion env/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += env/env
dist_man_MANS += env/env.1

env_env_SOURCES = env/env.cc
env_env_LDADD = $(LIBPU) $(ARGP_LIB)
env_env_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
env_env_CPPFLAGS = -I$(srcdir)/include

TESTS += env/env-test
Expand Down
2 changes: 1 addition & 1 deletion expand/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += expand/expand
dist_man_MANS += expand/expand.1

expand_expand_SOURCES = expand/expand.cc
expand_expand_LDADD = $(LIBPU) $(ARGP_LIB)
expand_expand_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
expand_expand_CPPFLAGS = -I$(srcdir)/include

TESTS += expand/expand-test
Expand Down
2 changes: 1 addition & 1 deletion getconf/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bin_PROGRAMS += getconf/getconf
dist_man_MANS += getconf/getconf.1

getconf_getconf_SOURCES = getconf/getconf.cc
getconf_getconf_LDADD = $(LIBPU) $(ARGP_LIB)
getconf_getconf_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
getconf_getconf_CPPFLAGS = -I$(srcdir)/include -I$(builddir)/getconf
getconf_getconf_INCLUDES = $(getconf_generated_headers)

Expand Down
2 changes: 1 addition & 1 deletion grep/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += grep/grep
dist_man_MANS += grep/grep.1

grep_grep_SOURCES = grep/grep.cc
grep_grep_LDADD = $(LIBPU) $(ARGP_LIB)
grep_grep_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
grep_grep_CPPFLAGS = -I$(srcdir)/include

TESTS += grep/grep-test
Expand Down
2 changes: 1 addition & 1 deletion head/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += head/head
dist_man_MANS += head/head.1

head_head_SOURCES = head/head.cc
head_head_LDADD = $(LIBPU) $(ARGP_LIB)
head_head_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
head_head_CPPFLAGS = -I$(srcdir)/include -I$(builddir)/head

TESTS += head/head-test
Expand Down
2 changes: 1 addition & 1 deletion id/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += id/id
dist_man_MANS += id/id.1

id_id_SOURCES = id/id.cc
id_id_LDADD = $(LIBPU) $(ARGP_LIB)
id_id_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
id_id_CPPFLAGS = -I$(srcdir)/include

TESTS += id/id-test
Expand Down
2 changes: 1 addition & 1 deletion ipcrm/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += ipcrm/ipcrm
dist_man_MANS += ipcrm/ipcrm.1

ipcrm_ipcrm_SOURCES = ipcrm/ipcrm.cc
ipcrm_ipcrm_LDADD = $(LIBPU) $(ARGP_LIB)
ipcrm_ipcrm_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
ipcrm_ipcrm_CPPFLAGS = -I$(srcdir)/include

TESTS += ipcrm/ipcrm-test
Expand Down
2 changes: 1 addition & 1 deletion ipcs/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += ipcs/ipcs
dist_man_MANS += ipcs/ipcs.1

ipcs_ipcs_SOURCES = ipcs/ipcs.cc
ipcs_ipcs_LDADD = $(LIBPU) $(ARGP_LIB)
ipcs_ipcs_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
ipcs_ipcs_CPPFLAGS = -I$(srcdir)/include

TESTS += ipcs/ipcs-test
Expand Down
2 changes: 1 addition & 1 deletion kill/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += kill/kill
dist_man_MANS += kill/kill.1

kill_kill_SOURCES = kill/kill.cc
kill_kill_LDADD = $(LIBPU) $(ARGP_LIB)
kill_kill_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
kill_kill_CPPFLAGS = -I$(srcdir)/include -I$(builddir)/kill

CLEANFILES += kill/kill-siglist.h
Expand Down
4 changes: 4 additions & 0 deletions libpu/term.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ char *get_terminal(void)

char *xtigetstr(const char *capname)
{
#if __APPLE__
char *s = tigetstr((char *)capname);
#else
char *s = tigetstr(capname);
#endif
if (s == (char *)-1)
s = NULL;

Expand Down
2 changes: 1 addition & 1 deletion link/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += link/link
dist_man_MANS += link/link.1

link_link_SOURCES = link/link.cc
link_link_LDADD = $(LIBPU) $(ARGP_LIB)
link_link_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
link_link_CPPFLAGS = -I$(srcdir)/include

TESTS += link/link-test
Expand Down
2 changes: 1 addition & 1 deletion ln/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += ln/ln
dist_man_MANS += ln/ln.1

ln_ln_SOURCES = ln/ln.cc
ln_ln_LDADD = $(LIBPU) $(ARGP_LIB)
ln_ln_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
ln_ln_CPPFLAGS = -I$(srcdir)/include

TESTS += ln/ln-test
Expand Down
2 changes: 1 addition & 1 deletion logger/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += logger/logger
dist_man_MANS += logger/logger.1

logger_logger_SOURCES = logger/logger.cc
logger_logger_LDADD = $(LIBPU) $(ARGP_LIB)
logger_logger_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
logger_logger_CPPFLAGS = -I$(srcdir)/include

TESTS += logger/logger-test
Expand Down
2 changes: 1 addition & 1 deletion logname/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += logname/logname
dist_man_MANS += logname/logname.1

logname_logname_SOURCES = logname/logname.cc
logname_logname_LDADD = $(LIBPU) $(ARGP_LIB)
logname_logname_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
logname_logname_CPPFLAGS = -I$(srcdir)/include

TESTS += logname/logname-test
Expand Down
2 changes: 1 addition & 1 deletion mesg/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += mesg/mesg
dist_man_MANS += mesg/mesg.1

mesg_mesg_SOURCES = mesg/mesg.cc
mesg_mesg_LDADD = $(LIBPU) $(ARGP_LIB)
mesg_mesg_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
mesg_mesg_CPPFLAGS = -I$(srcdir)/include

TESTS += mesg/mesg-test
Expand Down
2 changes: 1 addition & 1 deletion mkdir/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += mkdir/mkdir
dist_man_MANS += mkdir/mkdir.1

mkdir_mkdir_SOURCES = mkdir/mkdir.cc
mkdir_mkdir_LDADD = $(LIBPU) $(ARGP_LIB)
mkdir_mkdir_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
mkdir_mkdir_CPPFLAGS = -I$(srcdir)/include

TESTS += mkdir/mkdir-test
Expand Down
2 changes: 1 addition & 1 deletion mkfifo/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += mkfifo/mkfifo
dist_man_MANS += mkfifo/mkfifo.1

mkfifo_mkfifo_SOURCES = mkfifo/mkfifo.cc
mkfifo_mkfifo_LDADD = $(LIBPU) $(ARGP_LIB)
mkfifo_mkfifo_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
mkfifo_mkfifo_CPPFLAGS = -I$(srcdir)/include

TESTS += mkfifo/mkfifo-test
Expand Down
2 changes: 1 addition & 1 deletion mv/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += mv/mv
dist_man_MANS += mv/mv.1

mv_mv_SOURCES = mv/mv.cc
mv_mv_LDADD = $(LIBPU) $(ARGP_LIB)
mv_mv_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
mv_mv_CPPFLAGS = -I$(srcdir)/include

TESTS += mv/mv-test
Expand Down
2 changes: 2 additions & 0 deletions mv/mv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,10 @@ static int copy_reg_file(const char *src, struct stat *st, const char *target)
return 1;
}

#ifdef HAVE_POSIX_FADVISE
/* Do we care about the return value of posix_fadvise(2) ? */
posix_fadvise(in_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
#endif

/* st variable may be stale by now */
if (fstat(in_fd, st) < 0) {
Expand Down
2 changes: 1 addition & 1 deletion nice/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += nice/nice
dist_man_MANS += nice/nice.1

nice_nice_SOURCES = nice/nice.cc
nice_nice_LDADD = $(LIBPU) $(ARGP_LIB)
nice_nice_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
nice_nice_CPPFLAGS = -I$(srcdir)/include

TESTS += nice/nice-test
Expand Down
2 changes: 1 addition & 1 deletion nohup/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ bin_PROGRAMS += nohup/nohup
dist_man_MANS += nohup/nohup.1

nohup_nohup_SOURCES = nohup/nohup.cc
nohup_nohup_LDADD = $(LIBPU) $(ARGP_LIB)
nohup_nohup_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
nohup_nohup_CPPFLAGS = -I$(srcdir)/include

TESTS += nohup/nohup-test
Expand Down
2 changes: 1 addition & 1 deletion pathchk/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ noinst_PROGRAMS += pathchk/pathchk
dist_man_MANS += pathchk/pathchk.1

pathchk_pathchk_SOURCES = pathchk/pathchk.cc
pathchk_pathchk_LDADD = $(LIBPU) $(ARGP_LIB)
pathchk_pathchk_LDADD = $(LIBPU) $(ARGP_LIB) $(LIBINTL)
pathchk_pathchk_CPPFLAGS = -I$(srcdir)/include

TESTS += pathchk/pathchk-test
Expand Down
2 changes: 1 addition & 1 deletion pax/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
noinst_PROGRAMS += pax/pax

pax_pax_SOURCES = pax/main.cc pax/pax.h pax/pax.cc pax/ustar.cc pax/cpio.cc pax/zip.cc
pax_pax_LDADD = $(LIBPU) $(ARGP_LIB) $(ZLIB_LIB)
pax_pax_LDADD = $(LIBPU) $(ARGP_LIB) $(ZLIB_LIB) $(LIBINTL)
pax_pax_CPPFLAGS = -I$(srcdir)/include -I$(builddir)/pax

pax/pax-options.h: pax/pax-options.data
Expand Down
Loading

0 comments on commit 6ad8fea

Please sign in to comment.