"Fossies" - the Fresh Open Source Software Archive

Member "pidentd-3.0.19/configure.in" (18 Oct 2005, 10175 Bytes) of package /linux/misc/old/pidentd-3.0.19.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl Process this file with autoconf to produce a configure script.
    2 
    3 dnl Try to detect the return type of sprintf()
    4 AC_DEFUN(AC_CHECK_SPRINTF_RETVAL_POINTER, [
    5 AC_CACHE_CHECK([for sprintf() returning 'char *'], ac_cv_sprintf_retval_pointer, [
    6 AC_TRY_COMPILE([
    7 #include <stdio.h>
    8 ],[
    9    char buf[10];
   10    return *sprintf(buf, "%d", 10);
   11 ],
   12 ac_cv_sprintf_retval_pointer=yes, ac_cv_sprintf_retval_pointer=no)])
   13 if test "$ac_cv_sprintf_retval_pointer" = "yes"; then
   14     AC_DEFINE(SPRINTF_RETVAL_POINTER)
   15 fi
   16 ])
   17 
   18 
   19 
   20 dnl Try to detect the type of the third arg to getsockname() et al
   21 AC_DEFUN(AC_TYPE_SOCKLEN_T,
   22 [AC_CACHE_CHECK(for socklen_t in sys/socket.h, ac_cv_type_socklen_t,
   23 [AC_EGREP_HEADER(socklen_t, sys/socket.h,
   24   ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])
   25 if test $ac_cv_type_socklen_t = no; then
   26     AC_MSG_CHECKING(for AIX)
   27     AC_EGREP_CPP(yes, [
   28 #ifdef _AIX
   29  yes
   30 #endif
   31 ],[
   32 AC_MSG_RESULT(yes)
   33 AC_DEFINE(socklen_t, size_t)
   34 ],[
   35 AC_MSG_RESULT(no)
   36 AC_DEFINE(socklen_t, int)
   37 ])
   38 fi
   39 ])
   40 
   41 
   42 dnl extracted from autoconf 2.12 acspecific.m4 AC_FUNC_GETLOADAVG
   43 
   44 AC_DEFUN(AC_STRUCT_NLIST,
   45 [AC_CHECK_HEADER(nlist.h,
   46 [AC_DEFINE(NLIST_STRUCT)
   47 AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un,
   48 [AC_TRY_COMPILE([#include <nlist.h>],
   49 [struct nlist n; n.n_un.n_name = 0;],
   50 ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)])
   51 if test $ac_cv_struct_nlist_n_un = yes; then
   52   AC_DEFINE(NLIST_NAME_UNION)
   53 fi
   54 ])
   55 ])
   56 
   57 
   58 AC_INIT(src/pidentd.h)
   59 
   60 AC_CONFIG_AUX_DIR(aux)
   61 AC_CONFIG_HEADER(src/config.h)
   62 AC_PREREQ(2.10)
   63 
   64 AC_ARG_WITH(threads,
   65 [  --with-threads[=ARG]    enable usage of threads [ARG=yes]])
   66 
   67 if test "$with_threads" = "" || test "$with_threads" = "auto"; then
   68     with_threads=yes
   69 elif test "$with_threads" = "solaris"; then
   70     with_threads=ui
   71 elif test "$with_threads" = "cma"; then
   72     with_threads=dce
   73 fi
   74 
   75 
   76 AC_ARG_WITH(getpw_r,
   77 [  --with-getpw_r[=ARG]    enable usage of getpw..._r functions [ARG=yes]])
   78 
   79 
   80 AC_PROG_CC
   81 if test "$ac_cv_prog_gcc" = "no"; then
   82     if test "$CFLAGS" = ""; then
   83         CFLAGS="$CFLAGS -O"
   84     fi
   85 fi
   86 
   87 AC_ARG_WITH(des,
   88 [  --with-des[=ARG]        enable usage of DES encryption [ARG=yes]])
   89 
   90 AC_ARG_WITH(des-includes,
   91 [  --with-des-includes=DIR DES include files are in DIR])
   92 AC_ARG_WITH(des-libraries,
   93 [  --with-des-libraries=DIR DES library file are in DIR])
   94 
   95 if test "$with_des_includes"; then
   96     CPPFLAGS="$CPPFLAGS -I$with_des_includes"
   97     if test "$with_des" = ""; then
   98         with_des=yes
   99     fi
  100 fi
  101 
  102 if test "$with_des_libraries"; then
  103     LDFLAGS="$LDFLAGS -L$with_des_libraries"
  104     dnl How to handle -R$with_des_libraries ???
  105     if test "$with_des" = ""; then
  106         with_des=yes
  107     fi
  108 fi
  109 
  110 
  111 
  112 AC_CANONICAL_HOST
  113 
  114 need_libkvm=yes
  115 
  116 case "$host" in
  117     *-aix4.3.2* | *-aix5*)
  118         host_os=aix432
  119         ;;
  120     *-aix4.2* | *-aix4.3*)
  121         host_os=aix42
  122         ;;
  123     *-irix4*)
  124         host_os=irix4
  125         AC_DEFINE(_PATH_UNIX,"/unix")
  126         ;;
  127     *-irix5* | *-irix6*)
  128         host_os=irix5
  129         AC_DEFINE(_PATH_UNIX,"/unix")
  130         ;;
  131     *-hpux7*)
  132         host_os=bsd42
  133         AC_DEFINE(_PATH_UNIX, "/hp-ux")
  134                 if test "$ac_cv_prog_gcc" = "no"; then
  135                         CPPFLAGS="$CPPFLAGS -DHPUX7 -Ae"
  136                 fi
  137                 ;;
  138     *-hpux8* | *-hpux9*)
  139         host_os=bsd42
  140         AC_DEFINE(_PATH_UNIX, "/hp-ux")
  141                 if test "$ac_cv_prog_gcc" = "no"; then
  142                         CPPFLAGS="$CPPFLAGS -Ae"
  143                 fi
  144                 ;;
  145     *-hpux10*)
  146         host_os=bsd42
  147         AC_DEFINE(_PATH_UNIX,"/stand/vmunix")
  148         if test "$ac_cv_prog_gcc" = "no"; then
  149             CPPFLAGS="$CPPFLAGS -Ae"
  150         fi
  151         ;;
  152     *-linux*)
  153         host_os=linux
  154         need_libkvm=no
  155         ;;
  156     *-nextstep3*)
  157         host_os=next_mach
  158         AC_DEFINE(_PATH_UNIX, "/mach")
  159         ;;
  160     *-ultrix4*)
  161         host_os=bsd42
  162         LIBS="$LIBS -li"
  163         ;;
  164     *-osf4*|*-osf3.2*)
  165         host_os=osf4
  166         ;;
  167     *-osf5*)
  168         host_os=osf5
  169         ;;
  170     *-sunos4*)
  171         host_os=bsd42
  172         ;;
  173     *-solaris2.4*)
  174         host_os=sunos54
  175         ;;
  176     *-solaris2.5*)
  177         host_os=sunos55
  178         ;;
  179     *-solaris2.6)
  180         host_os=sunos56
  181         ;;
  182     *-solaris2.7|*-solaris2.8|*-solaris2.9|*-solaris2.10)
  183         case "$host" in
  184             *7) host_os=sunos57
  185                 ;;
  186             *8|*9)
  187                 host_os=sunos58
  188                 CPPFLAGS="$CPPFLAGS -DHAVE_IPV6=1"
  189                 ;;
  190             *10)
  191                 host_os=sunos510
  192                 CPPFLAGS="$CPPFLAGS -DHAVE_IPV6=1"
  193                 ;;
  194         esac
  195         ISA="`isainfo -k`"
  196         if test "$ISA" = "sparcv9" -o "$ISA" = "amd64"; then
  197             if test "$LD_LIBRARY_PATH" != "" ; then
  198                 AC_MSG_WARN([
  199 
  200 WARNING: You have the LD_LIBRARY_PATH environment variable set.
  201          This is almost never the right thing to do, and it will
  202          very likely cause a lot of problems when running
  203          Pidentd later. Please consider unsetting it.
  204 ])
  205             fi
  206 
  207             if test "$ac_cv_prog_gcc" = "yes"; then
  208                 CFLAGS="$CFLAGS -m64"
  209             else
  210                 CFLAGS="$CFLAGS -xarch=generic64"
  211             fi
  212         fi
  213         ;;
  214     *)
  215         AC_MSG_ERROR([
  216 
  217 ERROR: Pidentd 3 does not support '$host' yet.
  218        Please read the INSTALL file for more information.
  219 ])
  220 
  221         ;;
  222 esac
  223 
  224 
  225 AC_PROG_INSTALL
  226 AC_PROG_MAKE_SET
  227 
  228 AC_HEADER_STDC
  229 AC_CHECK_HEADERS(unistd.h kvm.h stdint.h)
  230 
  231 AC_TYPE_PID_T
  232 AC_TYPE_UID_T
  233 AC_TYPE_MODE_T
  234 AC_TYPE_SIZE_T
  235 AC_TYPE_SIGNAL
  236 AC_TYPE_SOCKLEN_T
  237 AC_TYPE_OFF_T
  238 
  239 AC_CHECK_TYPE(ssize_t, int)
  240 AC_CHECK_TYPE(uint32_t, unsigned int)
  241 AC_CHECK_TYPE(uint16_t, unsigned short)
  242 AC_CHECK_TYPE(uint8_t, unsigned char)
  243 
  244 AC_STRUCT_NLIST
  245 
  246 AC_CHECK_FUNCS(snprintf vsnprintf)
  247 AC_CHECK_SPRINTF_RETVAL_POINTER
  248 
  249 AC_CHECK_FUNCS(memcpy uname)
  250 AC_CHECK_FUNCS(random srandom)
  251 AC_CHECK_FUNCS(setsid ftruncate)
  252 
  253 AC_CHECK_FUNCS(socket)
  254 if test "$ac_cv_func_socket" = "no"; then
  255     AC_CHECK_LIB(socket, socket)
  256     AC_DEFINE(HAVE_SOCKET, 1)
  257 fi
  258 
  259 AC_CHECK_FUNCS(gethostbyname)
  260 if test "$ac_cv_func_gethostbyname" = "no"; then
  261     AC_CHECK_LIB(nsl, gethostbyname)
  262     AC_DEFINE(HAVE_GETHOSTBYNAME, 1)
  263 fi
  264 
  265 if test "$need_libkvm" = "yes"; then
  266     AC_DEFINE(NEED_LIBKVM, 1)
  267 
  268     AC_CHECK_FUNCS(nlist)
  269     if test "$ac_cv_func_nlist" = "no"; then
  270         AC_CHECK_LIB(elf, nlist)
  271         if test "$ac_cv_lib_elf_nlist" = "yes"; then
  272             AC_DEFINE(HAVE_NLIST, 1)
  273         else
  274             AC_CHECK_LIB(mld, nlist)
  275             if test "$ac_cv_lib_mld_nlist" = "yes"; then
  276                 AC_DEFINE(HAVE_NLIST, 1)
  277             fi
  278         fi
  279     fi
  280 
  281     AC_CHECK_FUNCS(kvm_open)
  282     if test "$ac_cv_func_kvm_open" = "no"; then
  283         AC_CHECK_LIB(kvm, kvm_open)
  284         if test "$ac_cv_lib_kvm_kvm_open" = "yes"; then
  285             AC_DEFINE(HAVE_KVM_OPEN, 1)
  286         fi
  287     fi
  288 fi
  289 
  290 CRYPTO_PROGRAMS=
  291 CRYPTO_OBJS=
  292 
  293 if test "$with_des" = "" || test "$with_des" = "yes";then
  294     dnl check in SSLeay -lcrypto
  295     AC_CHECK_HEADERS(des.h)
  296     AC_CHECK_HEADERS(openssl/des.h)
  297     AC_CHECK_HEADERS(rand.h)
  298     AC_CHECK_HEADERS(openssl/rand.h)
  299     AC_CHECK_LIB(crypto, RAND_bytes)
  300     if test "$ac_cv_lib_crypto_RAND_bytes" = "yes"; then
  301         AC_DEFINE(HAVE_RAND_BYTES, 1)
  302         AC_DEFINE(HAVE_LIBDES, 1)
  303         CRYPTO_PROGRAMS="idecrypt ikeygen"
  304         CRYPTO_OBJS="pdes.o"
  305     else
  306         dnl check for the -ldes library instead
  307         AC_CHECK_LIB(des, des_set_key)
  308         if test "$ac_cv_lib_des_des_set_key" = "yes"; then
  309             AC_MSG_CHECKING(for /dev/random)
  310             if test -r /dev/random; then
  311             AC_DEFINE(HAVE_DEV_RANDOM, 1)
  312             AC_MSG_RESULT(yes)
  313             else
  314             AC_MSG_RESULT(no)
  315             fi
  316             CRYPTO_PROGRAMS="idecrypt ikeygen"
  317             CRYPTO_OBJS="pdes.o"
  318         fi
  319     fi
  320 fi
  321 
  322 have_threads=no
  323 if test "$with_threads" != "no"; then
  324     AC_CHECK_HEADERS(pthread.h thread.h)
  325 
  326     dnl Check for Posix threads (in various incarnations)...
  327 
  328     if test "$with_threads" = "yes" || test "$with_threads" = "posix"; then
  329         AC_CHECK_LIB(pthread, pthread_attr_init)
  330     fi
  331     if test "$ac_cv_lib_pthread_pthread_attr_init" = "yes"; then
  332         have_threads=posix
  333     else
  334 
  335     if test "$with_threads" = "yes" || test "$with_threads" = "posix"; then
  336         AC_CHECK_LIB(pthreads, pthread_attr_init)
  337     fi
  338     if test "$ac_cv_lib_pthreads_pthread_attr_init" = "yes"; then
  339         have_threads=posix
  340     else
  341 
  342 
  343     dnl Check for Unix International threads
  344 
  345     if test "$with_threads" = "yes" || test "$with_threads" = "ui"; then
  346         AC_CHECK_LIB(thread, thr_create)
  347     fi
  348     if test "$ac_cv_lib_thread_thr_create" = "yes"; then
  349         have_threads=ui
  350     else
  351 
  352 
  353     dnl Check for DCE/CMA threads (an early Posix threads)
  354 
  355     if test "$with_threads" = "yes" || test "$with_threads" = "dce"; then
  356         AC_CHECK_LIB(cma, pthread_attr_create,,,$OS_LIBS)
  357     fi
  358     if test "$ac_cv_lib_cma_pthread_attr_create" = "yes"; then
  359         have_threads=dce
  360     fi
  361     fi
  362     fi
  363     fi
  364     
  365     dnl If that failed - warn the user
  366     if test "$have_threads" = "no"; then
  367         AC_MSG_WARN([
  368 
  369 WARNING: No usable threads library found.
  370          Building without threads support.
  371          Please see the INSTALL file for special instructions.
  372 ])
  373 
  374     else
  375 
  376         case "$host" in
  377         *-aix4.2* | *-aix4.3* | *-aix5*)
  378             if test "$GCC" = "yes"; then
  379               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
  380               LDFLAGS="-nostartfiles /usr/lib/crt0_r.o $LDFLAGS"
  381               LIBS="$LIBS -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a"
  382             else
  383               CC=cc_r
  384             fi
  385             ;;
  386         *-hpux10*)
  387             CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  388             ;;
  389         *-osf4*)
  390             CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  391             LIBS="$LIBS -lmach -lexc"
  392             ;;
  393         *-solaris2.*)
  394             if test "$have_threads" = "posix"; then
  395                 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=199506L -D__EXTENSIONS__"
  396             else
  397                 CPPFLAGS="$CPPFLAGS -D_REENTRANT"
  398             fi
  399             ;;
  400         esac
  401 
  402         AC_DEFINE(HAVE_THREADS,1)
  403         if test "$with_getpw_r" = "" || test "$with_getpw_r" = "yes"
  404         then
  405             AC_CHECK_FUNCS(getpwnam_r getpwuid_r)
  406         fi
  407         AC_CHECK_FUNCS(thr_setconcurrency)
  408     fi
  409 fi
  410 
  411 
  412 if test "$ac_cv_func_getpwuid_r" != "yes"; then
  413 
  414 dnl Check for IRIX -lsun for YP-enabled getpwuid() routines
  415 AC_CHECK_LIB(sun, getpwuid)
  416 
  417 else
  418 
  419 dnl Find out the calling sequence for the getpw*_r functions
  420 
  421 AC_MSG_CHECKING(for Posix-style getpw..._r)
  422 AC_TRY_LINK([
  423 #include <pwd.h>
  424 ],[
  425 struct passwd pwb, *pp;
  426 char buf[1024];
  427 int result;
  428 
  429 result = getpwuid_r(0, &pwb, buf, sizeof(buf), &pp);
  430 ], [
  431 AC_MSG_RESULT(yes)
  432 AC_DEFINE(HAVE_POSIX_GETPW,1)
  433 ], [
  434 AC_MSG_RESULT(no)
  435 
  436 
  437 AC_MSG_CHECKING(for UI-style getpw..._r)
  438 AC_TRY_LINK([
  439 #include <pwd.h>
  440 ],[
  441 struct passwd pwb;
  442 char buf[1024];
  443 
  444 pwb = *getpwuid_r(0, &pwb, buf, sizeof(buf));
  445 ], [
  446 AC_MSG_RESULT(yes)
  447 AC_DEFINE(HAVE_UI_GETPW,1)
  448 ], [
  449 AC_MSG_RESULT(no)
  450 
  451 
  452 AC_MSG_CHECKING(for DCE-style getpw..._r)
  453 AC_TRY_LINK([
  454 #include <pwd.h>
  455 ],[
  456 struct passwd pwb;
  457 char buf[1024];
  458 int result;
  459 
  460 result = getpwuid_r(0, &pwb, buf, sizeof(buf));
  461 ], [
  462 AC_MSG_RESULT(yes)
  463 AC_DEFINE(HAVE_DCE_GETPW,1)
  464 ], [
  465 AC_MSG_RESULT(no)
  466 ])])])
  467 
  468 fi
  469 
  470 
  471 AC_SUBST(CRYPTO_PROGRAMS)
  472 AC_SUBST(CRYPTO_OBJS)
  473 
  474 AC_OUTPUT(Makefile src/Makefile)
  475 
  476 
  477