Browse Source

BUG: break up CMAKE_AR into program and ARGS

Bill Hoffman 24 years ago
parent
commit
0846046200

+ 2 - 1
Source/cmUnixMakefileGenerator.cxx

@@ -501,7 +501,7 @@ void cmUnixMakefileGenerator::OutputTargets(std::ostream& fout)
       fout << "#\n";
       fout << "#\n";
       fout << m_LibraryOutputPath << "lib" << l->first << ".a: ${" << 
       fout << m_LibraryOutputPath << "lib" << l->first << ".a: ${" << 
         l->first << "_SRC_OBJS} \n";
         l->first << "_SRC_OBJS} \n";
-      fout << "\t${CMAKE_AR} "
+      fout << "\t${CMAKE_AR} ${CMAKE_AR_ARGS} "
            << m_LibraryOutputPath << "lib" << l->first << ".a ${" << 
            << m_LibraryOutputPath << "lib" << l->first << ".a ${" << 
         l->first << "_SRC_OBJS} \n";
         l->first << "_SRC_OBJS} \n";
       fout << "\t${CMAKE_RANLIB} "
       fout << "\t${CMAKE_RANLIB} "
@@ -951,6 +951,7 @@ void cmUnixMakefileGenerator::OutputMakeVariables(std::ostream& fout)
     "CMAKE_LIB_EXT       = @CMAKE_LIB_EXT@\n"
     "CMAKE_LIB_EXT       = @CMAKE_LIB_EXT@\n"
     "CMAKE_RANLIB        = @CMAKE_RANLIB@\n"
     "CMAKE_RANLIB        = @CMAKE_RANLIB@\n"
     "CMAKE_AR            = @CMAKE_AR@\n"
     "CMAKE_AR            = @CMAKE_AR@\n"
+    "CMAKE_AR_ARGS       = @CMAKE_AR_ARGS@\n"
     "CMAKE_C_COMPILER    = @CMAKE_C_COMPILER@\n"
     "CMAKE_C_COMPILER    = @CMAKE_C_COMPILER@\n"
     "CMAKE_CFLAGS        = @CMAKE_C_FLAGS@ @CMAKE_SHLIB_CFLAGS@ \n"
     "CMAKE_CFLAGS        = @CMAKE_C_FLAGS@ @CMAKE_SHLIB_CFLAGS@ \n"
     "\n"
     "\n"

+ 2 - 0
Templates/CMakeSystemConfig.cmake.in

@@ -16,6 +16,8 @@ SET (CMAKE_RANLIB             "@RANLIB@" CACHE FILEPATH
         " Library randomizer program used on archive libraries." )
         " Library randomizer program used on archive libraries." )
 SET (CMAKE_AR                 "@CMAKE_AR@" CACHE FILEPATH 
 SET (CMAKE_AR                 "@CMAKE_AR@" CACHE FILEPATH 
         " Archive program used to make archive libraries." )
         " Archive program used to make archive libraries." )
+SET (CMAKE_AR_ARGS            "@CMAKE_AR_ARGS@" CACHE STRING 
+        " Arguments for CMAKE_AR program to create an archive library." )
 SET (CMAKE_CXX_COMPILER       "@CXX@" CACHE FILEPATH "CXX compiler used.")
 SET (CMAKE_CXX_COMPILER       "@CXX@" CACHE FILEPATH "CXX compiler used.")
 SET (CMAKE_CXX_FLAGS          "@CXXFLAGS@" CACHE STRING 
 SET (CMAKE_CXX_FLAGS          "@CXXFLAGS@" CACHE STRING 
         "Flags used by CXX compiler")
         "Flags used by CXX compiler")

+ 5 - 1
Templates/configure

@@ -3045,7 +3045,8 @@ fi
 test -n "$CMAKE_AR_TMP" && break
 test -n "$CMAKE_AR_TMP" && break
 done
 done
 
 
-CMAKE_AR="$CMAKE_AR_TMP cr"
+CMAKE_AR="$CMAKE_AR_TMP"
+CMAKE_AR_ARGS="cr"
 # if on SunOS and not using gXX then use the compiler to make .a libs
 # if on SunOS and not using gXX then use the compiler to make .a libs
 case $system in 
 case $system in 
    SunOS-5*)
    SunOS-5*)
@@ -3054,10 +3055,12 @@ case $system in
    else
    else
       echo "Using $CXX -xar -o for creating .a libraries"
       echo "Using $CXX -xar -o for creating .a libraries"
       CMAKE_AR="$CXX -xar -o"
       CMAKE_AR="$CXX -xar -o"
+      CMAKE_AR_ARGS="-xar -o"
    fi
    fi
 esac
 esac
 
 
 
 
+
 # generate output files.
 # generate output files.
 # create mkdir files just to make some of the directories
 # create mkdir files just to make some of the directories
 
 
@@ -3243,6 +3246,7 @@ s%@CMAKE_NO_ANSI_STREAM_HEADERS@%$CMAKE_NO_ANSI_STREAM_HEADERS%g
 s%@RUNMAKE@%$RUNMAKE%g
 s%@RUNMAKE@%$RUNMAKE%g
 s%@CMAKE_AR_TMP@%$CMAKE_AR_TMP%g
 s%@CMAKE_AR_TMP@%$CMAKE_AR_TMP%g
 s%@CMAKE_AR@%$CMAKE_AR%g
 s%@CMAKE_AR@%$CMAKE_AR%g
+s%@CMAKE_AR_ARGS@%$CMAKE_AR_ARGS%g
 
 
 CEOF
 CEOF
 EOF
 EOF

+ 4 - 1
Templates/configure.in

@@ -542,7 +542,8 @@ fi
 # find make to use to build cmake, prefer gmake
 # find make to use to build cmake, prefer gmake
 AC_PATH_PROGS(RUNMAKE, gmake make)
 AC_PATH_PROGS(RUNMAKE, gmake make)
 AC_PATH_PROGS(CMAKE_AR_TMP, ar)
 AC_PATH_PROGS(CMAKE_AR_TMP, ar)
-CMAKE_AR="$CMAKE_AR_TMP cr"
+CMAKE_AR="$CMAKE_AR_TMP"
+CMAKE_AR_ARGS="cr"
 # if on SunOS and not using gXX then use the compiler to make .a libs
 # if on SunOS and not using gXX then use the compiler to make .a libs
 case $system in 
 case $system in 
    SunOS-5*)
    SunOS-5*)
@@ -551,9 +552,11 @@ case $system in
    else
    else
       echo "Using $CXX -xar -o for creating .a libraries"
       echo "Using $CXX -xar -o for creating .a libraries"
       CMAKE_AR="$CXX -xar -o"
       CMAKE_AR="$CXX -xar -o"
+      CMAKE_AR_ARGS="-xar -o"
    fi
    fi
 esac
 esac
 AC_SUBST(CMAKE_AR)
 AC_SUBST(CMAKE_AR)
+AC_SUBST(CMAKE_AR_ARGS)
 
 
 # generate output files.
 # generate output files.
 # create mkdir files just to make some of the directories
 # create mkdir files just to make some of the directories