Skip to content

Commit

Permalink
Remove configure detection of crypt()
Browse files Browse the repository at this point in the history
crypt() hasn't been needed since crypt detection was removed from
PostgreSQL, so these configure checks are not necessary.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/21f88934-f00c-27f6-a9d8-7ea06d317781%402ndquadrant.com
  • Loading branch information
petere committed Aug 21, 2019
1 parent 8f75e8e commit c45643d
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 1,159 deletions.
71 changes: 1 addition & 70 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -11209,62 +11209,6 @@ if test "$ac_res" != no; then :

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
$as_echo_n "checking for library containing crypt... " >&6; }
if ${ac_cv_search_crypt+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char crypt ();
int
main ()
{
return crypt ();
;
return 0;
}
_ACEOF
for ac_lib in '' crypt; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_crypt=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_crypt+:} false; then :
break
fi
done
if ${ac_cv_search_crypt+:} false; then :

else
ac_cv_search_crypt=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
$as_echo "$ac_cv_search_crypt" >&6; }
ac_res=$ac_cv_search_crypt
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing shm_open" >&5
$as_echo_n "checking for library containing shm_open... " >&6; }
if ${ac_cv_search_shm_open+:} false; then :
Expand Down Expand Up @@ -12760,7 +12704,7 @@ $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi


for ac_header in atomic.h copyfile.h crypt.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
for ac_header in atomic.h copyfile.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h mbarrier.h poll.h sys/epoll.h sys/ipc.h sys/prctl.h sys/procctl.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/sockio.h sys/tas.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
Expand Down Expand Up @@ -15782,19 +15726,6 @@ done

fi

ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt"
if test "x$ac_cv_func_crypt" = xyes; then :
$as_echo "#define HAVE_CRYPT 1" >>confdefs.h

else
case " $LIBOBJS " in
*" crypt.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS crypt.$ac_objext"
;;
esac

fi

ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
$as_echo "#define HAVE_DLOPEN 1" >>confdefs.h
Expand Down
3 changes: 0 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,6 @@ AC_SEARCH_LIBS(dlopen, dl)
AC_SEARCH_LIBS(socket, [socket ws2_32])
AC_SEARCH_LIBS(shl_load, dld)
AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
AC_SEARCH_LIBS(crypt, crypt)
AC_SEARCH_LIBS(shm_open, rt)
AC_SEARCH_LIBS(shm_unlink, rt)
AC_SEARCH_LIBS(clock_gettime, [rt posix4])
Expand Down Expand Up @@ -1273,7 +1272,6 @@ AC_HEADER_STDBOOL
AC_CHECK_HEADERS(m4_normalize([
atomic.h
copyfile.h
crypt.h
fp_class.h
getopt.h
ieeefp.h
Expand Down Expand Up @@ -1692,7 +1690,6 @@ else
fi

AC_REPLACE_FUNCS(m4_normalize([
crypt
dlopen
fls
getopt
Expand Down
3 changes: 0 additions & 3 deletions src/backend/libpq/crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include "postgres.h"

#include <unistd.h>
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif

#include "catalog/pg_authid.h"
#include "common/md5.h"
Expand Down
6 changes: 0 additions & 6 deletions src/include/pg_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,9 @@
/* Define to 1 if you have the <crtdefs.h> header file. */
#undef HAVE_CRTDEFS_H

/* Define to 1 if you have the `crypt' function. */
#undef HAVE_CRYPT

/* Define to 1 if you have the `CRYPTO_lock' function. */
#undef HAVE_CRYPTO_LOCK

/* Define to 1 if you have the <crypt.h> header file. */
#undef HAVE_CRYPT_H

/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
don't. */
#undef HAVE_DECL_FDATASYNC
Expand Down
6 changes: 0 additions & 6 deletions src/include/pg_config.h.win32
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@
/* Define to 1 if your compiler handles computed gotos. */
/* #undef HAVE_COMPUTED_GOTO */

/* Define to 1 if you have the `crypt' function. */
/* #undef HAVE_CRYPT */

/* Define to 1 if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */

/* Define to 1 if you have the declaration of `fdatasync', and to 0 if you
don't. */
#define HAVE_DECL_FDATASYNC 0
Expand Down
3 changes: 0 additions & 3 deletions src/include/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,6 @@ extern int gettimeofday(struct timeval *tp, struct timezone *tzp);
* Default "extern" declarations or macro substitutes for library routines.
* When necessary, these routines are provided by files in src/port/.
*/
#ifndef HAVE_CRYPT
extern char *crypt(const char *key, const char *setting);
#endif

/* WIN32 handled in port/win32_port.h */
#ifndef WIN32
Expand Down
Loading

0 comments on commit c45643d

Please sign in to comment.