[33108] trunk/base

afb at macports.org afb at macports.org
Fri Jan 18 00:27:44 PST 2008


Revision: 33108
          http://trac.macosforge.org/projects/macports/changeset/33108
Author:   afb at macports.org
Date:     2008-01-18 00:27:43 -0800 (Fri, 18 Jan 2008)

Log Message:
-----------
autoconf x11prefix, instead of hardcoding it

Modified Paths:
--------------
    trunk/base/configure
    trunk/base/configure.ac
    trunk/base/doc/macports.conf.in

Modified: trunk/base/configure
===================================================================
--- trunk/base/configure	2008-01-18 08:25:43 UTC (rev 33107)
+++ trunk/base/configure	2008-01-18 08:27:43 UTC (rev 33108)
@@ -736,6 +736,7 @@
 X_PRE_LIBS
 X_LIBS
 X_EXTRA_LIBS
+x11prefix
 READLINE_LIBS
 TCL_VERSION
 TCL_BIN_DIR
@@ -1395,6 +1396,8 @@
                           Specify group ownership of installed files
   --with-directory-mode=MODE
                           Specify directory mode of installed directories
+  --with-x11-prefix=PREFIX
+                          use PREFIX as the X11 base dir (default autodetect)
   --with-x                use the X Window System
   --with-tcl              directory containing tcl configuration (tclConfig.sh)
   --with-tclinclude       directory containing the public Tcl header files.
@@ -8786,6 +8789,23 @@
 
 
 
+
+# Check whether --with-x11-prefix was given.
+if test "${with_x11_prefix+set}" = set; then
+  withval=$with_x11_prefix;  x11prefix="$withval"
+fi
+
+case "$x11prefix" in
+  "")
+    # default to traditional value
+    x11prefix=/usr/X11R6
+    ;;
+  *)
+    x_includes=$x11prefix/include
+    x_libraries=$x11prefix/lib
+    ;;
+esac
+
 # Check for md5 implementation
 
 
@@ -10743,6 +10763,17 @@
 
 
 
+{ echo "$as_me:$LINENO: checking for X11 prefix" >&5
+echo $ECHO_N "checking for X11 prefix... $ECHO_C" >&6; }
+X_INCLUDES_PREFIX=`echo "$x_includes" | sed "s,/include,,"`
+X_LIBRARIES_PREFIX=`echo "$x_libraries" | sed "s,/lib,,"`
+if test "x$have_x" = "xyes" -a "x$X_INCLUDES_PREFIX" = "x$X_LIBRARIES_PREFIX"; then
+    x11prefix=$X_LIBRARIES_PREFIX
+fi
+{ echo "$as_me:$LINENO: result: $x11prefix" >&5
+echo "${ECHO_T}$x11prefix" >&6; }
+
+
 # Check for readline
 # Check whether --enable-readline was given.
 if test "${enable_readline+set}" = set; then
@@ -12941,6 +12972,7 @@
 X_PRE_LIBS!$X_PRE_LIBS$ac_delim
 X_LIBS!$X_LIBS$ac_delim
 X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim
+x11prefix!$x11prefix$ac_delim
 READLINE_LIBS!$READLINE_LIBS$ac_delim
 TCL_VERSION!$TCL_VERSION$ac_delim
 TCL_BIN_DIR!$TCL_BIN_DIR$ac_delim
@@ -12979,7 +13011,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 59; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5

Modified: trunk/base/configure.ac
===================================================================
--- trunk/base/configure.ac	2008-01-18 08:25:43 UTC (rev 33107)
+++ trunk/base/configure.ac	2008-01-18 08:27:43 UTC (rev 33108)
@@ -155,11 +155,32 @@
 AC_CHECK_FUNCS([bzero memset dup2 regcomp strdup strerror strtol fgetln lockf flock setmode strcasecmp strncasecmp strlcpy copyfile])
 MP_CHECK_READLINK_IS_P1003_1A
 
+AC_ARG_WITH(x11-prefix, [AC_HELP_STRING([--with-x11-prefix=PREFIX], [use PREFIX as the X11 base dir (default autodetect)])], [ x11prefix="$withval" ] )
+case "$x11prefix" in
+  "")
+    # default to traditional value
+    x11prefix=/usr/X11R6
+    ;;
+  *)
+    x_includes=$x11prefix/include
+    x_libraries=$x11prefix/lib
+    ;;
+esac
+
 # Check for md5 implementation
 MP_LIB_MD5
 # Check for X11 and paraphernalia
 MP_CHECK_X11
 
+AC_MSG_CHECKING(for X11 prefix)
+X_INCLUDES_PREFIX=`echo "$x_includes" | sed "s,/include,,"`
+X_LIBRARIES_PREFIX=`echo "$x_libraries" | sed "s,/lib,,"`
+if test "x$have_x" = "xyes" -a "x$X_INCLUDES_PREFIX" = "x$X_LIBRARIES_PREFIX"; then
+    x11prefix=$X_LIBRARIES_PREFIX
+fi
+AC_MSG_RESULT([$x11prefix])
+AC_SUBST(x11prefix)
+
 # Check for readline
 AC_ARG_ENABLE(readline, AC_HELP_STRING([--enable-readline], [Enable addition of readline support, if readline present.]),
 [

Modified: trunk/base/doc/macports.conf.in
===================================================================
--- trunk/base/doc/macports.conf.in	2008-01-18 08:25:43 UTC (rev 33107)
+++ trunk/base/doc/macports.conf.in	2008-01-18 08:27:43 UTC (rev 33108)
@@ -15,7 +15,7 @@
 portinstalltype		image
 
 # Directory containing the X11 installation.
-x11prefix		/usr/X11R6
+x11prefix		@x11prefix@
 
 # Where to find the sources list.
 sources_conf		@MPCONFIGDIR_EXPANDED@/sources.conf

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080118/b08ec9cc/attachment.html


More information about the macports-changes mailing list