Skip to content

Commit fbf3822

Browse files
committed
Fix macOS and Solaris builds
Also bring us closer to having a working AIX build (but not yet, need more Makefile changes). Resolves: #31
1 parent 974ee63 commit fbf3822

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ all locales pam utils install install_lib install_locales install_pam install_ut
133133
LDLIBS_pam="$(LDLIBS_pam_LINUX)" \
134134
$@_wrapped;; \
135135
SunOS) $(MAKE) -e CPPFLAGS_lib="$(CPPFLAGS_lib) -DHAVE_SHADOW" \
136-
LD_lib=ld \
136+
LD_lib=/usr/ccs/bin/ld \
137137
LDFLAGS_lib="$(LDFLAGS_lib_SUN)" \
138138
LDFLAGS_pam="$(LDFLAGS_pam_SUN)" \
139139
LDLIBS_pam="$(LDLIBS_pam_SUN)" \
@@ -174,9 +174,9 @@ $(SHARED_LIB): $(OBJS_LIB) $(MAP_LIB)
174174
$(LD_lib) $(LDFLAGS_lib) $(OBJS_LIB) $(LDLIBS_lib) -o $(SHARED_LIB)
175175

176176
$(DEVEL_LIB): $(SHARED_LIB)
177-
ifndef CYGWIN
178-
$(LN_s) $(SHARED_LIB) $(DEVEL_LIB)
179-
endif
177+
if [ "$(CYGWIN)" != true ]; then \
178+
$(LN_s) $(SHARED_LIB) $(DEVEL_LIB); \
179+
fi
180180

181181
$(SHARED_PAM): $(OBJS_PAM) $(MAP_PAM) $(DEVEL_LIB)
182182
$(LD_lib) $(LDFLAGS_pam) $(OBJS_PAM) $(LDLIBS_pam) -L. -lpasswdqc -o $(SHARED_PAM)
@@ -203,7 +203,7 @@ pwqfilter.o: pwqfilter.c passwdqc_filter.h passwdqc.h
203203
$(CC) $(CPPFLAGS_lib) $(CFLAGS_lib) -c $*.c
204204

205205
$(PKGCONFIG): $(PKGCONFIG).in
206-
sed -e "s|@VERSION@|$(VERSION)|g" $< > $@
206+
sed -e "s|@VERSION@|$(VERSION)|g" $(PKGCONFIG).in > $@
207207

208208
concat.o: concat.h
209209
pam_passwdqc.o: passwdqc.h pam_macros.h
@@ -225,12 +225,12 @@ install_lib_wrapped:
225225
$(INSTALL) -m $(SHLIBMODE) $(SHARED_LIB) $(DESTDIR)$(SHARED_LIBDIR)/
226226

227227
$(MKDIR) $(DESTDIR)$(DEVEL_LIBDIR)
228-
ifndef CYGWIN
229-
$(LN_s) $(SHARED_LIBDIR_REL)/$(SHARED_LIB) \
230-
$(DESTDIR)$(DEVEL_LIBDIR)/$(DEVEL_LIB)
231-
else
232-
$(INSTALL) -m $(SHLIBMODE) $(DEVEL_LIB) $(DESTDIR)$(DEVEL_LIBDIR)/
233-
endif
228+
if [ "$(CYGWIN)" != true ]; then \
229+
$(LN_s) $(SHARED_LIBDIR_REL)/$(SHARED_LIB) \
230+
$(DESTDIR)$(DEVEL_LIBDIR)/$(DEVEL_LIB); \
231+
else \
232+
$(INSTALL) -m $(SHLIBMODE) $(DEVEL_LIB) $(DESTDIR)$(DEVEL_LIBDIR)/; \
233+
fi
234234

235235
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)
236236
$(INSTALL) -m $(INCMODE) $(HEADER) $(DESTDIR)$(INCLUDEDIR)/

pam_passwdqc.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,9 @@
55
* See LICENSE
66
*/
77

8-
#ifdef __FreeBSD__
9-
/* For vsnprintf(3) */
108
#define _XOPEN_SOURCE 600
11-
#else
12-
#define _XOPEN_SOURCE 500
139
#define _XOPEN_SOURCE_EXTENDED
14-
#define _XOPEN_VERSION 500
1510
#define _DEFAULT_SOURCE
16-
#endif
1711
#include <stdio.h>
1812
#include <stdlib.h>
1913
#include <stdarg.h>
@@ -45,7 +39,7 @@
4539
#define PAM_AUTHTOK_RECOVERY_ERR PAM_AUTHTOK_RECOVER_ERR
4640
#endif
4741

48-
#if (defined(__sun) || defined(__hpux)) && \
42+
#if (defined(__sun) || defined(__hpux) || defined(_AIX)) && \
4943
!defined(LINUX_PAM) && !defined(_OPENPAM)
5044
/* Sun's PAM doesn't use const here, while Linux-PAM and OpenPAM do */
5145
#define lo_const

passwdqc_filter.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ extern int passwdqc_filter_close(passwdqc_filter_t *flt);
3434
/* Lower-level inlines for shared use by pwqfilter.c and passwdqc_filter.c */
3535

3636
#include <string.h> /* for strcspn() */
37-
#if !defined(_MSC_VER) && !defined(__APPLE__)
37+
38+
/* We assume little-endian if this leaves __BYTE_ORDER undefined */
39+
#if !defined(_MSC_VER) && !defined(__APPLE__) && !defined(__sun) && !defined(_AIX)
3840
#include <endian.h>
41+
#elif (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \
42+
defined(__sparc) || defined(_POWER)
43+
#define __LITTLE_ENDIAN 1234
44+
#define __BIG_ENDIAN 4321
45+
#define __BYTE_ORDER __BIG_ENDIAN
3946
#endif
4047

4148
#include "md4.h"

0 commit comments

Comments
 (0)