Alexandre Julliard : makefiles: Create the wine symlink from configure.

Alexandre Julliard julliard at winehq.org
Wed Feb 3 09:33:04 CST 2010


Module: wine
Branch: master
Commit: 7d020c9f088af3e2d8d6e75c2d088f430fcf4af0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=7d020c9f088af3e2d8d6e75c2d088f430fcf4af0

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb  3 13:12:12 2010 +0100

makefiles: Create the wine symlink from configure.

---

 Make.rules.in        |    1 -
 Makefile.in          |   12 ++++--------
 aclocal.m4           |    8 ++++++++
 configure            |   46 +++++++++++++++++++++++++++++++++++++++++++++-
 configure.ac         |    3 +++
 tools/make_makefiles |    1 +
 6 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index e155d88..6a52a01 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -65,7 +65,6 @@ TARGETFLAGS  = @TARGETFLAGS@
 WINEBUILDFLAGS = $(TARGETFLAGS) $(DLLFLAGS)
 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check
-WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
 RUNTEST      = $(TOPSRCDIR)/tools/runtest
 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT)
diff --git a/Makefile.in b/Makefile.in
index 9dd1bd9..08349b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -26,7 +26,6 @@ SRCDIR    = @srcdir@
 VPATH     = @srcdir@
 LIBEXT    = @LIBEXT@
 MODULE    = none
-PROGRAMS  = wine
 
 # Sub-directories to run make depend/clean into
 SUBDIRS = \
@@ -46,7 +45,7 @@ INSTALLSUBDIRS = @ALL_TOP_DIRS@
 # Sub-directories to run make test into
 TESTSUBDIRS = dlls
 
-all: Make.rules $(PROGRAMS)
+all: wine
 	@echo "Wine build complete."
 
 WINAPI_CHECK_EXTRA_FLAGS = --global
@@ -68,9 +67,6 @@ include/config.h: include/stamp-h
 include/stamp-h: include/config.h.in config.status
 	@./config.status include/config.h include/stamp-h
 
-wine: $(WINEWRAPPER)
-	$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
-
 # Installation rules
 
 uninstall::
@@ -138,10 +134,10 @@ distclean:: clean
 
 # Makefile rules
 
-ALL_MAKERULES = @ALL_MAKERULES@
 ALL_MAKEFILES = @ALL_MAKEFILES@
+ALL_CONFIGS   = Makefile $(ALL_MAKEFILES) @ALL_MAKERULES@ @ALL_SYMLINKS@
 
-Makefile $(ALL_MAKERULES) $(ALL_MAKEFILES):
+$(ALL_CONFIGS):
 	@./config.status $@
 .INIT: Makefile
 .BEGIN: Makefile
@@ -150,6 +146,6 @@ Makefile $(ALL_MAKERULES) $(ALL_MAKEFILES):
 $(RECURSE_TARGETS) $(MAKEDEP): $(ALL_MAKEFILES)
 
 distclean::
-	$(RM) Makefile $(ALL_MAKERULES) $(ALL_MAKEFILES)
+	$(RM) $(ALL_CONFIGS)
 
 @ALL_MAKEFILE_DEPENDS@
diff --git a/aclocal.m4 b/aclocal.m4
index 76af863..3240435 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -142,6 +142,14 @@ dnl
 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])])
 
+dnl **** Create symlinks from config.status ****
+dnl
+dnl Usage: WINE_CONFIG_SYMLINK(name,target)
+dnl
+AC_DEFUN([WINE_CONFIG_SYMLINK],[AC_CONFIG_LINKS([$1:]m4_default([$2],[$1]))dnl
+ALL_SYMLINKS="$ALL_SYMLINKS \\
+	$1"])
+
 dnl **** Create a make rules file from config.status ****
 dnl
 dnl Usage: WINE_CONFIG_MAKERULES(file,var,deps)
diff --git a/configure b/configure
index 0e68b55..5aac1cf 100755
--- a/configure
+++ b/configure
@@ -608,6 +608,7 @@ ALL_IMPLIB_DIRS
 ALL_DLL_DIRS
 ALL_TOP_DIRS
 ALL_MAKEFILE_DEPENDS
+ALL_SYMLINKS
 ALL_MAKEFILES
 ALL_MAKERULES
 DEPENDENCIES
@@ -13653,6 +13654,8 @@ ALL_MAKERULES=""
 
 ALL_MAKEFILES=""
 
+ALL_SYMLINKS=""
+
 ALL_MAKEFILE_DEPENDS="# Makefile dependencies"
 
 
@@ -13682,6 +13685,10 @@ ALL_PROGRAM_BIN_INSTALL_DIRS=""
 ac_config_commands="$ac_config_commands include/stamp-h"
 
 
+ac_config_links="$ac_config_links wine:tools/winewrapper"
+ALL_SYMLINKS="$ALL_SYMLINKS \\
+	wine"
+
 ac_config_commands="$ac_config_commands dlls/gdi32/enhmfdrv"
 
 ac_config_commands="$ac_config_commands dlls/gdi32/mfdrv"
@@ -19438,6 +19445,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 # Files that config.status was made for.
 config_files="$ac_config_files"
 config_headers="$ac_config_headers"
+config_links="$ac_config_links"
 config_commands="$ac_config_commands"
 
 _ACEOF
@@ -19468,6 +19476,9 @@ $config_files
 Configuration headers:
 $config_headers
 
+Configuration links:
+$config_links
+
 Configuration commands:
 $config_commands
 
@@ -19596,6 +19607,7 @@ do
   case $ac_config_target in
     "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
     "include/stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/stamp-h" ;;
+    "wine") CONFIG_LINKS="$CONFIG_LINKS wine:tools/winewrapper" ;;
     "dlls/gdi32/enhmfdrv") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/gdi32/enhmfdrv" ;;
     "dlls/gdi32/mfdrv") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/gdi32/mfdrv" ;;
     "dlls/kernel32/nls") CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/kernel32/nls" ;;
@@ -20159,6 +20171,7 @@ done
 if $ac_need_defaults; then
   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
 fi
 
@@ -20480,7 +20493,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 fi # test -n "$CONFIG_HEADERS"
 
 
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
 shift
 for ac_tag
 do
@@ -20721,7 +20734,38 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
       || as_fn_error "could not create -" "$LINENO" 5
   fi
  ;;
+  :L)
+  #
+  # CONFIG_LINK
+  #
+
+  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
+    :
+  else
+    # Prefer the file from the source tree if names are identical.
+    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
+      ac_source=$srcdir/$ac_source
+    fi
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
+
+    if test ! -r "$ac_source"; then
+      as_fn_error "$ac_source: file not found" "$LINENO" 5
+    fi
+    rm -f "$ac_file"
 
+    # Try a relative symlink, then a hard link, then a copy.
+    case $srcdir in
+    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
+	*) ac_rel_source=$ac_top_build_prefix$ac_source ;;
+    esac
+    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
+      ln "$ac_source" "$ac_file" 2>/dev/null ||
+      cp -p "$ac_source" "$ac_file" ||
+      as_fn_error "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
+  fi
+ ;;
   :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
 $as_echo "$as_me: executing $ac_file commands" >&6;}
  ;;
diff --git a/configure.ac b/configure.ac
index b8b04c2..733c028 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2096,6 +2096,7 @@ Makefile: dummy
 
 AC_SUBST(ALL_MAKERULES,"")
 AC_SUBST(ALL_MAKEFILES,"")
+AC_SUBST(ALL_SYMLINKS,"")
 AC_SUBST(ALL_MAKEFILE_DEPENDS,["# Makefile dependencies"])
 
 AC_SUBST(ALL_TOP_DIRS,"")
@@ -2113,6 +2114,8 @@ AH_TOP([#define __WINE_CONFIG_H])
 
 AC_CONFIG_COMMANDS([include/stamp-h], [echo timestamp > include/stamp-h])
 
+WINE_CONFIG_SYMLINK(wine,tools/winewrapper)
+
 WINE_CONFIG_EXTRA_DIR(dlls/gdi32/enhmfdrv)
 WINE_CONFIG_EXTRA_DIR(dlls/gdi32/mfdrv)
 WINE_CONFIG_EXTRA_DIR(dlls/kernel32/nls)
diff --git a/tools/make_makefiles b/tools/make_makefiles
index fec44f6..2a05442 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -86,6 +86,7 @@ my @ignores = (
     "/configure.lineno",
     "/TAGS",
     "/tags",
+    "/wine",
     "Makefile",
     "dlldata.c",
     "dlls/*/*.def",




More information about the wine-cvs mailing list