From af310178c6bb13134d449ec323196764ec0bd972 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 3 Apr 2004 21:31:58 +0000 Subject: [PATCH] Updated configure scripts for NetBSD --- Makefile.global.in | 1 + config.h.in | 3 ++ configure | 122 ++++++++++++++++++++++++++++++++++++++++++++- configure.in | 19 +++++++ 4 files changed, 144 insertions(+), 1 deletion(-) diff --git a/Makefile.global.in b/Makefile.global.in index f4c01888..f8e3c43f 100644 --- a/Makefile.global.in +++ b/Makefile.global.in @@ -23,6 +23,7 @@ SMODE = 6711 CHOWN = @CHOWN@ INSTALL = @INSTALL@ RANLIB = @RANLIB@ +LN_S = @LN_S@ SHELL = /bin/sh ECHO = echo -e CC = @CC@ diff --git a/config.h.in b/config.h.in index 465afc8b..ad582ae9 100644 --- a/config.h.in +++ b/config.h.in @@ -182,6 +182,9 @@ /* Define if you have the header file. */ #undef HAVE_UTMPX_H +/* Define if you have the utmp.ut_id strcuture member */ +#undef HAVE_UTMP_UT_ID + /* Define if you have the memcpy function. */ #undef HAVE_MEMCPY diff --git a/configure b/configure index 8e1a9471..16263c1b 100755 --- a/configure +++ b/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBDIRS PACKAGE MAJOR MINOR REVISION COPYRIGHT GROUP OWNER ROWNER RGROUP VERSION MAKE AWK INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RANLIB ac_ct_RANLIB TAR ZIP CHOWN CPP EGREP LIBOBJS COMPRESS GZIP ARC NOMARCH ARJ UNARJ LHA RAR UNRAR UNZIP ZOO HA ANTIVIR FPROT UVSCAN RB SB RZ SZ GOLDEDBIN GOLDNODE CONVERT LOG_COMPRESS LOG_COMPRESSEXT joebin joelib LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS SUBDIRS PACKAGE MAJOR MINOR REVISION COPYRIGHT GROUP OWNER ROWNER RGROUP VERSION MAKE AWK INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE RANLIB ac_ct_RANLIB LN_S TAR ZIP CHOWN CPP EGREP LIBOBJS COMPRESS GZIP ARC NOMARCH ARJ UNARJ LHA RAR UNRAR UNZIP ZOO HA ANTIVIR FPROT UVSCAN RB SB RZ SZ GOLDEDBIN GOLDNODE CONVERT LOG_COMPRESS LOG_COMPRESSEXT joebin joelib LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -2543,6 +2543,17 @@ else RANLIB="$ac_cv_prog_RANLIB" fi +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 +fi + # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -2886,6 +2897,22 @@ if test "$debugging" = "yes"; then else CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT" fi + +echo "$as_me:$LINENO: checking for cpuflags" >&5 +echo $ECHO_N "checking for cpuflags... $ECHO_C" >&6 +for cpuflagsbin in /usr/bin /usr/local/bin /usr/pkg/bin NONE; do + if test "$cpuflagsbin" = "NONE"; then + echo "$as_me:$LINENO: result: unknown" >&5 +echo "${ECHO_T}unknown" >&6 + elif test -x $cpuflagsbin/cpuflags; then + CPUFLAGS=`cpuflags` + echo "$as_me:$LINENO: result: $CPUFLAGS" >&5 +echo "${ECHO_T}$CPUFLAGS" >&6 + CFLAGS="$CFLAGS $CPUFLAGS" + break + fi +done + # Check whether --enable-newbinkp or --disable-newbinkp was given. if test "${enable_newbinkp+set}" = set; then enableval="$enable_newbinkp" @@ -6453,6 +6480,98 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for struct utmp.ut_id" >&5 +echo $ECHO_N "checking for struct utmp.ut_id... $ECHO_C" >&6 +if test "${ac_cv_member_struct_utmp_ut_id+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static struct utmp ac_aggr; +if (ac_aggr.ut_id) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_utmp_ut_id=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static struct utmp ac_aggr; +if (sizeof ac_aggr.ut_id) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_utmp_ut_id=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_member_struct_utmp_ut_id=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_utmp_ut_id" >&5 +echo "${ECHO_T}$ac_cv_member_struct_utmp_ut_id" >&6 +if test $ac_cv_member_struct_utmp_ut_id = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_UTMP_UT_ID 1 +_ACEOF + + +fi + @@ -8902,6 +9021,7 @@ s,@OBJEXT@,$OBJEXT,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@LN_S@,$LN_S,;t t s,@TAR@,$TAR,;t t s,@ZIP@,$ZIP,;t t s,@CHOWN@,$CHOWN,;t t diff --git a/configure.in b/configure.in index 347d1584..15c24e8e 100644 --- a/configure.in +++ b/configure.in @@ -57,6 +57,7 @@ AC_CHECK_PROG(INSTALL, install, install) AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_RANLIB +AC_PROG_LN_S AC_CHECK_PROG(TAR, tar, tar) AC_CHECK_PROG(ZIP, zip, zip) AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:) @@ -76,6 +77,23 @@ if test "$debugging" = "yes"; then else CFLAGS="-O3 -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -D_REENTRANT" fi + +dnl +dnl Check if cpuflags program is installed, if so get CPU optimization flags +dnl Currently this only works on NetBSD. +dnl +AC_MSG_CHECKING(for cpuflags) +for cpuflagsbin in /usr/bin /usr/local/bin /usr/pkg/bin NONE; do + if test "$cpuflagsbin" = "NONE"; then + AC_MSG_RESULT(unknown) + elif test -x $cpuflagsbin/cpuflags; then + CPUFLAGS=`cpuflags` + AC_MSG_RESULT($CPUFLAGS) + CFLAGS="$CFLAGS $CPUFLAGS" + break + fi +done + AC_ARG_ENABLE(newbinkp, [ --enable-newbinkp Compile New Binkp code], [ newbinkp=$enableval ], [ newbinkp=no ]) if test "$newbinkp" = "yes"; then AC_DEFINE(USE_NEWBINKP) @@ -219,6 +237,7 @@ AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE AC_HEADER_STAT AC_STRUCT_TM +AC_CHECK_MEMBERS([struct utmp.ut_id]) dnl dnl Checks for library functions.