apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: apr apr-config.in configure.in
Date Sun, 03 Feb 2002 13:39:47 GMT
gstein      02/02/03 05:39:47

  Modified:    .        apr-config.in configure.in
  Log:
  Provide more outputs for the apr-config file. Corrected some handling
  of the prefix, and the exit code for the --help switch.
  
  Make the chmod +x for apr-config part of the "config commands" so that
  it will occur every time that config.status is run.
  
  Revision  Changes    Path
  1.4       +71 -10    apr/apr-config.in
  
  Index: apr-config.in
  ===================================================================
  RCS file: /home/cvs/apr/apr-config.in,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- apr-config.in	12 Dec 2001 06:52:06 -0000	1.3
  +++ apr-config.in	3 Feb 2002 13:39:47 -0000	1.4
  @@ -55,10 +55,12 @@
   # APR script designed to allow easy command line access to APR configuration
   # parameters.
   
  -PREFIX="@prefix@"
  -EXEC_PREFIX="@exec_prefix@"
  -LIBDIR="@libdir@"
  -INCLUDEDIR="@includedir@"
  +prefix="@prefix@"
  +exec_prefix="@exec_prefix@"
  +bindir="@bindir@"
  +libdir="@libdir@"
  +includedir="@includedir@"
  +
   CC="@CC@"
   CPP="@CPP@"
   SHELL="@SHELL@"
  @@ -66,8 +68,7 @@
   CFLAGS="@EXTRA_CFLAGS@"
   LDFLAGS="@EXTRA_LDFLAGS@"
   LIBS="@EXTRA_LIBS@"
  -INCLUDES="@EXTRA_INCLUDES@"
  -LIBTOOL_LIBS="@LIBTOOL_LIBS@"
  +EXTRA_INCLUDES="@EXTRA_INCLUDES@"
   SHLIBPATH_VAR="@shlibpath_var@"
   APR_SOURCE_DIR="@abs_srcdir@"
   APR_SO_EXT="@so_ext@"
  @@ -84,8 +85,20 @@
     --cppflags        print cpp flags
     --includes        print include information
     --ldflags         print linker flags
  -  --libs            print library information
  +  --libs            print additional libraries to link against
  +  --srcdir          print APR source directory
  +  --apr-ld          print link switch(es) for linking to APR
  +  --apr-libtool     print the libtool inputs for linking to APR
  +  --apr-la-file     print the path to the .la file, if available
     --help            print this help
  +
  +When linking with libtool, an application should do something like:
  +  APR_LIBS="\`apr-config --apr-libtool --libs\`"
  +or when linking directly:
  +  APR_LIBS="\`apr-config --apr-ld --libs\`"
  +
  +An application should use the results of --cflags, --cppflags, --includes,
  +and --ldflags in their build process.
   EOF
   }
   
  @@ -94,6 +107,22 @@
       exit 1
   fi
   
  +thisdir="`dirname $0`"
  +thisdir="`cd $thisdir && pwd`"
  +if test "$BINDIR" = "$thisdir"; then
  +  location=installed
  +elif test "$APR_SOURCE_DIR" = "$thisdir"; then
  +  location=source
  +else
  +  location=build
  +fi
  +
  +if test "$location" = "installed"; then
  +    LA_FILE="$libdir/libapr.la"
  +else
  +    LA_FILE="$thisdir/libapr.la"
  +fi
  +
   while test $# -gt 0; do
       # Normalize the prefix.
       case "$1" in
  @@ -107,7 +136,7 @@
       prefix=$optarg
       ;;
       --prefix)
  -    echo $PREFIX
  +    echo $prefix
       ;;
       --cflags)
       echo $CFLAGS
  @@ -122,11 +151,43 @@
       echo $LDFLAGS
       ;;
       --includes)
  -    echo $INCLUDES
  +    if test "$location" = "installed"; then
  +        echo "-I$includedir $EXTRA_INCLUDES"
  +    elif test "$location" = "source"; then
  +        echo "-I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
  +    else
  +        echo "-I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
  +    fi
  +    ;;
  +    --srcdir)
  +    echo $APR_SOURCE_DIR
  +    ;;
  +    --apr-ld)
  +    if test "$location" = "installed"; then
  +        ### avoid using -L if libdir is a "standard" location like /usr/lib
  +        echo "-L$libdir -lapr"
  +    else
  +        echo "-L$thisdir -lapr"
  +    fi
  +    ;;
  +    --apr-libtool)
  +    if test -f "$LA_FILE"; then
  +        echo $LA_FILE
  +    elif test "$location" = "installed"; then
  +        ### avoid using -L if libdir is a "standard" location like /usr/lib
  +        echo "-L$libdir -lapr"
  +    else
  +        echo "-L$thisdir -lapr"
  +    fi
  +    ;;
  +    --apr-la-file)
  +    if test -f "$LA_FILE"; then
  +        echo $LA_FILE
  +    fi
       ;;
       --help)
       show_usage
  -    exit 1
  +    exit 0
       ;;
       *)
       show_usage
  
  
  
  1.401     +1 -2      apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.400
  retrieving revision 1.401
  diff -u -r1.400 -r1.401
  --- configure.in	24 Jan 2002 12:18:18 -0000	1.400
  +++ configure.in	3 Feb 2002 13:39:47 -0000	1.401
  @@ -1546,9 +1546,8 @@
     fi
     rm -f $i.save
   done
  -])
  -
   chmod +x apr-config
  +])
   
   dnl #----------------------------- Fixup Makefiles for VPATH support
   
  
  
  

Mime
View raw message